diff --git a/go.mod b/go.mod
index ff264a5252..ad86dfd073 100644
--- a/go.mod
+++ b/go.mod
@@ -6,113 +6,114 @@ toolchain go1.22.2
require (
github.com/blang/semver/v4 v4.0.0
- github.com/davecgh/go-spew v1.1.1
+ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/ghodss/yaml v1.0.0
github.com/google/go-cmp v0.6.0
- github.com/google/uuid v1.3.0
- github.com/openshift/api v0.0.0-20240911192208-3e5de946111c
- github.com/openshift/client-go v0.0.0-20240528061634-b054aa794d87
- github.com/openshift/library-go v0.0.0-20240709182732-b94141242b0c
+ github.com/google/uuid v1.6.0
+ github.com/openshift/api v0.0.0-20241109205306-a2817b89f7e0
+ github.com/openshift/client-go v0.0.0-20241107164952-923091dd2b1a
+ github.com/openshift/library-go v0.0.0-20241107160307-0064ad7bd060
github.com/operator-framework/api v0.17.1
github.com/operator-framework/operator-lifecycle-manager v0.22.0
github.com/pkg/errors v0.9.1
- github.com/prometheus/client_golang v1.16.0
- github.com/prometheus/client_model v0.4.0
- github.com/prometheus/common v0.44.0
- github.com/spf13/cobra v1.7.0
- golang.org/x/crypto v0.21.0
- golang.org/x/net v0.23.0
+ github.com/prometheus/client_golang v1.19.1
+ github.com/prometheus/client_model v0.6.1
+ github.com/prometheus/common v0.55.0
+ github.com/spf13/cobra v1.8.1
+ golang.org/x/crypto v0.27.0
+ golang.org/x/net v0.29.0
golang.org/x/time v0.3.0
gopkg.in/fsnotify.v1 v1.4.7
gopkg.in/yaml.v3 v3.0.1
- k8s.io/api v0.30.1
- k8s.io/apiextensions-apiserver v0.30.1
- k8s.io/apimachinery v0.30.1
- k8s.io/client-go v0.30.1
- k8s.io/klog/v2 v2.120.1
- k8s.io/kube-aggregator v0.30.1
- k8s.io/utils v0.0.0-20230726121419-3b25d923346b
+ k8s.io/api v0.31.1
+ k8s.io/apiextensions-apiserver v0.31.1
+ k8s.io/apimachinery v0.31.1
+ k8s.io/client-go v0.31.1
+ k8s.io/klog/v2 v2.130.1
+ k8s.io/kube-aggregator v0.31.1
+ k8s.io/utils v0.0.0-20240921022957-49e7df575cb6
)
require (
github.com/NYTimes/gziphandler v1.1.1 // 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/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cenkalti/backoff/v4 v4.2.1 // indirect
- github.com/cespare/xxhash/v2 v2.2.0 // indirect
+ github.com/cenkalti/backoff/v4 v4.3.0 // indirect
+ github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
- github.com/evanphx/json-patch v4.12.0+incompatible // indirect
- github.com/felixge/httpsnoop v1.0.3 // indirect
+ github.com/felixge/fgprof v0.9.4 // indirect
+ github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.4.1 // indirect
+ github.com/fxamacker/cbor/v2 v2.7.0 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
- github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/go-openapi/swag v0.22.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
- github.com/google/cel-go v0.17.8 // indirect
+ github.com/google/cel-go v0.20.1 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
+ github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
- github.com/pkg/profile v1.3.0 // indirect
- github.com/prometheus/procfs v0.10.1 // indirect
+ github.com/pkg/profile v1.7.0 // indirect
+ github.com/prometheus/procfs v0.15.1 // indirect
github.com/robfig/cron v1.2.0 // indirect
- github.com/sirupsen/logrus v1.9.0 // indirect
+ github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
- go.etcd.io/etcd/api/v3 v3.5.10 // indirect
- go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
- go.etcd.io/etcd/client/v3 v3.5.10 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 // indirect
- go.opentelemetry.io/otel v1.19.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect
- go.opentelemetry.io/otel/metric v1.19.0 // indirect
- go.opentelemetry.io/otel/sdk v1.19.0 // indirect
- go.opentelemetry.io/otel/trace v1.19.0 // indirect
- go.opentelemetry.io/proto/otlp v1.0.0 // indirect
+ github.com/x448/float16 v0.8.4 // indirect
+ go.etcd.io/etcd/api/v3 v3.5.14 // indirect
+ go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect
+ go.etcd.io/etcd/client/v3 v3.5.14 // indirect
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
+ go.opentelemetry.io/otel v1.28.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect
+ go.opentelemetry.io/otel/metric v1.28.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.28.0 // indirect
+ go.opentelemetry.io/otel/trace v1.28.0 // indirect
+ go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
- golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
- golang.org/x/oauth2 v0.10.0 // indirect
- golang.org/x/sync v0.6.0 // indirect
- golang.org/x/sys v0.18.0 // indirect
- golang.org/x/term v0.18.0 // indirect
- golang.org/x/text v0.14.0 // indirect
- google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
- google.golang.org/grpc v1.58.3 // indirect
- google.golang.org/protobuf v1.33.0 // indirect
+ golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
+ golang.org/x/oauth2 v0.21.0 // indirect
+ golang.org/x/sync v0.8.0 // indirect
+ golang.org/x/sys v0.25.0 // indirect
+ golang.org/x/term v0.24.0 // indirect
+ golang.org/x/text v0.18.0 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
+ google.golang.org/grpc v1.65.0 // indirect
+ google.golang.org/protobuf v1.34.2 // indirect
+ gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
- k8s.io/apiserver v0.30.1 // indirect
- k8s.io/component-base v0.30.1 // indirect
- k8s.io/kms v0.30.1 // indirect
+ k8s.io/apiserver v0.31.1 // indirect
+ k8s.io/component-base v0.31.1 // indirect
+ k8s.io/kms v0.31.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
- sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect
+ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect
sigs.k8s.io/controller-runtime v0.12.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
- sigs.k8s.io/yaml v1.3.0 // indirect
+ sigs.k8s.io/yaml v1.4.0 // indirect
)
diff --git a/go.sum b/go.sum
index dfc223d545..2524760108 100644
--- a/go.sum
+++ b/go.sum
@@ -1,50 +1,54 @@
-cloud.google.com/go v0.110.6 h1:8uYAkj3YHTP/1iwReuHPxLSbdcyc+dSBbzFMrVwDR6Q=
-cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY=
-cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
-cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
-cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
-github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-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/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY=
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
-github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
-github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
-github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
-github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=
-github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
+github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
+github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
+github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
+github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmtGzzhLsnLs=
+github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww=
+github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ=
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
+github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk=
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
+github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
-github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
-github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
-github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
-github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
-github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
-github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
-github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
+github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
+github.com/felixge/fgprof v0.9.4 h1:ocDNwMFlnA0NU0zSB3I52xkO4sFXk80VK9lXjLClu88=
+github.com/felixge/fgprof v0.9.4/go.mod h1:yKl+ERSa++RYOs32d8K6WEXCB4uXdLls4ZaZPpayhMM=
+github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
+github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
+github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
+github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
-github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
@@ -53,27 +57,28 @@ github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
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/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
-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-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
+github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
+github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
+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/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
+github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
+github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
-github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
-github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
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/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.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
-github.com/google/cel-go v0.17.8 h1:j9m730pMZt1Fc4oKhCLUHfjj6527LuhYcYw0Rl8gqto=
-github.com/google/cel-go v0.17.8/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY=
+github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84=
+github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -82,10 +87,12 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
-github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
-github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
+github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
+github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k=
+github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
@@ -94,8 +101,10 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92Bcuy
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
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.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
+github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
+github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
@@ -117,10 +126,9 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
-github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -134,45 +142,47 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
-github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
-github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
-github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=
-github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk=
-github.com/openshift/api v0.0.0-20240911192208-3e5de946111c h1:46hH/7XmmaPmeJWTyrzh8TRB6I7TCwzJdxxWeyK8blM=
-github.com/openshift/api v0.0.0-20240911192208-3e5de946111c/go.mod h1:OOh6Qopf21pSzqNVCB5gomomBXb8o5sGKZxG2KNpaXM=
-github.com/openshift/client-go v0.0.0-20240528061634-b054aa794d87 h1:JtLhaGpSEconE+1IKmIgCOof/Len5ceG6H1pk43yv5U=
-github.com/openshift/client-go v0.0.0-20240528061634-b054aa794d87/go.mod h1:3IPD4U0qyovZS4EFady2kqY32m8lGcbs/Wx+yprg9z8=
-github.com/openshift/library-go v0.0.0-20240709182732-b94141242b0c h1:J79MQ2jYap7l9ugCosp73mIcb6PNcXeczINlyfGC7XA=
-github.com/openshift/library-go v0.0.0-20240709182732-b94141242b0c/go.mod h1:PdASVamWinll2BPxiUpXajTwZxV8A1pQbWEsCN1od7I=
+github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA=
+github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To=
+github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
+github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
+github.com/openshift/api v0.0.0-20241109205306-a2817b89f7e0 h1:l4VHxObu73EoMGtdgxNXo+MeYCjQyvN/PCvSfV/SkCU=
+github.com/openshift/api v0.0.0-20241109205306-a2817b89f7e0/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo=
+github.com/openshift/client-go v0.0.0-20241107164952-923091dd2b1a h1:h3F55x+zOXwSG4okUlXmOlU/5CQ7Ve2HKxYjseJPVoY=
+github.com/openshift/client-go v0.0.0-20241107164952-923091dd2b1a/go.mod h1:JBIcn1JfD/JCpGYnRRT0+HLxrleF/Y7T3Y/t0p8o5jk=
+github.com/openshift/library-go v0.0.0-20241107160307-0064ad7bd060 h1:jiDC7d8d+jmjv2WfiMY0+Uf55q11MGyYkGGqXnfqWTU=
+github.com/openshift/library-go v0.0.0-20241107160307-0064ad7bd060/go.mod h1:9B1MYPoLtP9tqjWxcbUNVpwxy68zOH/3EIP6c31dAM0=
github.com/operator-framework/api v0.17.1 h1:J/6+Xj4IEV8C7hcirqUFwOiZAU3PbnJhWvB0/bB51c4=
github.com/operator-framework/api v0.17.1/go.mod h1:kk8xJahHJR3bKqrA+A+1VIrhOTmyV76k+ARv+iV+u1Q=
github.com/operator-framework/operator-lifecycle-manager v0.22.0 h1:7DEWOq24HQ0l5xPOXMhn17XaJACgwoipz+JfQ7QCXZw=
github.com/operator-framework/operator-lifecycle-manager v0.22.0/go.mod h1:4zssIIl23ohxS1nXRU9xTkBmwt+qleuHMO02BaWOHLA=
+github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/profile v1.3.0 h1:OQIvuDgm00gWVWGTf4m4mCt6W1/0YqU7Ntg0mySWgaI=
-github.com/pkg/profile v1.3.0/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA=
+github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
-github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
-github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY=
-github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
-github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
-github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
-github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
-github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
+github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
+github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
+github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
+github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
+github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
+github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
+github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
+github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
+github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
-github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
-github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
+github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
-github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
+github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
+github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
-github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
-github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
+github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
+github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=
@@ -186,48 +196,50 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
+github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
+github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=
-go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
-go.etcd.io/etcd/api/v3 v3.5.10 h1:szRajuUUbLyppkhs9K6BRtjY37l66XQQmw7oZRANE4k=
-go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI=
-go.etcd.io/etcd/client/pkg/v3 v3.5.10 h1:kfYIdQftBnbAq8pUWFXfpuuxFSKzlmM5cSn76JByiT0=
-go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U=
-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.10 h1:W9TXNZ+oB3MCd/8UjxHTWK5J9Nquw9fQBLJd5ne5/Ao=
-go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc=
-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.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0 h1:ZOLJc06r4CB42laIXg/7udr0pbZyuAihN10A/XuiQRY=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0/go.mod h1:5z+/ZWJQKXa9YT34fQNx5K8Hd1EoIhvtUygUQPqEOgQ=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 h1:KfYpVmrjI7JuToy5k8XV3nkapjWx48k4E4JOtVstzQI=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0/go.mod h1:SeQhzAEccGVZVEy7aH87Nh0km+utSpo1pTv6eMMop48=
-go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs=
-go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I=
-go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE=
-go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8=
-go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o=
-go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A=
-go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg=
-go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo=
-go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
-go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
+go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI=
+go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE=
+go.etcd.io/etcd/api/v3 v3.5.14 h1:vHObSCxyB9zlF60w7qzAdTcGaglbJOpSj1Xj9+WGxq0=
+go.etcd.io/etcd/api/v3 v3.5.14/go.mod h1:BmtWcRlQvwa1h3G2jvKYwIQy4PkHlDej5t7uLMUdJUU=
+go.etcd.io/etcd/client/pkg/v3 v3.5.14 h1:SaNH6Y+rVEdxfpA2Jr5wkEvN6Zykme5+YnbCkxvuWxQ=
+go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSvPjFMunkgeZI=
+go.etcd.io/etcd/client/v2 v2.305.13 h1:RWfV1SX5jTU0lbCvpVQe3iPQeAHETWdOTb6pxhd77C8=
+go.etcd.io/etcd/client/v2 v2.305.13/go.mod h1:iQnL7fepbiomdXMb3om1rHq96htNNGv2sJkEcZGDRRg=
+go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg=
+go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk=
+go.etcd.io/etcd/pkg/v3 v3.5.13 h1:st9bDWNsKkBNpP4PR1MvM/9NqUPfvYZx/YXegsYEH8M=
+go.etcd.io/etcd/pkg/v3 v3.5.13/go.mod h1:N+4PLrp7agI/Viy+dUYpX7iRtSPvKq+w8Y14d1vX+m0=
+go.etcd.io/etcd/raft/v3 v3.5.13 h1:7r/NKAOups1YnKcfro2RvGGo2PTuizF/xh26Z2CTAzA=
+go.etcd.io/etcd/raft/v3 v3.5.13/go.mod h1:uUFibGLn2Ksm2URMxN1fICGhk8Wu96EfDQyuLhAcAmw=
+go.etcd.io/etcd/server/v3 v3.5.13 h1:V6KG+yMfMSqWt+lGnhFpP5z5dRUj1BDRJ5k1fQ9DFok=
+go.etcd.io/etcd/server/v3 v3.5.13/go.mod h1:K/8nbsGupHqmr5MkgaZpLlH1QdX1pcNQLAkODy44XcQ=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=
+go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
+go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ=
+go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
+go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
+go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE=
+go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg=
+go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
+go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
+go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
+go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
@@ -237,67 +249,67 @@ go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
-golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
-golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
-golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
+golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
+golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
+golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU=
+golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
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/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
-golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
-golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8=
-golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
-golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
+golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
+golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
+golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
-golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
+golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
-golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
-golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
+golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
+golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
golang.org/x/text v0.3.0/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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
+golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=
-golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=
+golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
+golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
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=
-google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
-google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g=
-google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8=
-google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e h1:z3vDksarJxsAKM5dmEGv0GHwE2hKJ096wZra71Vs4sw=
-google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
-google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=
-google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
-google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
-google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY=
+google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
+google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw=
+google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
+google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
+google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
+google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
+google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
+gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
@@ -314,35 +326,35 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-k8s.io/api v0.30.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY=
-k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM=
-k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws=
-k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4=
-k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U=
-k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
-k8s.io/apiserver v0.30.1 h1:BEWEe8bzS12nMtDKXzCF5Q5ovp6LjjYkSp8qOPk8LZ8=
-k8s.io/apiserver v0.30.1/go.mod h1:i87ZnQ+/PGAmSbD/iEKM68bm1D5reX8fO4Ito4B01mo=
-k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q=
-k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc=
-k8s.io/component-base v0.30.1 h1:bvAtlPh1UrdaZL20D9+sWxsJljMi0QZ3Lmw+kmZAaxQ=
-k8s.io/component-base v0.30.1/go.mod h1:e/X9kDiOebwlI41AvBHuWdqFriSRrX50CdwA9TFaHLI=
-k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
-k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
-k8s.io/kms v0.30.1 h1:gEIbEeCbFiaN2tNfp/EUhFdGr5/CSj8Eyq6Mkr7cCiY=
-k8s.io/kms v0.30.1/go.mod h1:GrMurD0qk3G4yNgGcsCEmepqf9KyyIrTXYR2lyUOJC4=
-k8s.io/kube-aggregator v0.30.1 h1:ymR2BsxDacTKwzKTuNhGZttuk009c+oZbSeD+IPX5q4=
-k8s.io/kube-aggregator v0.30.1/go.mod h1:SFbqWsM6ea8dHd3mPLsZFzJHbjBOS5ykIgJh4znZ5iQ=
+k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU=
+k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI=
+k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40=
+k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ=
+k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
+k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
+k8s.io/apiserver v0.31.1 h1:Sars5ejQDCRBY5f7R3QFHdqN3s61nhkpaX8/k1iEw1c=
+k8s.io/apiserver v0.31.1/go.mod h1:lzDhpeToamVZJmmFlaLwdYZwd7zB+WYRYIboqA1kGxM=
+k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0=
+k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg=
+k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8=
+k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w=
+k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
+k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
+k8s.io/kms v0.31.1 h1:cGLyV3cIwb0ovpP/jtyIe2mEuQ/MkbhmeBF2IYCA9Io=
+k8s.io/kms v0.31.1/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94=
+k8s.io/kube-aggregator v0.31.1 h1:vrYBTTs3xMrpiEsmBjsLETZE9uuX67oQ8B3i1BFfMPw=
+k8s.io/kube-aggregator v0.31.1/go.mod h1:+aW4NX50uneozN+BtoCxI4g7ND922p8Wy3tWKFDiWVk=
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/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
-k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-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=
+k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 h1:MDF6h2H/h4tbzmtIKTuctcwZmY0tY9mD9fNT47QO6HI=
+k8s.io/utils v0.0.0-20240921022957-49e7df575cb6/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
sigs.k8s.io/controller-runtime v0.12.1 h1:4BJY01xe9zKQti8oRjj/NeHKRXthf1YkYJAgLONFFoI=
sigs.k8s.io/controller-runtime v0.12.1/go.mod h1:BKhxlA4l7FPK4AQcsuL4X6vZeWnKDXez/vp1Y8dxTU0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
-sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
-sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
+sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
+sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go
index 22fdaa3cea..5afab483c1 100644
--- a/pkg/autoupdate/autoupdate.go
+++ b/pkg/autoupdate/autoupdate.go
@@ -48,7 +48,7 @@ type Controller struct {
cacheSynced []cache.InformerSynced
// queue tracks keeping the list of available updates on a cluster version
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[any]
}
// New returns a new autoupdate controller.
@@ -68,7 +68,7 @@ func New(
name: name,
client: client,
eventRecorder: eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: "autoupdater"}),
- queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "autoupdater"),
+ queue: workqueue.NewTypedRateLimitingQueueWithConfig[any](workqueue.DefaultTypedControllerRateLimiter[any](), workqueue.TypedRateLimitingQueueConfig[any]{Name: "autoupdater"}),
}
if _, err := cvInformer.Informer().AddEventHandler(ctrl.eventHandler()); err != nil {
diff --git a/pkg/cvo/availableupdates_test.go b/pkg/cvo/availableupdates_test.go
index d57bcf9879..c73ec59ef7 100644
--- a/pkg/cvo/availableupdates_test.go
+++ b/pkg/cvo/availableupdates_test.go
@@ -121,7 +121,7 @@ func newOperator(url, version string, promqlMock clusterconditions.Condition) (*
proxyLister: notFoundProxyLister{},
cmConfigManagedLister: notFoundConfigMapLister{},
conditionRegistry: registry,
- queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()),
+ queue: workqueue.NewTypedRateLimitingQueue[any](workqueue.DefaultTypedControllerRateLimiter[any]()),
release: currentRelease,
}
availableUpdates := &availableUpdates{
diff --git a/pkg/cvo/cvo.go b/pkg/cvo/cvo.go
index 442ad1e7fc..6054bf6349 100644
--- a/pkg/cvo/cvo.go
+++ b/pkg/cvo/cvo.go
@@ -120,11 +120,11 @@ type Operator struct {
cacheSynced []cache.InformerSynced
// queue tracks applying updates to a cluster.
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[any]
// availableUpdatesQueue tracks checking for updates from the update server.
- availableUpdatesQueue workqueue.RateLimitingInterface
+ availableUpdatesQueue workqueue.TypedRateLimitingInterface[any]
// upgradeableQueue tracks checking for upgradeable.
- upgradeableQueue workqueue.RateLimitingInterface
+ upgradeableQueue workqueue.TypedRateLimitingInterface[any]
// statusLock guards access to modifying available updates
statusLock sync.Mutex
@@ -217,13 +217,12 @@ func New(
payloadDir: overridePayloadDir,
updateService: updateService,
- client: client,
- kubeClient: kubeClient,
- eventRecorder: eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: namespace}),
-
- queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "clusterversion"),
- availableUpdatesQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "availableupdates"),
- upgradeableQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "upgradeable"),
+ client: client,
+ kubeClient: kubeClient,
+ eventRecorder: eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: namespace}),
+ queue: workqueue.NewTypedRateLimitingQueueWithConfig[any](workqueue.DefaultTypedControllerRateLimiter[any](), workqueue.TypedRateLimitingQueueConfig[any]{Name: "clusterversion"}),
+ availableUpdatesQueue: workqueue.NewTypedRateLimitingQueueWithConfig[any](workqueue.DefaultTypedControllerRateLimiter[any](), workqueue.TypedRateLimitingQueueConfig[any]{Name: "availableupdates"}),
+ upgradeableQueue: workqueue.NewTypedRateLimitingQueueWithConfig[any](workqueue.DefaultTypedControllerRateLimiter[any](), workqueue.TypedRateLimitingQueueConfig[any]{Name: "upgradeable"}),
exclude: exclude,
clusterProfile: clusterProfile,
@@ -607,14 +606,14 @@ func clusterOperatorConditionStatus(co *configv1.ClusterOperator, condType confi
return configv1.ConditionUnknown
}
-func (optr *Operator) worker(ctx context.Context, queue workqueue.RateLimitingInterface, syncHandler func(context.Context, string) error) {
+func (optr *Operator) worker(ctx context.Context, queue workqueue.TypedRateLimitingInterface[any], syncHandler func(context.Context, string) error) {
for processNextWorkItem(ctx, queue, syncHandler, optr.syncFailingStatus) {
}
}
type syncFailingStatusFunc func(ctx context.Context, config *configv1.ClusterVersion, err error) error
-func processNextWorkItem(ctx context.Context, queue workqueue.RateLimitingInterface, syncHandler func(context.Context, string) error, syncFailingStatus syncFailingStatusFunc) bool {
+func processNextWorkItem(ctx context.Context, queue workqueue.TypedRateLimitingInterface[any], syncHandler func(context.Context, string) error, syncFailingStatus syncFailingStatusFunc) bool {
key, quit := queue.Get()
if quit {
return false
@@ -626,7 +625,7 @@ func processNextWorkItem(ctx context.Context, queue workqueue.RateLimitingInterf
return true
}
-func handleErr(ctx context.Context, queue workqueue.RateLimitingInterface, err error, key interface{}, syncFailingStatus syncFailingStatusFunc) {
+func handleErr(ctx context.Context, queue workqueue.TypedRateLimitingInterface[any], err error, key interface{}, syncFailingStatus syncFailingStatusFunc) {
if err == nil {
queue.Forget(key)
return
diff --git a/pkg/cvo/cvo_scenarios_test.go b/pkg/cvo/cvo_scenarios_test.go
index e67243f5ce..db07f9f979 100644
--- a/pkg/cvo/cvo_scenarios_test.go
+++ b/pkg/cvo/cvo_scenarios_test.go
@@ -115,7 +115,7 @@ func setupCVOTest(payloadDir string) (*Operator, map[string]apiruntime.Object, *
o := &Operator{
namespace: "test",
name: "version",
- queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "cvo-loop-test"),
+ queue: workqueue.NewTypedRateLimitingQueueWithConfig[any](workqueue.DefaultTypedControllerRateLimiter[any](), workqueue.TypedRateLimitingQueueConfig[any]{Name: "cvo-loop-test"}),
client: client,
enabledFeatureGates: featuregates.DefaultCvoGates("version"),
cvLister: &clientCVLister{client: client},
@@ -2018,7 +2018,7 @@ func TestCVO_InitImplicitlyEnabledCaps(t *testing.T) {
// Emulates capabilities status set by a previous pod
Capabilities: configv1.ClusterVersionCapabilitiesStatus{
EnabledCapabilities: sortedCaps,
- KnownCapabilities: []configv1.ClusterVersionCapability{configv1.ClusterVersionCapabilityBaremetal, configv1.ClusterVersionCapabilityMarketplace, configv1.ClusterVersionCapabilityOpenShiftSamples, configv1.ClusterVersionCapabilityOpenShiftSamples},
+ KnownCapabilities: []configv1.ClusterVersionCapability{configv1.ClusterVersionCapabilityBaremetal, configv1.ClusterVersionCapabilityMarketplace, configv1.ClusterVersionCapabilityOpenShiftSamples, configv1.ClusterVersionCapabilityOperatorLifecycleManager, configv1.ClusterVersionCapabilityOperatorLifecycleManagerV1},
},
},
}
@@ -2086,7 +2086,7 @@ func TestCVO_InitImplicitlyEnabledCaps(t *testing.T) {
EnabledCapabilities: sortedCaps,
KnownCapabilities: sortedKnownCaps,
},
- ImplicitlyEnabledCaps: []configv1.ClusterVersionCapability{configv1.ClusterVersionCapabilityBuild, configv1.ClusterVersionCapabilityCSISnapshot, configv1.ClusterVersionCapabilityCloudControllerManager, configv1.ClusterVersionCapabilityCloudCredential, configv1.ClusterVersionCapabilityConsole, configv1.ClusterVersionCapabilityDeploymentConfig, configv1.ClusterVersionCapabilityImageRegistry, configv1.ClusterVersionCapabilityIngress, configv1.ClusterVersionCapabilityInsights, configv1.ClusterVersionCapabilityMachineAPI, configv1.ClusterVersionCapabilityNodeTuning, configv1.ClusterVersionCapabilityOperatorLifecycleManager, configv1.ClusterVersionCapabilityStorage, configv1.ClusterVersionCapabilityMarketplace, configv1.ClusterVersionCapabilityOpenShiftSamples},
+ ImplicitlyEnabledCaps: []configv1.ClusterVersionCapability{configv1.ClusterVersionCapabilityBuild, configv1.ClusterVersionCapabilityCSISnapshot, configv1.ClusterVersionCapabilityCloudControllerManager, configv1.ClusterVersionCapabilityCloudCredential, configv1.ClusterVersionCapabilityConsole, configv1.ClusterVersionCapabilityDeploymentConfig, configv1.ClusterVersionCapabilityImageRegistry, configv1.ClusterVersionCapabilityIngress, configv1.ClusterVersionCapabilityInsights, configv1.ClusterVersionCapabilityMachineAPI, configv1.ClusterVersionCapabilityNodeTuning, configv1.ClusterVersionCapabilityOperatorLifecycleManager, configv1.ClusterVersionCapabilityOperatorLifecycleManagerV1, configv1.ClusterVersionCapabilityStorage, configv1.ClusterVersionCapabilityMarketplace, configv1.ClusterVersionCapabilityOpenShiftSamples},
},
loadPayloadStatus: LoadPayloadStatus{
Step: "PayloadLoaded",
@@ -2130,7 +2130,7 @@ func TestCVO_InitImplicitlyEnabledCaps(t *testing.T) {
KnownCapabilities: sortedKnownCaps,
},
Conditions: []configv1.ClusterOperatorStatusCondition{
- {Type: ImplicitlyEnabledCapabilities, Status: configv1.ConditionTrue, Reason: "CapabilitiesImplicitlyEnabled", Message: "The following capabilities could not be disabled: Build, CSISnapshot, CloudControllerManager, CloudCredential, Console, DeploymentConfig, ImageRegistry, Ingress, Insights, MachineAPI, NodeTuning, OperatorLifecycleManager, Storage, marketplace, openshift-samples"},
+ {Type: ImplicitlyEnabledCapabilities, Status: configv1.ConditionTrue, Reason: "CapabilitiesImplicitlyEnabled", Message: "The following capabilities could not be disabled: Build, CSISnapshot, CloudControllerManager, CloudCredential, Console, DeploymentConfig, ImageRegistry, Ingress, Insights, MachineAPI, NodeTuning, OperatorLifecycleManager, OperatorLifecycleManagerV1, Storage, marketplace, openshift-samples"},
{Type: DesiredReleaseAccepted, Status: configv1.ConditionTrue, Reason: "PayloadLoaded",
Message: "Payload loaded version=\"1.0.1-abc\" image=\"image/image:1\" architecture=\"" + architecture + "\""},
{Type: "Available", Status: "False"},
diff --git a/pkg/cvo/cvo_test.go b/pkg/cvo/cvo_test.go
index 4da6cc7696..a9d6a07905 100644
--- a/pkg/cvo/cvo_test.go
+++ b/pkg/cvo/cvo_test.go
@@ -2775,7 +2775,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
optr := tt.optr
- optr.queue = workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
+ optr.queue = workqueue.NewTypedRateLimitingQueue[any](workqueue.DefaultTypedControllerRateLimiter[any]())
optr.proxyLister = &clientProxyLister{client: optr.client}
optr.coLister = &clientCOLister{client: optr.client}
optr.cvLister = &clientCVLister{client: optr.client}
@@ -3868,7 +3868,7 @@ func TestOperator_upgradeableSync(t *testing.T) {
{
t.Run(tt.name, func(t *testing.T) {
optr := tt.optr
- optr.queue = workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
+ optr.queue = workqueue.NewTypedRateLimitingQueue[any](workqueue.DefaultTypedControllerRateLimiter[any]())
optr.proxyLister = &clientProxyLister{client: optr.client}
optr.coLister = &clientCOLister{client: optr.client}
optr.cvLister = &clientCVLister{client: optr.client}
diff --git a/pkg/featuregates/featurechangestopper.go b/pkg/featuregates/featurechangestopper.go
index 7231bc82b2..873f78308f 100644
--- a/pkg/featuregates/featurechangestopper.go
+++ b/pkg/featuregates/featurechangestopper.go
@@ -25,7 +25,7 @@ type ChangeStopper struct {
featureGateLister configlistersv1.FeatureGateLister
cacheSynced []cache.InformerSynced
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[any]
shutdownFn context.CancelFunc
}
@@ -34,7 +34,7 @@ func NewChangeStopper(featureGateInformer configinformersv1.FeatureGateInformer)
c := &ChangeStopper{
featureGateLister: featureGateInformer.Lister(),
cacheSynced: []cache.InformerSynced{featureGateInformer.Informer().HasSynced},
- queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "feature-gate-stopper"),
+ queue: workqueue.NewTypedRateLimitingQueueWithConfig[any](workqueue.DefaultTypedControllerRateLimiter[any](), workqueue.TypedRateLimitingQueueConfig[any]{Name: "feature-gate-stopper"}),
}
c.queue.Add("cluster") // seed an initial sync, in case startingRequiredFeatureSet is wrong
if _, err := featureGateInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
diff --git a/pkg/updatestatus/controlplaneinformer_test.go b/pkg/updatestatus/controlplaneinformer_test.go
index b8fc194111..617fc94b5e 100644
--- a/pkg/updatestatus/controlplaneinformer_test.go
+++ b/pkg/updatestatus/controlplaneinformer_test.go
@@ -254,10 +254,10 @@ func makeTestClusterVersion(progressing *configv1.ClusterOperatorStatusCondition
type testSyncContext struct {
queueKey string
eventRecorder events.Recorder
- queue workqueue.RateLimitingInterface
+ queue workqueue.TypedRateLimitingInterface[any]
}
-func (c testSyncContext) Queue() workqueue.RateLimitingInterface {
+func (c testSyncContext) Queue() workqueue.RateLimitingInterface { //nolint:staticcheck
return c.queue
}
diff --git a/pkg/updatestatus/updatestatuscontroller_test.go b/pkg/updatestatus/updatestatuscontroller_test.go
index 8871568e81..168b4e83d2 100644
--- a/pkg/updatestatus/updatestatuscontroller_test.go
+++ b/pkg/updatestatus/updatestatuscontroller_test.go
@@ -154,6 +154,6 @@ func Test_updateStatusController(t *testing.T) {
func newTestSyncContextWithQueue() factory.SyncContext {
return testSyncContext{
eventRecorder: events.NewInMemoryRecorder("test"),
- queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()),
+ queue: workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[any]()),
}
}
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 52cf18e425..0000000000
--- 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 ab51212676..0000000000
--- 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 7619fa172e..0000000000
--- 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 43e9b33f3b..0000000000
--- 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 a8b889cedb..0000000000
--- 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 = " 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. 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. 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). 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}.
- // 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.
- // 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.
- // 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.
-// This method computes the SLL prediction termination condition for both of
-// the following cases. 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. 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}: 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 EXACT AMBIGUITY DETECTION If all states Report the same conflicting set of alternatives, then we
-// know we have the exact ambiguity set. 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...
-// 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 c9bd6751e3..0000000000
--- 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 0000000000..38ea34ff51
--- /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 0000000000..a22292eb5a
--- /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 0000000000..03e5b83eb1
--- /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 0000000000..3bb4fd7c4e
--- /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 98010d2e6e..cdeefed247 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 0000000000..a83f25d349
--- /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 0000000000..52dbaf8064
--- /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 3c975ec7bf..bdb30b3622 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 3888856b4b..2dcb9ae11b 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 41529115fa..afe6c9f809 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 1f2a56bc31..2ae5807cdb 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 c33f0adb5e..bd8127b6b5 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 c6c9485a20..b75da9df08 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 9ea3200536..7467e9b43d 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 0000000000..c2b724514d
--- /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 bfd43e1f73..6b63eb1589 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 84d0a31e53..0e11009899 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 c90dec55c8..6541430745 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 c55bcc19b2..bd2cd8bc3a 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 f679f0dcd5..21a0216434 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. The default implementation simply calls {@link //endErrorCondition}. 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. 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. Implements Jim Idle's magic Sync mechanism in closures and optional
-// subrules. E.g., If the sub rule is optional ({@code (...)?}, {@code (...)*}, or block
-// with an empty alternative), then the expected set includes what follows
-// the subrule. 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. ORIGINS 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 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 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. 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}. 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. 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}. 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}. 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. This recovery strategy is implemented by {@link
-// //singleTokenDeletion}. 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. This recovery strategy is implemented by {@link
-// //singleTokenInsertion}. 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: 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.
-//
-//
-//
-// Local-Context Merges
-//
-//
-//
-//
-// Full-Context Merges
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-// map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not
-// alt and not pred
-//
-//
-//
-//
-//
-//
-// |A_i|>1 and
-// A_i = A_j for all i, j.
-// 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 210699ba23..0000000000
--- 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.
-//
-// 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
-//
+// 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}
-//
-//
-// 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.
//
-//
-// 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.
//
-//
-// 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.
//
-//
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 = "-// This error strategy is useful in the following scenarios.
+// This error strategy is useful in the following scenarios. // -//-// {@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 3954c13782..8f0f2f601f 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 bd6ad5efe3..5f65f809be 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 0000000000..b737fe85fb --- /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: "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 be1ba7a7e3..dfc28c32b3 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 c573b75210..fe938b0259 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 76689615a6..4955ac876f 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 0000000000..923c7b52c4 --- /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 d26bf06392..fb57ac15db 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.
-// -//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 8bcc46a0d9..ae2869692a 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. // -//-// 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. // -//// 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 1c8cee7479..c249bc1385 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 0000000000..c1b80cc1f0 --- /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.
+//
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.
+//
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).
+//
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}.
+//
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 "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 0000000000..70c0673a0f --- /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 0000000000..4d9eb94e5f --- /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 f73b06bc6a..9670efb829 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 1527d43f60..bf4ff6633e 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 b3e38af344..ccf59b465c 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 36be4f7331..313b0fc127 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 85b4f137b5..c288420fb2 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 d7dbb03228..f44c05d811 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 9fad5d916b..733d7df9dc 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/cenkalti/backoff/v4/README.md b/vendor/github.com/cenkalti/backoff/v4/README.md index 16abdfc084..9433004a28 100644 --- a/vendor/github.com/cenkalti/backoff/v4/README.md +++ b/vendor/github.com/cenkalti/backoff/v4/README.md @@ -1,4 +1,4 @@ -# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Build Status][travis image]][travis] [![Coverage Status][coveralls image]][coveralls] +# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Coverage Status][coveralls image]][coveralls] This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client]. @@ -21,8 +21,6 @@ Use https://pkg.go.dev/github.com/cenkalti/backoff/v4 to view the documentation. [godoc]: https://pkg.go.dev/github.com/cenkalti/backoff/v4 [godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png -[travis]: https://travis-ci.org/cenkalti/backoff -[travis image]: https://travis-ci.org/cenkalti/backoff.png?branch=master [coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master [coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master diff --git a/vendor/github.com/cenkalti/backoff/v4/exponential.go b/vendor/github.com/cenkalti/backoff/v4/exponential.go index 2c56c1e718..aac99f196a 100644 --- a/vendor/github.com/cenkalti/backoff/v4/exponential.go +++ b/vendor/github.com/cenkalti/backoff/v4/exponential.go @@ -71,6 +71,9 @@ type Clock interface { Now() time.Time } +// ExponentialBackOffOpts is a function type used to configure ExponentialBackOff options. +type ExponentialBackOffOpts func(*ExponentialBackOff) + // Default values for ExponentialBackOff. const ( DefaultInitialInterval = 500 * time.Millisecond @@ -81,7 +84,7 @@ const ( ) // NewExponentialBackOff creates an instance of ExponentialBackOff using default values. -func NewExponentialBackOff() *ExponentialBackOff { +func NewExponentialBackOff(opts ...ExponentialBackOffOpts) *ExponentialBackOff { b := &ExponentialBackOff{ InitialInterval: DefaultInitialInterval, RandomizationFactor: DefaultRandomizationFactor, @@ -91,10 +94,62 @@ func NewExponentialBackOff() *ExponentialBackOff { Stop: Stop, Clock: SystemClock, } + for _, fn := range opts { + fn(b) + } b.Reset() return b } +// WithInitialInterval sets the initial interval between retries. +func WithInitialInterval(duration time.Duration) ExponentialBackOffOpts { + return func(ebo *ExponentialBackOff) { + ebo.InitialInterval = duration + } +} + +// WithRandomizationFactor sets the randomization factor to add jitter to intervals. +func WithRandomizationFactor(randomizationFactor float64) ExponentialBackOffOpts { + return func(ebo *ExponentialBackOff) { + ebo.RandomizationFactor = randomizationFactor + } +} + +// WithMultiplier sets the multiplier for increasing the interval after each retry. +func WithMultiplier(multiplier float64) ExponentialBackOffOpts { + return func(ebo *ExponentialBackOff) { + ebo.Multiplier = multiplier + } +} + +// WithMaxInterval sets the maximum interval between retries. +func WithMaxInterval(duration time.Duration) ExponentialBackOffOpts { + return func(ebo *ExponentialBackOff) { + ebo.MaxInterval = duration + } +} + +// WithMaxElapsedTime sets the maximum total time for retries. +func WithMaxElapsedTime(duration time.Duration) ExponentialBackOffOpts { + return func(ebo *ExponentialBackOff) { + ebo.MaxElapsedTime = duration + } +} + +// WithRetryStopDuration sets the duration after which retries should stop. +func WithRetryStopDuration(duration time.Duration) ExponentialBackOffOpts { + return func(ebo *ExponentialBackOff) { + ebo.Stop = duration + } +} + +// WithClockProvider sets the clock used to measure time. +func WithClockProvider(clock Clock) ExponentialBackOffOpts { + return func(ebo *ExponentialBackOff) { + ebo.Clock = clock + } +} + type systemClock struct{} func (t systemClock) Now() time.Time { diff --git a/vendor/github.com/cespare/xxhash/v2/README.md b/vendor/github.com/cespare/xxhash/v2/README.md index 8bf0e5b781..33c88305c4 100644 --- a/vendor/github.com/cespare/xxhash/v2/README.md +++ b/vendor/github.com/cespare/xxhash/v2/README.md @@ -70,3 +70,5 @@ benchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$') - [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) - [FreeCache](https://github.com/coocood/freecache) - [FastCache](https://github.com/VictoriaMetrics/fastcache) +- [Ristretto](https://github.com/dgraph-io/ristretto) +- [Badger](https://github.com/dgraph-io/badger) diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash.go b/vendor/github.com/cespare/xxhash/v2/xxhash.go index a9e0d45c9d..78bddf1cee 100644 --- a/vendor/github.com/cespare/xxhash/v2/xxhash.go +++ b/vendor/github.com/cespare/xxhash/v2/xxhash.go @@ -19,10 +19,13 @@ const ( // Store the primes in an array as well. // // The consts are used when possible in Go code to avoid MOVs but we need a -// contiguous array of the assembly code. +// contiguous array for the assembly code. var primes = [...]uint64{prime1, prime2, prime3, prime4, prime5} // Digest implements hash.Hash64. +// +// Note that a zero-valued Digest is not ready to receive writes. +// Call Reset or create a Digest using New before calling other methods. type Digest struct { v1 uint64 v2 uint64 @@ -33,19 +36,31 @@ type Digest struct { n int // how much of mem is used } -// New creates a new Digest that computes the 64-bit xxHash algorithm. +// New creates a new Digest with a zero seed. func New() *Digest { + return NewWithSeed(0) +} + +// NewWithSeed creates a new Digest with the given seed. +func NewWithSeed(seed uint64) *Digest { var d Digest - d.Reset() + d.ResetWithSeed(seed) return &d } // Reset clears the Digest's state so that it can be reused. +// It uses a seed value of zero. func (d *Digest) Reset() { - d.v1 = primes[0] + prime2 - d.v2 = prime2 - d.v3 = 0 - d.v4 = -primes[0] + d.ResetWithSeed(0) +} + +// ResetWithSeed clears the Digest's state so that it can be reused. +// It uses the given seed to initialize the state. +func (d *Digest) ResetWithSeed(seed uint64) { + d.v1 = seed + prime1 + prime2 + d.v2 = seed + prime2 + d.v3 = seed + d.v4 = seed - prime1 d.total = 0 d.n = 0 } diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go b/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go index 9216e0a40c..78f95f2561 100644 --- a/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go +++ b/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go @@ -6,7 +6,7 @@ package xxhash -// Sum64 computes the 64-bit xxHash digest of b. +// Sum64 computes the 64-bit xxHash digest of b with a zero seed. // //go:noescape func Sum64(b []byte) uint64 diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_other.go b/vendor/github.com/cespare/xxhash/v2/xxhash_other.go index 26df13bba4..118e49e819 100644 --- a/vendor/github.com/cespare/xxhash/v2/xxhash_other.go +++ b/vendor/github.com/cespare/xxhash/v2/xxhash_other.go @@ -3,7 +3,7 @@ package xxhash -// Sum64 computes the 64-bit xxHash digest of b. +// Sum64 computes the 64-bit xxHash digest of b with a zero seed. func Sum64(b []byte) uint64 { // A simpler version would be // d := New() diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go b/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go index e86f1b5fd8..05f5e7dfe7 100644 --- a/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go +++ b/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go @@ -5,7 +5,7 @@ package xxhash -// Sum64String computes the 64-bit xxHash digest of s. +// Sum64String computes the 64-bit xxHash digest of s with a zero seed. func Sum64String(s string) uint64 { return Sum64([]byte(s)) } diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go b/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go index 1c1638fd88..cf9d42aed5 100644 --- a/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go +++ b/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go @@ -33,7 +33,7 @@ import ( // // See https://github.com/golang/go/issues/42739 for discussion. -// Sum64String computes the 64-bit xxHash digest of s. +// Sum64String computes the 64-bit xxHash digest of s with a zero seed. // It may be faster than Sum64([]byte(s)) by avoiding a copy. func Sum64String(s string) uint64 { b := *(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)})) diff --git a/vendor/github.com/felixge/fgprof/BenchmarkProfilerGoroutines.txt b/vendor/github.com/felixge/fgprof/BenchmarkProfilerGoroutines.txt new file mode 100644 index 0000000000..f90fadc355 --- /dev/null +++ b/vendor/github.com/felixge/fgprof/BenchmarkProfilerGoroutines.txt @@ -0,0 +1,25 @@ +$ go test -bench=BenchmarkProfilerGoroutines +goos: darwin +goarch: amd64 +pkg: github.com/felixge/fgprof +BenchmarkProfilerGoroutines/1_goroutines-8 43431 26860 ns/op +BenchmarkProfilerGoroutines/2_goroutines-8 42590 27648 ns/op +BenchmarkProfilerGoroutines/4_goroutines-8 40725 28694 ns/op +BenchmarkProfilerGoroutines/8_goroutines-8 37874 31067 ns/op +BenchmarkProfilerGoroutines/16_goroutines-8 32778 37302 ns/op +BenchmarkProfilerGoroutines/32_goroutines-8 25447 47171 ns/op +BenchmarkProfilerGoroutines/64_goroutines-8 17937 66803 ns/op +BenchmarkProfilerGoroutines/128_goroutines-8 11138 108283 ns/op +BenchmarkProfilerGoroutines/256_goroutines-8 5232 191830 ns/op +BenchmarkProfilerGoroutines/512_goroutines-8 2848 351686 ns/op +BenchmarkProfilerGoroutines/1024_goroutines-8 1611 681412 ns/op +BenchmarkProfilerGoroutines/2048_goroutines-8 846 1396125 ns/op +BenchmarkProfilerGoroutines/4096_goroutines-8 358 3286943 ns/op +BenchmarkProfilerGoroutines/8192_goroutines-8 153 7813804 ns/op +BenchmarkProfilerGoroutines/16384_goroutines-8 70 16440643 ns/op +BenchmarkProfilerGoroutines/32768_goroutines-8 33 34101649 ns/op +BenchmarkProfilerGoroutines/65536_goroutines-8 16 68460458 ns/op +BenchmarkProfilerGoroutines/131072_goroutines-8 8 134481118 ns/op +BenchmarkProfilerGoroutines/262144_goroutines-8 4 270522885 ns/op +BenchmarkProfilerGoroutines/524288_goroutines-8 2 567821104 ns/op +BenchmarkProfilerGoroutines/1048576_goroutines-8 1 1202184643 ns/op diff --git a/vendor/github.com/felixge/fgprof/LICENSE.txt b/vendor/github.com/felixge/fgprof/LICENSE.txt new file mode 100644 index 0000000000..3e424911bd --- /dev/null +++ b/vendor/github.com/felixge/fgprof/LICENSE.txt @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright © 2020 Felix Geisendörfer
+}
+```
+
+fgprof is compatible with the `go tool pprof` visualizer, so taking and analyzing a 3s profile is as simple as:
+
+```
+go tool pprof --http=:6061 http://localhost:6060/debug/fgprof?seconds=3
+```
+
+
+
+Additionally fgprof supports the plain text format used by Brendan Gregg's [FlameGraph](http://www.brendangregg.com/flamegraphs.html) utility:
+
+```
+git clone https://github.com/brendangregg/FlameGraph
+cd FlameGraph
+curl -s 'localhost:6060/debug/fgprof?seconds=3&format=folded' > fgprof.folded
+./flamegraph.pl fgprof.folded > fgprof.svg
+```
+
+
+
+Which tool you prefer is up to you, but one thing I like about Gregg's tool is that you can filter the plaintext files using grep which can be very useful when analyzing large programs.
+
+If you don't have a program to profile right now, you can `go run ./example` which should allow you to reproduce the graphs you see above. If you've never seen such graphs before, and are unsure how to read them, head over to Brendan Gregg's [Flame Graph](http://www.brendangregg.com/flamegraphs.html) page.
+
+## The Problem
+
+Let's say you've been tasked to optimize a simple program that has a loop calling out to three functions:
+
+```go
+func main() {
+ for {
+ // Http request to a web service that might be slow.
+ slowNetworkRequest()
+ // Some heavy CPU computation.
+ cpuIntensiveTask()
+ // Poorly named function that you don't understand yet.
+ weirdFunction()
+ }
+}
+```
+
+One way to decide which of these three functions you should focus your attention on would be to wrap each function call like this:
+
+```go
+start := time.Start()
+slowNetworkRequest()
+fmt.Printf("slowNetworkRequest: %s\n", time.Since(start))
+// ...
+```
+
+However, this can be very tedious for large programs. You'll also have to figure out how to average the numbers in case they fluctuate. And once you've done that, you'll have to repeat the process for the functions called by the function you decide to focus on.
+
+### /debug/pprof/profile
+
+So, this seems like a perfect use case for a profiler. Let's try the `/debug/pprof/profile` endpoint of the builtin `net/http/pprof` pkg to analyze our program for 10s:
+
+```go
+import _ "net/http/pprof"
+
+func main() {
+ go func() {
+ log.Println(http.ListenAndServe(":6060", nil))
+ }()
+
+ //
+}
+```
+
+```
+go tool pprof -http=:6061 http://localhost:6060/debug/pprof/profile?seconds=10
+```
+
+That was easy! Looks like we're spending all our time in `cpuIntensiveTask()`, so let's focus on that?
+
+
+
+But before we get carried away, let's quickly double check this assumption by manually timing our function calls with `time.Since()` as described above:
+
+```
+slowNetworkRequest: 66.815041ms
+cpuIntensiveTask: 30.000672ms
+weirdFunction: 10.64764ms
+slowNetworkRequest: 67.194516ms
+cpuIntensiveTask: 30.000912ms
+weirdFunction: 10.105371ms
+// ...
+```
+
+Oh no, the builtin CPU profiler is misleading us! How is that possible? Well, it turns out the builtin profiler only shows On-CPU time. Time spent waiting on I/O is completely hidden from us.
+
+### /debug/pprof/trace
+
+Let's try something else. The `/debug/pprof/trace` endpoint includes a "synchronization blocking profile", maybe that's what we need?
+
+```
+curl -so pprof.trace http://localhost:6060/debug/pprof/trace?seconds=10
+go tool trace --pprof=sync pprof.trace > sync.pprof
+go tool pprof --http=:6061 sync.pprof
+```
+
+Oh no, we're being mislead again. This profiler thinks all our time is spent on `slowNetworkRequest()`. It's completely missing `cpuIntensiveTask()`. And what about `weirdFunction()`? It seems like no builtin profiler can see it?
+
+
+
+### /debug/fgprof
+
+So what can we do? Let's try fgprof, which is designed to analyze mixed I/O and CPU workloads like the one we're dealing with here. We can easily add it alongside the builtin profilers.
+
+```go
+import(
+ _ "net/http/pprof"
+ "github.com/felixge/fgprof"
+)
+
+func main() {
+ http.DefaultServeMux.Handle("/debug/fgprof", fgprof.Handler())
+ go func() {
+ log.Println(http.ListenAndServe(":6060", nil))
+ }()
+
+ //
+}
+```
+
+
+
+```
+go tool pprof --http=:6061 http://localhost:6060/debug/fgprof?seconds=10
+```
+
+Finally, a profile that shows all three of our functions and how much time we're spending on them. It also turns out our `weirdFunction()` was simply calling `time.Sleep()`, how weird indeed!
+
+
+
+## How it Works
+
+### fgprof
+
+fgprof is implemented as a background goroutine that wakes up 99 times per second and calls `runtime.GoroutineProfile`. This returns a list of all goroutines regardless of their current On/Off CPU scheduling status and their call stacks.
+
+This data is used to maintain an in-memory stack counter which can be converted to the pprof or folded output format. The meat of the implementation is super simple and < 100 lines of code, you should [check it out](./fgprof.go).
+
+The overhead of fgprof increases with the number of active goroutines (including those waiting on I/O, Channels, Locks, etc.) executed by your program. If your program typically has less than 1000 active goroutines, you shouldn't have much to worry about. However, at 10k or more goroutines fgprof might start to cause some noticeable overhead.
+
+### Go's builtin CPU Profiler
+
+The builtin Go CPU profiler uses the [setitimer(2)](https://linux.die.net/man/2/setitimer) system call to ask the operating system to be sent a `SIGPROF` signal 100 times a second. Each signal stops the Go process and gets delivered to a random thread's `sigtrampgo()` function. This function then proceeds to call `sigprof()` or `sigprofNonGo()` to record the thread's current stack.
+
+Since Go uses non-blocking I/O, Goroutines that wait on I/O are parked and not running on any threads. Therefore they end up being largely invisible to Go's builtin CPU profiler.
+
+## Known Issues
+
+There is no perfect approach to profiling, and fgprof is no exception. Below is a list of known issues that will hopefully not be of practical concern for most users, but are important to highlight.
+
+- Internal C functions are not showing up in the stack traces, e.g. `runtime.nanotime` which is called by `time.Since` in the example program.
+- The current implementation is relying on the Go scheduler to schedule the internal goroutine at a fixed sample rate. Scheduler delays, especially biased ones, might cause inaccuracies.
+
+## Credits
+
+The following articles helped me to learn more about how profilers in general, and the Go profiler in particular work.
+
+- [How do Ruby & Python profilers work?](https://jvns.ca/blog/2017/12/17/how-do-ruby---python-profilers-work-/) by Julia Evans
+- [Profiling Go programs with pprof](https://jvns.ca/blog/2017/09/24/profiling-go-with-pprof/) by Julia Evans
+
+## License
+
+fgprof is licensed under the MIT License.
diff --git a/vendor/github.com/felixge/fgprof/fgprof.go b/vendor/github.com/felixge/fgprof/fgprof.go
new file mode 100644
index 0000000000..e4af2e4052
--- /dev/null
+++ b/vendor/github.com/felixge/fgprof/fgprof.go
@@ -0,0 +1,318 @@
+// fgprof is a sampling Go profiler that allows you to analyze On-CPU as well
+// as [Off-CPU](http://www.brendangregg.com/offcpuanalysis.html) (e.g. I/O)
+// time together.
+package fgprof
+
+import (
+ "fmt"
+ "io"
+ "math"
+ "runtime"
+ "sort"
+ "strings"
+ "time"
+
+ "github.com/google/pprof/profile"
+)
+
+// Format decides how the output is rendered to the user.
+type Format string
+
+const (
+ // FormatFolded is used by Brendan Gregg's FlameGraph utility, see
+ // https://github.com/brendangregg/FlameGraph#2-fold-stacks.
+ FormatFolded Format = "folded"
+ // FormatPprof is used by Google's pprof utility, see
+ // https://github.com/google/pprof/blob/master/proto/README.md.
+ FormatPprof Format = "pprof"
+)
+
+// Start begins profiling the goroutines of the program and returns a function
+// that needs to be invoked by the caller to stop the profiling and write the
+// results to w using the given format.
+func Start(w io.Writer, format Format) func() error {
+ startTime := time.Now()
+
+ // Go's CPU profiler uses 100hz, but 99hz might be less likely to result in
+ // accidental synchronization with the program we're profiling.
+ const hz = 99
+ ticker := time.NewTicker(time.Second / hz)
+ stopCh := make(chan struct{})
+ prof := &profiler{}
+ profile := newWallclockProfile()
+
+ var sampleCount int64
+
+ go func() {
+ defer ticker.Stop()
+
+ for {
+ select {
+ case <-ticker.C:
+ sampleCount++
+
+ stacks := prof.GoroutineProfile()
+ profile.Add(stacks)
+ case <-stopCh:
+ return
+ }
+ }
+ }()
+
+ return func() error {
+ stopCh <- struct{}{}
+ endTime := time.Now()
+ profile.Ignore(prof.SelfFrames()...)
+
+ // Compute actual sample rate in case, due to performance issues, we
+ // were not actually able to sample at the given hz. Converting
+ // everything to float avoids integers being rounded in the wrong
+ // direction and improves the correctness of times in profiles.
+ duration := endTime.Sub(startTime)
+ actualHz := float64(sampleCount) / (float64(duration) / 1e9)
+ return profile.Export(w, format, int(math.Round(actualHz)), startTime, endTime)
+ }
+}
+
+// profiler provides a convenient and performant way to access
+// runtime.GoroutineProfile().
+type profiler struct {
+ stacks []runtime.StackRecord
+ selfFrame *runtime.Frame
+}
+
+// GoroutineProfile returns the stacks of all goroutines currently managed by
+// the scheduler. This includes both goroutines that are currently running
+// (On-CPU), as well as waiting (Off-CPU).
+func (p *profiler) GoroutineProfile() []runtime.StackRecord {
+ if p.selfFrame == nil {
+ // Determine the runtime.Frame of this func so we can hide it from our
+ // profiling output.
+ rpc := make([]uintptr, 1)
+ n := runtime.Callers(1, rpc)
+ if n < 1 {
+ panic("could not determine selfFrame")
+ }
+ selfFrame, _ := runtime.CallersFrames(rpc).Next()
+ p.selfFrame = &selfFrame
+ }
+
+ // We don't know how many goroutines exist, so we have to grow p.stacks
+ // dynamically. We overshoot by 10% since it's possible that more goroutines
+ // are launched in between two calls to GoroutineProfile. Once p.stacks
+ // reaches the maximum number of goroutines used by the program, it will get
+ // reused indefinitely, eliminating GoroutineProfile calls and allocations.
+ //
+ // TODO(fg) There might be workloads where it would be nice to shrink
+ // p.stacks dynamically as well, but let's not over-engineer this until we
+ // understand those cases better.
+ for {
+ n, ok := runtime.GoroutineProfile(p.stacks)
+ if !ok {
+ p.stacks = make([]runtime.StackRecord, int(float64(n)*1.1))
+ } else {
+ return p.stacks[0:n]
+ }
+ }
+}
+
+// SelfFrames returns frames that belong to the profiler so that we can ignore
+// them when exporting the final profile.
+func (p *profiler) SelfFrames() []*runtime.Frame {
+ if p.selfFrame != nil {
+ return []*runtime.Frame{p.selfFrame}
+ }
+ return nil
+}
+
+func newWallclockProfile() *wallclockProfile {
+ return &wallclockProfile{stacks: map[[32]uintptr]*wallclockStack{}}
+}
+
+// wallclockProfile holds a wallclock profile that can be exported in different
+// formats.
+type wallclockProfile struct {
+ stacks map[[32]uintptr]*wallclockStack
+ ignore []*runtime.Frame
+}
+
+// wallclockStack holds the symbolized frames of a stack trace and the number
+// of times it has been seen.
+type wallclockStack struct {
+ frames []*runtime.Frame
+ count int
+}
+
+// Ignore sets a list of frames that should be ignored when exporting the
+// profile.
+func (p *wallclockProfile) Ignore(frames ...*runtime.Frame) {
+ p.ignore = frames
+}
+
+// Add adds the given stack traces to the profile.
+func (p *wallclockProfile) Add(stackRecords []runtime.StackRecord) {
+ for _, stackRecord := range stackRecords {
+ if _, ok := p.stacks[stackRecord.Stack0]; !ok {
+ ws := &wallclockStack{}
+ // symbolize pcs into frames
+ frames := runtime.CallersFrames(stackRecord.Stack())
+ for {
+ frame, more := frames.Next()
+ ws.frames = append(ws.frames, &frame)
+ if !more {
+ break
+ }
+ }
+ p.stacks[stackRecord.Stack0] = ws
+ }
+ p.stacks[stackRecord.Stack0].count++
+ }
+}
+
+func (p *wallclockProfile) Export(w io.Writer, f Format, hz int, startTime, endTime time.Time) error {
+ switch f {
+ case FormatFolded:
+ return p.exportFolded(w)
+ case FormatPprof:
+ return p.exportPprof(hz, startTime, endTime).Write(w)
+ default:
+ return fmt.Errorf("unknown format: %q", f)
+ }
+}
+
+// exportStacks returns the stacks in this profile except those that have been
+// set to Ignore().
+func (p *wallclockProfile) exportStacks() []*wallclockStack {
+ stacks := make([]*wallclockStack, 0, len(p.stacks))
+nextStack:
+ for _, ws := range p.stacks {
+ for _, f := range ws.frames {
+ for _, igf := range p.ignore {
+ if f.Entry == igf.Entry {
+ continue nextStack
+ }
+ }
+ }
+ stacks = append(stacks, ws)
+ }
+ return stacks
+}
+
+func (p *wallclockProfile) exportFolded(w io.Writer) error {
+ var lines []string
+ stacks := p.exportStacks()
+ for _, ws := range stacks {
+ var foldedStack []string
+ for _, f := range ws.frames {
+ foldedStack = append(foldedStack, f.Function)
+ }
+ line := fmt.Sprintf("%s %d", strings.Join(foldedStack, ";"), ws.count)
+ lines = append(lines, line)
+ }
+ sort.Strings(lines)
+ _, err := io.WriteString(w, strings.Join(lines, "\n")+"\n")
+ return err
+}
+
+func (p *wallclockProfile) exportPprof(hz int, startTime, endTime time.Time) *profile.Profile {
+ prof := &profile.Profile{}
+ m := &profile.Mapping{ID: 1, HasFunctions: true}
+ prof.Period = int64(1e9 / hz) // Number of nanoseconds between samples.
+ prof.TimeNanos = startTime.UnixNano()
+ prof.DurationNanos = int64(endTime.Sub(startTime))
+ prof.Mapping = []*profile.Mapping{m}
+ prof.SampleType = []*profile.ValueType{
+ {
+ Type: "samples",
+ Unit: "count",
+ },
+ {
+ Type: "time",
+ Unit: "nanoseconds",
+ },
+ }
+ prof.PeriodType = &profile.ValueType{
+ Type: "wallclock",
+ Unit: "nanoseconds",
+ }
+
+ type functionKey struct {
+ Name string
+ Filename string
+ }
+ funcIdx := map[functionKey]*profile.Function{}
+
+ type locationKey struct {
+ Function functionKey
+ Line int
+ }
+ locationIdx := map[locationKey]*profile.Location{}
+ for _, ws := range p.exportStacks() {
+ sample := &profile.Sample{
+ Value: []int64{
+ int64(ws.count),
+ int64(1000 * 1000 * 1000 / hz * ws.count),
+ },
+ }
+
+ for _, frame := range ws.frames {
+ fnKey := functionKey{Name: frame.Function, Filename: frame.File}
+ function, ok := funcIdx[fnKey]
+ if !ok {
+ function = &profile.Function{
+ ID: uint64(len(prof.Function)) + 1,
+ Name: frame.Function,
+ SystemName: frame.Function,
+ Filename: frame.File,
+ }
+ funcIdx[fnKey] = function
+ prof.Function = append(prof.Function, function)
+ }
+
+ locKey := locationKey{Function: fnKey, Line: frame.Line}
+ location, ok := locationIdx[locKey]
+ if !ok {
+ location = &profile.Location{
+ ID: uint64(len(prof.Location)) + 1,
+ Mapping: m,
+ Line: []profile.Line{{
+ Function: function,
+ Line: int64(frame.Line),
+ }},
+ }
+ locationIdx[locKey] = location
+ prof.Location = append(prof.Location, location)
+ }
+ sample.Location = append(sample.Location, location)
+ }
+ prof.Sample = append(prof.Sample, sample)
+ }
+ return prof
+}
+
+type symbolizedStacks map[[32]uintptr][]frameCount
+
+func (w wallclockProfile) Symbolize(exclude *runtime.Frame) symbolizedStacks {
+ m := make(symbolizedStacks)
+outer:
+ for stack0, ws := range w.stacks {
+ frames := runtime.CallersFrames((&runtime.StackRecord{Stack0: stack0}).Stack())
+
+ for {
+ frame, more := frames.Next()
+ if frame.Entry == exclude.Entry {
+ continue outer
+ }
+ m[stack0] = append(m[stack0], frameCount{Frame: &frame, Count: ws.count})
+ if !more {
+ break
+ }
+ }
+ }
+ return m
+}
+
+type frameCount struct {
+ *runtime.Frame
+ Count int
+}
diff --git a/vendor/github.com/felixge/fgprof/handler.go b/vendor/github.com/felixge/fgprof/handler.go
new file mode 100644
index 0000000000..ce28f01344
--- /dev/null
+++ b/vendor/github.com/felixge/fgprof/handler.go
@@ -0,0 +1,35 @@
+package fgprof
+
+import (
+ "fmt"
+ "net/http"
+ "strconv"
+ "time"
+)
+
+// Handler returns an http handler that takes an optional "seconds" query
+// argument that defaults to "30" and produces a profile over this duration.
+// The optional "format" parameter controls if the output is written in
+// Google's "pprof" format (default) or Brendan Gregg's "folded" stack format.
+func Handler() http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ var seconds int
+ var err error
+ if s := r.URL.Query().Get("seconds"); s == "" {
+ seconds = 30
+ } else if seconds, err = strconv.Atoi(s); err != nil || seconds <= 0 {
+ w.WriteHeader(http.StatusBadRequest)
+ fmt.Fprintf(w, "bad seconds: %d: %s\n", seconds, err)
+ return
+ }
+
+ format := Format(r.URL.Query().Get("format"))
+ if format == "" {
+ format = FormatPprof
+ }
+
+ stop := Start(w, format)
+ defer stop()
+ time.Sleep(time.Duration(seconds) * time.Second)
+ })
+}
diff --git a/vendor/github.com/felixge/httpsnoop/.travis.yml b/vendor/github.com/felixge/httpsnoop/.travis.yml
deleted file mode 100644
index bfc421200d..0000000000
--- a/vendor/github.com/felixge/httpsnoop/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: go
-
-go:
- - 1.6
- - 1.7
- - 1.8
diff --git a/vendor/github.com/felixge/httpsnoop/Makefile b/vendor/github.com/felixge/httpsnoop/Makefile
index 2d84889aed..4e12afdd90 100644
--- a/vendor/github.com/felixge/httpsnoop/Makefile
+++ b/vendor/github.com/felixge/httpsnoop/Makefile
@@ -1,7 +1,7 @@
.PHONY: ci generate clean
ci: clean generate
- go test -v ./...
+ go test -race -v ./...
generate:
go generate .
diff --git a/vendor/github.com/felixge/httpsnoop/README.md b/vendor/github.com/felixge/httpsnoop/README.md
index ddcecd13e7..cf6b42f3d7 100644
--- a/vendor/github.com/felixge/httpsnoop/README.md
+++ b/vendor/github.com/felixge/httpsnoop/README.md
@@ -7,8 +7,8 @@ http.Handlers.
Doing this requires non-trivial wrapping of the http.ResponseWriter interface,
which is also exposed for users interested in a more low-level API.
-[](https://godoc.org/github.com/felixge/httpsnoop)
-[](https://travis-ci.org/felixge/httpsnoop)
+[](https://pkg.go.dev/github.com/felixge/httpsnoop)
+[](https://github.com/felixge/httpsnoop/actions/workflows/main.yaml)
## Usage Example
diff --git a/vendor/github.com/felixge/httpsnoop/capture_metrics.go b/vendor/github.com/felixge/httpsnoop/capture_metrics.go
index b77cc7c009..bec7b71b39 100644
--- a/vendor/github.com/felixge/httpsnoop/capture_metrics.go
+++ b/vendor/github.com/felixge/httpsnoop/capture_metrics.go
@@ -52,7 +52,7 @@ func (m *Metrics) CaptureMetrics(w http.ResponseWriter, fn func(http.ResponseWri
return func(code int) {
next(code)
- if !headerWritten {
+ if !(code >= 100 && code <= 199) && !headerWritten {
m.Code = code
headerWritten = true
}
diff --git a/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go b/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go
index 31cbdfb8ef..101cedde67 100644
--- a/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go
+++ b/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go
@@ -1,5 +1,5 @@
// +build go1.8
-// Code generated by "httpsnoop/codegen"; DO NOT EDIT
+// Code generated by "httpsnoop/codegen"; DO NOT EDIT.
package httpsnoop
diff --git a/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go b/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go
index ab99c07c7a..e0951df152 100644
--- a/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go
+++ b/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go
@@ -1,5 +1,5 @@
// +build !go1.8
-// Code generated by "httpsnoop/codegen"; DO NOT EDIT
+// Code generated by "httpsnoop/codegen"; DO NOT EDIT.
package httpsnoop
diff --git a/vendor/github.com/fxamacker/cbor/v2/.gitignore b/vendor/github.com/fxamacker/cbor/v2/.gitignore
new file mode 100644
index 0000000000..f1c181ec9c
--- /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 0000000000..38cb9ae101
--- /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 0000000000..c794b2b0c6
--- /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 0000000000..de0965e12d
--- /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/fxamacker/cbor/v2/LICENSE b/vendor/github.com/fxamacker/cbor/v2/LICENSE
new file mode 100644
index 0000000000..eaa8504921
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019-present Faye Amacker
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ 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 0000000000..af0a79507e
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/README.md
@@ -0,0 +1,691 @@
+# CBOR Codec in Go
+
+
+
+[fxamacker/cbor](https://github.com/fxamacker/cbor) is a library for encoding and decoding [CBOR](https://www.rfc-editor.org/info/std94) and [CBOR Sequences](https://www.rfc-editor.org/rfc/rfc8742.html).
+
+CBOR is a [trusted alternative](https://www.rfc-editor.org/rfc/rfc8949.html#name-comparison-of-other-binary-) to JSON, MessagePack, Protocol Buffers, etc. CBOR is an Internet Standard defined by [IETF STD 94 (RFC 8949)](https://www.rfc-editor.org/info/std94) and is designed to be relevant for decades.
+
+`fxamacker/cbor` is used in projects by Arm Ltd., Cisco, EdgeX Foundry, Flow Foundation, Fraunhofer‑AISEC, Kubernetes, Let's Encrypt (ISRG), Linux Foundation, Microsoft, Mozilla, Oasis Protocol, Tailscale, Teleport, [etc](https://github.com/fxamacker/cbor#who-uses-fxamackercbor).
+
+See [Quick Start](#quick-start) and [Releases](https://github.com/fxamacker/cbor/releases/). 🆕 `UnmarshalFirst` and `DiagnoseFirst` can decode CBOR Sequences. `cbor.MarshalToBuffer()` and `UserBufferEncMode` accepts user-specified buffer.
+
+## fxamacker/cbor
+
+[](https://github.com/fxamacker/cbor/actions?query=workflow%3Aci)
+[](https://github.com/fxamacker/cbor/actions?query=workflow%3A%22cover+%E2%89%A596%25%22)
+[](https://github.com/fxamacker/cbor/actions/workflows/codeql-analysis.yml)
+[](#fuzzing-and-code-coverage)
+[](https://goreportcard.com/report/github.com/fxamacker/cbor)
+
+`fxamacker/cbor` is a CBOR codec in full conformance with [IETF STD 94 (RFC 8949)](https://www.rfc-editor.org/info/std94). It also supports CBOR Sequences ([RFC 8742](https://www.rfc-editor.org/rfc/rfc8742.html)) and Extended Diagnostic Notation ([Appendix G of RFC 8610](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G)).
+
+Features include full support for CBOR tags, [Core Deterministic Encoding](https://www.rfc-editor.org/rfc/rfc8949.html#name-core-deterministic-encoding), duplicate map key detection, etc.
+
+Design balances trade-offs between security, speed, concurrency, encoded data size, usability, etc.
+
+Highlights
+
+__🚀 Speed__
+
+Encoding and decoding is fast without using Go's `unsafe` package. Slower settings are opt-in. Default limits allow very fast and memory efficient rejection of malformed CBOR data.
+
+__🔒 Security__
+
+Decoder has configurable limits that defend against malicious inputs. Duplicate map key detection is supported. By contrast, `encoding/gob` is [not designed to be hardened against adversarial inputs](https://pkg.go.dev/encoding/gob#hdr-Security).
+
+Codec passed multiple confidential security assessments in 2022. No vulnerabilities found in subset of codec in a [nonconfidential security assessment](https://github.com/veraison/go-cose/blob/v1.0.0-rc.1/reports/NCC_Microsoft-go-cose-Report_2022-05-26_v1.0.pdf) prepared by NCC Group for Microsoft Corporation.
+
+__🗜️ Data Size__
+
+Struct tags (`toarray`, `keyasint`, `omitempty`) automatically reduce size of encoded structs. Encoding optionally shrinks float64→32→16 when values fit.
+
+__:jigsaw: Usability__
+
+API is mostly same as `encoding/json` plus interfaces that simplify concurrency for CBOR options. Encoding and decoding modes can be created at startup and reused by any goroutines.
+
+Presets include Core Deterministic Encoding, Preferred Serialization, CTAP2 Canonical CBOR, etc.
+
+__📆 Extensibility__
+
+Features include CBOR [extension points](https://www.rfc-editor.org/rfc/rfc8949.html#section-7.1) (e.g. CBOR tags) and extensive settings. API has interfaces that allow users to create custom encoding and decoding without modifying this library.
+
+
+
+
+
+### Secure Decoding with Configurable Settings
+
+`fxamacker/cbor` has configurable limits, etc. that defend against malicious CBOR data.
+
+By contrast, `encoding/gob` is [not designed to be hardened against adversarial inputs](https://pkg.go.dev/encoding/gob#hdr-Security).
+
+Example decoding with encoding/gob 💥 fatal error (out of memory)
+
+```Go
+// Example of encoding/gob having "fatal error: runtime: out of memory"
+// while decoding 181 bytes.
+package main
+import (
+ "bytes"
+ "encoding/gob"
+ "encoding/hex"
+ "fmt"
+)
+
+// Example data is from https://github.com/golang/go/issues/24446
+// (shortened to 181 bytes).
+const data = "4dffb503010102303001ff30000109010130010800010130010800010130" +
+ "01ffb80001014a01ffb60001014b01ff860001013001ff860001013001ff" +
+ "860001013001ff860001013001ffb80000001eff850401010e3030303030" +
+ "30303030303030303001ff3000010c0104000016ffb70201010830303030" +
+ "3030303001ff3000010c000030ffb6040405fcff00303030303030303030" +
+ "303030303030303030303030303030303030303030303030303030303030" +
+ "30"
+
+type X struct {
+ J *X
+ K map[string]int
+}
+
+func main() {
+ raw, _ := hex.DecodeString(data)
+ decoder := gob.NewDecoder(bytes.NewReader(raw))
+
+ var x X
+ decoder.Decode(&x) // fatal error: runtime: out of memory
+ fmt.Println("Decoding finished.")
+}
+```
+
+
+
+
+
+`fxamacker/cbor` is fast at rejecting malformed CBOR data. E.g. attempts to
+decode 10 bytes of malicious CBOR data to `[]byte` (with default settings):
+
+| Codec | Speed (ns/op) | Memory | Allocs |
+| :---- | ------------: | -----: | -----: |
+| fxamacker/cbor 2.5.0 | 44 ± 5% | 32 B/op | 2 allocs/op |
+| ugorji/go 1.2.11 | 5353261 ± 4% | 67111321 B/op | 13 allocs/op |
+
+Benchmark details
+
+Latest comparison used:
+- Input: `[]byte{0x9B, 0x00, 0x00, 0x42, 0xFA, 0x42, 0xFA, 0x42, 0xFA, 0x42}`
+- go1.19.10, linux/amd64, i5-13600K (disabled all e-cores, DDR4 @2933)
+- go test -bench=. -benchmem -count=20
+
+#### Prior comparisons
+
+| Codec | Speed (ns/op) | Memory | Allocs |
+| :---- | ------------: | -----: | -----: |
+| fxamacker/cbor 2.5.0-beta2 | 44.33 ± 2% | 32 B/op | 2 allocs/op |
+| fxamacker/cbor 0.1.0 - 2.4.0 | ~44.68 ± 6% | 32 B/op | 2 allocs/op |
+| ugorji/go 1.2.10 | 5524792.50 ± 3% | 67110491 B/op | 12 allocs/op |
+| ugorji/go 1.1.0 - 1.2.6 | 💥 runtime: | out of memory: | cannot allocate |
+
+- Input: `[]byte{0x9B, 0x00, 0x00, 0x42, 0xFA, 0x42, 0xFA, 0x42, 0xFA, 0x42}`
+- go1.19.6, linux/amd64, i5-13600K (DDR4)
+- go test -bench=. -benchmem -count=20
+
+
+
+
+
+### Smaller Encodings with Struct Tags
+
+Struct tags (`toarray`, `keyasint`, `omitempty`) reduce encoded size of structs.
+
+Example encoding 3-level nested Go struct to 1 byte CBOR
+
+https://go.dev/play/p/YxwvfPdFQG2
+
+```Go
+// Example encoding nested struct (with omitempty tag)
+// - encoding/json: 18 byte JSON
+// - fxamacker/cbor: 1 byte CBOR
+package main
+
+import (
+ "encoding/hex"
+ "encoding/json"
+ "fmt"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+type GrandChild struct {
+ Quux int `json:",omitempty"`
+}
+
+type Child struct {
+ Baz int `json:",omitempty"`
+ Qux GrandChild `json:",omitempty"`
+}
+
+type Parent struct {
+ Foo Child `json:",omitempty"`
+ Bar int `json:",omitempty"`
+}
+
+func cb() {
+ results, _ := cbor.Marshal(Parent{})
+ fmt.Println("hex(CBOR): " + hex.EncodeToString(results))
+
+ text, _ := cbor.Diagnose(results) // Diagnostic Notation
+ fmt.Println("DN: " + text)
+}
+
+func js() {
+ results, _ := json.Marshal(Parent{})
+ fmt.Println("hex(JSON): " + hex.EncodeToString(results))
+
+ text := string(results) // JSON
+ fmt.Println("JSON: " + text)
+}
+
+func main() {
+ cb()
+ fmt.Println("-------------")
+ js()
+}
+```
+
+Output (DN is Diagnostic Notation):
+```
+hex(CBOR): a0
+DN: {}
+-------------
+hex(JSON): 7b22466f6f223a7b22517578223a7b7d7d7d
+JSON: {"Foo":{"Qux":{}}}
+```
+
+
+
+
+
+Example using different struct tags together:
+
+
+
+API is mostly same as `encoding/json`, plus interfaces that simplify concurrency for CBOR options.
+
+## Quick Start
+
+__Install__: `go get github.com/fxamacker/cbor/v2` and `import "github.com/fxamacker/cbor/v2"`.
+
+### Key Points
+
+This library can encode and decode CBOR (RFC 8949) and CBOR Sequences (RFC 8742).
+
+- __CBOR data item__ is a single piece of CBOR data and its structure may contain 0 or more nested data items.
+- __CBOR sequence__ is a concatenation of 0 or more encoded CBOR data items.
+
+Configurable limits and options can be used to balance trade-offs.
+
+- Encoding and decoding modes are created from options (settings).
+- Modes can be created at startup and reused.
+- Modes are safe for concurrent use.
+
+### Default Mode
+
+Package level functions only use this library's default settings.
+They provide the "default mode" of encoding and decoding.
+
+```go
+// API matches encoding/json for Marshal, Unmarshal, Encode, Decode, etc.
+b, err = cbor.Marshal(v) // encode v to []byte b
+err = cbor.Unmarshal(b, &v) // decode []byte b to v
+decoder = cbor.NewDecoder(r) // create decoder with io.Reader r
+err = decoder.Decode(&v) // decode a CBOR data item to v
+
+// v2.7.0 added MarshalToBuffer() and UserBufferEncMode interface.
+err = cbor.MarshalToBuffer(v, b) // encode v to b instead of using built-in buf pool.
+
+// v2.5.0 added new functions that return remaining bytes.
+
+// UnmarshalFirst decodes first CBOR data item and returns remaining bytes.
+rest, err = cbor.UnmarshalFirst(b, &v) // decode []byte b to v
+
+// DiagnoseFirst translates first CBOR data item to text and returns remaining bytes.
+text, rest, err = cbor.DiagnoseFirst(b) // decode []byte b to Diagnostic Notation text
+
+// NOTE: Unmarshal returns ExtraneousDataError if there are remaining bytes,
+// but new funcs UnmarshalFirst and DiagnoseFirst do not.
+```
+
+__IMPORTANT__: 👉 CBOR settings allow trade-offs between speed, security, encoding size, etc.
+
+- Different CBOR libraries may use different default settings.
+- CBOR-based formats or protocols usually require specific settings.
+
+For example, WebAuthn uses "CTAP2 Canonical CBOR" which is available as a preset.
+
+### Presets
+
+Presets can be used as-is or as a starting point for custom settings.
+
+```go
+// EncOptions is a struct of encoder settings.
+func CoreDetEncOptions() EncOptions // RFC 8949 Core Deterministic Encoding
+func PreferredUnsortedEncOptions() EncOptions // RFC 8949 Preferred Serialization
+func CanonicalEncOptions() EncOptions // RFC 7049 Canonical CBOR
+func CTAP2EncOptions() EncOptions // FIDO2 CTAP2 Canonical CBOR
+```
+
+Presets are used to create custom modes.
+
+### Custom Modes
+
+Modes are created from settings. Once created, modes have immutable settings.
+
+💡 Create the mode at startup and reuse it. It is safe for concurrent use.
+
+```Go
+// Create encoding mode.
+opts := cbor.CoreDetEncOptions() // use preset options as a starting point
+opts.Time = cbor.TimeUnix // change any settings if needed
+em, err := opts.EncMode() // create an immutable encoding mode
+
+// Reuse the encoding mode. It is safe for concurrent use.
+
+// API matches encoding/json.
+b, err := em.Marshal(v) // encode v to []byte b
+encoder := em.NewEncoder(w) // create encoder with io.Writer w
+err := encoder.Encode(v) // encode v to io.Writer w
+```
+
+Default mode and custom modes automatically apply struct tags.
+
+### User Specified Buffer for Encoding (v2.7.0)
+
+`UserBufferEncMode` interface extends `EncMode` interface to add `MarshalToBuffer()`. It accepts a user-specified buffer instead of using built-in buffer pool.
+
+```Go
+em, err := myEncOptions.UserBufferEncMode() // create UserBufferEncMode mode
+
+var buf bytes.Buffer
+err = em.MarshalToBuffer(v, &buf) // encode v to provided buf
+```
+
+### Struct Tags
+
+Struct tags (`toarray`, `keyasint`, `omitempty`) reduce encoded size of structs.
+
+Example encoding 3-level nested Go struct to 1 byte CBOR
+
+https://go.dev/play/p/YxwvfPdFQG2
+
+```Go
+// Example encoding nested struct (with omitempty tag)
+// - encoding/json: 18 byte JSON
+// - fxamacker/cbor: 1 byte CBOR
+package main
+
+import (
+ "encoding/hex"
+ "encoding/json"
+ "fmt"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+type GrandChild struct {
+ Quux int `json:",omitempty"`
+}
+
+type Child struct {
+ Baz int `json:",omitempty"`
+ Qux GrandChild `json:",omitempty"`
+}
+
+type Parent struct {
+ Foo Child `json:",omitempty"`
+ Bar int `json:",omitempty"`
+}
+
+func cb() {
+ results, _ := cbor.Marshal(Parent{})
+ fmt.Println("hex(CBOR): " + hex.EncodeToString(results))
+
+ text, _ := cbor.Diagnose(results) // Diagnostic Notation
+ fmt.Println("DN: " + text)
+}
+
+func js() {
+ results, _ := json.Marshal(Parent{})
+ fmt.Println("hex(JSON): " + hex.EncodeToString(results))
+
+ text := string(results) // JSON
+ fmt.Println("JSON: " + text)
+}
+
+func main() {
+ cb()
+ fmt.Println("-------------")
+ js()
+}
+```
+
+Output (DN is Diagnostic Notation):
+```
+hex(CBOR): a0
+DN: {}
+-------------
+hex(JSON): 7b22466f6f223a7b22517578223a7b7d7d7d
+JSON: {"Foo":{"Qux":{}}}
+```
+
+
+
+
+
+Example using several struct tags
+
+
+
+
+
+Struct tags simplify use of CBOR-based protocols that require CBOR arrays or maps with integer keys.
+
+### CBOR Tags
+
+CBOR tags are specified in a `TagSet`.
+
+Custom modes can be created with a `TagSet` to handle CBOR tags.
+
+```go
+em, err := opts.EncMode() // no CBOR tags
+em, err := opts.EncModeWithTags(ts) // immutable CBOR tags
+em, err := opts.EncModeWithSharedTags(ts) // mutable shared CBOR tags
+```
+
+`TagSet` and modes using it are safe for concurrent use. Equivalent API is available for `DecMode`.
+
+Example using TagSet and TagOptions
+
+```go
+// Use signedCWT struct defined in "Decoding CWT" example.
+
+// Create TagSet (safe for concurrency).
+tags := cbor.NewTagSet()
+// Register tag COSE_Sign1 18 with signedCWT type.
+tags.Add(
+ cbor.TagOptions{EncTag: cbor.EncTagRequired, DecTag: cbor.DecTagRequired},
+ reflect.TypeOf(signedCWT{}),
+ 18)
+
+// Create DecMode with immutable tags.
+dm, _ := cbor.DecOptions{}.DecModeWithTags(tags)
+
+// Unmarshal to signedCWT with tag support.
+var v signedCWT
+if err := dm.Unmarshal(data, &v); err != nil {
+ return err
+}
+
+// Create EncMode with immutable tags.
+em, _ := cbor.EncOptions{}.EncModeWithTags(tags)
+
+// Marshal signedCWT with tag number.
+if data, err := cbor.Marshal(v); err != nil {
+ return err
+}
+```
+
+
+
+### Functions and Interfaces
+
+Functions and interfaces at a glance
+
+Common functions with same API as `encoding/json`:
+- `Marshal`, `Unmarshal`
+- `NewEncoder`, `(*Encoder).Encode`
+- `NewDecoder`, `(*Decoder).Decode`
+
+NOTE: `Unmarshal` will return `ExtraneousDataError` if there are remaining bytes
+because RFC 8949 treats CBOR data item with remaining bytes as malformed.
+- 💡 Use `UnmarshalFirst` to decode first CBOR data item and return any remaining bytes.
+
+Other useful functions:
+- `Diagnose`, `DiagnoseFirst` produce human-readable [Extended Diagnostic Notation](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G) from CBOR data.
+- `UnmarshalFirst` decodes first CBOR data item and return any remaining bytes.
+- `Wellformed` returns true if the the CBOR data item is well-formed.
+
+Interfaces identical or comparable to Go `encoding` packages include:
+`Marshaler`, `Unmarshaler`, `BinaryMarshaler`, and `BinaryUnmarshaler`.
+
+The `RawMessage` type can be used to delay CBOR decoding or precompute CBOR encoding.
+
+
+
+### Security Tips
+
+🔒 Use Go's `io.LimitReader` to limit size when decoding very large or indefinite size data.
+
+Default limits may need to be increased for systems handling very large data (e.g. blockchains).
+
+`DecOptions` can be used to modify default limits for `MaxArrayElements`, `MaxMapPairs`, and `MaxNestedLevels`.
+
+## Status
+
+v2.7.0 (June 23, 2024) adds features and improvements that help large projects (e.g. Kubernetes) use CBOR as an alternative to JSON and Protocol Buffers. Other improvements include speedups, improved memory use, bug fixes, new serialization options, etc. It passed fuzz tests (5+ billion executions) and is production quality.
+
+For more details, see [release notes](https://github.com/fxamacker/cbor/releases).
+
+### Prior Release
+
+[v2.6.0](https://github.com/fxamacker/cbor/releases/tag/v2.6.0) (February 2024) adds important new features, optimizations, and bug fixes. It is especially useful to systems that need to convert data between CBOR and JSON. New options and optimizations improve handling of bignum, integers, maps, and strings.
+
+v2.5.0 was released on Sunday, August 13, 2023 with new features and important bug fixes. It is fuzz tested and production quality after extended beta [v2.5.0-beta](https://github.com/fxamacker/cbor/releases/tag/v2.5.0-beta) (Dec 2022) -> [v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Aug 2023).
+
+__IMPORTANT__: 👉 Before upgrading from v2.4 or older release, please read the notable changes highlighted in the release notes. v2.5.0 is a large release with bug fixes to error handling for extraneous data in `Unmarshal`, etc. that should be reviewed before upgrading.
+
+See [v2.5.0 release notes](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) for list of new features, improvements, and bug fixes.
+
+See ["Version and API Changes"](https://github.com/fxamacker/cbor#versions-and-api-changes) section for more info about version numbering, etc.
+
+
+
+## Who uses fxamacker/cbor
+
+`fxamacker/cbor` is used in projects by Arm Ltd., Berlin Institute of Health at Charité, Chainlink, Cisco, Confidential Computing Consortium, ConsenSys, Dapper Labs, EdgeX Foundry, F5, FIDO Alliance, Fraunhofer‑AISEC, Kubernetes, Let's Encrypt (ISRG), Linux Foundation, Matrix.org, Microsoft, Mozilla, National Cybersecurity Agency of France (govt), Netherlands (govt), Oasis Protocol, Smallstep, Tailscale, Taurus SA, Teleport, TIBCO, and others.
+
+`fxamacker/cbor` passed multiple confidential security assessments. A [nonconfidential security assessment](https://github.com/veraison/go-cose/blob/v1.0.0-rc.1/reports/NCC_Microsoft-go-cose-Report_2022-05-26_v1.0.pdf) (prepared by NCC Group for Microsoft Corporation) includes a subset of fxamacker/cbor v2.4.0 in its scope.
+
+## Standards
+
+`fxamacker/cbor` is a CBOR codec in full conformance with [IETF STD 94 (RFC 8949)](https://www.rfc-editor.org/info/std94). It also supports CBOR Sequences ([RFC 8742](https://www.rfc-editor.org/rfc/rfc8742.html)) and Extended Diagnostic Notation ([Appendix G of RFC 8610](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G)).
+
+Notable CBOR features include:
+
+| CBOR Feature | Description |
+| :--- | :--- |
+| CBOR tags | API supports built-in and user-defined tags. |
+| Preferred serialization | Integers encode to fewest bytes. Optional float64 → float32 → float16. |
+| Map key sorting | Unsorted, length-first (Canonical CBOR), and bytewise-lexicographic (CTAP2). |
+| Duplicate map keys | Always forbid for encoding and option to allow/forbid for decoding. |
+| Indefinite length data | Option to allow/forbid for encoding and decoding. |
+| Well-formedness | Always checked and enforced. |
+| Basic validity checks | Optionally check UTF-8 validity and duplicate map keys. |
+| Security considerations | Prevent integer overflow and resource exhaustion (RFC 8949 Section 10). |
+
+Known limitations are noted in the [Limitations section](#limitations).
+
+Go nil values for slices, maps, pointers, etc. are encoded as CBOR null. Empty slices, maps, etc. are encoded as empty CBOR arrays and maps.
+
+Decoder checks for all required well-formedness errors, including all "subkinds" of syntax errors and too little data.
+
+After well-formedness is verified, basic validity errors are handled as follows:
+
+* Invalid UTF-8 string: Decoder has option to check and return invalid UTF-8 string error. This check is enabled by default.
+* Duplicate keys in a map: Decoder has options to ignore or enforce rejection of duplicate map keys.
+
+When decoding well-formed CBOR arrays and maps, decoder saves the first error it encounters and continues with the next item. Options to handle this differently may be added in the future.
+
+By default, decoder treats time values of floating-point NaN and Infinity as if they are CBOR Null or CBOR Undefined.
+
+__Click to expand topic:__
+
+
+ Duplicate Map Keys
+
+This library provides options for fast detection and rejection of duplicate map keys based on applying a Go-specific data model to CBOR's extended generic data model in order to determine duplicate vs distinct map keys. Detection relies on whether the CBOR map key would be a duplicate "key" when decoded and applied to the user-provided Go map or struct.
+
+`DupMapKeyQuiet` turns off detection of duplicate map keys. It tries to use a "keep fastest" method by choosing either "keep first" or "keep last" depending on the Go data type.
+
+`DupMapKeyEnforcedAPF` enforces detection and rejection of duplidate map keys. Decoding stops immediately and returns `DupMapKeyError` when the first duplicate key is detected. The error includes the duplicate map key and the index number.
+
+APF suffix means "Allow Partial Fill" so the destination map or struct can contain some decoded values at the time of error. It is the caller's responsibility to respond to the `DupMapKeyError` by discarding the partially filled result if that's required by their protocol.
+
+
+
+
+ Tag Validity
+
+This library checks tag validity for built-in tags (currently tag numbers 0, 1, 2, 3, and 55799):
+
+* Inadmissible type for tag content
+* Inadmissible value for tag content
+
+Unknown tag data items (not tag number 0, 1, 2, 3, or 55799) are handled in two ways:
+
+* When decoding into an empty interface, unknown tag data item will be decoded into `cbor.Tag` data type, which contains tag number and tag content. The tag content will be decoded into the default Go data type for the CBOR data type.
+* When decoding into other Go types, unknown tag data item is decoded into the specified Go type. If Go type is registered with a tag number, the tag number can optionally be verified.
+
+Decoder also has an option to forbid tag data items (treat any tag data item as error) which is specified by protocols such as CTAP2 Canonical CBOR.
+
+For more information, see [decoding options](#decoding-options-1) and [tag options](#tag-options).
+
+
+
+## Limitations
+
+If any of these limitations prevent you from using this library, please open an issue along with a link to your project.
+
+* CBOR `Undefined` (0xf7) value decodes to Go's `nil` value. CBOR `Null` (0xf6) more closely matches Go's `nil`.
+* CBOR map keys with data types not supported by Go for map keys are ignored and an error is returned after continuing to decode remaining items.
+* When decoding registered CBOR tag data to interface type, decoder creates a pointer to registered Go type matching CBOR tag number. Requiring a pointer for this is a Go limitation.
+
+## Fuzzing and Code Coverage
+
+__Code coverage__ is always 95% or higher (with `go test -cover`) when tagging a release.
+
+__Coverage-guided fuzzing__ must pass billions of execs using before tagging a release. Fuzzing is done using nonpublic code which may eventually get merged into this project. Until then, reports like OpenSSF Scorecard can't detect fuzz tests being used by this project.
+
+
+
+## Versions and API Changes
+This project uses [Semantic Versioning](https://semver.org), so the API is always backwards compatible unless the major version number changes.
+
+These functions have signatures identical to encoding/json and their API will continue to match `encoding/json` even after major new releases:
+`Marshal`, `Unmarshal`, `NewEncoder`, `NewDecoder`, `(*Encoder).Encode`, and `(*Decoder).Decode`.
+
+Exclusions from SemVer:
+- Newly added API documented as "subject to change".
+- Newly added API in the master branch that has never been tagged in non-beta release.
+- If function parameters are unchanged, bug fixes that change behavior (e.g. return error for edge case was missed in prior version). We try to highlight these in the release notes and add extended beta period. E.g. [v2.5.0-beta](https://github.com/fxamacker/cbor/releases/tag/v2.5.0-beta) (Dec 2022) -> [v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Aug 2023).
+
+This project avoids breaking changes to behavior of encoding and decoding functions unless required to improve conformance with supported RFCs (e.g. RFC 8949, RFC 8742, etc.) Visible changes that don't improve conformance to standards are typically made available as new opt-in settings or new functions.
+
+## Code of Conduct
+
+This project has adopted the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). Contact [faye.github@gmail.com](mailto:faye.github@gmail.com) with any questions or comments.
+
+## Contributing
+
+Please open an issue before beginning work on a PR. The improvement may have already been considered, etc.
+
+For more info, see [How to Contribute](CONTRIBUTING.md).
+
+## Security Policy
+
+Security fixes are provided for the latest released version of fxamacker/cbor.
+
+For the full text of the Security Policy, see [SECURITY.md](SECURITY.md).
+
+## Acknowledgements
+
+Many thanks to all the contributors on this project!
+
+I'm especially grateful to Bastian Müller and Dieter Shirley for suggesting and collaborating on CBOR stream mode, and much more.
+
+I'm very grateful to Stefan Tatschner, Yawning Angel, Jernej Kos, x448, ZenGround0, and Jakob Borg for their contributions or support in the very early days.
+
+Big thanks to Ben Luddy for his contributions in v2.6.0 and v2.7.0.
+
+This library clearly wouldn't be possible without Carsten Bormann authoring CBOR RFCs.
+
+Special thanks to Laurence Lundblade and Jeffrey Yasskin for their help on IETF mailing list or at [7049bis](https://github.com/cbor-wg/CBORbis).
+
+Huge thanks to The Go Authors for creating a fun and practical programming language with batteries included!
+
+This library uses `x448/float16` which used to be included. As a standalone package, `x448/float16` is useful to other projects as well.
+
+## License
+
+Copyright © 2019-2024 [Faye Amacker](https://github.com/fxamacker).
+
+fxamacker/cbor is licensed under the MIT License. See [LICENSE](LICENSE) for the full license text.
+
+
diff --git a/vendor/github.com/fxamacker/cbor/v2/SECURITY.md b/vendor/github.com/fxamacker/cbor/v2/SECURITY.md
new file mode 100644
index 0000000000..9c05146d16
--- /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 0000000000..823bff12ce
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/bytestring.go
@@ -0,0 +1,63 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "errors"
+)
+
+// ByteString represents CBOR byte string (major type 2). ByteString can be used
+// when using a Go []byte is not possible or convenient. For example, Go doesn't
+// allow []byte as map key, so ByteString can be used to support data formats
+// having CBOR map with byte string keys. ByteString can also be used to
+// encode invalid UTF-8 string as CBOR byte string.
+// See DecOption.MapKeyByteStringMode for more details.
+type ByteString string
+
+// Bytes returns bytes representing ByteString.
+func (bs ByteString) Bytes() []byte {
+ return []byte(bs)
+}
+
+// MarshalCBOR encodes ByteString as CBOR byte string (major type 2).
+func (bs ByteString) MarshalCBOR() ([]byte, error) {
+ e := getEncodeBuffer()
+ defer putEncodeBuffer(e)
+
+ // Encode length
+ encodeHead(e, byte(cborTypeByteString), uint64(len(bs)))
+
+ // Encode data
+ buf := make([]byte, e.Len()+len(bs))
+ n := copy(buf, e.Bytes())
+ copy(buf[n:], bs)
+
+ return buf, nil
+}
+
+// UnmarshalCBOR decodes CBOR byte string (major type 2) to ByteString.
+// Decoding CBOR null and CBOR undefined sets ByteString to be empty.
+func (bs *ByteString) UnmarshalCBOR(data []byte) error {
+ if bs == nil {
+ return errors.New("cbor.ByteString: UnmarshalCBOR on nil pointer")
+ }
+
+ // Decoding CBOR null and CBOR undefined to ByteString resets data.
+ // This behavior is similar to decoding CBOR null and CBOR undefined to []byte.
+ if len(data) == 1 && (data[0] == 0xf6 || data[0] == 0xf7) {
+ *bs = ""
+ return nil
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ // Check if CBOR data type is byte string
+ if typ := d.nextCBORType(); typ != cborTypeByteString {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: typeByteString.String()}
+ }
+
+ b, _ := d.parseByteString()
+ *bs = ByteString(b)
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/cache.go b/vendor/github.com/fxamacker/cbor/v2/cache.go
new file mode 100644
index 0000000000..ea0f39e24f
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/cache.go
@@ -0,0 +1,363 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "errors"
+ "fmt"
+ "reflect"
+ "sort"
+ "strconv"
+ "strings"
+ "sync"
+)
+
+type encodeFuncs struct {
+ ef encodeFunc
+ ief isEmptyFunc
+}
+
+var (
+ decodingStructTypeCache sync.Map // map[reflect.Type]*decodingStructType
+ encodingStructTypeCache sync.Map // map[reflect.Type]*encodingStructType
+ encodeFuncCache sync.Map // map[reflect.Type]encodeFuncs
+ typeInfoCache sync.Map // map[reflect.Type]*typeInfo
+)
+
+type specialType int
+
+const (
+ specialTypeNone specialType = iota
+ specialTypeUnmarshalerIface
+ specialTypeEmptyIface
+ specialTypeIface
+ specialTypeTag
+ specialTypeTime
+)
+
+type typeInfo struct {
+ elemTypeInfo *typeInfo
+ keyTypeInfo *typeInfo
+ typ reflect.Type
+ kind reflect.Kind
+ nonPtrType reflect.Type
+ nonPtrKind reflect.Kind
+ spclType specialType
+}
+
+func newTypeInfo(t reflect.Type) *typeInfo {
+ tInfo := typeInfo{typ: t, kind: t.Kind()}
+
+ for t.Kind() == reflect.Ptr {
+ t = t.Elem()
+ }
+
+ k := t.Kind()
+
+ tInfo.nonPtrType = t
+ tInfo.nonPtrKind = k
+
+ if k == reflect.Interface {
+ if t.NumMethod() == 0 {
+ tInfo.spclType = specialTypeEmptyIface
+ } else {
+ tInfo.spclType = specialTypeIface
+ }
+ } else if t == typeTag {
+ tInfo.spclType = specialTypeTag
+ } else if t == typeTime {
+ tInfo.spclType = specialTypeTime
+ } else if reflect.PtrTo(t).Implements(typeUnmarshaler) {
+ tInfo.spclType = specialTypeUnmarshalerIface
+ }
+
+ switch k {
+ case reflect.Array, reflect.Slice:
+ tInfo.elemTypeInfo = getTypeInfo(t.Elem())
+ case reflect.Map:
+ tInfo.keyTypeInfo = getTypeInfo(t.Key())
+ tInfo.elemTypeInfo = getTypeInfo(t.Elem())
+ }
+
+ return &tInfo
+}
+
+type decodingStructType struct {
+ fields fields
+ fieldIndicesByName map[string]int
+ err error
+ toArray bool
+}
+
+// The stdlib errors.Join was introduced in Go 1.20, and we still support Go 1.17, so instead,
+// here's a very basic implementation of an aggregated error.
+type multierror []error
+
+func (m multierror) Error() string {
+ var sb strings.Builder
+ for i, err := range m {
+ sb.WriteString(err.Error())
+ if i < len(m)-1 {
+ sb.WriteString(", ")
+ }
+ }
+ return sb.String()
+}
+
+func getDecodingStructType(t reflect.Type) *decodingStructType {
+ if v, _ := decodingStructTypeCache.Load(t); v != nil {
+ return v.(*decodingStructType)
+ }
+
+ flds, structOptions := getFields(t)
+
+ toArray := hasToArrayOption(structOptions)
+
+ var errs []error
+ for i := 0; i < len(flds); i++ {
+ if flds[i].keyAsInt {
+ nameAsInt, numErr := strconv.Atoi(flds[i].name)
+ if numErr != nil {
+ errs = append(errs, errors.New("cbor: failed to parse field name \""+flds[i].name+"\" to int ("+numErr.Error()+")"))
+ break
+ }
+ flds[i].nameAsInt = int64(nameAsInt)
+ }
+
+ flds[i].typInfo = getTypeInfo(flds[i].typ)
+ }
+
+ fieldIndicesByName := make(map[string]int, len(flds))
+ for i, fld := range flds {
+ if _, ok := fieldIndicesByName[fld.name]; ok {
+ errs = append(errs, fmt.Errorf("cbor: two or more fields of %v have the same name %q", t, fld.name))
+ continue
+ }
+ fieldIndicesByName[fld.name] = i
+ }
+
+ var err error
+ {
+ var multi multierror
+ for _, each := range errs {
+ if each != nil {
+ multi = append(multi, each)
+ }
+ }
+ if len(multi) == 1 {
+ err = multi[0]
+ } else if len(multi) > 1 {
+ err = multi
+ }
+ }
+
+ structType := &decodingStructType{
+ fields: flds,
+ fieldIndicesByName: fieldIndicesByName,
+ err: err,
+ toArray: toArray,
+ }
+ decodingStructTypeCache.Store(t, structType)
+ return structType
+}
+
+type encodingStructType struct {
+ fields fields
+ bytewiseFields fields
+ lengthFirstFields fields
+ omitEmptyFieldsIdx []int
+ err error
+ toArray bool
+}
+
+func (st *encodingStructType) getFields(em *encMode) fields {
+ switch em.sort {
+ case SortNone, SortFastShuffle:
+ return st.fields
+ case SortLengthFirst:
+ return st.lengthFirstFields
+ default:
+ return st.bytewiseFields
+ }
+}
+
+type bytewiseFieldSorter struct {
+ fields fields
+}
+
+func (x *bytewiseFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *bytewiseFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *bytewiseFieldSorter) Less(i, j int) bool {
+ return bytes.Compare(x.fields[i].cborName, x.fields[j].cborName) <= 0
+}
+
+type lengthFirstFieldSorter struct {
+ fields fields
+}
+
+func (x *lengthFirstFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *lengthFirstFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *lengthFirstFieldSorter) Less(i, j int) bool {
+ if len(x.fields[i].cborName) != len(x.fields[j].cborName) {
+ return len(x.fields[i].cborName) < len(x.fields[j].cborName)
+ }
+ return bytes.Compare(x.fields[i].cborName, x.fields[j].cborName) <= 0
+}
+
+func getEncodingStructType(t reflect.Type) (*encodingStructType, error) {
+ if v, _ := encodingStructTypeCache.Load(t); v != nil {
+ structType := v.(*encodingStructType)
+ return structType, structType.err
+ }
+
+ flds, structOptions := getFields(t)
+
+ if hasToArrayOption(structOptions) {
+ return getEncodingStructToArrayType(t, flds)
+ }
+
+ var err error
+ var hasKeyAsInt bool
+ var hasKeyAsStr bool
+ var omitEmptyIdx []int
+ e := getEncodeBuffer()
+ for i := 0; i < len(flds); i++ {
+ // Get field's encodeFunc
+ flds[i].ef, flds[i].ief = getEncodeFunc(flds[i].typ)
+ if flds[i].ef == nil {
+ err = &UnsupportedTypeError{t}
+ break
+ }
+
+ // Encode field name
+ if flds[i].keyAsInt {
+ nameAsInt, numErr := strconv.Atoi(flds[i].name)
+ if numErr != nil {
+ err = errors.New("cbor: failed to parse field name \"" + flds[i].name + "\" to int (" + numErr.Error() + ")")
+ break
+ }
+ flds[i].nameAsInt = int64(nameAsInt)
+ if nameAsInt >= 0 {
+ encodeHead(e, byte(cborTypePositiveInt), uint64(nameAsInt))
+ } else {
+ n := nameAsInt*(-1) - 1
+ encodeHead(e, byte(cborTypeNegativeInt), uint64(n))
+ }
+ flds[i].cborName = make([]byte, e.Len())
+ copy(flds[i].cborName, e.Bytes())
+ e.Reset()
+
+ hasKeyAsInt = true
+ } else {
+ encodeHead(e, byte(cborTypeTextString), uint64(len(flds[i].name)))
+ flds[i].cborName = make([]byte, e.Len()+len(flds[i].name))
+ n := copy(flds[i].cborName, e.Bytes())
+ copy(flds[i].cborName[n:], flds[i].name)
+ e.Reset()
+
+ // If cborName contains a text string, then cborNameByteString contains a
+ // string that has the byte string major type but is otherwise identical to
+ // cborName.
+ flds[i].cborNameByteString = make([]byte, len(flds[i].cborName))
+ copy(flds[i].cborNameByteString, flds[i].cborName)
+ // Reset encoded CBOR type to byte string, preserving the "additional
+ // information" bits:
+ flds[i].cborNameByteString[0] = byte(cborTypeByteString) |
+ getAdditionalInformation(flds[i].cborNameByteString[0])
+
+ hasKeyAsStr = true
+ }
+
+ // Check if field can be omitted when empty
+ if flds[i].omitEmpty {
+ omitEmptyIdx = append(omitEmptyIdx, i)
+ }
+ }
+ putEncodeBuffer(e)
+
+ if err != nil {
+ structType := &encodingStructType{err: err}
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+ }
+
+ // Sort fields by canonical order
+ bytewiseFields := make(fields, len(flds))
+ copy(bytewiseFields, flds)
+ sort.Sort(&bytewiseFieldSorter{bytewiseFields})
+
+ lengthFirstFields := bytewiseFields
+ if hasKeyAsInt && hasKeyAsStr {
+ lengthFirstFields = make(fields, len(flds))
+ copy(lengthFirstFields, flds)
+ sort.Sort(&lengthFirstFieldSorter{lengthFirstFields})
+ }
+
+ structType := &encodingStructType{
+ fields: flds,
+ bytewiseFields: bytewiseFields,
+ lengthFirstFields: lengthFirstFields,
+ omitEmptyFieldsIdx: omitEmptyIdx,
+ }
+
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+}
+
+func getEncodingStructToArrayType(t reflect.Type, flds fields) (*encodingStructType, error) {
+ for i := 0; i < len(flds); i++ {
+ // Get field's encodeFunc
+ flds[i].ef, flds[i].ief = getEncodeFunc(flds[i].typ)
+ if flds[i].ef == nil {
+ structType := &encodingStructType{err: &UnsupportedTypeError{t}}
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+ }
+ }
+
+ structType := &encodingStructType{
+ fields: flds,
+ toArray: true,
+ }
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+}
+
+func getEncodeFunc(t reflect.Type) (encodeFunc, isEmptyFunc) {
+ if v, _ := encodeFuncCache.Load(t); v != nil {
+ fs := v.(encodeFuncs)
+ return fs.ef, fs.ief
+ }
+ ef, ief := getEncodeFuncInternal(t)
+ encodeFuncCache.Store(t, encodeFuncs{ef, ief})
+ return ef, ief
+}
+
+func getTypeInfo(t reflect.Type) *typeInfo {
+ if v, _ := typeInfoCache.Load(t); v != nil {
+ return v.(*typeInfo)
+ }
+ tInfo := newTypeInfo(t)
+ typeInfoCache.Store(t, tInfo)
+ return tInfo
+}
+
+func hasToArrayOption(tag string) bool {
+ s := ",toarray"
+ idx := strings.Index(tag, s)
+ return idx >= 0 && (len(tag) == idx+len(s) || tag[idx+len(s)] == ',')
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/common.go b/vendor/github.com/fxamacker/cbor/v2/common.go
new file mode 100644
index 0000000000..ec038a49ec
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/common.go
@@ -0,0 +1,182 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "fmt"
+ "strconv"
+)
+
+type cborType uint8
+
+const (
+ cborTypePositiveInt cborType = 0x00
+ cborTypeNegativeInt cborType = 0x20
+ cborTypeByteString cborType = 0x40
+ cborTypeTextString cborType = 0x60
+ cborTypeArray cborType = 0x80
+ cborTypeMap cborType = 0xa0
+ cborTypeTag cborType = 0xc0
+ cborTypePrimitives cborType = 0xe0
+)
+
+func (t cborType) String() string {
+ switch t {
+ case cborTypePositiveInt:
+ return "positive integer"
+ case cborTypeNegativeInt:
+ return "negative integer"
+ case cborTypeByteString:
+ return "byte string"
+ case cborTypeTextString:
+ return "UTF-8 text string"
+ case cborTypeArray:
+ return "array"
+ case cborTypeMap:
+ return "map"
+ case cborTypeTag:
+ return "tag"
+ case cborTypePrimitives:
+ return "primitives"
+ default:
+ return "Invalid type " + strconv.Itoa(int(t))
+ }
+}
+
+type additionalInformation uint8
+
+const (
+ maxAdditionalInformationWithoutArgument = 23
+ additionalInformationWith1ByteArgument = 24
+ additionalInformationWith2ByteArgument = 25
+ additionalInformationWith4ByteArgument = 26
+ additionalInformationWith8ByteArgument = 27
+
+ // For major type 7.
+ additionalInformationAsFalse = 20
+ additionalInformationAsTrue = 21
+ additionalInformationAsNull = 22
+ additionalInformationAsUndefined = 23
+ additionalInformationAsFloat16 = 25
+ additionalInformationAsFloat32 = 26
+ additionalInformationAsFloat64 = 27
+
+ // For major type 2, 3, 4, 5.
+ additionalInformationAsIndefiniteLengthFlag = 31
+)
+
+const (
+ maxSimpleValueInAdditionalInformation = 23
+ minSimpleValueIn1ByteArgument = 32
+)
+
+func (ai additionalInformation) isIndefiniteLength() bool {
+ return ai == additionalInformationAsIndefiniteLengthFlag
+}
+
+const (
+ // From RFC 8949 Section 3:
+ // "The initial byte of each encoded data item contains both information about the major type
+ // (the high-order 3 bits, described in Section 3.1) and additional information
+ // (the low-order 5 bits)."
+
+ // typeMask is used to extract major type in initial byte of encoded data item.
+ typeMask = 0xe0
+
+ // additionalInformationMask is used to extract additional information in initial byte of encoded data item.
+ additionalInformationMask = 0x1f
+)
+
+func getType(raw byte) cborType {
+ return cborType(raw & typeMask)
+}
+
+func getAdditionalInformation(raw byte) byte {
+ return raw & additionalInformationMask
+}
+
+func isBreakFlag(raw byte) bool {
+ return raw == cborBreakFlag
+}
+
+func parseInitialByte(b byte) (t cborType, ai byte) {
+ return getType(b), getAdditionalInformation(b)
+}
+
+const (
+ tagNumRFC3339Time = 0
+ tagNumEpochTime = 1
+ tagNumUnsignedBignum = 2
+ tagNumNegativeBignum = 3
+ tagNumExpectedLaterEncodingBase64URL = 21
+ tagNumExpectedLaterEncodingBase64 = 22
+ tagNumExpectedLaterEncodingBase16 = 23
+ tagNumSelfDescribedCBOR = 55799
+)
+
+const (
+ cborBreakFlag = byte(0xff)
+ cborByteStringWithIndefiniteLengthHead = byte(0x5f)
+ cborTextStringWithIndefiniteLengthHead = byte(0x7f)
+ cborArrayWithIndefiniteLengthHead = byte(0x9f)
+ cborMapWithIndefiniteLengthHead = byte(0xbf)
+)
+
+var (
+ cborFalse = []byte{0xf4}
+ cborTrue = []byte{0xf5}
+ cborNil = []byte{0xf6}
+ cborNaN = []byte{0xf9, 0x7e, 0x00}
+ cborPositiveInfinity = []byte{0xf9, 0x7c, 0x00}
+ cborNegativeInfinity = []byte{0xf9, 0xfc, 0x00}
+)
+
+// validBuiltinTag checks that supported built-in tag numbers are followed by expected content types.
+func validBuiltinTag(tagNum uint64, contentHead byte) error {
+ t := getType(contentHead)
+ switch tagNum {
+ case tagNumRFC3339Time:
+ // Tag content (date/time text string in RFC 3339 format) must be string type.
+ if t != cborTypeTextString {
+ return newInadmissibleTagContentTypeError(
+ tagNumRFC3339Time,
+ "text string",
+ t.String())
+ }
+ return nil
+
+ case tagNumEpochTime:
+ // Tag content (epoch date/time) must be uint, int, or float type.
+ if t != cborTypePositiveInt && t != cborTypeNegativeInt && (contentHead < 0xf9 || contentHead > 0xfb) {
+ return newInadmissibleTagContentTypeError(
+ tagNumEpochTime,
+ "integer or floating-point number",
+ t.String())
+ }
+ return nil
+
+ case tagNumUnsignedBignum, tagNumNegativeBignum:
+ // Tag content (bignum) must be byte type.
+ if t != cborTypeByteString {
+ return newInadmissibleTagContentTypeErrorf(
+ fmt.Sprintf(
+ "tag number %d or %d must be followed by byte string, got %s",
+ tagNumUnsignedBignum,
+ tagNumNegativeBignum,
+ t.String(),
+ ))
+ }
+ return nil
+
+ case tagNumExpectedLaterEncodingBase64URL, tagNumExpectedLaterEncodingBase64, tagNumExpectedLaterEncodingBase16:
+ // From RFC 8949 3.4.5.2:
+ // The data item tagged can be a byte string or any other data item. In the latter
+ // case, the tag applies to all of the byte string data items contained in the data
+ // item, except for those contained in a nested data item tagged with an expected
+ // conversion.
+ return nil
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/decode.go b/vendor/github.com/fxamacker/cbor/v2/decode.go
new file mode 100644
index 0000000000..85842ac736
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/decode.go
@@ -0,0 +1,3187 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "encoding"
+ "encoding/base64"
+ "encoding/binary"
+ "encoding/hex"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "math/big"
+ "reflect"
+ "strconv"
+ "strings"
+ "time"
+ "unicode/utf8"
+
+ "github.com/x448/float16"
+)
+
+// Unmarshal parses the CBOR-encoded data into the value pointed to by v
+// using default decoding options. If v is nil, not a pointer, or
+// a nil pointer, Unmarshal returns an error.
+//
+// To unmarshal CBOR into a value implementing the Unmarshaler interface,
+// Unmarshal calls that value's UnmarshalCBOR method with a valid
+// CBOR value.
+//
+// To unmarshal CBOR byte string into a value implementing the
+// encoding.BinaryUnmarshaler interface, Unmarshal calls that value's
+// UnmarshalBinary method with decoded CBOR byte string.
+//
+// To unmarshal CBOR into a pointer, Unmarshal sets the pointer to nil
+// if CBOR data is null (0xf6) or undefined (0xf7). Otherwise, Unmarshal
+// unmarshals CBOR into the value pointed to by the pointer. If the
+// pointer is nil, Unmarshal creates a new value for it to point to.
+//
+// To unmarshal CBOR into an empty interface value, Unmarshal uses the
+// following rules:
+//
+// CBOR booleans decode to bool.
+// CBOR positive integers decode to uint64.
+// CBOR negative integers decode to int64 (big.Int if value overflows).
+// CBOR floating points decode to float64.
+// CBOR byte strings decode to []byte.
+// CBOR text strings decode to string.
+// CBOR arrays decode to []interface{}.
+// CBOR maps decode to map[interface{}]interface{}.
+// CBOR null and undefined values decode to nil.
+// CBOR times (tag 0 and 1) decode to time.Time.
+// CBOR bignums (tag 2 and 3) decode to big.Int.
+// CBOR tags with an unrecognized number decode to cbor.Tag
+//
+// To unmarshal a CBOR array into a slice, Unmarshal allocates a new slice
+// if the CBOR array is empty or slice capacity is less than CBOR array length.
+// Otherwise Unmarshal overwrites existing elements, and sets slice length
+// to CBOR array length.
+//
+// To unmarshal a CBOR array into a Go array, Unmarshal decodes CBOR array
+// elements into Go array elements. If the Go array is smaller than the
+// CBOR array, the extra CBOR array elements are discarded. If the CBOR
+// array is smaller than the Go array, the extra Go array elements are
+// set to zero values.
+//
+// To unmarshal a CBOR array into a struct, struct must have a special field "_"
+// with struct tag `cbor:",toarray"`. Go array elements are decoded into struct
+// fields. Any "omitempty" struct field tag option is ignored in this case.
+//
+// To unmarshal a CBOR map into a map, Unmarshal allocates a new map only if the
+// map is nil. Otherwise Unmarshal reuses the existing map and keeps existing
+// entries. Unmarshal stores key-value pairs from the CBOR map into Go map.
+// See DecOptions.DupMapKey to enable duplicate map key detection.
+//
+// To unmarshal a CBOR map into a struct, Unmarshal matches CBOR map keys to the
+// keys in the following priority:
+//
+// 1. "cbor" key in struct field tag,
+// 2. "json" key in struct field tag,
+// 3. struct field name.
+//
+// Unmarshal tries an exact match for field name, then a case-insensitive match.
+// Map key-value pairs without corresponding struct fields are ignored. See
+// DecOptions.ExtraReturnErrors to return error at unknown field.
+//
+// To unmarshal a CBOR text string into a time.Time value, Unmarshal parses text
+// string formatted in RFC3339. To unmarshal a CBOR integer/float into a
+// time.Time value, Unmarshal creates an unix time with integer/float as seconds
+// and fractional seconds since January 1, 1970 UTC. As a special case, Infinite
+// and NaN float values decode to time.Time's zero value.
+//
+// To unmarshal CBOR null (0xf6) and undefined (0xf7) values into a
+// slice/map/pointer, Unmarshal sets Go value to nil. Because null is often
+// used to mean "not present", unmarshalling CBOR null and undefined value
+// into any other Go type has no effect and returns no error.
+//
+// Unmarshal supports CBOR tag 55799 (self-describe CBOR), tag 0 and 1 (time),
+// and tag 2 and 3 (bignum).
+//
+// Unmarshal returns ExtraneousDataError error (without decoding into v)
+// if there are any remaining bytes following the first valid CBOR data item.
+// See UnmarshalFirst, if you want to unmarshal only the first
+// CBOR data item without ExtraneousDataError caused by remaining bytes.
+func Unmarshal(data []byte, v interface{}) error {
+ return defaultDecMode.Unmarshal(data, v)
+}
+
+// UnmarshalFirst parses the first CBOR data item into the value pointed to by v
+// using default decoding options. Any remaining bytes are returned in rest.
+//
+// If v is nil, not a pointer, or a nil pointer, UnmarshalFirst returns an error.
+//
+// See the documentation for Unmarshal for details.
+func UnmarshalFirst(data []byte, v interface{}) (rest []byte, err error) {
+ return defaultDecMode.UnmarshalFirst(data, v)
+}
+
+// Valid checks whether data is a well-formed encoded CBOR data item and
+// that it complies with default restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+//
+// WARNING: Valid doesn't check if encoded CBOR data item is valid (i.e. validity)
+// and RFC 8949 distinctly defines what is "Valid" and what is "Well-formed".
+//
+// Deprecated: Valid is kept for compatibility and should not be used.
+// Use Wellformed instead because it has a more appropriate name.
+func Valid(data []byte) error {
+ return defaultDecMode.Valid(data)
+}
+
+// Wellformed checks whether data is a well-formed encoded CBOR data item and
+// that it complies with default restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+func Wellformed(data []byte) error {
+ return defaultDecMode.Wellformed(data)
+}
+
+// Unmarshaler is the interface implemented by types that wish to unmarshal
+// CBOR data themselves. The input is a valid CBOR value. UnmarshalCBOR
+// must copy the CBOR data if it needs to use it after returning.
+type Unmarshaler interface {
+ UnmarshalCBOR([]byte) error
+}
+
+// InvalidUnmarshalError describes an invalid argument passed to Unmarshal.
+type InvalidUnmarshalError struct {
+ s string
+}
+
+func (e *InvalidUnmarshalError) Error() string {
+ return e.s
+}
+
+// UnmarshalTypeError describes a CBOR value that can't be decoded to a Go type.
+type UnmarshalTypeError struct {
+ CBORType string // type of CBOR value
+ GoType string // type of Go value it could not be decoded into
+ StructFieldName string // name of the struct field holding the Go value (optional)
+ errorMsg string // additional error message (optional)
+}
+
+func (e *UnmarshalTypeError) Error() string {
+ var s string
+ if e.StructFieldName != "" {
+ s = "cbor: cannot unmarshal " + e.CBORType + " into Go struct field " + e.StructFieldName + " of type " + e.GoType
+ } else {
+ s = "cbor: cannot unmarshal " + e.CBORType + " into Go value of type " + e.GoType
+ }
+ if e.errorMsg != "" {
+ s += " (" + e.errorMsg + ")"
+ }
+ return s
+}
+
+// InvalidMapKeyTypeError describes invalid Go map key type when decoding CBOR map.
+// For example, Go doesn't allow slice as map key.
+type InvalidMapKeyTypeError struct {
+ GoType string
+}
+
+func (e *InvalidMapKeyTypeError) Error() string {
+ return "cbor: invalid map key type: " + e.GoType
+}
+
+// DupMapKeyError describes detected duplicate map key in CBOR map.
+type DupMapKeyError struct {
+ Key interface{}
+ Index int
+}
+
+func (e *DupMapKeyError) Error() string {
+ return fmt.Sprintf("cbor: found duplicate map key \"%v\" at map element index %d", e.Key, e.Index)
+}
+
+// UnknownFieldError describes detected unknown field in CBOR map when decoding to Go struct.
+type UnknownFieldError struct {
+ Index int
+}
+
+func (e *UnknownFieldError) Error() string {
+ return fmt.Sprintf("cbor: found unknown field at map element index %d", e.Index)
+}
+
+// UnacceptableDataItemError is returned when unmarshaling a CBOR input that contains a data item
+// that is not acceptable to a specific CBOR-based application protocol ("invalid or unexpected" as
+// described in RFC 8949 Section 5 Paragraph 3).
+type UnacceptableDataItemError struct {
+ CBORType string
+ Message string
+}
+
+func (e UnacceptableDataItemError) Error() string {
+ return fmt.Sprintf("cbor: data item of cbor type %s is not accepted by protocol: %s", e.CBORType, e.Message)
+}
+
+// ByteStringExpectedFormatError is returned when unmarshaling CBOR byte string fails when
+// using non-default ByteStringExpectedFormat decoding option that makes decoder expect
+// a specified format such as base64, hex, etc.
+type ByteStringExpectedFormatError struct {
+ expectedFormatOption ByteStringExpectedFormatMode
+ err error
+}
+
+func newByteStringExpectedFormatError(expectedFormatOption ByteStringExpectedFormatMode, err error) *ByteStringExpectedFormatError {
+ return &ByteStringExpectedFormatError{expectedFormatOption, err}
+}
+
+func (e *ByteStringExpectedFormatError) Error() string {
+ switch e.expectedFormatOption {
+ case ByteStringExpectedBase64URL:
+ return fmt.Sprintf("cbor: failed to decode base64url from byte string: %s", e.err)
+
+ case ByteStringExpectedBase64:
+ return fmt.Sprintf("cbor: failed to decode base64 from byte string: %s", e.err)
+
+ case ByteStringExpectedBase16:
+ return fmt.Sprintf("cbor: failed to decode hex from byte string: %s", e.err)
+
+ default:
+ return fmt.Sprintf("cbor: failed to decode byte string in expected format %d: %s", e.expectedFormatOption, e.err)
+ }
+}
+
+func (e *ByteStringExpectedFormatError) Unwrap() error {
+ return e.err
+}
+
+// InadmissibleTagContentTypeError is returned when unmarshaling built-in CBOR tags
+// fails because of inadmissible type for tag content. Currently, the built-in
+// CBOR tags in this codec are tags 0-3 and 21-23.
+// See "Tag validity" in RFC 8949 Section 5.3.2.
+type InadmissibleTagContentTypeError struct {
+ s string
+ tagNum int
+ expectedTagContentType string
+ gotTagContentType string
+}
+
+func newInadmissibleTagContentTypeError(
+ tagNum int,
+ expectedTagContentType string,
+ gotTagContentType string,
+) *InadmissibleTagContentTypeError {
+ return &InadmissibleTagContentTypeError{
+ tagNum: tagNum,
+ expectedTagContentType: expectedTagContentType,
+ gotTagContentType: gotTagContentType,
+ }
+}
+
+func newInadmissibleTagContentTypeErrorf(s string) *InadmissibleTagContentTypeError {
+ return &InadmissibleTagContentTypeError{s: "cbor: " + s} //nolint:goconst // ignore "cbor"
+}
+
+func (e *InadmissibleTagContentTypeError) Error() string {
+ if e.s == "" {
+ return fmt.Sprintf(
+ "cbor: tag number %d must be followed by %s, got %s",
+ e.tagNum,
+ e.expectedTagContentType,
+ e.gotTagContentType,
+ )
+ }
+ return e.s
+}
+
+// DupMapKeyMode specifies how to enforce duplicate map key. Two map keys are considered duplicates if:
+// 1. When decoding into a struct, both keys match the same struct field. The keys are also
+// considered duplicates if neither matches any field and decoding to interface{} would produce
+// equal (==) values for both keys.
+// 2. When decoding into a map, both keys are equal (==) when decoded into values of the
+// destination map's key type.
+type DupMapKeyMode int
+
+const (
+ // DupMapKeyQuiet doesn't enforce duplicate map key. Decoder quietly (no error)
+ // uses faster of "keep first" or "keep last" depending on Go data type and other factors.
+ DupMapKeyQuiet DupMapKeyMode = iota
+
+ // DupMapKeyEnforcedAPF enforces detection and rejection of duplicate map keys.
+ // APF means "Allow Partial Fill" and the destination map or struct can be partially filled.
+ // If a duplicate map key is detected, DupMapKeyError is returned without further decoding
+ // of the map. It's the caller's responsibility to respond to DupMapKeyError by
+ // discarding the partially filled result if their protocol requires it.
+ // WARNING: using DupMapKeyEnforcedAPF will decrease performance and increase memory use.
+ DupMapKeyEnforcedAPF
+
+ maxDupMapKeyMode
+)
+
+func (dmkm DupMapKeyMode) valid() bool {
+ return dmkm >= 0 && dmkm < maxDupMapKeyMode
+}
+
+// IndefLengthMode specifies whether to allow indefinite length items.
+type IndefLengthMode int
+
+const (
+ // IndefLengthAllowed allows indefinite length items.
+ IndefLengthAllowed IndefLengthMode = iota
+
+ // IndefLengthForbidden disallows indefinite length items.
+ IndefLengthForbidden
+
+ maxIndefLengthMode
+)
+
+func (m IndefLengthMode) valid() bool {
+ return m >= 0 && m < maxIndefLengthMode
+}
+
+// TagsMode specifies whether to allow CBOR tags.
+type TagsMode int
+
+const (
+ // TagsAllowed allows CBOR tags.
+ TagsAllowed TagsMode = iota
+
+ // TagsForbidden disallows CBOR tags.
+ TagsForbidden
+
+ maxTagsMode
+)
+
+func (tm TagsMode) valid() bool {
+ return tm >= 0 && tm < maxTagsMode
+}
+
+// IntDecMode specifies which Go type (int64, uint64, or big.Int) should
+// be used when decoding CBOR integers (major type 0 and 1) to Go interface{}.
+type IntDecMode int
+
+const (
+ // IntDecConvertNone affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It decodes CBOR unsigned integer (major type 0) to:
+ // - uint64
+ // It decodes CBOR negative integer (major type 1) to:
+ // - int64 if value fits
+ // - big.Int or *big.Int (see BigIntDecMode) if value doesn't fit into int64
+ IntDecConvertNone IntDecMode = iota
+
+ // IntDecConvertSigned affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It decodes CBOR integers (major type 0 and 1) to:
+ // - int64 if value fits
+ // - big.Int or *big.Int (see BigIntDecMode) if value < math.MinInt64
+ // - return UnmarshalTypeError if value > math.MaxInt64
+ // Deprecated: IntDecConvertSigned should not be used.
+ // Please use other options, such as IntDecConvertSignedOrError, IntDecConvertSignedOrBigInt, IntDecConvertNone.
+ IntDecConvertSigned
+
+ // IntDecConvertSignedOrFail affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It decodes CBOR integers (major type 0 and 1) to:
+ // - int64 if value fits
+ // - return UnmarshalTypeError if value doesn't fit into int64
+ IntDecConvertSignedOrFail
+
+ // IntDecConvertSigned affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It makes CBOR integers (major type 0 and 1) decode to:
+ // - int64 if value fits
+ // - big.Int or *big.Int (see BigIntDecMode) if value doesn't fit into int64
+ IntDecConvertSignedOrBigInt
+
+ maxIntDec
+)
+
+func (idm IntDecMode) valid() bool {
+ return idm >= 0 && idm < maxIntDec
+}
+
+// MapKeyByteStringMode specifies how to decode CBOR byte string (major type 2)
+// as Go map key when decoding CBOR map key into an empty Go interface value.
+// Specifically, this option applies when decoding CBOR map into
+// - Go empty interface, or
+// - Go map with empty interface as key type.
+// The CBOR map key types handled by this option are
+// - byte string
+// - tagged byte string
+// - nested tagged byte string
+type MapKeyByteStringMode int
+
+const (
+ // MapKeyByteStringAllowed allows CBOR byte string to be decoded as Go map key.
+ // Since Go doesn't allow []byte as map key, CBOR byte string is decoded to
+ // ByteString which has underlying string type.
+ // This is the default setting.
+ MapKeyByteStringAllowed MapKeyByteStringMode = iota
+
+ // MapKeyByteStringForbidden forbids CBOR byte string being decoded as Go map key.
+ // Attempting to decode CBOR byte string as map key into empty interface value
+ // returns a decoding error.
+ MapKeyByteStringForbidden
+
+ maxMapKeyByteStringMode
+)
+
+func (mkbsm MapKeyByteStringMode) valid() bool {
+ return mkbsm >= 0 && mkbsm < maxMapKeyByteStringMode
+}
+
+// ExtraDecErrorCond specifies extra conditions that should be treated as errors.
+type ExtraDecErrorCond uint
+
+// ExtraDecErrorNone indicates no extra error condition.
+const ExtraDecErrorNone ExtraDecErrorCond = 0
+
+const (
+ // ExtraDecErrorUnknownField indicates error condition when destination
+ // Go struct doesn't have a field matching a CBOR map key.
+ ExtraDecErrorUnknownField ExtraDecErrorCond = 1 << iota
+
+ maxExtraDecError
+)
+
+func (ec ExtraDecErrorCond) valid() bool {
+ return ec < maxExtraDecError
+}
+
+// UTF8Mode option specifies if decoder should
+// decode CBOR Text containing invalid UTF-8 string.
+type UTF8Mode int
+
+const (
+ // UTF8RejectInvalid rejects CBOR Text containing
+ // invalid UTF-8 string.
+ UTF8RejectInvalid UTF8Mode = iota
+
+ // UTF8DecodeInvalid allows decoding CBOR Text containing
+ // invalid UTF-8 string.
+ UTF8DecodeInvalid
+
+ maxUTF8Mode
+)
+
+func (um UTF8Mode) valid() bool {
+ return um >= 0 && um < maxUTF8Mode
+}
+
+// FieldNameMatchingMode specifies how string keys in CBOR maps are matched to Go struct field names.
+type FieldNameMatchingMode int
+
+const (
+ // FieldNameMatchingPreferCaseSensitive prefers to decode map items into struct fields whose names (or tag
+ // names) exactly match the item's key. If there is no such field, a map item will be decoded into a field whose
+ // name is a case-insensitive match for the item's key.
+ FieldNameMatchingPreferCaseSensitive FieldNameMatchingMode = iota
+
+ // FieldNameMatchingCaseSensitive decodes map items only into a struct field whose name (or tag name) is an
+ // exact match for the item's key.
+ FieldNameMatchingCaseSensitive
+
+ maxFieldNameMatchingMode
+)
+
+func (fnmm FieldNameMatchingMode) valid() bool {
+ return fnmm >= 0 && fnmm < maxFieldNameMatchingMode
+}
+
+// BigIntDecMode specifies how to decode CBOR bignum to Go interface{}.
+type BigIntDecMode int
+
+const (
+ // BigIntDecodeValue makes CBOR bignum decode to big.Int (instead of *big.Int)
+ // when unmarshalling into a Go interface{}.
+ BigIntDecodeValue BigIntDecMode = iota
+
+ // BigIntDecodePointer makes CBOR bignum decode to *big.Int when
+ // unmarshalling into a Go interface{}.
+ BigIntDecodePointer
+
+ maxBigIntDecMode
+)
+
+func (bidm BigIntDecMode) valid() bool {
+ return bidm >= 0 && bidm < maxBigIntDecMode
+}
+
+// ByteStringToStringMode specifies the behavior when decoding a CBOR byte string into a Go string.
+type ByteStringToStringMode int
+
+const (
+ // ByteStringToStringForbidden generates an error on an attempt to decode a CBOR byte string into a Go string.
+ ByteStringToStringForbidden ByteStringToStringMode = iota
+
+ // ByteStringToStringAllowed permits decoding a CBOR byte string into a Go string.
+ ByteStringToStringAllowed
+
+ // ByteStringToStringAllowedWithExpectedLaterEncoding permits decoding a CBOR byte string
+ // into a Go string. Also, if the byte string is enclosed (directly or indirectly) by one of
+ // the "expected later encoding" tags (numbers 21 through 23), the destination string will
+ // be populated by applying the designated text encoding to the contents of the input byte
+ // string.
+ ByteStringToStringAllowedWithExpectedLaterEncoding
+
+ maxByteStringToStringMode
+)
+
+func (bstsm ByteStringToStringMode) valid() bool {
+ return bstsm >= 0 && bstsm < maxByteStringToStringMode
+}
+
+// FieldNameByteStringMode specifies the behavior when decoding a CBOR byte string map key as a Go struct field name.
+type FieldNameByteStringMode int
+
+const (
+ // FieldNameByteStringForbidden generates an error on an attempt to decode a CBOR byte string map key as a Go struct field name.
+ FieldNameByteStringForbidden FieldNameByteStringMode = iota
+
+ // FieldNameByteStringAllowed permits CBOR byte string map keys to be recognized as Go struct field names.
+ FieldNameByteStringAllowed
+
+ maxFieldNameByteStringMode
+)
+
+func (fnbsm FieldNameByteStringMode) valid() bool {
+ return fnbsm >= 0 && fnbsm < maxFieldNameByteStringMode
+}
+
+// UnrecognizedTagToAnyMode specifies how to decode unrecognized CBOR tag into an empty interface (any).
+// Currently, recognized CBOR tag numbers are 0, 1, 2, 3, or registered by TagSet.
+type UnrecognizedTagToAnyMode int
+
+const (
+ // UnrecognizedTagNumAndContentToAny decodes CBOR tag number and tag content to cbor.Tag
+ // when decoding unrecognized CBOR tag into an empty interface.
+ UnrecognizedTagNumAndContentToAny UnrecognizedTagToAnyMode = iota
+
+ // UnrecognizedTagContentToAny decodes only CBOR tag content (into its default type)
+ // when decoding unrecognized CBOR tag into an empty interface.
+ UnrecognizedTagContentToAny
+
+ maxUnrecognizedTagToAny
+)
+
+func (uttam UnrecognizedTagToAnyMode) valid() bool {
+ return uttam >= 0 && uttam < maxUnrecognizedTagToAny
+}
+
+// TimeTagToAnyMode specifies how to decode CBOR tag 0 and 1 into an empty interface (any).
+// Based on the specified mode, Unmarshal can return a time.Time value or a time string in a specific format.
+type TimeTagToAnyMode int
+
+const (
+ // TimeTagToTime decodes CBOR tag 0 and 1 into a time.Time value
+ // when decoding tag 0 or 1 into an empty interface.
+ TimeTagToTime TimeTagToAnyMode = iota
+
+ // TimeTagToRFC3339 decodes CBOR tag 0 and 1 into a time string in RFC3339 format
+ // when decoding tag 0 or 1 into an empty interface.
+ TimeTagToRFC3339
+
+ // TimeTagToRFC3339Nano decodes CBOR tag 0 and 1 into a time string in RFC3339Nano format
+ // when decoding tag 0 or 1 into an empty interface.
+ TimeTagToRFC3339Nano
+
+ maxTimeTagToAnyMode
+)
+
+func (tttam TimeTagToAnyMode) valid() bool {
+ return tttam >= 0 && tttam < maxTimeTagToAnyMode
+}
+
+// SimpleValueRegistry is a registry of unmarshaling behaviors for each possible CBOR simple value
+// number (0...23 and 32...255).
+type SimpleValueRegistry struct {
+ rejected [256]bool
+}
+
+// WithRejectedSimpleValue registers the given simple value as rejected. If the simple value is
+// encountered in a CBOR input during unmarshaling, an UnacceptableDataItemError is returned.
+func WithRejectedSimpleValue(sv SimpleValue) func(*SimpleValueRegistry) error {
+ return func(r *SimpleValueRegistry) error {
+ if sv >= 24 && sv <= 31 {
+ return fmt.Errorf("cbor: cannot set analog for reserved simple value %d", sv)
+ }
+ r.rejected[sv] = true
+ return nil
+ }
+}
+
+// Creates a new SimpleValueRegistry. The registry state is initialized by executing the provided
+// functions in order against a registry that is pre-populated with the defaults for all well-formed
+// simple value numbers.
+func NewSimpleValueRegistryFromDefaults(fns ...func(*SimpleValueRegistry) error) (*SimpleValueRegistry, error) {
+ var r SimpleValueRegistry
+ for _, fn := range fns {
+ if err := fn(&r); err != nil {
+ return nil, err
+ }
+ }
+ return &r, nil
+}
+
+// NaNMode specifies how to decode floating-point values (major type 7, additional information 25
+// through 27) representing NaN (not-a-number).
+type NaNMode int
+
+const (
+ // NaNDecodeAllowed will decode NaN values to Go float32 or float64.
+ NaNDecodeAllowed NaNMode = iota
+
+ // NaNDecodeForbidden will return an UnacceptableDataItemError on an attempt to decode a NaN value.
+ NaNDecodeForbidden
+
+ maxNaNDecode
+)
+
+func (ndm NaNMode) valid() bool {
+ return ndm >= 0 && ndm < maxNaNDecode
+}
+
+// InfMode specifies how to decode floating-point values (major type 7, additional information 25
+// through 27) representing positive or negative infinity.
+type InfMode int
+
+const (
+ // InfDecodeAllowed will decode infinite values to Go float32 or float64.
+ InfDecodeAllowed InfMode = iota
+
+ // InfDecodeForbidden will return an UnacceptableDataItemError on an attempt to decode an
+ // infinite value.
+ InfDecodeForbidden
+
+ maxInfDecode
+)
+
+func (idm InfMode) valid() bool {
+ return idm >= 0 && idm < maxInfDecode
+}
+
+// ByteStringToTimeMode specifies the behavior when decoding a CBOR byte string into a Go time.Time.
+type ByteStringToTimeMode int
+
+const (
+ // ByteStringToTimeForbidden generates an error on an attempt to decode a CBOR byte string into a Go time.Time.
+ ByteStringToTimeForbidden ByteStringToTimeMode = iota
+
+ // ByteStringToTimeAllowed permits decoding a CBOR byte string into a Go time.Time.
+ ByteStringToTimeAllowed
+
+ maxByteStringToTimeMode
+)
+
+func (bttm ByteStringToTimeMode) valid() bool {
+ return bttm >= 0 && bttm < maxByteStringToTimeMode
+}
+
+// ByteStringExpectedFormatMode specifies how to decode CBOR byte string into Go byte slice
+// when the byte string is NOT enclosed in CBOR tag 21, 22, or 23. An error is returned if
+// the CBOR byte string does not contain the expected format (e.g. base64) specified.
+// For tags 21-23, see "Expected Later Encoding for CBOR-to-JSON Converters"
+// in RFC 8949 Section 3.4.5.2.
+type ByteStringExpectedFormatMode int
+
+const (
+ // ByteStringExpectedFormatNone copies the unmodified CBOR byte string into Go byte slice
+ // if the byte string is not tagged by CBOR tag 21-23.
+ ByteStringExpectedFormatNone ByteStringExpectedFormatMode = iota
+
+ // ByteStringExpectedBase64URL expects CBOR byte strings to contain base64url-encoded bytes
+ // if the byte string is not tagged by CBOR tag 21-23. The decoder will attempt to decode
+ // the base64url-encoded bytes into Go slice.
+ ByteStringExpectedBase64URL
+
+ // ByteStringExpectedBase64 expects CBOR byte strings to contain base64-encoded bytes
+ // if the byte string is not tagged by CBOR tag 21-23. The decoder will attempt to decode
+ // the base64-encoded bytes into Go slice.
+ ByteStringExpectedBase64
+
+ // ByteStringExpectedBase16 expects CBOR byte strings to contain base16-encoded bytes
+ // if the byte string is not tagged by CBOR tag 21-23. The decoder will attempt to decode
+ // the base16-encoded bytes into Go slice.
+ ByteStringExpectedBase16
+
+ maxByteStringExpectedFormatMode
+)
+
+func (bsefm ByteStringExpectedFormatMode) valid() bool {
+ return bsefm >= 0 && bsefm < maxByteStringExpectedFormatMode
+}
+
+// BignumTagMode specifies whether or not the "bignum" tags 2 and 3 (RFC 8949 Section 3.4.3) can be
+// decoded.
+type BignumTagMode int
+
+const (
+ // BignumTagAllowed allows bignum tags to be decoded.
+ BignumTagAllowed BignumTagMode = iota
+
+ // BignumTagForbidden produces an UnacceptableDataItemError during Unmarshal if a bignum tag
+ // is encountered in the input.
+ BignumTagForbidden
+
+ maxBignumTag
+)
+
+func (btm BignumTagMode) valid() bool {
+ return btm >= 0 && btm < maxBignumTag
+}
+
+// BinaryUnmarshalerMode specifies how to decode into types that implement
+// encoding.BinaryUnmarshaler.
+type BinaryUnmarshalerMode int
+
+const (
+ // BinaryUnmarshalerByteString will invoke UnmarshalBinary on the contents of a CBOR byte
+ // string when decoding into a value that implements BinaryUnmarshaler.
+ BinaryUnmarshalerByteString BinaryUnmarshalerMode = iota
+
+ // BinaryUnmarshalerNone does not recognize BinaryUnmarshaler implementations during decode.
+ BinaryUnmarshalerNone
+
+ maxBinaryUnmarshalerMode
+)
+
+func (bum BinaryUnmarshalerMode) valid() bool {
+ return bum >= 0 && bum < maxBinaryUnmarshalerMode
+}
+
+// DecOptions specifies decoding options.
+type DecOptions struct {
+ // DupMapKey specifies whether to enforce duplicate map key.
+ DupMapKey DupMapKeyMode
+
+ // TimeTag specifies whether or not untagged data items, or tags other
+ // than tag 0 and tag 1, can be decoded to time.Time. If tag 0 or tag 1
+ // appears in an input, the type of its content is always validated as
+ // specified in RFC 8949. That behavior is not controlled by this
+ // option. The behavior of the supported modes are:
+ //
+ // DecTagIgnored (default): Untagged text strings and text strings
+ // enclosed in tags other than 0 and 1 are decoded as though enclosed
+ // in tag 0. Untagged unsigned integers, negative integers, and
+ // floating-point numbers (or those enclosed in tags other than 0 and
+ // 1) are decoded as though enclosed in tag 1. Decoding a tag other
+ // than 0 or 1 enclosing simple values null or undefined into a
+ // time.Time does not modify the destination value.
+ //
+ // DecTagOptional: Untagged text strings are decoded as though
+ // enclosed in tag 0. Untagged unsigned integers, negative integers,
+ // and floating-point numbers are decoded as though enclosed in tag
+ // 1. Tags other than 0 and 1 will produce an error on attempts to
+ // decode them into a time.Time.
+ //
+ // DecTagRequired: Only tags 0 and 1 can be decoded to time.Time. Any
+ // other input will produce an error.
+ TimeTag DecTagMode
+
+ // MaxNestedLevels specifies the max nested levels allowed for any combination of CBOR array, maps, and tags.
+ // Default is 32 levels and it can be set to [4, 65535]. Note that higher maximum levels of nesting can
+ // require larger amounts of stack to deserialize. Don't increase this higher than you require.
+ MaxNestedLevels int
+
+ // MaxArrayElements specifies the max number of elements for CBOR arrays.
+ // Default is 128*1024=131072 and it can be set to [16, 2147483647]
+ MaxArrayElements int
+
+ // MaxMapPairs specifies the max number of key-value pairs for CBOR maps.
+ // Default is 128*1024=131072 and it can be set to [16, 2147483647]
+ MaxMapPairs int
+
+ // IndefLength specifies whether to allow indefinite length CBOR items.
+ IndefLength IndefLengthMode
+
+ // TagsMd specifies whether to allow CBOR tags (major type 6).
+ TagsMd TagsMode
+
+ // IntDec specifies which Go integer type (int64 or uint64) to use
+ // when decoding CBOR int (major type 0 and 1) to Go interface{}.
+ IntDec IntDecMode
+
+ // MapKeyByteString specifies how to decode CBOR byte string as map key
+ // when decoding CBOR map with byte string key into an empty interface value.
+ // By default, an error is returned when attempting to decode CBOR byte string
+ // as map key because Go doesn't allow []byte as map key.
+ MapKeyByteString MapKeyByteStringMode
+
+ // ExtraReturnErrors specifies extra conditions that should be treated as errors.
+ ExtraReturnErrors ExtraDecErrorCond
+
+ // DefaultMapType specifies Go map type to create and decode to
+ // when unmarshalling CBOR into an empty interface value.
+ // By default, unmarshal uses map[interface{}]interface{}.
+ DefaultMapType reflect.Type
+
+ // UTF8 specifies if decoder should decode CBOR Text containing invalid UTF-8.
+ // By default, unmarshal rejects CBOR text containing invalid UTF-8.
+ UTF8 UTF8Mode
+
+ // FieldNameMatching specifies how string keys in CBOR maps are matched to Go struct field names.
+ FieldNameMatching FieldNameMatchingMode
+
+ // BigIntDec specifies how to decode CBOR bignum to Go interface{}.
+ BigIntDec BigIntDecMode
+
+ // DefaultByteStringType is the Go type that should be produced when decoding a CBOR byte
+ // string into an empty interface value. Types to which a []byte is convertible are valid
+ // for this option, except for array and pointer-to-array types. If nil, the default is
+ // []byte.
+ DefaultByteStringType reflect.Type
+
+ // ByteStringToString specifies the behavior when decoding a CBOR byte string into a Go string.
+ ByteStringToString ByteStringToStringMode
+
+ // FieldNameByteString specifies the behavior when decoding a CBOR byte string map key as a
+ // Go struct field name.
+ FieldNameByteString FieldNameByteStringMode
+
+ // UnrecognizedTagToAny specifies how to decode unrecognized CBOR tag into an empty interface.
+ // Currently, recognized CBOR tag numbers are 0, 1, 2, 3, or registered by TagSet.
+ UnrecognizedTagToAny UnrecognizedTagToAnyMode
+
+ // TimeTagToAny specifies how to decode CBOR tag 0 and 1 into an empty interface (any).
+ // Based on the specified mode, Unmarshal can return a time.Time value or a time string in a specific format.
+ TimeTagToAny TimeTagToAnyMode
+
+ // SimpleValues is an immutable mapping from each CBOR simple value to a corresponding
+ // unmarshal behavior. If nil, the simple values false, true, null, and undefined are mapped
+ // to the Go analog values false, true, nil, and nil, respectively, and all other simple
+ // values N (except the reserved simple values 24 through 31) are mapped to
+ // cbor.SimpleValue(N). In other words, all well-formed simple values can be decoded.
+ //
+ // Users may provide a custom SimpleValueRegistry constructed via
+ // NewSimpleValueRegistryFromDefaults.
+ SimpleValues *SimpleValueRegistry
+
+ // NaN specifies how to decode floating-point values (major type 7, additional information
+ // 25 through 27) representing NaN (not-a-number).
+ NaN NaNMode
+
+ // Inf specifies how to decode floating-point values (major type 7, additional information
+ // 25 through 27) representing positive or negative infinity.
+ Inf InfMode
+
+ // ByteStringToTime specifies how to decode CBOR byte string into Go time.Time.
+ ByteStringToTime ByteStringToTimeMode
+
+ // ByteStringExpectedFormat specifies how to decode CBOR byte string into Go byte slice
+ // when the byte string is NOT enclosed in CBOR tag 21, 22, or 23. An error is returned if
+ // the CBOR byte string does not contain the expected format (e.g. base64) specified.
+ // For tags 21-23, see "Expected Later Encoding for CBOR-to-JSON Converters"
+ // in RFC 8949 Section 3.4.5.2.
+ ByteStringExpectedFormat ByteStringExpectedFormatMode
+
+ // BignumTag specifies whether or not the "bignum" tags 2 and 3 (RFC 8949 Section 3.4.3) can
+ // be decoded. Unlike BigIntDec, this option applies to all bignum tags encountered in a
+ // CBOR input, independent of the type of the destination value of a particular Unmarshal
+ // operation.
+ BignumTag BignumTagMode
+
+ // BinaryUnmarshaler specifies how to decode into types that implement
+ // encoding.BinaryUnmarshaler.
+ BinaryUnmarshaler BinaryUnmarshalerMode
+}
+
+// DecMode returns DecMode with immutable options and no tags (safe for concurrency).
+func (opts DecOptions) DecMode() (DecMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.decMode()
+}
+
+// validForTags checks that the provided tag set is compatible with these options and returns a
+// non-nil error if and only if the provided tag set is incompatible.
+func (opts DecOptions) validForTags(tags TagSet) error { //nolint:gocritic // ignore hugeParam
+ if opts.TagsMd == TagsForbidden {
+ return errors.New("cbor: cannot create DecMode with TagSet when TagsMd is TagsForbidden")
+ }
+ if tags == nil {
+ return errors.New("cbor: cannot create DecMode with nil value as TagSet")
+ }
+ if opts.ByteStringToString == ByteStringToStringAllowedWithExpectedLaterEncoding ||
+ opts.ByteStringExpectedFormat != ByteStringExpectedFormatNone {
+ for _, tagNum := range []uint64{
+ tagNumExpectedLaterEncodingBase64URL,
+ tagNumExpectedLaterEncodingBase64,
+ tagNumExpectedLaterEncodingBase16,
+ } {
+ if rt := tags.getTypeFromTagNum([]uint64{tagNum}); rt != nil {
+ return fmt.Errorf("cbor: DecMode with non-default StringExpectedEncoding or ByteSliceExpectedEncoding treats tag %d as built-in and conflicts with the provided TagSet's registration of %v", tagNum, rt)
+ }
+ }
+
+ }
+ return nil
+}
+
+// DecModeWithTags returns DecMode with options and tags that are both immutable (safe for concurrency).
+func (opts DecOptions) DecModeWithTags(tags TagSet) (DecMode, error) { //nolint:gocritic // ignore hugeParam
+ if err := opts.validForTags(tags); err != nil {
+ return nil, err
+ }
+ dm, err := opts.decMode()
+ if err != nil {
+ return nil, err
+ }
+
+ // Copy tags
+ ts := tagSet(make(map[reflect.Type]*tagItem))
+ syncTags := tags.(*syncTagSet)
+ syncTags.RLock()
+ for contentType, tag := range syncTags.t {
+ if tag.opts.DecTag != DecTagIgnored {
+ ts[contentType] = tag
+ }
+ }
+ syncTags.RUnlock()
+
+ if len(ts) > 0 {
+ dm.tags = ts
+ }
+
+ return dm, nil
+}
+
+// DecModeWithSharedTags returns DecMode with immutable options and mutable shared tags (safe for concurrency).
+func (opts DecOptions) DecModeWithSharedTags(tags TagSet) (DecMode, error) { //nolint:gocritic // ignore hugeParam
+ if err := opts.validForTags(tags); err != nil {
+ return nil, err
+ }
+ dm, err := opts.decMode()
+ if err != nil {
+ return nil, err
+ }
+ dm.tags = tags
+ return dm, nil
+}
+
+const (
+ defaultMaxArrayElements = 131072
+ minMaxArrayElements = 16
+ maxMaxArrayElements = 2147483647
+
+ defaultMaxMapPairs = 131072
+ minMaxMapPairs = 16
+ maxMaxMapPairs = 2147483647
+
+ defaultMaxNestedLevels = 32
+ minMaxNestedLevels = 4
+ maxMaxNestedLevels = 65535
+)
+
+var defaultSimpleValues = func() *SimpleValueRegistry {
+ registry, err := NewSimpleValueRegistryFromDefaults()
+ if err != nil {
+ panic(err)
+ }
+ return registry
+}()
+
+//nolint:gocyclo // Each option comes with some manageable boilerplate
+func (opts DecOptions) decMode() (*decMode, error) { //nolint:gocritic // ignore hugeParam
+ if !opts.DupMapKey.valid() {
+ return nil, errors.New("cbor: invalid DupMapKey " + strconv.Itoa(int(opts.DupMapKey)))
+ }
+
+ if !opts.TimeTag.valid() {
+ return nil, errors.New("cbor: invalid TimeTag " + strconv.Itoa(int(opts.TimeTag)))
+ }
+
+ if !opts.IndefLength.valid() {
+ return nil, errors.New("cbor: invalid IndefLength " + strconv.Itoa(int(opts.IndefLength)))
+ }
+
+ if !opts.TagsMd.valid() {
+ return nil, errors.New("cbor: invalid TagsMd " + strconv.Itoa(int(opts.TagsMd)))
+ }
+
+ if !opts.IntDec.valid() {
+ return nil, errors.New("cbor: invalid IntDec " + strconv.Itoa(int(opts.IntDec)))
+ }
+
+ if !opts.MapKeyByteString.valid() {
+ return nil, errors.New("cbor: invalid MapKeyByteString " + strconv.Itoa(int(opts.MapKeyByteString)))
+ }
+
+ if opts.MaxNestedLevels == 0 {
+ opts.MaxNestedLevels = defaultMaxNestedLevels
+ } else if opts.MaxNestedLevels < minMaxNestedLevels || opts.MaxNestedLevels > maxMaxNestedLevels {
+ return nil, errors.New("cbor: invalid MaxNestedLevels " + strconv.Itoa(opts.MaxNestedLevels) +
+ " (range is [" + strconv.Itoa(minMaxNestedLevels) + ", " + strconv.Itoa(maxMaxNestedLevels) + "])")
+ }
+
+ if opts.MaxArrayElements == 0 {
+ opts.MaxArrayElements = defaultMaxArrayElements
+ } else if opts.MaxArrayElements < minMaxArrayElements || opts.MaxArrayElements > maxMaxArrayElements {
+ return nil, errors.New("cbor: invalid MaxArrayElements " + strconv.Itoa(opts.MaxArrayElements) +
+ " (range is [" + strconv.Itoa(minMaxArrayElements) + ", " + strconv.Itoa(maxMaxArrayElements) + "])")
+ }
+
+ if opts.MaxMapPairs == 0 {
+ opts.MaxMapPairs = defaultMaxMapPairs
+ } else if opts.MaxMapPairs < minMaxMapPairs || opts.MaxMapPairs > maxMaxMapPairs {
+ return nil, errors.New("cbor: invalid MaxMapPairs " + strconv.Itoa(opts.MaxMapPairs) +
+ " (range is [" + strconv.Itoa(minMaxMapPairs) + ", " + strconv.Itoa(maxMaxMapPairs) + "])")
+ }
+
+ if !opts.ExtraReturnErrors.valid() {
+ return nil, errors.New("cbor: invalid ExtraReturnErrors " + strconv.Itoa(int(opts.ExtraReturnErrors)))
+ }
+
+ if opts.DefaultMapType != nil && opts.DefaultMapType.Kind() != reflect.Map {
+ return nil, fmt.Errorf("cbor: invalid DefaultMapType %s", opts.DefaultMapType)
+ }
+
+ if !opts.UTF8.valid() {
+ return nil, errors.New("cbor: invalid UTF8 " + strconv.Itoa(int(opts.UTF8)))
+ }
+
+ if !opts.FieldNameMatching.valid() {
+ return nil, errors.New("cbor: invalid FieldNameMatching " + strconv.Itoa(int(opts.FieldNameMatching)))
+ }
+
+ if !opts.BigIntDec.valid() {
+ return nil, errors.New("cbor: invalid BigIntDec " + strconv.Itoa(int(opts.BigIntDec)))
+ }
+
+ if opts.DefaultByteStringType != nil &&
+ opts.DefaultByteStringType.Kind() != reflect.String &&
+ (opts.DefaultByteStringType.Kind() != reflect.Slice || opts.DefaultByteStringType.Elem().Kind() != reflect.Uint8) {
+ return nil, fmt.Errorf("cbor: invalid DefaultByteStringType: %s is not of kind string or []uint8", opts.DefaultByteStringType)
+ }
+
+ if !opts.ByteStringToString.valid() {
+ return nil, errors.New("cbor: invalid ByteStringToString " + strconv.Itoa(int(opts.ByteStringToString)))
+ }
+
+ if !opts.FieldNameByteString.valid() {
+ return nil, errors.New("cbor: invalid FieldNameByteString " + strconv.Itoa(int(opts.FieldNameByteString)))
+ }
+
+ if !opts.UnrecognizedTagToAny.valid() {
+ return nil, errors.New("cbor: invalid UnrecognizedTagToAnyMode " + strconv.Itoa(int(opts.UnrecognizedTagToAny)))
+ }
+ simpleValues := opts.SimpleValues
+ if simpleValues == nil {
+ simpleValues = defaultSimpleValues
+ }
+
+ if !opts.TimeTagToAny.valid() {
+ return nil, errors.New("cbor: invalid TimeTagToAny " + strconv.Itoa(int(opts.TimeTagToAny)))
+ }
+
+ if !opts.NaN.valid() {
+ return nil, errors.New("cbor: invalid NaNDec " + strconv.Itoa(int(opts.NaN)))
+ }
+
+ if !opts.Inf.valid() {
+ return nil, errors.New("cbor: invalid InfDec " + strconv.Itoa(int(opts.Inf)))
+ }
+
+ if !opts.ByteStringToTime.valid() {
+ return nil, errors.New("cbor: invalid ByteStringToTime " + strconv.Itoa(int(opts.ByteStringToTime)))
+ }
+
+ if !opts.ByteStringExpectedFormat.valid() {
+ return nil, errors.New("cbor: invalid ByteStringExpectedFormat " + strconv.Itoa(int(opts.ByteStringExpectedFormat)))
+ }
+
+ if !opts.BignumTag.valid() {
+ return nil, errors.New("cbor: invalid BignumTag " + strconv.Itoa(int(opts.BignumTag)))
+ }
+
+ if !opts.BinaryUnmarshaler.valid() {
+ return nil, errors.New("cbor: invalid BinaryUnmarshaler " + strconv.Itoa(int(opts.BinaryUnmarshaler)))
+ }
+
+ dm := decMode{
+ dupMapKey: opts.DupMapKey,
+ timeTag: opts.TimeTag,
+ maxNestedLevels: opts.MaxNestedLevels,
+ maxArrayElements: opts.MaxArrayElements,
+ maxMapPairs: opts.MaxMapPairs,
+ indefLength: opts.IndefLength,
+ tagsMd: opts.TagsMd,
+ intDec: opts.IntDec,
+ mapKeyByteString: opts.MapKeyByteString,
+ extraReturnErrors: opts.ExtraReturnErrors,
+ defaultMapType: opts.DefaultMapType,
+ utf8: opts.UTF8,
+ fieldNameMatching: opts.FieldNameMatching,
+ bigIntDec: opts.BigIntDec,
+ defaultByteStringType: opts.DefaultByteStringType,
+ byteStringToString: opts.ByteStringToString,
+ fieldNameByteString: opts.FieldNameByteString,
+ unrecognizedTagToAny: opts.UnrecognizedTagToAny,
+ timeTagToAny: opts.TimeTagToAny,
+ simpleValues: simpleValues,
+ nanDec: opts.NaN,
+ infDec: opts.Inf,
+ byteStringToTime: opts.ByteStringToTime,
+ byteStringExpectedFormat: opts.ByteStringExpectedFormat,
+ bignumTag: opts.BignumTag,
+ binaryUnmarshaler: opts.BinaryUnmarshaler,
+ }
+
+ return &dm, nil
+}
+
+// DecMode is the main interface for CBOR decoding.
+type DecMode interface {
+ // Unmarshal parses the CBOR-encoded data into the value pointed to by v
+ // using the decoding mode. If v is nil, not a pointer, or a nil pointer,
+ // Unmarshal returns an error.
+ //
+ // See the documentation for Unmarshal for details.
+ Unmarshal(data []byte, v interface{}) error
+
+ // UnmarshalFirst parses the first CBOR data item into the value pointed to by v
+ // using the decoding mode. Any remaining bytes are returned in rest.
+ //
+ // If v is nil, not a pointer, or a nil pointer, UnmarshalFirst returns an error.
+ //
+ // See the documentation for Unmarshal for details.
+ UnmarshalFirst(data []byte, v interface{}) (rest []byte, err error)
+
+ // Valid checks whether data is a well-formed encoded CBOR data item and
+ // that it complies with configurable restrictions such as MaxNestedLevels,
+ // MaxArrayElements, MaxMapPairs, etc.
+ //
+ // If there are any remaining bytes after the CBOR data item,
+ // an ExtraneousDataError is returned.
+ //
+ // WARNING: Valid doesn't check if encoded CBOR data item is valid (i.e. validity)
+ // and RFC 8949 distinctly defines what is "Valid" and what is "Well-formed".
+ //
+ // Deprecated: Valid is kept for compatibility and should not be used.
+ // Use Wellformed instead because it has a more appropriate name.
+ Valid(data []byte) error
+
+ // Wellformed checks whether data is a well-formed encoded CBOR data item and
+ // that it complies with configurable restrictions such as MaxNestedLevels,
+ // MaxArrayElements, MaxMapPairs, etc.
+ //
+ // If there are any remaining bytes after the CBOR data item,
+ // an ExtraneousDataError is returned.
+ Wellformed(data []byte) error
+
+ // NewDecoder returns a new decoder that reads from r using dm DecMode.
+ NewDecoder(r io.Reader) *Decoder
+
+ // DecOptions returns user specified options used to create this DecMode.
+ DecOptions() DecOptions
+}
+
+type decMode struct {
+ tags tagProvider
+ dupMapKey DupMapKeyMode
+ timeTag DecTagMode
+ maxNestedLevels int
+ maxArrayElements int
+ maxMapPairs int
+ indefLength IndefLengthMode
+ tagsMd TagsMode
+ intDec IntDecMode
+ mapKeyByteString MapKeyByteStringMode
+ extraReturnErrors ExtraDecErrorCond
+ defaultMapType reflect.Type
+ utf8 UTF8Mode
+ fieldNameMatching FieldNameMatchingMode
+ bigIntDec BigIntDecMode
+ defaultByteStringType reflect.Type
+ byteStringToString ByteStringToStringMode
+ fieldNameByteString FieldNameByteStringMode
+ unrecognizedTagToAny UnrecognizedTagToAnyMode
+ timeTagToAny TimeTagToAnyMode
+ simpleValues *SimpleValueRegistry
+ nanDec NaNMode
+ infDec InfMode
+ byteStringToTime ByteStringToTimeMode
+ byteStringExpectedFormat ByteStringExpectedFormatMode
+ bignumTag BignumTagMode
+ binaryUnmarshaler BinaryUnmarshalerMode
+}
+
+var defaultDecMode, _ = DecOptions{}.decMode()
+
+// DecOptions returns user specified options used to create this DecMode.
+func (dm *decMode) DecOptions() DecOptions {
+ simpleValues := dm.simpleValues
+ if simpleValues == defaultSimpleValues {
+ // Users can't explicitly set this to defaultSimpleValues. It must have been nil in
+ // the original DecOptions.
+ simpleValues = nil
+ }
+
+ return DecOptions{
+ DupMapKey: dm.dupMapKey,
+ TimeTag: dm.timeTag,
+ MaxNestedLevels: dm.maxNestedLevels,
+ MaxArrayElements: dm.maxArrayElements,
+ MaxMapPairs: dm.maxMapPairs,
+ IndefLength: dm.indefLength,
+ TagsMd: dm.tagsMd,
+ IntDec: dm.intDec,
+ MapKeyByteString: dm.mapKeyByteString,
+ ExtraReturnErrors: dm.extraReturnErrors,
+ DefaultMapType: dm.defaultMapType,
+ UTF8: dm.utf8,
+ FieldNameMatching: dm.fieldNameMatching,
+ BigIntDec: dm.bigIntDec,
+ DefaultByteStringType: dm.defaultByteStringType,
+ ByteStringToString: dm.byteStringToString,
+ FieldNameByteString: dm.fieldNameByteString,
+ UnrecognizedTagToAny: dm.unrecognizedTagToAny,
+ TimeTagToAny: dm.timeTagToAny,
+ SimpleValues: simpleValues,
+ NaN: dm.nanDec,
+ Inf: dm.infDec,
+ ByteStringToTime: dm.byteStringToTime,
+ ByteStringExpectedFormat: dm.byteStringExpectedFormat,
+ BignumTag: dm.bignumTag,
+ BinaryUnmarshaler: dm.binaryUnmarshaler,
+ }
+}
+
+// Unmarshal parses the CBOR-encoded data into the value pointed to by v
+// using dm decoding mode. If v is nil, not a pointer, or a nil pointer,
+// Unmarshal returns an error.
+//
+// See the documentation for Unmarshal for details.
+func (dm *decMode) Unmarshal(data []byte, v interface{}) error {
+ d := decoder{data: data, dm: dm}
+
+ // Check well-formedness.
+ off := d.off // Save offset before data validation
+ err := d.wellformed(false, false) // don't allow any extra data after valid data item.
+ d.off = off // Restore offset
+ if err != nil {
+ return err
+ }
+
+ return d.value(v)
+}
+
+// UnmarshalFirst parses the first CBOR data item into the value pointed to by v
+// using dm decoding mode. Any remaining bytes are returned in rest.
+//
+// If v is nil, not a pointer, or a nil pointer, UnmarshalFirst returns an error.
+//
+// See the documentation for Unmarshal for details.
+func (dm *decMode) UnmarshalFirst(data []byte, v interface{}) (rest []byte, err error) {
+ d := decoder{data: data, dm: dm}
+
+ // check well-formedness.
+ off := d.off // Save offset before data validation
+ err = d.wellformed(true, false) // allow extra data after well-formed data item
+ d.off = off // Restore offset
+
+ // If it is well-formed, parse the value. This is structured like this to allow
+ // better test coverage
+ if err == nil {
+ err = d.value(v)
+ }
+
+ // If either wellformed or value returned an error, do not return rest bytes
+ if err != nil {
+ return nil, err
+ }
+
+ // Return the rest of the data slice (which might be len 0)
+ return d.data[d.off:], nil
+}
+
+// Valid checks whether data is a well-formed encoded CBOR data item and
+// that it complies with configurable restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+//
+// WARNING: Valid doesn't check if encoded CBOR data item is valid (i.e. validity)
+// and RFC 8949 distinctly defines what is "Valid" and what is "Well-formed".
+//
+// Deprecated: Valid is kept for compatibility and should not be used.
+// Use Wellformed instead because it has a more appropriate name.
+func (dm *decMode) Valid(data []byte) error {
+ return dm.Wellformed(data)
+}
+
+// Wellformed checks whether data is a well-formed encoded CBOR data item and
+// that it complies with configurable restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+func (dm *decMode) Wellformed(data []byte) error {
+ d := decoder{data: data, dm: dm}
+ return d.wellformed(false, false)
+}
+
+// NewDecoder returns a new decoder that reads from r using dm DecMode.
+func (dm *decMode) NewDecoder(r io.Reader) *Decoder {
+ return &Decoder{r: r, d: decoder{dm: dm}}
+}
+
+type decoder struct {
+ data []byte
+ off int // next read offset in data
+ dm *decMode
+
+ // expectedLaterEncodingTags stores a stack of encountered "Expected Later Encoding" tags,
+ // if any.
+ //
+ // The "Expected Later Encoding" tags (21 to 23) are valid for any data item. When decoding
+ // byte strings, the effective encoding comes from the tag nearest to the byte string being
+ // decoded. For example, the effective encoding of the byte string 21(22(h'41')) would be
+ // controlled by tag 22,and in the data item 23(h'42', 22([21(h'43')])]) the effective
+ // encoding of the byte strings h'42' and h'43' would be controlled by tag 23 and 21,
+ // respectively.
+ expectedLaterEncodingTags []uint64
+}
+
+// value decodes CBOR data item into the value pointed to by v.
+// If CBOR data item fails to be decoded into v,
+// error is returned and offset is moved to the next CBOR data item.
+// Precondition: d.data contains at least one well-formed CBOR data item.
+func (d *decoder) value(v interface{}) error {
+ // v can't be nil, non-pointer, or nil pointer value.
+ if v == nil {
+ return &InvalidUnmarshalError{"cbor: Unmarshal(nil)"}
+ }
+ rv := reflect.ValueOf(v)
+ if rv.Kind() != reflect.Ptr {
+ return &InvalidUnmarshalError{"cbor: Unmarshal(non-pointer " + rv.Type().String() + ")"}
+ } else if rv.IsNil() {
+ return &InvalidUnmarshalError{"cbor: Unmarshal(nil " + rv.Type().String() + ")"}
+ }
+ rv = rv.Elem()
+ return d.parseToValue(rv, getTypeInfo(rv.Type()))
+}
+
+// parseToValue decodes CBOR data to value. It assumes data is well-formed,
+// and does not perform bounds checking.
+func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo
+
+ // Decode CBOR nil or CBOR undefined to pointer value by setting pointer value to nil.
+ if d.nextCBORNil() && v.Kind() == reflect.Ptr {
+ d.skip()
+ v.Set(reflect.Zero(v.Type()))
+ return nil
+ }
+
+ if tInfo.spclType == specialTypeIface {
+ if !v.IsNil() {
+ // Use value type
+ v = v.Elem()
+ tInfo = getTypeInfo(v.Type())
+ } else { //nolint:gocritic
+ // Create and use registered type if CBOR data is registered tag
+ if d.dm.tags != nil && d.nextCBORType() == cborTypeTag {
+
+ off := d.off
+ var tagNums []uint64
+ for d.nextCBORType() == cborTypeTag {
+ _, _, tagNum := d.getHead()
+ tagNums = append(tagNums, tagNum)
+ }
+ d.off = off
+
+ registeredType := d.dm.tags.getTypeFromTagNum(tagNums)
+ if registeredType != nil {
+ if registeredType.Implements(tInfo.nonPtrType) ||
+ reflect.PtrTo(registeredType).Implements(tInfo.nonPtrType) {
+ v.Set(reflect.New(registeredType))
+ v = v.Elem()
+ tInfo = getTypeInfo(registeredType)
+ }
+ }
+ }
+ }
+ }
+
+ // Create new value for the pointer v to point to.
+ // At this point, CBOR value is not nil/undefined if v is a pointer.
+ for v.Kind() == reflect.Ptr {
+ if v.IsNil() {
+ if !v.CanSet() {
+ d.skip()
+ return errors.New("cbor: cannot set new value for " + v.Type().String())
+ }
+ v.Set(reflect.New(v.Type().Elem()))
+ }
+ v = v.Elem()
+ }
+
+ // Strip self-described CBOR tag number.
+ for d.nextCBORType() == cborTypeTag {
+ off := d.off
+ _, _, tagNum := d.getHead()
+ if tagNum != tagNumSelfDescribedCBOR {
+ d.off = off
+ break
+ }
+ }
+
+ // Check validity of supported built-in tags.
+ off := d.off
+ for d.nextCBORType() == cborTypeTag {
+ _, _, tagNum := d.getHead()
+ if err := validBuiltinTag(tagNum, d.data[d.off]); err != nil {
+ d.skip()
+ return err
+ }
+ }
+ d.off = off
+
+ if tInfo.spclType != specialTypeNone {
+ switch tInfo.spclType {
+ case specialTypeEmptyIface:
+ iv, err := d.parse(false) // Skipped self-described CBOR tag number already.
+ if iv != nil {
+ v.Set(reflect.ValueOf(iv))
+ }
+ return err
+
+ case specialTypeTag:
+ return d.parseToTag(v)
+
+ case specialTypeTime:
+ if d.nextCBORNil() {
+ // Decoding CBOR null and undefined to time.Time is no-op.
+ d.skip()
+ return nil
+ }
+ tm, ok, err := d.parseToTime()
+ if err != nil {
+ return err
+ }
+ if ok {
+ v.Set(reflect.ValueOf(tm))
+ }
+ return nil
+
+ case specialTypeUnmarshalerIface:
+ return d.parseToUnmarshaler(v)
+ }
+ }
+
+ // Check registered tag number
+ if tagItem := d.getRegisteredTagItem(tInfo.nonPtrType); tagItem != nil {
+ t := d.nextCBORType()
+ if t != cborTypeTag {
+ if tagItem.opts.DecTag == DecTagRequired {
+ d.skip() // Required tag number is absent, skip entire tag
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.typ.String(),
+ errorMsg: "expect CBOR tag value"}
+ }
+ } else if err := d.validRegisteredTagNums(tagItem); err != nil {
+ d.skip() // Skip tag content
+ return err
+ }
+ }
+
+ t := d.nextCBORType()
+
+ switch t {
+ case cborTypePositiveInt:
+ _, _, val := d.getHead()
+ return fillPositiveInt(t, val, v)
+
+ case cborTypeNegativeInt:
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ // CBOR negative integer overflows int64, use big.Int to store value.
+ bi := new(big.Int)
+ bi.SetUint64(val)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if tInfo.nonPtrType == typeBigInt {
+ v.Set(reflect.ValueOf(*bi))
+ return nil
+ }
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: bi.String() + " overflows Go's int64",
+ }
+ }
+ nValue := int64(-1) ^ int64(val)
+ return fillNegativeInt(t, nValue, v)
+
+ case cborTypeByteString:
+ b, copied := d.parseByteString()
+ b, converted, err := d.applyByteStringTextConversion(b, v.Type())
+ if err != nil {
+ return err
+ }
+ copied = copied || converted
+ return fillByteString(t, b, !copied, v, d.dm.byteStringToString, d.dm.binaryUnmarshaler)
+
+ case cborTypeTextString:
+ b, err := d.parseTextString()
+ if err != nil {
+ return err
+ }
+ return fillTextString(t, b, v)
+
+ case cborTypePrimitives:
+ _, ai, val := d.getHead()
+ switch ai {
+ case additionalInformationAsFloat16:
+ f := float64(float16.Frombits(uint16(val)).Float32())
+ return fillFloat(t, f, v)
+
+ case additionalInformationAsFloat32:
+ f := float64(math.Float32frombits(uint32(val)))
+ return fillFloat(t, f, v)
+
+ case additionalInformationAsFloat64:
+ f := math.Float64frombits(val)
+ return fillFloat(t, f, v)
+
+ default: // ai <= 24
+ if d.dm.simpleValues.rejected[SimpleValue(val)] {
+ return &UnacceptableDataItemError{
+ CBORType: t.String(),
+ Message: "simple value " + strconv.FormatInt(int64(val), 10) + " is not recognized",
+ }
+ }
+
+ switch ai {
+ case additionalInformationAsFalse,
+ additionalInformationAsTrue:
+ return fillBool(t, ai == additionalInformationAsTrue, v)
+
+ case additionalInformationAsNull,
+ additionalInformationAsUndefined:
+ return fillNil(t, v)
+
+ default:
+ return fillPositiveInt(t, val, v)
+ }
+ }
+
+ case cborTypeTag:
+ _, _, tagNum := d.getHead()
+ switch tagNum {
+ case tagNumUnsignedBignum:
+ // Bignum (tag 2) can be decoded to uint, int, float, slice, array, or big.Int.
+ b, copied := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+
+ if tInfo.nonPtrType == typeBigInt {
+ v.Set(reflect.ValueOf(*bi))
+ return nil
+ }
+ if tInfo.nonPtrKind == reflect.Slice || tInfo.nonPtrKind == reflect.Array {
+ return fillByteString(t, b, !copied, v, ByteStringToStringForbidden, d.dm.binaryUnmarshaler)
+ }
+ if bi.IsUint64() {
+ return fillPositiveInt(t, bi.Uint64(), v)
+ }
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: bi.String() + " overflows " + v.Type().String(),
+ }
+
+ case tagNumNegativeBignum:
+ // Bignum (tag 3) can be decoded to int, float, slice, array, or big.Int.
+ b, copied := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if tInfo.nonPtrType == typeBigInt {
+ v.Set(reflect.ValueOf(*bi))
+ return nil
+ }
+ if tInfo.nonPtrKind == reflect.Slice || tInfo.nonPtrKind == reflect.Array {
+ return fillByteString(t, b, !copied, v, ByteStringToStringForbidden, d.dm.binaryUnmarshaler)
+ }
+ if bi.IsInt64() {
+ return fillNegativeInt(t, bi.Int64(), v)
+ }
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: bi.String() + " overflows " + v.Type().String(),
+ }
+
+ case tagNumExpectedLaterEncodingBase64URL, tagNumExpectedLaterEncodingBase64, tagNumExpectedLaterEncodingBase16:
+ // If conversion for interoperability with text encodings is not configured,
+ // treat tags 21-23 as unregistered tags.
+ if d.dm.byteStringToString == ByteStringToStringAllowedWithExpectedLaterEncoding || d.dm.byteStringExpectedFormat != ByteStringExpectedFormatNone {
+ d.expectedLaterEncodingTags = append(d.expectedLaterEncodingTags, tagNum)
+ defer func() {
+ d.expectedLaterEncodingTags = d.expectedLaterEncodingTags[:len(d.expectedLaterEncodingTags)-1]
+ }()
+ }
+ }
+
+ return d.parseToValue(v, tInfo)
+
+ case cborTypeArray:
+ if tInfo.nonPtrKind == reflect.Slice {
+ return d.parseArrayToSlice(v, tInfo)
+ } else if tInfo.nonPtrKind == reflect.Array {
+ return d.parseArrayToArray(v, tInfo)
+ } else if tInfo.nonPtrKind == reflect.Struct {
+ return d.parseArrayToStruct(v, tInfo)
+ }
+ d.skip()
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: tInfo.nonPtrType.String()}
+
+ case cborTypeMap:
+ if tInfo.nonPtrKind == reflect.Struct {
+ return d.parseMapToStruct(v, tInfo)
+ } else if tInfo.nonPtrKind == reflect.Map {
+ return d.parseMapToMap(v, tInfo)
+ }
+ d.skip()
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: tInfo.nonPtrType.String()}
+ }
+
+ return nil
+}
+
+func (d *decoder) parseToTag(v reflect.Value) error {
+ if d.nextCBORNil() {
+ // Decoding CBOR null and undefined to cbor.Tag is no-op.
+ d.skip()
+ return nil
+ }
+
+ t := d.nextCBORType()
+ if t != cborTypeTag {
+ d.skip()
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: typeTag.String()}
+ }
+
+ // Unmarshal tag number
+ _, _, num := d.getHead()
+
+ // Unmarshal tag content
+ content, err := d.parse(false)
+ if err != nil {
+ return err
+ }
+
+ v.Set(reflect.ValueOf(Tag{num, content}))
+ return nil
+}
+
+// parseToTime decodes the current data item as a time.Time. The bool return value is false if and
+// only if the destination value should remain unmodified.
+func (d *decoder) parseToTime() (time.Time, bool, error) {
+ // Verify that tag number or absence of tag number is acceptable to specified timeTag.
+ if t := d.nextCBORType(); t == cborTypeTag {
+ if d.dm.timeTag == DecTagIgnored {
+ // Skip all enclosing tags
+ for t == cborTypeTag {
+ d.getHead()
+ t = d.nextCBORType()
+ }
+ if d.nextCBORNil() {
+ d.skip()
+ return time.Time{}, false, nil
+ }
+ } else {
+ // Read tag number
+ _, _, tagNum := d.getHead()
+ if tagNum != 0 && tagNum != 1 {
+ d.skip() // skip tag content
+ return time.Time{}, false, errors.New("cbor: wrong tag number for time.Time, got " + strconv.Itoa(int(tagNum)) + ", expect 0 or 1")
+ }
+ }
+ } else {
+ if d.dm.timeTag == DecTagRequired {
+ d.skip()
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String(), errorMsg: "expect CBOR tag value"}
+ }
+ }
+
+ switch t := d.nextCBORType(); t {
+ case cborTypeByteString:
+ if d.dm.byteStringToTime == ByteStringToTimeAllowed {
+ b, _ := d.parseByteString()
+ t, err := time.Parse(time.RFC3339, string(b))
+ if err != nil {
+ return time.Time{}, false, fmt.Errorf("cbor: cannot set %q for time.Time: %w", string(b), err)
+ }
+ return t, true, nil
+ }
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()}
+
+ case cborTypeTextString:
+ s, err := d.parseTextString()
+ if err != nil {
+ return time.Time{}, false, err
+ }
+ t, err := time.Parse(time.RFC3339, string(s))
+ if err != nil {
+ return time.Time{}, false, errors.New("cbor: cannot set " + string(s) + " for time.Time: " + err.Error())
+ }
+ return t, true, nil
+
+ case cborTypePositiveInt:
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ return time.Time{}, false, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: typeTime.String(),
+ errorMsg: fmt.Sprintf("%d overflows Go's int64", val),
+ }
+ }
+ return time.Unix(int64(val), 0), true, nil
+
+ case cborTypeNegativeInt:
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ if val == math.MaxUint64 {
+ // Maximum absolute value representable by negative integer is 2^64,
+ // not 2^64-1, so it overflows uint64.
+ return time.Time{}, false, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: typeTime.String(),
+ errorMsg: "-18446744073709551616 overflows Go's int64",
+ }
+ }
+ return time.Time{}, false, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: typeTime.String(),
+ errorMsg: fmt.Sprintf("-%d overflows Go's int64", val+1),
+ }
+ }
+ return time.Unix(int64(-1)^int64(val), 0), true, nil
+
+ case cborTypePrimitives:
+ _, ai, val := d.getHead()
+ var f float64
+ switch ai {
+ case additionalInformationAsFloat16:
+ f = float64(float16.Frombits(uint16(val)).Float32())
+
+ case additionalInformationAsFloat32:
+ f = float64(math.Float32frombits(uint32(val)))
+
+ case additionalInformationAsFloat64:
+ f = math.Float64frombits(val)
+
+ default:
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()}
+ }
+
+ if math.IsNaN(f) || math.IsInf(f, 0) {
+ // https://www.rfc-editor.org/rfc/rfc8949.html#section-3.4.2-6
+ return time.Time{}, true, nil
+ }
+ seconds, fractional := math.Modf(f)
+ return time.Unix(int64(seconds), int64(fractional*1e9)), true, nil
+
+ default:
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()}
+ }
+}
+
+// parseToUnmarshaler parses CBOR data to value implementing Unmarshaler interface.
+// It assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) parseToUnmarshaler(v reflect.Value) error {
+ if d.nextCBORNil() && v.Kind() == reflect.Ptr && v.IsNil() {
+ d.skip()
+ return nil
+ }
+
+ if v.Kind() != reflect.Ptr && v.CanAddr() {
+ v = v.Addr()
+ }
+ if u, ok := v.Interface().(Unmarshaler); ok {
+ start := d.off
+ d.skip()
+ return u.UnmarshalCBOR(d.data[start:d.off])
+ }
+ d.skip()
+ return errors.New("cbor: failed to assert " + v.Type().String() + " as cbor.Unmarshaler")
+}
+
+// parse parses CBOR data and returns value in default Go type.
+// It assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) parse(skipSelfDescribedTag bool) (interface{}, error) { //nolint:gocyclo
+ // Strip self-described CBOR tag number.
+ if skipSelfDescribedTag {
+ for d.nextCBORType() == cborTypeTag {
+ off := d.off
+ _, _, tagNum := d.getHead()
+ if tagNum != tagNumSelfDescribedCBOR {
+ d.off = off
+ break
+ }
+ }
+ }
+
+ // Check validity of supported built-in tags.
+ off := d.off
+ for d.nextCBORType() == cborTypeTag {
+ _, _, tagNum := d.getHead()
+ if err := validBuiltinTag(tagNum, d.data[d.off]); err != nil {
+ d.skip()
+ return nil, err
+ }
+ }
+ d.off = off
+
+ t := d.nextCBORType()
+ switch t {
+ case cborTypePositiveInt:
+ _, _, val := d.getHead()
+
+ switch d.dm.intDec {
+ case IntDecConvertNone:
+ return val, nil
+
+ case IntDecConvertSigned, IntDecConvertSignedOrFail:
+ if val > math.MaxInt64 {
+ return nil, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf(int64(0)).String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows Go's int64",
+ }
+ }
+
+ return int64(val), nil
+
+ case IntDecConvertSignedOrBigInt:
+ if val > math.MaxInt64 {
+ bi := new(big.Int).SetUint64(val)
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+ }
+
+ return int64(val), nil
+
+ default:
+ // not reachable
+ }
+
+ case cborTypeNegativeInt:
+ _, _, val := d.getHead()
+
+ if val > math.MaxInt64 {
+ // CBOR negative integer value overflows Go int64, use big.Int instead.
+ bi := new(big.Int).SetUint64(val)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if d.dm.intDec == IntDecConvertSignedOrFail {
+ return nil, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf(int64(0)).String(),
+ errorMsg: bi.String() + " overflows Go's int64",
+ }
+ }
+
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+ }
+
+ nValue := int64(-1) ^ int64(val)
+ return nValue, nil
+
+ case cborTypeByteString:
+ b, copied := d.parseByteString()
+ var effectiveByteStringType = d.dm.defaultByteStringType
+ if effectiveByteStringType == nil {
+ effectiveByteStringType = typeByteSlice
+ }
+ b, converted, err := d.applyByteStringTextConversion(b, effectiveByteStringType)
+ if err != nil {
+ return nil, err
+ }
+ copied = copied || converted
+
+ switch effectiveByteStringType {
+ case typeByteSlice:
+ if copied {
+ return b, nil
+ }
+ clone := make([]byte, len(b))
+ copy(clone, b)
+ return clone, nil
+
+ case typeString:
+ return string(b), nil
+
+ default:
+ if copied || d.dm.defaultByteStringType.Kind() == reflect.String {
+ // Avoid an unnecessary copy since the conversion to string must
+ // copy the underlying bytes.
+ return reflect.ValueOf(b).Convert(d.dm.defaultByteStringType).Interface(), nil
+ }
+ clone := make([]byte, len(b))
+ copy(clone, b)
+ return reflect.ValueOf(clone).Convert(d.dm.defaultByteStringType).Interface(), nil
+ }
+
+ case cborTypeTextString:
+ b, err := d.parseTextString()
+ if err != nil {
+ return nil, err
+ }
+ return string(b), nil
+
+ case cborTypeTag:
+ tagOff := d.off
+ _, _, tagNum := d.getHead()
+ contentOff := d.off
+
+ switch tagNum {
+ case tagNumRFC3339Time, tagNumEpochTime:
+ d.off = tagOff
+ tm, _, err := d.parseToTime()
+ if err != nil {
+ return nil, err
+ }
+
+ switch d.dm.timeTagToAny {
+ case TimeTagToTime:
+ return tm, nil
+
+ case TimeTagToRFC3339:
+ if tagNum == 1 {
+ tm = tm.UTC()
+ }
+ // Call time.MarshalText() to format decoded time to RFC3339 format,
+ // and return error on time value that cannot be represented in
+ // RFC3339 format. E.g. year cannot exceed 9999, etc.
+ text, err := tm.Truncate(time.Second).MarshalText()
+ if err != nil {
+ return nil, fmt.Errorf("cbor: decoded time cannot be represented in RFC3339 format: %v", err)
+ }
+ return string(text), nil
+
+ case TimeTagToRFC3339Nano:
+ if tagNum == 1 {
+ tm = tm.UTC()
+ }
+ // Call time.MarshalText() to format decoded time to RFC3339 format,
+ // and return error on time value that cannot be represented in
+ // RFC3339 format with sub-second precision.
+ text, err := tm.MarshalText()
+ if err != nil {
+ return nil, fmt.Errorf("cbor: decoded time cannot be represented in RFC3339 format with sub-second precision: %v", err)
+ }
+ return string(text), nil
+
+ default:
+ // not reachable
+ }
+
+ case tagNumUnsignedBignum:
+ b, _ := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+
+ case tagNumNegativeBignum:
+ b, _ := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+
+ case tagNumExpectedLaterEncodingBase64URL, tagNumExpectedLaterEncodingBase64, tagNumExpectedLaterEncodingBase16:
+ // If conversion for interoperability with text encodings is not configured,
+ // treat tags 21-23 as unregistered tags.
+ if d.dm.byteStringToString == ByteStringToStringAllowedWithExpectedLaterEncoding ||
+ d.dm.byteStringExpectedFormat != ByteStringExpectedFormatNone {
+ d.expectedLaterEncodingTags = append(d.expectedLaterEncodingTags, tagNum)
+ defer func() {
+ d.expectedLaterEncodingTags = d.expectedLaterEncodingTags[:len(d.expectedLaterEncodingTags)-1]
+ }()
+ return d.parse(false)
+ }
+ }
+
+ if d.dm.tags != nil {
+ // Parse to specified type if tag number is registered.
+ tagNums := []uint64{tagNum}
+ for d.nextCBORType() == cborTypeTag {
+ _, _, num := d.getHead()
+ tagNums = append(tagNums, num)
+ }
+ registeredType := d.dm.tags.getTypeFromTagNum(tagNums)
+ if registeredType != nil {
+ d.off = tagOff
+ rv := reflect.New(registeredType)
+ if err := d.parseToValue(rv.Elem(), getTypeInfo(registeredType)); err != nil {
+ return nil, err
+ }
+ return rv.Elem().Interface(), nil
+ }
+ }
+
+ // Parse tag content
+ d.off = contentOff
+ content, err := d.parse(false)
+ if err != nil {
+ return nil, err
+ }
+ if d.dm.unrecognizedTagToAny == UnrecognizedTagContentToAny {
+ return content, nil
+ }
+ return Tag{tagNum, content}, nil
+
+ case cborTypePrimitives:
+ _, ai, val := d.getHead()
+ if ai <= 24 && d.dm.simpleValues.rejected[SimpleValue(val)] {
+ return nil, &UnacceptableDataItemError{
+ CBORType: t.String(),
+ Message: "simple value " + strconv.FormatInt(int64(val), 10) + " is not recognized",
+ }
+ }
+ if ai < 20 || ai == 24 {
+ return SimpleValue(val), nil
+ }
+
+ switch ai {
+ case additionalInformationAsFalse,
+ additionalInformationAsTrue:
+ return (ai == additionalInformationAsTrue), nil
+
+ case additionalInformationAsNull,
+ additionalInformationAsUndefined:
+ return nil, nil
+
+ case additionalInformationAsFloat16:
+ f := float64(float16.Frombits(uint16(val)).Float32())
+ return f, nil
+
+ case additionalInformationAsFloat32:
+ f := float64(math.Float32frombits(uint32(val)))
+ return f, nil
+
+ case additionalInformationAsFloat64:
+ f := math.Float64frombits(val)
+ return f, nil
+ }
+
+ case cborTypeArray:
+ return d.parseArray()
+
+ case cborTypeMap:
+ if d.dm.defaultMapType != nil {
+ m := reflect.New(d.dm.defaultMapType)
+ err := d.parseToValue(m, getTypeInfo(m.Elem().Type()))
+ if err != nil {
+ return nil, err
+ }
+ return m.Elem().Interface(), nil
+ }
+ return d.parseMap()
+ }
+
+ return nil, nil
+}
+
+// parseByteString parses a CBOR encoded byte string. The returned byte slice
+// may be backed directly by the input. The second return value will be true if
+// and only if the slice is backed by a copy of the input. Callers are
+// responsible for making a copy if necessary.
+func (d *decoder) parseByteString() ([]byte, bool) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ if !indefiniteLength {
+ b := d.data[d.off : d.off+int(val)]
+ d.off += int(val)
+ return b, false
+ }
+ // Process indefinite length string chunks.
+ b := []byte{}
+ for !d.foundBreak() {
+ _, _, val = d.getHead()
+ b = append(b, d.data[d.off:d.off+int(val)]...)
+ d.off += int(val)
+ }
+ return b, true
+}
+
+// applyByteStringTextConversion converts bytes read from a byte string to or from a configured text
+// encoding. If no transformation was performed (because it was not required), the original byte
+// slice is returned and the bool return value is false. Otherwise, a new slice containing the
+// converted bytes is returned along with the bool value true.
+func (d *decoder) applyByteStringTextConversion(
+ src []byte,
+ dstType reflect.Type,
+) (
+ dst []byte,
+ transformed bool,
+ err error,
+) {
+ switch dstType.Kind() {
+ case reflect.String:
+ if d.dm.byteStringToString != ByteStringToStringAllowedWithExpectedLaterEncoding || len(d.expectedLaterEncodingTags) == 0 {
+ return src, false, nil
+ }
+
+ switch d.expectedLaterEncodingTags[len(d.expectedLaterEncodingTags)-1] {
+ case tagNumExpectedLaterEncodingBase64URL:
+ encoded := make([]byte, base64.RawURLEncoding.EncodedLen(len(src)))
+ base64.RawURLEncoding.Encode(encoded, src)
+ return encoded, true, nil
+
+ case tagNumExpectedLaterEncodingBase64:
+ encoded := make([]byte, base64.StdEncoding.EncodedLen(len(src)))
+ base64.StdEncoding.Encode(encoded, src)
+ return encoded, true, nil
+
+ case tagNumExpectedLaterEncodingBase16:
+ encoded := make([]byte, hex.EncodedLen(len(src)))
+ hex.Encode(encoded, src)
+ return encoded, true, nil
+
+ default:
+ // If this happens, there is a bug: the decoder has pushed an invalid
+ // "expected later encoding" tag to the stack.
+ panic(fmt.Sprintf("unrecognized expected later encoding tag: %d", d.expectedLaterEncodingTags))
+ }
+
+ case reflect.Slice:
+ if dstType.Elem().Kind() != reflect.Uint8 || len(d.expectedLaterEncodingTags) > 0 {
+ // Either the destination is not a slice of bytes, or the encoder that
+ // produced the input indicated an expected text encoding tag and therefore
+ // the content of the byte string has NOT been text encoded.
+ return src, false, nil
+ }
+
+ switch d.dm.byteStringExpectedFormat {
+ case ByteStringExpectedBase64URL:
+ decoded := make([]byte, base64.RawURLEncoding.DecodedLen(len(src)))
+ n, err := base64.RawURLEncoding.Decode(decoded, src)
+ if err != nil {
+ return nil, false, newByteStringExpectedFormatError(ByteStringExpectedBase64URL, err)
+ }
+ return decoded[:n], true, nil
+
+ case ByteStringExpectedBase64:
+ decoded := make([]byte, base64.StdEncoding.DecodedLen(len(src)))
+ n, err := base64.StdEncoding.Decode(decoded, src)
+ if err != nil {
+ return nil, false, newByteStringExpectedFormatError(ByteStringExpectedBase64, err)
+ }
+ return decoded[:n], true, nil
+
+ case ByteStringExpectedBase16:
+ decoded := make([]byte, hex.DecodedLen(len(src)))
+ n, err := hex.Decode(decoded, src)
+ if err != nil {
+ return nil, false, newByteStringExpectedFormatError(ByteStringExpectedBase16, err)
+ }
+ return decoded[:n], true, nil
+ }
+ }
+
+ return src, false, nil
+}
+
+// parseTextString parses CBOR encoded text string. It returns a byte slice
+// to prevent creating an extra copy of string. Caller should wrap returned
+// byte slice as string when needed.
+func (d *decoder) parseTextString() ([]byte, error) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ if !indefiniteLength {
+ b := d.data[d.off : d.off+int(val)]
+ d.off += int(val)
+ if d.dm.utf8 == UTF8RejectInvalid && !utf8.Valid(b) {
+ return nil, &SemanticError{"cbor: invalid UTF-8 string"}
+ }
+ return b, nil
+ }
+ // Process indefinite length string chunks.
+ b := []byte{}
+ for !d.foundBreak() {
+ _, _, val = d.getHead()
+ x := d.data[d.off : d.off+int(val)]
+ d.off += int(val)
+ if d.dm.utf8 == UTF8RejectInvalid && !utf8.Valid(x) {
+ for !d.foundBreak() {
+ d.skip() // Skip remaining chunk on error
+ }
+ return nil, &SemanticError{"cbor: invalid UTF-8 string"}
+ }
+ b = append(b, x...)
+ }
+ return b, nil
+}
+
+func (d *decoder) parseArray() ([]interface{}, error) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if !hasSize {
+ count = d.numOfItemsUntilBreak() // peek ahead to get array size to preallocate slice for better performance
+ }
+ v := make([]interface{}, count)
+ var e interface{}
+ var err, lastErr error
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ if e, lastErr = d.parse(true); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ continue
+ }
+ v[i] = e
+ }
+ return v, err
+}
+
+func (d *decoder) parseArrayToSlice(v reflect.Value, tInfo *typeInfo) error {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if !hasSize {
+ count = d.numOfItemsUntilBreak() // peek ahead to get array size to preallocate slice for better performance
+ }
+ if v.IsNil() || v.Cap() < count || count == 0 {
+ v.Set(reflect.MakeSlice(tInfo.nonPtrType, count, count))
+ }
+ v.SetLen(count)
+ var err error
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ if lastErr := d.parseToValue(v.Index(i), tInfo.elemTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ }
+ }
+ return err
+}
+
+func (d *decoder) parseArrayToArray(v reflect.Value, tInfo *typeInfo) error {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ gi := 0
+ vLen := v.Len()
+ var err error
+ for ci := 0; (hasSize && ci < count) || (!hasSize && !d.foundBreak()); ci++ {
+ if gi < vLen {
+ // Read CBOR array element and set array element
+ if lastErr := d.parseToValue(v.Index(gi), tInfo.elemTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ }
+ gi++
+ } else {
+ d.skip() // Skip remaining CBOR array element
+ }
+ }
+ // Set remaining Go array elements to zero values.
+ if gi < vLen {
+ zeroV := reflect.Zero(tInfo.elemTypeInfo.typ)
+ for ; gi < vLen; gi++ {
+ v.Index(gi).Set(zeroV)
+ }
+ }
+ return err
+}
+
+func (d *decoder) parseMap() (interface{}, error) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ m := make(map[interface{}]interface{})
+ var k, e interface{}
+ var err, lastErr error
+ keyCount := 0
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ // Parse CBOR map key.
+ if k, lastErr = d.parse(true); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ d.skip()
+ continue
+ }
+
+ // Detect if CBOR map key can be used as Go map key.
+ rv := reflect.ValueOf(k)
+ if !isHashableValue(rv) {
+ var converted bool
+ if d.dm.mapKeyByteString == MapKeyByteStringAllowed {
+ k, converted = convertByteSliceToByteString(k)
+ }
+ if !converted {
+ if err == nil {
+ err = &InvalidMapKeyTypeError{rv.Type().String()}
+ }
+ d.skip()
+ continue
+ }
+ }
+
+ // Parse CBOR map value.
+ if e, lastErr = d.parse(true); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ continue
+ }
+
+ // Add key-value pair to Go map.
+ m[k] = e
+
+ // Detect duplicate map key.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ newKeyCount := len(m)
+ if newKeyCount == keyCount {
+ m[k] = nil
+ err = &DupMapKeyError{k, i}
+ i++
+ // skip the rest of the map
+ for ; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ d.skip() // Skip map key
+ d.skip() // Skip map value
+ }
+ return m, err
+ }
+ keyCount = newKeyCount
+ }
+ }
+ return m, err
+}
+
+func (d *decoder) parseMapToMap(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if v.IsNil() {
+ mapsize := count
+ if !hasSize {
+ mapsize = 0
+ }
+ v.Set(reflect.MakeMapWithSize(tInfo.nonPtrType, mapsize))
+ }
+ keyType, eleType := tInfo.keyTypeInfo.typ, tInfo.elemTypeInfo.typ
+ reuseKey, reuseEle := isImmutableKind(tInfo.keyTypeInfo.kind), isImmutableKind(tInfo.elemTypeInfo.kind)
+ var keyValue, eleValue, zeroKeyValue, zeroEleValue reflect.Value
+ keyIsInterfaceType := keyType == typeIntf // If key type is interface{}, need to check if key value is hashable.
+ var err, lastErr error
+ keyCount := v.Len()
+ var existingKeys map[interface{}]bool // Store existing map keys, used for detecting duplicate map key.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ existingKeys = make(map[interface{}]bool, keyCount)
+ if keyCount > 0 {
+ vKeys := v.MapKeys()
+ for i := 0; i < len(vKeys); i++ {
+ existingKeys[vKeys[i].Interface()] = true
+ }
+ }
+ }
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ // Parse CBOR map key.
+ if !keyValue.IsValid() {
+ keyValue = reflect.New(keyType).Elem()
+ } else if !reuseKey {
+ if !zeroKeyValue.IsValid() {
+ zeroKeyValue = reflect.Zero(keyType)
+ }
+ keyValue.Set(zeroKeyValue)
+ }
+ if lastErr = d.parseToValue(keyValue, tInfo.keyTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ d.skip()
+ continue
+ }
+
+ // Detect if CBOR map key can be used as Go map key.
+ if keyIsInterfaceType && keyValue.Elem().IsValid() {
+ if !isHashableValue(keyValue.Elem()) {
+ var converted bool
+ if d.dm.mapKeyByteString == MapKeyByteStringAllowed {
+ var k interface{}
+ k, converted = convertByteSliceToByteString(keyValue.Elem().Interface())
+ if converted {
+ keyValue.Set(reflect.ValueOf(k))
+ }
+ }
+ if !converted {
+ if err == nil {
+ err = &InvalidMapKeyTypeError{keyValue.Elem().Type().String()}
+ }
+ d.skip()
+ continue
+ }
+ }
+ }
+
+ // Parse CBOR map value.
+ if !eleValue.IsValid() {
+ eleValue = reflect.New(eleType).Elem()
+ } else if !reuseEle {
+ if !zeroEleValue.IsValid() {
+ zeroEleValue = reflect.Zero(eleType)
+ }
+ eleValue.Set(zeroEleValue)
+ }
+ if lastErr := d.parseToValue(eleValue, tInfo.elemTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ continue
+ }
+
+ // Add key-value pair to Go map.
+ v.SetMapIndex(keyValue, eleValue)
+
+ // Detect duplicate map key.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ newKeyCount := v.Len()
+ if newKeyCount == keyCount {
+ kvi := keyValue.Interface()
+ if !existingKeys[kvi] {
+ v.SetMapIndex(keyValue, reflect.New(eleType).Elem())
+ err = &DupMapKeyError{kvi, i}
+ i++
+ // skip the rest of the map
+ for ; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ d.skip() // skip map key
+ d.skip() // skip map value
+ }
+ return err
+ }
+ delete(existingKeys, kvi)
+ }
+ keyCount = newKeyCount
+ }
+ }
+ return err
+}
+
+func (d *decoder) parseArrayToStruct(v reflect.Value, tInfo *typeInfo) error {
+ structType := getDecodingStructType(tInfo.nonPtrType)
+ if structType.err != nil {
+ return structType.err
+ }
+
+ if !structType.toArray {
+ t := d.nextCBORType()
+ d.skip()
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: "cannot decode CBOR array to struct without toarray option",
+ }
+ }
+
+ start := d.off
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if !hasSize {
+ count = d.numOfItemsUntilBreak() // peek ahead to get array size
+ }
+ if count != len(structType.fields) {
+ d.off = start
+ d.skip()
+ return &UnmarshalTypeError{
+ CBORType: cborTypeArray.String(),
+ GoType: tInfo.typ.String(),
+ errorMsg: "cannot decode CBOR array to struct with different number of elements",
+ }
+ }
+ var err, lastErr error
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ f := structType.fields[i]
+
+ // Get field value by index
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ fv, lastErr = getFieldValue(v, f.idx, func(v reflect.Value) (reflect.Value, error) {
+ // Return a new value for embedded field null pointer to point to, or return error.
+ if !v.CanSet() {
+ return reflect.Value{}, errors.New("cbor: cannot set embedded pointer to unexported struct: " + v.Type().String())
+ }
+ v.Set(reflect.New(v.Type().Elem()))
+ return v, nil
+ })
+ if lastErr != nil && err == nil {
+ err = lastErr
+ }
+ if !fv.IsValid() {
+ d.skip()
+ continue
+ }
+ }
+
+ if lastErr = d.parseToValue(fv, f.typInfo); lastErr != nil {
+ if err == nil {
+ if typeError, ok := lastErr.(*UnmarshalTypeError); ok {
+ typeError.StructFieldName = tInfo.typ.String() + "." + f.name
+ err = typeError
+ } else {
+ err = lastErr
+ }
+ }
+ }
+ }
+ return err
+}
+
+// parseMapToStruct needs to be fast so gocyclo can be ignored for now.
+func (d *decoder) parseMapToStruct(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo
+ structType := getDecodingStructType(tInfo.nonPtrType)
+ if structType.err != nil {
+ return structType.err
+ }
+
+ if structType.toArray {
+ t := d.nextCBORType()
+ d.skip()
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: "cannot decode CBOR map to struct with toarray option",
+ }
+ }
+
+ var err, lastErr error
+
+ // Get CBOR map size
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+
+ // Keeps track of matched struct fields
+ var foundFldIdx []bool
+ {
+ const maxStackFields = 128
+ if nfields := len(structType.fields); nfields <= maxStackFields {
+ // For structs with typical field counts, expect that this can be
+ // stack-allocated.
+ var a [maxStackFields]bool
+ foundFldIdx = a[:nfields]
+ } else {
+ foundFldIdx = make([]bool, len(structType.fields))
+ }
+ }
+
+ // Keeps track of CBOR map keys to detect duplicate map key
+ keyCount := 0
+ var mapKeys map[interface{}]struct{}
+
+ errOnUnknownField := (d.dm.extraReturnErrors & ExtraDecErrorUnknownField) > 0
+
+MapEntryLoop:
+ for j := 0; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ var f *field
+
+ // If duplicate field detection is enabled and the key at index j did not match any
+ // field, k will hold the map key.
+ var k interface{}
+
+ t := d.nextCBORType()
+ if t == cborTypeTextString || (t == cborTypeByteString && d.dm.fieldNameByteString == FieldNameByteStringAllowed) {
+ var keyBytes []byte
+ if t == cborTypeTextString {
+ keyBytes, lastErr = d.parseTextString()
+ if lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ d.skip() // skip value
+ continue
+ }
+ } else { // cborTypeByteString
+ keyBytes, _ = d.parseByteString()
+ }
+
+ // Check for exact match on field name.
+ if i, ok := structType.fieldIndicesByName[string(keyBytes)]; ok {
+ fld := structType.fields[i]
+
+ if !foundFldIdx[i] {
+ f = fld
+ foundFldIdx[i] = true
+ } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ err = &DupMapKeyError{fld.name, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ } else {
+ // discard repeated match
+ d.skip()
+ continue MapEntryLoop
+ }
+ }
+
+ // Find field with case-insensitive match
+ if f == nil && d.dm.fieldNameMatching == FieldNameMatchingPreferCaseSensitive {
+ keyLen := len(keyBytes)
+ keyString := string(keyBytes)
+ for i := 0; i < len(structType.fields); i++ {
+ fld := structType.fields[i]
+ if len(fld.name) == keyLen && strings.EqualFold(fld.name, keyString) {
+ if !foundFldIdx[i] {
+ f = fld
+ foundFldIdx[i] = true
+ } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ err = &DupMapKeyError{keyString, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ } else {
+ // discard repeated match
+ d.skip()
+ continue MapEntryLoop
+ }
+ break
+ }
+ }
+ }
+
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF && f == nil {
+ k = string(keyBytes)
+ }
+ } else if t <= cborTypeNegativeInt { // uint/int
+ var nameAsInt int64
+
+ if t == cborTypePositiveInt {
+ _, _, val := d.getHead()
+ nameAsInt = int64(val)
+ } else {
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ if err == nil {
+ err = &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf(int64(0)).String(),
+ errorMsg: "-1-" + strconv.FormatUint(val, 10) + " overflows Go's int64",
+ }
+ }
+ d.skip() // skip value
+ continue
+ }
+ nameAsInt = int64(-1) ^ int64(val)
+ }
+
+ // Find field
+ for i := 0; i < len(structType.fields); i++ {
+ fld := structType.fields[i]
+ if fld.keyAsInt && fld.nameAsInt == nameAsInt {
+ if !foundFldIdx[i] {
+ f = fld
+ foundFldIdx[i] = true
+ } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ err = &DupMapKeyError{nameAsInt, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ } else {
+ // discard repeated match
+ d.skip()
+ continue MapEntryLoop
+ }
+ break
+ }
+ }
+
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF && f == nil {
+ k = nameAsInt
+ }
+ } else {
+ if err == nil {
+ err = &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf("").String(),
+ errorMsg: "map key is of type " + t.String() + " and cannot be used to match struct field name",
+ }
+ }
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ // parse key
+ k, lastErr = d.parse(true)
+ if lastErr != nil {
+ d.skip() // skip value
+ continue
+ }
+ // Detect if CBOR map key can be used as Go map key.
+ if !isHashableValue(reflect.ValueOf(k)) {
+ d.skip() // skip value
+ continue
+ }
+ } else {
+ d.skip() // skip key
+ }
+ }
+
+ if f == nil {
+ if errOnUnknownField {
+ err = &UnknownFieldError{j}
+ d.skip() // Skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ }
+
+ // Two map keys that match the same struct field are immediately considered
+ // duplicates. This check detects duplicates between two map keys that do
+ // not match a struct field. If unknown field errors are enabled, then this
+ // check is never reached.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ if mapKeys == nil {
+ mapKeys = make(map[interface{}]struct{}, 1)
+ }
+ mapKeys[k] = struct{}{}
+ newKeyCount := len(mapKeys)
+ if newKeyCount == keyCount {
+ err = &DupMapKeyError{k, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ }
+ keyCount = newKeyCount
+ }
+
+ d.skip() // Skip value
+ continue
+ }
+
+ // Get field value by index
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ fv, lastErr = getFieldValue(v, f.idx, func(v reflect.Value) (reflect.Value, error) {
+ // Return a new value for embedded field null pointer to point to, or return error.
+ if !v.CanSet() {
+ return reflect.Value{}, errors.New("cbor: cannot set embedded pointer to unexported struct: " + v.Type().String())
+ }
+ v.Set(reflect.New(v.Type().Elem()))
+ return v, nil
+ })
+ if lastErr != nil && err == nil {
+ err = lastErr
+ }
+ if !fv.IsValid() {
+ d.skip()
+ continue
+ }
+ }
+
+ if lastErr = d.parseToValue(fv, f.typInfo); lastErr != nil {
+ if err == nil {
+ if typeError, ok := lastErr.(*UnmarshalTypeError); ok {
+ typeError.StructFieldName = tInfo.nonPtrType.String() + "." + f.name
+ err = typeError
+ } else {
+ err = lastErr
+ }
+ }
+ }
+ }
+ return err
+}
+
+// validRegisteredTagNums verifies that tag numbers match registered tag numbers of type t.
+// validRegisteredTagNums assumes next CBOR data type is tag. It scans all tag numbers, and stops at tag content.
+func (d *decoder) validRegisteredTagNums(registeredTag *tagItem) error {
+ // Scan until next cbor data is tag content.
+ tagNums := make([]uint64, 0, 1)
+ for d.nextCBORType() == cborTypeTag {
+ _, _, val := d.getHead()
+ tagNums = append(tagNums, val)
+ }
+
+ if !registeredTag.equalTagNum(tagNums) {
+ return &WrongTagError{registeredTag.contentType, registeredTag.num, tagNums}
+ }
+ return nil
+}
+
+func (d *decoder) getRegisteredTagItem(vt reflect.Type) *tagItem {
+ if d.dm.tags != nil {
+ return d.dm.tags.getTagItemFromType(vt)
+ }
+ return nil
+}
+
+// skip moves data offset to the next item. skip assumes data is well-formed,
+// and does not perform bounds checking.
+func (d *decoder) skip() {
+ t, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+
+ if indefiniteLength {
+ switch t {
+ case cborTypeByteString, cborTypeTextString, cborTypeArray, cborTypeMap:
+ for {
+ if isBreakFlag(d.data[d.off]) {
+ d.off++
+ return
+ }
+ d.skip()
+ }
+ }
+ }
+
+ switch t {
+ case cborTypeByteString, cborTypeTextString:
+ d.off += int(val)
+
+ case cborTypeArray:
+ for i := 0; i < int(val); i++ {
+ d.skip()
+ }
+
+ case cborTypeMap:
+ for i := 0; i < int(val)*2; i++ {
+ d.skip()
+ }
+
+ case cborTypeTag:
+ d.skip()
+ }
+}
+
+func (d *decoder) getHeadWithIndefiniteLengthFlag() (
+ t cborType,
+ ai byte,
+ val uint64,
+ indefiniteLength bool,
+) {
+ t, ai, val = d.getHead()
+ indefiniteLength = additionalInformation(ai).isIndefiniteLength()
+ return
+}
+
+// getHead assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) getHead() (t cborType, ai byte, val uint64) {
+ t, ai = parseInitialByte(d.data[d.off])
+ val = uint64(ai)
+ d.off++
+
+ if ai <= maxAdditionalInformationWithoutArgument {
+ return
+ }
+
+ if ai == additionalInformationWith1ByteArgument {
+ val = uint64(d.data[d.off])
+ d.off++
+ return
+ }
+
+ if ai == additionalInformationWith2ByteArgument {
+ const argumentSize = 2
+ val = uint64(binary.BigEndian.Uint16(d.data[d.off : d.off+argumentSize]))
+ d.off += argumentSize
+ return
+ }
+
+ if ai == additionalInformationWith4ByteArgument {
+ const argumentSize = 4
+ val = uint64(binary.BigEndian.Uint32(d.data[d.off : d.off+argumentSize]))
+ d.off += argumentSize
+ return
+ }
+
+ if ai == additionalInformationWith8ByteArgument {
+ const argumentSize = 8
+ val = binary.BigEndian.Uint64(d.data[d.off : d.off+argumentSize])
+ d.off += argumentSize
+ return
+ }
+ return
+}
+
+func (d *decoder) numOfItemsUntilBreak() int {
+ savedOff := d.off
+ i := 0
+ for !d.foundBreak() {
+ d.skip()
+ i++
+ }
+ d.off = savedOff
+ return i
+}
+
+// foundBreak returns true if next byte is CBOR break code and moves cursor by 1,
+// otherwise it returns false.
+// foundBreak assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) foundBreak() bool {
+ if isBreakFlag(d.data[d.off]) {
+ d.off++
+ return true
+ }
+ return false
+}
+
+func (d *decoder) reset(data []byte) {
+ d.data = data
+ d.off = 0
+ d.expectedLaterEncodingTags = d.expectedLaterEncodingTags[:0]
+}
+
+func (d *decoder) nextCBORType() cborType {
+ return getType(d.data[d.off])
+}
+
+func (d *decoder) nextCBORNil() bool {
+ return d.data[d.off] == 0xf6 || d.data[d.off] == 0xf7
+}
+
+var (
+ typeIntf = reflect.TypeOf([]interface{}(nil)).Elem()
+ typeTime = reflect.TypeOf(time.Time{})
+ typeBigInt = reflect.TypeOf(big.Int{})
+ typeUnmarshaler = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
+ typeBinaryUnmarshaler = reflect.TypeOf((*encoding.BinaryUnmarshaler)(nil)).Elem()
+ typeString = reflect.TypeOf("")
+ typeByteSlice = reflect.TypeOf([]byte(nil))
+)
+
+func fillNil(_ cborType, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Slice, reflect.Map, reflect.Interface, reflect.Ptr:
+ v.Set(reflect.Zero(v.Type()))
+ return nil
+ }
+ return nil
+}
+
+func fillPositiveInt(t cborType, val uint64, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ if val > math.MaxInt64 {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ if v.OverflowInt(int64(val)) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetInt(int64(val))
+ return nil
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ if v.OverflowUint(val) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetUint(val)
+ return nil
+
+ case reflect.Float32, reflect.Float64:
+ f := float64(val)
+ v.SetFloat(f)
+ return nil
+ }
+
+ if v.Type() == typeBigInt {
+ i := new(big.Int).SetUint64(val)
+ v.Set(reflect.ValueOf(*i))
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillNegativeInt(t cborType, val int64, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ if v.OverflowInt(val) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatInt(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetInt(val)
+ return nil
+
+ case reflect.Float32, reflect.Float64:
+ f := float64(val)
+ v.SetFloat(f)
+ return nil
+ }
+ if v.Type() == typeBigInt {
+ i := new(big.Int).SetInt64(val)
+ v.Set(reflect.ValueOf(*i))
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillBool(t cborType, val bool, v reflect.Value) error {
+ if v.Kind() == reflect.Bool {
+ v.SetBool(val)
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillFloat(t cborType, val float64, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Float32, reflect.Float64:
+ if v.OverflowFloat(val) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatFloat(val, 'E', -1, 64) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetFloat(val)
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillByteString(t cborType, val []byte, shared bool, v reflect.Value, bsts ByteStringToStringMode, bum BinaryUnmarshalerMode) error {
+ if bum == BinaryUnmarshalerByteString && reflect.PtrTo(v.Type()).Implements(typeBinaryUnmarshaler) {
+ if v.CanAddr() {
+ v = v.Addr()
+ if u, ok := v.Interface().(encoding.BinaryUnmarshaler); ok {
+ // The contract of BinaryUnmarshaler forbids
+ // retaining the input bytes, so no copying is
+ // required even if val is shared.
+ return u.UnmarshalBinary(val)
+ }
+ }
+ return errors.New("cbor: cannot set new value for " + v.Type().String())
+ }
+ if bsts != ByteStringToStringForbidden && v.Kind() == reflect.String {
+ v.SetString(string(val))
+ return nil
+ }
+ if v.Kind() == reflect.Slice && v.Type().Elem().Kind() == reflect.Uint8 {
+ src := val
+ if shared {
+ // SetBytes shares the underlying bytes of the source slice.
+ src = make([]byte, len(val))
+ copy(src, val)
+ }
+ v.SetBytes(src)
+ return nil
+ }
+ if v.Kind() == reflect.Array && v.Type().Elem().Kind() == reflect.Uint8 {
+ vLen := v.Len()
+ i := 0
+ for ; i < vLen && i < len(val); i++ {
+ v.Index(i).SetUint(uint64(val[i]))
+ }
+ // Set remaining Go array elements to zero values.
+ if i < vLen {
+ zeroV := reflect.Zero(reflect.TypeOf(byte(0)))
+ for ; i < vLen; i++ {
+ v.Index(i).Set(zeroV)
+ }
+ }
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillTextString(t cborType, val []byte, v reflect.Value) error {
+ if v.Kind() == reflect.String {
+ v.SetString(string(val))
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func isImmutableKind(k reflect.Kind) bool {
+ switch k {
+ case reflect.Bool,
+ reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
+ reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
+ reflect.Float32, reflect.Float64,
+ reflect.String:
+ return true
+
+ default:
+ return false
+ }
+}
+
+func isHashableValue(rv reflect.Value) bool {
+ switch rv.Kind() {
+ case reflect.Slice, reflect.Map, reflect.Func:
+ return false
+
+ case reflect.Struct:
+ switch rv.Type() {
+ case typeTag:
+ tag := rv.Interface().(Tag)
+ return isHashableValue(reflect.ValueOf(tag.Content))
+ case typeBigInt:
+ return false
+ }
+ }
+ return true
+}
+
+// convertByteSliceToByteString converts []byte to ByteString if
+// - v is []byte type, or
+// - v is Tag type and tag content type is []byte
+// This function also handles nested tags.
+// CBOR data is already verified to be well-formed before this function is used,
+// so the recursion won't exceed max nested levels.
+func convertByteSliceToByteString(v interface{}) (interface{}, bool) {
+ switch v := v.(type) {
+ case []byte:
+ return ByteString(v), true
+
+ case Tag:
+ content, converted := convertByteSliceToByteString(v.Content)
+ if converted {
+ return Tag{Number: v.Number, Content: content}, true
+ }
+ }
+ return v, false
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/diagnose.go b/vendor/github.com/fxamacker/cbor/v2/diagnose.go
new file mode 100644
index 0000000000..44afb86608
--- /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 0000000000..23f68b984c
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/doc.go
@@ -0,0 +1,129 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+/*
+Package cbor is a modern CBOR codec (RFC 8949 & RFC 7049) with CBOR tags,
+Go struct tags (toarray/keyasint/omitempty), Core Deterministic Encoding,
+CTAP2, Canonical CBOR, float64->32->16, and duplicate map key detection.
+
+Encoding options allow "preferred serialization" by encoding integers and floats
+to their smallest forms (e.g. float16) when values fit.
+
+Struct tags like "keyasint", "toarray" and "omitempty" make CBOR data smaller
+and easier to use with structs.
+
+For example, "toarray" tag makes struct fields encode to CBOR array elements. And
+"keyasint" makes a field encode to an element of CBOR map with specified int key.
+
+Latest docs can be viewed at https://github.com/fxamacker/cbor#cbor-library-in-go
+
+# Basics
+
+The Quick Start guide is at https://github.com/fxamacker/cbor#quick-start
+
+Function signatures identical to encoding/json include:
+
+ Marshal, Unmarshal, NewEncoder, NewDecoder, (*Encoder).Encode, (*Decoder).Decode.
+
+Standard interfaces include:
+
+ BinaryMarshaler, BinaryUnmarshaler, Marshaler, and Unmarshaler.
+
+Custom encoding and decoding is possible by implementing standard interfaces for
+user-defined Go types.
+
+Codec functions are available at package-level (using defaults options) or by
+creating modes from options at runtime.
+
+"Mode" in this API means definite way of encoding (EncMode) or decoding (DecMode).
+
+EncMode and DecMode interfaces are created from EncOptions or DecOptions structs.
+
+ em, err := cbor.EncOptions{...}.EncMode()
+ em, err := cbor.CanonicalEncOptions().EncMode()
+ em, err := cbor.CTAP2EncOptions().EncMode()
+
+Modes use immutable options to avoid side-effects and simplify concurrency. Behavior of
+modes won't accidentally change at runtime after they're created.
+
+Modes are intended to be reused and are safe for concurrent use.
+
+EncMode and DecMode Interfaces
+
+ // EncMode interface uses immutable options and is safe for concurrent use.
+ type EncMode interface {
+ Marshal(v interface{}) ([]byte, error)
+ NewEncoder(w io.Writer) *Encoder
+ EncOptions() EncOptions // returns copy of options
+ }
+
+ // DecMode interface uses immutable options and is safe for concurrent use.
+ type DecMode interface {
+ Unmarshal(data []byte, v interface{}) error
+ NewDecoder(r io.Reader) *Decoder
+ DecOptions() DecOptions // returns copy of options
+ }
+
+Using Default Encoding Mode
+
+ b, err := cbor.Marshal(v)
+
+ encoder := cbor.NewEncoder(w)
+ err = encoder.Encode(v)
+
+Using Default Decoding Mode
+
+ err := cbor.Unmarshal(b, &v)
+
+ decoder := cbor.NewDecoder(r)
+ err = decoder.Decode(&v)
+
+Creating and Using Encoding Modes
+
+ // Create EncOptions using either struct literal or a function.
+ opts := cbor.CanonicalEncOptions()
+
+ // If needed, modify encoding options
+ opts.Time = cbor.TimeUnix
+
+ // Create reusable EncMode interface with immutable options, safe for concurrent use.
+ em, err := opts.EncMode()
+
+ // Use EncMode like encoding/json, with same function signatures.
+ b, err := em.Marshal(v)
+ // or
+ encoder := em.NewEncoder(w)
+ err := encoder.Encode(v)
+
+ // NOTE: Both em.Marshal(v) and encoder.Encode(v) use encoding options
+ // specified during creation of em (encoding mode).
+
+# CBOR Options
+
+Predefined Encoding Options: https://github.com/fxamacker/cbor#predefined-encoding-options
+
+Encoding Options: https://github.com/fxamacker/cbor#encoding-options
+
+Decoding Options: https://github.com/fxamacker/cbor#decoding-options
+
+# Struct Tags
+
+Struct tags like `cbor:"name,omitempty"` and `json:"name,omitempty"` work as expected.
+If both struct tags are specified then `cbor` is used.
+
+Struct tags like "keyasint", "toarray", and "omitempty" make it easy to use
+very compact formats like COSE and CWT (CBOR Web Tokens) with structs.
+
+For example, "toarray" makes struct fields encode to array elements. And "keyasint"
+makes struct fields encode to elements of CBOR map with int keys.
+
+https://raw.githubusercontent.com/fxamacker/images/master/cbor/v2.0.0/cbor_easy_api.png
+
+Struct tags are listed at https://github.com/fxamacker/cbor#struct-tags-1
+
+# Tests and Fuzzing
+
+Over 375 tests are included in this package. Cover-guided fuzzing is handled by
+a private fuzzer that replaced fxamacker/cbor-fuzz years ago.
+*/
+package cbor
diff --git a/vendor/github.com/fxamacker/cbor/v2/encode.go b/vendor/github.com/fxamacker/cbor/v2/encode.go
new file mode 100644
index 0000000000..6508e291d6
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode.go
@@ -0,0 +1,1989 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "encoding"
+ "encoding/binary"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "math/big"
+ "math/rand"
+ "reflect"
+ "sort"
+ "strconv"
+ "sync"
+ "time"
+
+ "github.com/x448/float16"
+)
+
+// Marshal returns the CBOR encoding of v using default encoding options.
+// See EncOptions for encoding options.
+//
+// Marshal uses the following encoding rules:
+//
+// If value implements the Marshaler interface, Marshal calls its
+// MarshalCBOR method.
+//
+// If value implements encoding.BinaryMarshaler, Marhsal calls its
+// MarshalBinary method and encode it as CBOR byte string.
+//
+// Boolean values encode as CBOR booleans (type 7).
+//
+// Positive integer values encode as CBOR positive integers (type 0).
+//
+// Negative integer values encode as CBOR negative integers (type 1).
+//
+// Floating point values encode as CBOR floating points (type 7).
+//
+// String values encode as CBOR text strings (type 3).
+//
+// []byte values encode as CBOR byte strings (type 2).
+//
+// Array and slice values encode as CBOR arrays (type 4).
+//
+// Map values encode as CBOR maps (type 5).
+//
+// Struct values encode as CBOR maps (type 5). Each exported struct field
+// becomes a pair with field name encoded as CBOR text string (type 3) and
+// field value encoded based on its type. See struct tag option "keyasint"
+// to encode field name as CBOR integer (type 0 and 1). Also see struct
+// tag option "toarray" for special field "_" to encode struct values as
+// CBOR array (type 4).
+//
+// Marshal supports format string stored under the "cbor" key in the struct
+// field's tag. CBOR format string can specify the name of the field,
+// "omitempty" and "keyasint" options, and special case "-" for field omission.
+// If "cbor" key is absent, Marshal uses "json" key.
+//
+// Struct field name is treated as integer if it has "keyasint" option in
+// its format string. The format string must specify an integer as its
+// field name.
+//
+// Special struct field "_" is used to specify struct level options, such as
+// "toarray". "toarray" option enables Go struct to be encoded as CBOR array.
+// "omitempty" is disabled by "toarray" to ensure that the same number
+// of elements are encoded every time.
+//
+// Anonymous struct fields are marshaled as if their exported fields
+// were fields in the outer struct. Marshal follows the same struct fields
+// visibility rules used by JSON encoding package.
+//
+// time.Time values encode as text strings specified in RFC3339 or numerical
+// representation of seconds since January 1, 1970 UTC depending on
+// EncOptions.Time setting. Also See EncOptions.TimeTag to encode
+// time.Time as CBOR tag with tag number 0 or 1.
+//
+// big.Int values encode as CBOR integers (type 0 and 1) if values fit.
+// Otherwise, big.Int values encode as CBOR bignums (tag 2 and 3). See
+// EncOptions.BigIntConvert to always encode big.Int values as CBOR
+// bignums.
+//
+// Pointer values encode as the value pointed to.
+//
+// Interface values encode as the value stored in the interface.
+//
+// Nil slice/map/pointer/interface values encode as CBOR nulls (type 7).
+//
+// Values of other types cannot be encoded in CBOR. Attempting
+// to encode such a value causes Marshal to return an UnsupportedTypeError.
+func Marshal(v interface{}) ([]byte, error) {
+ return defaultEncMode.Marshal(v)
+}
+
+// MarshalToBuffer encodes v into provided buffer (instead of using built-in buffer pool)
+// and uses default encoding options.
+//
+// NOTE: Unlike Marshal, the buffer provided to MarshalToBuffer can contain
+// partially encoded data if error is returned.
+//
+// See Marshal for more details.
+func MarshalToBuffer(v interface{}, buf *bytes.Buffer) error {
+ return defaultEncMode.MarshalToBuffer(v, buf)
+}
+
+// Marshaler is the interface implemented by types that can marshal themselves
+// into valid CBOR.
+type Marshaler interface {
+ MarshalCBOR() ([]byte, error)
+}
+
+// MarshalerError represents error from checking encoded CBOR data item
+// returned from MarshalCBOR for well-formedness and some very limited tag validation.
+type MarshalerError struct {
+ typ reflect.Type
+ err error
+}
+
+func (e *MarshalerError) Error() string {
+ return "cbor: error calling MarshalCBOR for type " +
+ e.typ.String() +
+ ": " + e.err.Error()
+}
+
+func (e *MarshalerError) Unwrap() error {
+ return e.err
+}
+
+// UnsupportedTypeError is returned by Marshal when attempting to encode value
+// of an unsupported type.
+type UnsupportedTypeError struct {
+ Type reflect.Type
+}
+
+func (e *UnsupportedTypeError) Error() string {
+ return "cbor: unsupported type: " + e.Type.String()
+}
+
+// UnsupportedValueError is returned by Marshal when attempting to encode an
+// unsupported value.
+type UnsupportedValueError struct {
+ msg string
+}
+
+func (e *UnsupportedValueError) Error() string {
+ return "cbor: unsupported value: " + e.msg
+}
+
+// SortMode identifies supported sorting order.
+type SortMode int
+
+const (
+ // SortNone encodes map pairs and struct fields in an arbitrary order.
+ SortNone SortMode = 0
+
+ // SortLengthFirst causes map keys or struct fields to be sorted such that:
+ // - If two keys have different lengths, the shorter one sorts earlier;
+ // - If two keys have the same length, the one with the lower value in
+ // (byte-wise) lexical order sorts earlier.
+ // It is used in "Canonical CBOR" encoding in RFC 7049 3.9.
+ SortLengthFirst SortMode = 1
+
+ // SortBytewiseLexical causes map keys or struct fields to be sorted in the
+ // bytewise lexicographic order of their deterministic CBOR encodings.
+ // It is used in "CTAP2 Canonical CBOR" and "Core Deterministic Encoding"
+ // in RFC 7049bis.
+ SortBytewiseLexical SortMode = 2
+
+ // SortShuffle encodes map pairs and struct fields in a shuffled
+ // order. This mode does not guarantee an unbiased permutation, but it
+ // does guarantee that the runtime of the shuffle algorithm used will be
+ // constant.
+ SortFastShuffle SortMode = 3
+
+ // SortCanonical is used in "Canonical CBOR" encoding in RFC 7049 3.9.
+ SortCanonical SortMode = SortLengthFirst
+
+ // SortCTAP2 is used in "CTAP2 Canonical CBOR".
+ SortCTAP2 SortMode = SortBytewiseLexical
+
+ // SortCoreDeterministic is used in "Core Deterministic Encoding" in RFC 7049bis.
+ SortCoreDeterministic SortMode = SortBytewiseLexical
+
+ maxSortMode SortMode = 4
+)
+
+func (sm SortMode) valid() bool {
+ return sm >= 0 && sm < maxSortMode
+}
+
+// StringMode specifies how to encode Go string values.
+type StringMode int
+
+const (
+ // StringToTextString encodes Go string to CBOR text string (major type 3).
+ StringToTextString StringMode = iota
+
+ // StringToByteString encodes Go string to CBOR byte string (major type 2).
+ StringToByteString
+)
+
+func (st StringMode) cborType() (cborType, error) {
+ switch st {
+ case StringToTextString:
+ return cborTypeTextString, nil
+
+ case StringToByteString:
+ return cborTypeByteString, nil
+ }
+ return 0, errors.New("cbor: invalid StringType " + strconv.Itoa(int(st)))
+}
+
+// ShortestFloatMode specifies which floating-point format should
+// be used as the shortest possible format for CBOR encoding.
+// It is not used for encoding Infinity and NaN values.
+type ShortestFloatMode int
+
+const (
+ // ShortestFloatNone makes float values encode without any conversion.
+ // This is the default for ShortestFloatMode in v1.
+ // E.g. a float32 in Go will encode to CBOR float32. And
+ // a float64 in Go will encode to CBOR float64.
+ ShortestFloatNone ShortestFloatMode = iota
+
+ // ShortestFloat16 specifies float16 as the shortest form that preserves value.
+ // E.g. if float64 can convert to float32 while preserving value, then
+ // encoding will also try to convert float32 to float16. So a float64 might
+ // encode as CBOR float64, float32 or float16 depending on the value.
+ ShortestFloat16
+
+ maxShortestFloat
+)
+
+func (sfm ShortestFloatMode) valid() bool {
+ return sfm >= 0 && sfm < maxShortestFloat
+}
+
+// NaNConvertMode specifies how to encode NaN and overrides ShortestFloatMode.
+// ShortestFloatMode is not used for encoding Infinity and NaN values.
+type NaNConvertMode int
+
+const (
+ // NaNConvert7e00 always encodes NaN to 0xf97e00 (CBOR float16 = 0x7e00).
+ NaNConvert7e00 NaNConvertMode = iota
+
+ // NaNConvertNone never modifies or converts NaN to other representations
+ // (float64 NaN stays float64, etc. even if it can use float16 without losing
+ // any bits).
+ NaNConvertNone
+
+ // NaNConvertPreserveSignal converts NaN to the smallest form that preserves
+ // value (quiet bit + payload) as described in RFC 7049bis Draft 12.
+ NaNConvertPreserveSignal
+
+ // NaNConvertQuiet always forces quiet bit = 1 and shortest form that preserves
+ // NaN payload.
+ NaNConvertQuiet
+
+ // NaNConvertReject returns UnsupportedValueError on attempts to encode a NaN value.
+ NaNConvertReject
+
+ maxNaNConvert
+)
+
+func (ncm NaNConvertMode) valid() bool {
+ return ncm >= 0 && ncm < maxNaNConvert
+}
+
+// InfConvertMode specifies how to encode Infinity and overrides ShortestFloatMode.
+// ShortestFloatMode is not used for encoding Infinity and NaN values.
+type InfConvertMode int
+
+const (
+ // InfConvertFloat16 always converts Inf to lossless IEEE binary16 (float16).
+ InfConvertFloat16 InfConvertMode = iota
+
+ // InfConvertNone never converts (used by CTAP2 Canonical CBOR).
+ InfConvertNone
+
+ // InfConvertReject returns UnsupportedValueError on attempts to encode an infinite value.
+ InfConvertReject
+
+ maxInfConvert
+)
+
+func (icm InfConvertMode) valid() bool {
+ return icm >= 0 && icm < maxInfConvert
+}
+
+// TimeMode specifies how to encode time.Time values.
+type TimeMode int
+
+const (
+ // TimeUnix causes time.Time to be encoded as epoch time in integer with second precision.
+ TimeUnix TimeMode = iota
+
+ // TimeUnixMicro causes time.Time to be encoded as epoch time in float-point rounded to microsecond precision.
+ TimeUnixMicro
+
+ // TimeUnixDynamic causes time.Time to be encoded as integer if time.Time doesn't have fractional seconds,
+ // otherwise float-point rounded to microsecond precision.
+ TimeUnixDynamic
+
+ // TimeRFC3339 causes time.Time to be encoded as RFC3339 formatted string with second precision.
+ TimeRFC3339
+
+ // TimeRFC3339Nano causes time.Time to be encoded as RFC3339 formatted string with nanosecond precision.
+ TimeRFC3339Nano
+
+ maxTimeMode
+)
+
+func (tm TimeMode) valid() bool {
+ return tm >= 0 && tm < maxTimeMode
+}
+
+// BigIntConvertMode specifies how to encode big.Int values.
+type BigIntConvertMode int
+
+const (
+ // BigIntConvertShortest makes big.Int encode to CBOR integer if value fits.
+ // E.g. if big.Int value can be converted to CBOR integer while preserving
+ // value, encoder will encode it to CBOR integer (major type 0 or 1).
+ BigIntConvertShortest BigIntConvertMode = iota
+
+ // BigIntConvertNone makes big.Int encode to CBOR bignum (tag 2 or 3) without
+ // converting it to another CBOR type.
+ BigIntConvertNone
+
+ // BigIntConvertReject returns an UnsupportedTypeError instead of marshaling a big.Int.
+ BigIntConvertReject
+
+ maxBigIntConvert
+)
+
+func (bim BigIntConvertMode) valid() bool {
+ return bim >= 0 && bim < maxBigIntConvert
+}
+
+// NilContainersMode specifies how to encode nil slices and maps.
+type NilContainersMode int
+
+const (
+ // NilContainerAsNull encodes nil slices and maps as CBOR null.
+ // This is the default.
+ NilContainerAsNull NilContainersMode = iota
+
+ // NilContainerAsEmpty encodes nil slices and maps as
+ // empty container (CBOR bytestring, array, or map).
+ NilContainerAsEmpty
+
+ maxNilContainersMode
+)
+
+func (m NilContainersMode) valid() bool {
+ return m >= 0 && m < maxNilContainersMode
+}
+
+// OmitEmptyMode specifies how to encode struct fields with omitempty tag.
+// The default behavior omits if field value would encode as empty CBOR value.
+type OmitEmptyMode int
+
+const (
+ // OmitEmptyCBORValue specifies that struct fields tagged with "omitempty"
+ // should be omitted from encoding if the field would be encoded as an empty
+ // CBOR value, such as CBOR false, 0, 0.0, nil, empty byte, empty string,
+ // empty array, or empty map.
+ OmitEmptyCBORValue OmitEmptyMode = iota
+
+ // OmitEmptyGoValue specifies that struct fields tagged with "omitempty"
+ // should be omitted from encoding if the field has an empty Go value,
+ // defined as false, 0, 0.0, a nil pointer, a nil interface value, and
+ // any empty array, slice, map, or string.
+ // This behavior is the same as the current (aka v1) encoding/json package
+ // included in Go.
+ OmitEmptyGoValue
+
+ maxOmitEmptyMode
+)
+
+func (om OmitEmptyMode) valid() bool {
+ return om >= 0 && om < maxOmitEmptyMode
+}
+
+// FieldNameMode specifies the CBOR type to use when encoding struct field names.
+type FieldNameMode int
+
+const (
+ // FieldNameToTextString encodes struct fields to CBOR text string (major type 3).
+ FieldNameToTextString FieldNameMode = iota
+
+ // FieldNameToTextString encodes struct fields to CBOR byte string (major type 2).
+ FieldNameToByteString
+
+ maxFieldNameMode
+)
+
+func (fnm FieldNameMode) valid() bool {
+ return fnm >= 0 && fnm < maxFieldNameMode
+}
+
+// ByteSliceLaterFormatMode specifies which later format conversion hint (CBOR tag 21-23)
+// to include (if any) when encoding Go byte slice to CBOR byte string. The encoder will
+// always encode unmodified bytes from the byte slice and just wrap it within
+// CBOR tag 21, 22, or 23 if specified.
+// See "Expected Later Encoding for CBOR-to-JSON Converters" in RFC 8949 Section 3.4.5.2.
+type ByteSliceLaterFormatMode int
+
+const (
+ // ByteSliceLaterFormatNone encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // without adding CBOR tag 21, 22, or 23.
+ ByteSliceLaterFormatNone ByteSliceLaterFormatMode = iota
+
+ // ByteSliceLaterFormatBase64URL encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // inside CBOR tag 21 (expected later conversion to base64url encoding, see RFC 8949 Section 3.4.5.2).
+ ByteSliceLaterFormatBase64URL
+
+ // ByteSliceLaterFormatBase64 encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // inside CBOR tag 22 (expected later conversion to base64 encoding, see RFC 8949 Section 3.4.5.2).
+ ByteSliceLaterFormatBase64
+
+ // ByteSliceLaterFormatBase16 encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // inside CBOR tag 23 (expected later conversion to base16 encoding, see RFC 8949 Section 3.4.5.2).
+ ByteSliceLaterFormatBase16
+)
+
+func (bsefm ByteSliceLaterFormatMode) encodingTag() (uint64, error) {
+ switch bsefm {
+ case ByteSliceLaterFormatNone:
+ return 0, nil
+
+ case ByteSliceLaterFormatBase64URL:
+ return tagNumExpectedLaterEncodingBase64URL, nil
+
+ case ByteSliceLaterFormatBase64:
+ return tagNumExpectedLaterEncodingBase64, nil
+
+ case ByteSliceLaterFormatBase16:
+ return tagNumExpectedLaterEncodingBase16, nil
+ }
+ return 0, errors.New("cbor: invalid ByteSliceLaterFormat " + strconv.Itoa(int(bsefm)))
+}
+
+// ByteArrayMode specifies how to encode byte arrays.
+type ByteArrayMode int
+
+const (
+ // ByteArrayToByteSlice encodes byte arrays the same way that a byte slice with identical
+ // length and contents is encoded.
+ ByteArrayToByteSlice ByteArrayMode = iota
+
+ // ByteArrayToArray encodes byte arrays to the CBOR array type with one unsigned integer
+ // item for each byte in the array.
+ ByteArrayToArray
+
+ maxByteArrayMode
+)
+
+func (bam ByteArrayMode) valid() bool {
+ return bam >= 0 && bam < maxByteArrayMode
+}
+
+// BinaryMarshalerMode specifies how to encode types that implement encoding.BinaryMarshaler.
+type BinaryMarshalerMode int
+
+const (
+ // BinaryMarshalerByteString encodes the output of MarshalBinary to a CBOR byte string.
+ BinaryMarshalerByteString BinaryMarshalerMode = iota
+
+ // BinaryMarshalerNone does not recognize BinaryMarshaler implementations during encode.
+ BinaryMarshalerNone
+
+ maxBinaryMarshalerMode
+)
+
+func (bmm BinaryMarshalerMode) valid() bool {
+ return bmm >= 0 && bmm < maxBinaryMarshalerMode
+}
+
+// EncOptions specifies encoding options.
+type EncOptions struct {
+ // Sort specifies sorting order.
+ Sort SortMode
+
+ // ShortestFloat specifies the shortest floating-point encoding that preserves
+ // the value being encoded.
+ ShortestFloat ShortestFloatMode
+
+ // NaNConvert specifies how to encode NaN and it overrides ShortestFloatMode.
+ NaNConvert NaNConvertMode
+
+ // InfConvert specifies how to encode Inf and it overrides ShortestFloatMode.
+ InfConvert InfConvertMode
+
+ // BigIntConvert specifies how to encode big.Int values.
+ BigIntConvert BigIntConvertMode
+
+ // Time specifies how to encode time.Time.
+ Time TimeMode
+
+ // TimeTag allows time.Time to be encoded with a tag number.
+ // RFC3339 format gets tag number 0, and numeric epoch time tag number 1.
+ TimeTag EncTagMode
+
+ // IndefLength specifies whether to allow indefinite length CBOR items.
+ IndefLength IndefLengthMode
+
+ // NilContainers specifies how to encode nil slices and maps.
+ NilContainers NilContainersMode
+
+ // TagsMd specifies whether to allow CBOR tags (major type 6).
+ TagsMd TagsMode
+
+ // OmitEmptyMode specifies how to encode struct fields with omitempty tag.
+ OmitEmpty OmitEmptyMode
+
+ // String specifies which CBOR type to use when encoding Go strings.
+ // - CBOR text string (major type 3) is default
+ // - CBOR byte string (major type 2)
+ String StringMode
+
+ // FieldName specifies the CBOR type to use when encoding struct field names.
+ FieldName FieldNameMode
+
+ // ByteSliceLaterFormat specifies which later format conversion hint (CBOR tag 21-23)
+ // to include (if any) when encoding Go byte slice to CBOR byte string. The encoder will
+ // always encode unmodified bytes from the byte slice and just wrap it within
+ // CBOR tag 21, 22, or 23 if specified.
+ // See "Expected Later Encoding for CBOR-to-JSON Converters" in RFC 8949 Section 3.4.5.2.
+ ByteSliceLaterFormat ByteSliceLaterFormatMode
+
+ // ByteArray specifies how to encode byte arrays.
+ ByteArray ByteArrayMode
+
+ // BinaryMarshaler specifies how to encode types that implement encoding.BinaryMarshaler.
+ BinaryMarshaler BinaryMarshalerMode
+}
+
+// CanonicalEncOptions returns EncOptions for "Canonical CBOR" encoding,
+// defined in RFC 7049 Section 3.9 with the following rules:
+//
+// 1. "Integers must be as small as possible."
+// 2. "The expression of lengths in major types 2 through 5 must be as short as possible."
+// 3. The keys in every map must be sorted in length-first sorting order.
+// See SortLengthFirst for details.
+// 4. "Indefinite-length items must be made into definite-length items."
+// 5. "If a protocol allows for IEEE floats, then additional canonicalization rules might
+// need to be added. One example rule might be to have all floats start as a 64-bit
+// float, then do a test conversion to a 32-bit float; if the result is the same numeric
+// value, use the shorter value and repeat the process with a test conversion to a
+// 16-bit float. (This rule selects 16-bit float for positive and negative Infinity
+// as well.) Also, there are many representations for NaN. If NaN is an allowed value,
+// it must always be represented as 0xf97e00."
+func CanonicalEncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortCanonical,
+ ShortestFloat: ShortestFloat16,
+ NaNConvert: NaNConvert7e00,
+ InfConvert: InfConvertFloat16,
+ IndefLength: IndefLengthForbidden,
+ }
+}
+
+// CTAP2EncOptions returns EncOptions for "CTAP2 Canonical CBOR" encoding,
+// defined in CTAP specification, with the following rules:
+//
+// 1. "Integers must be encoded as small as possible."
+// 2. "The representations of any floating-point values are not changed."
+// 3. "The expression of lengths in major types 2 through 5 must be as short as possible."
+// 4. "Indefinite-length items must be made into definite-length items.""
+// 5. The keys in every map must be sorted in bytewise lexicographic order.
+// See SortBytewiseLexical for details.
+// 6. "Tags as defined in Section 2.4 in [RFC7049] MUST NOT be present."
+func CTAP2EncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortCTAP2,
+ ShortestFloat: ShortestFloatNone,
+ NaNConvert: NaNConvertNone,
+ InfConvert: InfConvertNone,
+ IndefLength: IndefLengthForbidden,
+ TagsMd: TagsForbidden,
+ }
+}
+
+// CoreDetEncOptions returns EncOptions for "Core Deterministic" encoding,
+// defined in RFC 7049bis with the following rules:
+//
+// 1. "Preferred serialization MUST be used. In particular, this means that arguments
+// (see Section 3) for integers, lengths in major types 2 through 5, and tags MUST
+// be as short as possible"
+// "Floating point values also MUST use the shortest form that preserves the value"
+// 2. "Indefinite-length items MUST NOT appear."
+// 3. "The keys in every map MUST be sorted in the bytewise lexicographic order of
+// their deterministic encodings."
+func CoreDetEncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortCoreDeterministic,
+ ShortestFloat: ShortestFloat16,
+ NaNConvert: NaNConvert7e00,
+ InfConvert: InfConvertFloat16,
+ IndefLength: IndefLengthForbidden,
+ }
+}
+
+// PreferredUnsortedEncOptions returns EncOptions for "Preferred Serialization" encoding,
+// defined in RFC 7049bis with the following rules:
+//
+// 1. "The preferred serialization always uses the shortest form of representing the argument
+// (Section 3);"
+// 2. "it also uses the shortest floating-point encoding that preserves the value being
+// encoded (see Section 5.5)."
+// "The preferred encoding for a floating-point value is the shortest floating-point encoding
+// that preserves its value, e.g., 0xf94580 for the number 5.5, and 0xfa45ad9c00 for the
+// number 5555.5, unless the CBOR-based protocol specifically excludes the use of the shorter
+// floating-point encodings. For NaN values, a shorter encoding is preferred if zero-padding
+// the shorter significand towards the right reconstitutes the original NaN value (for many
+// applications, the single NaN encoding 0xf97e00 will suffice)."
+// 3. "Definite length encoding is preferred whenever the length is known at the time the
+// serialization of the item starts."
+func PreferredUnsortedEncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortNone,
+ ShortestFloat: ShortestFloat16,
+ NaNConvert: NaNConvert7e00,
+ InfConvert: InfConvertFloat16,
+ }
+}
+
+// EncMode returns EncMode with immutable options and no tags (safe for concurrency).
+func (opts EncOptions) EncMode() (EncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.encMode()
+}
+
+// UserBufferEncMode returns UserBufferEncMode with immutable options and no tags (safe for concurrency).
+func (opts EncOptions) UserBufferEncMode() (UserBufferEncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.encMode()
+}
+
+// EncModeWithTags returns EncMode with options and tags that are both immutable (safe for concurrency).
+func (opts EncOptions) EncModeWithTags(tags TagSet) (EncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.UserBufferEncModeWithTags(tags)
+}
+
+// UserBufferEncModeWithTags returns UserBufferEncMode with options and tags that are both immutable (safe for concurrency).
+func (opts EncOptions) UserBufferEncModeWithTags(tags TagSet) (UserBufferEncMode, error) { //nolint:gocritic // ignore hugeParam
+ if opts.TagsMd == TagsForbidden {
+ return nil, errors.New("cbor: cannot create EncMode with TagSet when TagsMd is TagsForbidden")
+ }
+ if tags == nil {
+ return nil, errors.New("cbor: cannot create EncMode with nil value as TagSet")
+ }
+ em, err := opts.encMode()
+ if err != nil {
+ return nil, err
+ }
+ // Copy tags
+ ts := tagSet(make(map[reflect.Type]*tagItem))
+ syncTags := tags.(*syncTagSet)
+ syncTags.RLock()
+ for contentType, tag := range syncTags.t {
+ if tag.opts.EncTag != EncTagNone {
+ ts[contentType] = tag
+ }
+ }
+ syncTags.RUnlock()
+ if len(ts) > 0 {
+ em.tags = ts
+ }
+ return em, nil
+}
+
+// EncModeWithSharedTags returns EncMode with immutable options and mutable shared tags (safe for concurrency).
+func (opts EncOptions) EncModeWithSharedTags(tags TagSet) (EncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.UserBufferEncModeWithSharedTags(tags)
+}
+
+// UserBufferEncModeWithSharedTags returns UserBufferEncMode with immutable options and mutable shared tags (safe for concurrency).
+func (opts EncOptions) UserBufferEncModeWithSharedTags(tags TagSet) (UserBufferEncMode, error) { //nolint:gocritic // ignore hugeParam
+ if opts.TagsMd == TagsForbidden {
+ return nil, errors.New("cbor: cannot create EncMode with TagSet when TagsMd is TagsForbidden")
+ }
+ if tags == nil {
+ return nil, errors.New("cbor: cannot create EncMode with nil value as TagSet")
+ }
+ em, err := opts.encMode()
+ if err != nil {
+ return nil, err
+ }
+ em.tags = tags
+ return em, nil
+}
+
+func (opts EncOptions) encMode() (*encMode, error) { //nolint:gocritic // ignore hugeParam
+ if !opts.Sort.valid() {
+ return nil, errors.New("cbor: invalid SortMode " + strconv.Itoa(int(opts.Sort)))
+ }
+ if !opts.ShortestFloat.valid() {
+ return nil, errors.New("cbor: invalid ShortestFloatMode " + strconv.Itoa(int(opts.ShortestFloat)))
+ }
+ if !opts.NaNConvert.valid() {
+ return nil, errors.New("cbor: invalid NaNConvertMode " + strconv.Itoa(int(opts.NaNConvert)))
+ }
+ if !opts.InfConvert.valid() {
+ return nil, errors.New("cbor: invalid InfConvertMode " + strconv.Itoa(int(opts.InfConvert)))
+ }
+ if !opts.BigIntConvert.valid() {
+ return nil, errors.New("cbor: invalid BigIntConvertMode " + strconv.Itoa(int(opts.BigIntConvert)))
+ }
+ if !opts.Time.valid() {
+ return nil, errors.New("cbor: invalid TimeMode " + strconv.Itoa(int(opts.Time)))
+ }
+ if !opts.TimeTag.valid() {
+ return nil, errors.New("cbor: invalid TimeTag " + strconv.Itoa(int(opts.TimeTag)))
+ }
+ if !opts.IndefLength.valid() {
+ return nil, errors.New("cbor: invalid IndefLength " + strconv.Itoa(int(opts.IndefLength)))
+ }
+ if !opts.NilContainers.valid() {
+ return nil, errors.New("cbor: invalid NilContainers " + strconv.Itoa(int(opts.NilContainers)))
+ }
+ if !opts.TagsMd.valid() {
+ return nil, errors.New("cbor: invalid TagsMd " + strconv.Itoa(int(opts.TagsMd)))
+ }
+ if opts.TagsMd == TagsForbidden && opts.TimeTag == EncTagRequired {
+ return nil, errors.New("cbor: cannot set TagsMd to TagsForbidden when TimeTag is EncTagRequired")
+ }
+ if !opts.OmitEmpty.valid() {
+ return nil, errors.New("cbor: invalid OmitEmpty " + strconv.Itoa(int(opts.OmitEmpty)))
+ }
+ stringMajorType, err := opts.String.cborType()
+ if err != nil {
+ return nil, err
+ }
+ if !opts.FieldName.valid() {
+ return nil, errors.New("cbor: invalid FieldName " + strconv.Itoa(int(opts.FieldName)))
+ }
+ byteSliceLaterEncodingTag, err := opts.ByteSliceLaterFormat.encodingTag()
+ if err != nil {
+ return nil, err
+ }
+ if !opts.ByteArray.valid() {
+ return nil, errors.New("cbor: invalid ByteArray " + strconv.Itoa(int(opts.ByteArray)))
+ }
+ if !opts.BinaryMarshaler.valid() {
+ return nil, errors.New("cbor: invalid BinaryMarshaler " + strconv.Itoa(int(opts.BinaryMarshaler)))
+ }
+ em := encMode{
+ sort: opts.Sort,
+ shortestFloat: opts.ShortestFloat,
+ nanConvert: opts.NaNConvert,
+ infConvert: opts.InfConvert,
+ bigIntConvert: opts.BigIntConvert,
+ time: opts.Time,
+ timeTag: opts.TimeTag,
+ indefLength: opts.IndefLength,
+ nilContainers: opts.NilContainers,
+ tagsMd: opts.TagsMd,
+ omitEmpty: opts.OmitEmpty,
+ stringType: opts.String,
+ stringMajorType: stringMajorType,
+ fieldName: opts.FieldName,
+ byteSliceLaterFormat: opts.ByteSliceLaterFormat,
+ byteSliceLaterEncodingTag: byteSliceLaterEncodingTag,
+ byteArray: opts.ByteArray,
+ binaryMarshaler: opts.BinaryMarshaler,
+ }
+ return &em, nil
+}
+
+// EncMode is the main interface for CBOR encoding.
+type EncMode interface {
+ Marshal(v interface{}) ([]byte, error)
+ NewEncoder(w io.Writer) *Encoder
+ EncOptions() EncOptions
+}
+
+// UserBufferEncMode is an interface for CBOR encoding, which extends EncMode by
+// adding MarshalToBuffer to support user specified buffer rather than encoding
+// into the built-in buffer pool.
+type UserBufferEncMode interface {
+ EncMode
+ MarshalToBuffer(v interface{}, buf *bytes.Buffer) error
+
+ // This private method is to prevent users implementing
+ // this interface and so future additions to it will
+ // not be breaking changes.
+ // See https://go.dev/blog/module-compatibility
+ unexport()
+}
+
+type encMode struct {
+ tags tagProvider
+ sort SortMode
+ shortestFloat ShortestFloatMode
+ nanConvert NaNConvertMode
+ infConvert InfConvertMode
+ bigIntConvert BigIntConvertMode
+ time TimeMode
+ timeTag EncTagMode
+ indefLength IndefLengthMode
+ nilContainers NilContainersMode
+ tagsMd TagsMode
+ omitEmpty OmitEmptyMode
+ stringType StringMode
+ stringMajorType cborType
+ fieldName FieldNameMode
+ byteSliceLaterFormat ByteSliceLaterFormatMode
+ byteSliceLaterEncodingTag uint64
+ byteArray ByteArrayMode
+ binaryMarshaler BinaryMarshalerMode
+}
+
+var defaultEncMode, _ = EncOptions{}.encMode()
+
+// These four decoding modes are used by getMarshalerDecMode.
+// maxNestedLevels, maxArrayElements, and maxMapPairs are
+// set to max allowed limits to avoid rejecting Marshaler
+// output that would have been the allowable output of a
+// non-Marshaler object that exceeds default limits.
+var (
+ marshalerForbidIndefLengthForbidTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthForbidden,
+ tagsMd: TagsForbidden,
+ }
+
+ marshalerAllowIndefLengthForbidTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthAllowed,
+ tagsMd: TagsForbidden,
+ }
+
+ marshalerForbidIndefLengthAllowTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthForbidden,
+ tagsMd: TagsAllowed,
+ }
+
+ marshalerAllowIndefLengthAllowTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthAllowed,
+ tagsMd: TagsAllowed,
+ }
+)
+
+// getMarshalerDecMode returns one of four existing decoding modes
+// which can be reused (safe for parallel use) for the purpose of
+// checking if data returned by Marshaler is well-formed.
+func getMarshalerDecMode(indefLength IndefLengthMode, tagsMd TagsMode) *decMode {
+ switch {
+ case indefLength == IndefLengthAllowed && tagsMd == TagsAllowed:
+ return &marshalerAllowIndefLengthAllowTagsDecMode
+
+ case indefLength == IndefLengthAllowed && tagsMd == TagsForbidden:
+ return &marshalerAllowIndefLengthForbidTagsDecMode
+
+ case indefLength == IndefLengthForbidden && tagsMd == TagsAllowed:
+ return &marshalerForbidIndefLengthAllowTagsDecMode
+
+ case indefLength == IndefLengthForbidden && tagsMd == TagsForbidden:
+ return &marshalerForbidIndefLengthForbidTagsDecMode
+
+ default:
+ // This should never happen, unless we add new options to
+ // IndefLengthMode or TagsMode without updating this function.
+ return &decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: indefLength,
+ tagsMd: tagsMd,
+ }
+ }
+}
+
+// EncOptions returns user specified options used to create this EncMode.
+func (em *encMode) EncOptions() EncOptions {
+ return EncOptions{
+ Sort: em.sort,
+ ShortestFloat: em.shortestFloat,
+ NaNConvert: em.nanConvert,
+ InfConvert: em.infConvert,
+ BigIntConvert: em.bigIntConvert,
+ Time: em.time,
+ TimeTag: em.timeTag,
+ IndefLength: em.indefLength,
+ NilContainers: em.nilContainers,
+ TagsMd: em.tagsMd,
+ OmitEmpty: em.omitEmpty,
+ String: em.stringType,
+ FieldName: em.fieldName,
+ ByteSliceLaterFormat: em.byteSliceLaterFormat,
+ ByteArray: em.byteArray,
+ BinaryMarshaler: em.binaryMarshaler,
+ }
+}
+
+func (em *encMode) unexport() {}
+
+func (em *encMode) encTagBytes(t reflect.Type) []byte {
+ if em.tags != nil {
+ if tagItem := em.tags.getTagItemFromType(t); tagItem != nil {
+ return tagItem.cborTagNum
+ }
+ }
+ return nil
+}
+
+// Marshal returns the CBOR encoding of v using em encoding mode.
+//
+// See the documentation for Marshal for details.
+func (em *encMode) Marshal(v interface{}) ([]byte, error) {
+ e := getEncodeBuffer()
+
+ if err := encode(e, em, reflect.ValueOf(v)); err != nil {
+ putEncodeBuffer(e)
+ return nil, err
+ }
+
+ buf := make([]byte, e.Len())
+ copy(buf, e.Bytes())
+
+ putEncodeBuffer(e)
+ return buf, nil
+}
+
+// MarshalToBuffer encodes v into provided buffer (instead of using built-in buffer pool)
+// and uses em encoding mode.
+//
+// NOTE: Unlike Marshal, the buffer provided to MarshalToBuffer can contain
+// partially encoded data if error is returned.
+//
+// See Marshal for more details.
+func (em *encMode) MarshalToBuffer(v interface{}, buf *bytes.Buffer) error {
+ if buf == nil {
+ return fmt.Errorf("cbor: encoding buffer provided by user is nil")
+ }
+ return encode(buf, em, reflect.ValueOf(v))
+}
+
+// NewEncoder returns a new encoder that writes to w using em EncMode.
+func (em *encMode) NewEncoder(w io.Writer) *Encoder {
+ return &Encoder{w: w, em: em}
+}
+
+// encodeBufferPool caches unused bytes.Buffer objects for later reuse.
+var encodeBufferPool = sync.Pool{
+ New: func() interface{} {
+ e := new(bytes.Buffer)
+ e.Grow(32) // TODO: make this configurable
+ return e
+ },
+}
+
+func getEncodeBuffer() *bytes.Buffer {
+ return encodeBufferPool.Get().(*bytes.Buffer)
+}
+
+func putEncodeBuffer(e *bytes.Buffer) {
+ e.Reset()
+ encodeBufferPool.Put(e)
+}
+
+type encodeFunc func(e *bytes.Buffer, em *encMode, v reflect.Value) error
+type isEmptyFunc func(em *encMode, v reflect.Value) (empty bool, err error)
+
+func encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if !v.IsValid() {
+ // v is zero value
+ e.Write(cborNil)
+ return nil
+ }
+ vt := v.Type()
+ f, _ := getEncodeFunc(vt)
+ if f == nil {
+ return &UnsupportedTypeError{vt}
+ }
+
+ return f(e, em, v)
+}
+
+func encodeBool(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ b := cborFalse
+ if v.Bool() {
+ b = cborTrue
+ }
+ e.Write(b)
+ return nil
+}
+
+func encodeInt(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ i := v.Int()
+ if i >= 0 {
+ encodeHead(e, byte(cborTypePositiveInt), uint64(i))
+ return nil
+ }
+ i = i*(-1) - 1
+ encodeHead(e, byte(cborTypeNegativeInt), uint64(i))
+ return nil
+}
+
+func encodeUint(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ encodeHead(e, byte(cborTypePositiveInt), v.Uint())
+ return nil
+}
+
+func encodeFloat(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ f64 := v.Float()
+ if math.IsNaN(f64) {
+ return encodeNaN(e, em, v)
+ }
+ if math.IsInf(f64, 0) {
+ return encodeInf(e, em, v)
+ }
+ fopt := em.shortestFloat
+ if v.Kind() == reflect.Float64 && (fopt == ShortestFloatNone || cannotFitFloat32(f64)) {
+ // Encode float64
+ // Don't use encodeFloat64() because it cannot be inlined.
+ const argumentSize = 8
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | byte(additionalInformationAsFloat64)
+ binary.BigEndian.PutUint64(scratch[1:], math.Float64bits(f64))
+ e.Write(scratch[:])
+ return nil
+ }
+
+ f32 := float32(f64)
+ if fopt == ShortestFloat16 {
+ var f16 float16.Float16
+ p := float16.PrecisionFromfloat32(f32)
+ if p == float16.PrecisionExact {
+ // Roundtrip float32->float16->float32 test isn't needed.
+ f16 = float16.Fromfloat32(f32)
+ } else if p == float16.PrecisionUnknown {
+ // Try roundtrip float32->float16->float32 to determine if float32 can fit into float16.
+ f16 = float16.Fromfloat32(f32)
+ if f16.Float32() == f32 {
+ p = float16.PrecisionExact
+ }
+ }
+ if p == float16.PrecisionExact {
+ // Encode float16
+ // Don't use encodeFloat16() because it cannot be inlined.
+ const argumentSize = 2
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat16
+ binary.BigEndian.PutUint16(scratch[1:], uint16(f16))
+ e.Write(scratch[:])
+ return nil
+ }
+ }
+
+ // Encode float32
+ // Don't use encodeFloat32() because it cannot be inlined.
+ const argumentSize = 4
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat32
+ binary.BigEndian.PutUint32(scratch[1:], math.Float32bits(f32))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeInf(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ f64 := v.Float()
+ switch em.infConvert {
+ case InfConvertReject:
+ return &UnsupportedValueError{msg: "floating-point infinity"}
+
+ case InfConvertFloat16:
+ if f64 > 0 {
+ e.Write(cborPositiveInfinity)
+ } else {
+ e.Write(cborNegativeInfinity)
+ }
+ return nil
+ }
+ if v.Kind() == reflect.Float64 {
+ return encodeFloat64(e, f64)
+ }
+ return encodeFloat32(e, float32(f64))
+}
+
+func encodeNaN(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ switch em.nanConvert {
+ case NaNConvert7e00:
+ e.Write(cborNaN)
+ return nil
+
+ case NaNConvertNone:
+ if v.Kind() == reflect.Float64 {
+ return encodeFloat64(e, v.Float())
+ }
+ f32 := float32NaNFromReflectValue(v)
+ return encodeFloat32(e, f32)
+
+ case NaNConvertReject:
+ return &UnsupportedValueError{msg: "floating-point NaN"}
+
+ default: // NaNConvertPreserveSignal, NaNConvertQuiet
+ if v.Kind() == reflect.Float64 {
+ f64 := v.Float()
+ f64bits := math.Float64bits(f64)
+ if em.nanConvert == NaNConvertQuiet && f64bits&(1<<51) == 0 {
+ f64bits |= 1 << 51 // Set quiet bit = 1
+ f64 = math.Float64frombits(f64bits)
+ }
+ // The lower 29 bits are dropped when converting from float64 to float32.
+ if f64bits&0x1fffffff != 0 {
+ // Encode NaN as float64 because dropped coef bits from float64 to float32 are not all 0s.
+ return encodeFloat64(e, f64)
+ }
+ // Create float32 from float64 manually because float32(f64) always turns on NaN's quiet bits.
+ sign := uint32(f64bits>>32) & (1 << 31)
+ exp := uint32(0x7f800000)
+ coef := uint32((f64bits & 0xfffffffffffff) >> 29)
+ f32bits := sign | exp | coef
+ f32 := math.Float32frombits(f32bits)
+ // The lower 13 bits are dropped when converting from float32 to float16.
+ if f32bits&0x1fff != 0 {
+ // Encode NaN as float32 because dropped coef bits from float32 to float16 are not all 0s.
+ return encodeFloat32(e, f32)
+ }
+ // Encode NaN as float16
+ f16, _ := float16.FromNaN32ps(f32) // Ignore err because it only returns error when f32 is not a NaN.
+ return encodeFloat16(e, f16)
+ }
+
+ f32 := float32NaNFromReflectValue(v)
+ f32bits := math.Float32bits(f32)
+ if em.nanConvert == NaNConvertQuiet && f32bits&(1<<22) == 0 {
+ f32bits |= 1 << 22 // Set quiet bit = 1
+ f32 = math.Float32frombits(f32bits)
+ }
+ // The lower 13 bits are dropped coef bits when converting from float32 to float16.
+ if f32bits&0x1fff != 0 {
+ // Encode NaN as float32 because dropped coef bits from float32 to float16 are not all 0s.
+ return encodeFloat32(e, f32)
+ }
+ f16, _ := float16.FromNaN32ps(f32) // Ignore err because it only returns error when f32 is not a NaN.
+ return encodeFloat16(e, f16)
+ }
+}
+
+func encodeFloat16(e *bytes.Buffer, f16 float16.Float16) error {
+ const argumentSize = 2
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat16
+ binary.BigEndian.PutUint16(scratch[1:], uint16(f16))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeFloat32(e *bytes.Buffer, f32 float32) error {
+ const argumentSize = 4
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat32
+ binary.BigEndian.PutUint32(scratch[1:], math.Float32bits(f32))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeFloat64(e *bytes.Buffer, f64 float64) error {
+ const argumentSize = 8
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat64
+ binary.BigEndian.PutUint64(scratch[1:], math.Float64bits(f64))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeByteString(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ vk := v.Kind()
+ if vk == reflect.Slice && v.IsNil() && em.nilContainers == NilContainerAsNull {
+ e.Write(cborNil)
+ return nil
+ }
+ if vk == reflect.Slice && v.Type().Elem().Kind() == reflect.Uint8 && em.byteSliceLaterEncodingTag != 0 {
+ encodeHead(e, byte(cborTypeTag), em.byteSliceLaterEncodingTag)
+ }
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ slen := v.Len()
+ if slen == 0 {
+ return e.WriteByte(byte(cborTypeByteString))
+ }
+ encodeHead(e, byte(cborTypeByteString), uint64(slen))
+ if vk == reflect.Array {
+ for i := 0; i < slen; i++ {
+ e.WriteByte(byte(v.Index(i).Uint()))
+ }
+ return nil
+ }
+ e.Write(v.Bytes())
+ return nil
+}
+
+func encodeString(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ s := v.String()
+ encodeHead(e, byte(em.stringMajorType), uint64(len(s)))
+ e.WriteString(s)
+ return nil
+}
+
+type arrayEncodeFunc struct {
+ f encodeFunc
+}
+
+func (ae arrayEncodeFunc) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.byteArray == ByteArrayToByteSlice && v.Type().Elem().Kind() == reflect.Uint8 {
+ return encodeByteString(e, em, v)
+ }
+ if v.Kind() == reflect.Slice && v.IsNil() && em.nilContainers == NilContainerAsNull {
+ e.Write(cborNil)
+ return nil
+ }
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ alen := v.Len()
+ if alen == 0 {
+ return e.WriteByte(byte(cborTypeArray))
+ }
+ encodeHead(e, byte(cborTypeArray), uint64(alen))
+ for i := 0; i < alen; i++ {
+ if err := ae.f(e, em, v.Index(i)); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// encodeKeyValueFunc encodes key/value pairs in map (v).
+// If kvs is provided (having the same length as v), length of encoded key and value are stored in kvs.
+// kvs is used for canonical encoding of map.
+type encodeKeyValueFunc func(e *bytes.Buffer, em *encMode, v reflect.Value, kvs []keyValue) error
+
+type mapEncodeFunc struct {
+ e encodeKeyValueFunc
+}
+
+func (me mapEncodeFunc) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if v.IsNil() && em.nilContainers == NilContainerAsNull {
+ e.Write(cborNil)
+ return nil
+ }
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ mlen := v.Len()
+ if mlen == 0 {
+ return e.WriteByte(byte(cborTypeMap))
+ }
+
+ encodeHead(e, byte(cborTypeMap), uint64(mlen))
+ if em.sort == SortNone || em.sort == SortFastShuffle || mlen <= 1 {
+ return me.e(e, em, v, nil)
+ }
+
+ kvsp := getKeyValues(v.Len()) // for sorting keys
+ defer putKeyValues(kvsp)
+ kvs := *kvsp
+
+ kvBeginOffset := e.Len()
+ if err := me.e(e, em, v, kvs); err != nil {
+ return err
+ }
+ kvTotalLen := e.Len() - kvBeginOffset
+
+ // Use the capacity at the tail of the encode buffer as a staging area to rearrange the
+ // encoded pairs into sorted order.
+ e.Grow(kvTotalLen)
+ tmp := e.Bytes()[e.Len() : e.Len()+kvTotalLen] // Can use e.AvailableBuffer() in Go 1.21+.
+ dst := e.Bytes()[kvBeginOffset:]
+
+ if em.sort == SortBytewiseLexical {
+ sort.Sort(&bytewiseKeyValueSorter{kvs: kvs, data: dst})
+ } else {
+ sort.Sort(&lengthFirstKeyValueSorter{kvs: kvs, data: dst})
+ }
+
+ // This is where the encoded bytes are actually rearranged in the output buffer to reflect
+ // the desired order.
+ sortedOffset := 0
+ for _, kv := range kvs {
+ copy(tmp[sortedOffset:], dst[kv.offset:kv.nextOffset])
+ sortedOffset += kv.nextOffset - kv.offset
+ }
+ copy(dst, tmp[:kvTotalLen])
+
+ return nil
+
+}
+
+// keyValue is the position of an encoded pair in a buffer. All offsets are zero-based and relative
+// to the first byte of the first encoded pair.
+type keyValue struct {
+ offset int
+ valueOffset int
+ nextOffset int
+}
+
+type bytewiseKeyValueSorter struct {
+ kvs []keyValue
+ data []byte
+}
+
+func (x *bytewiseKeyValueSorter) Len() int {
+ return len(x.kvs)
+}
+
+func (x *bytewiseKeyValueSorter) Swap(i, j int) {
+ x.kvs[i], x.kvs[j] = x.kvs[j], x.kvs[i]
+}
+
+func (x *bytewiseKeyValueSorter) Less(i, j int) bool {
+ kvi, kvj := x.kvs[i], x.kvs[j]
+ return bytes.Compare(x.data[kvi.offset:kvi.valueOffset], x.data[kvj.offset:kvj.valueOffset]) <= 0
+}
+
+type lengthFirstKeyValueSorter struct {
+ kvs []keyValue
+ data []byte
+}
+
+func (x *lengthFirstKeyValueSorter) Len() int {
+ return len(x.kvs)
+}
+
+func (x *lengthFirstKeyValueSorter) Swap(i, j int) {
+ x.kvs[i], x.kvs[j] = x.kvs[j], x.kvs[i]
+}
+
+func (x *lengthFirstKeyValueSorter) Less(i, j int) bool {
+ kvi, kvj := x.kvs[i], x.kvs[j]
+ if keyLengthDifference := (kvi.valueOffset - kvi.offset) - (kvj.valueOffset - kvj.offset); keyLengthDifference != 0 {
+ return keyLengthDifference < 0
+ }
+ return bytes.Compare(x.data[kvi.offset:kvi.valueOffset], x.data[kvj.offset:kvj.valueOffset]) <= 0
+}
+
+var keyValuePool = sync.Pool{}
+
+func getKeyValues(length int) *[]keyValue {
+ v := keyValuePool.Get()
+ if v == nil {
+ y := make([]keyValue, length)
+ return &y
+ }
+ x := v.(*[]keyValue)
+ if cap(*x) >= length {
+ *x = (*x)[:length]
+ return x
+ }
+ // []keyValue from the pool does not have enough capacity.
+ // Return it back to the pool and create a new one.
+ keyValuePool.Put(x)
+ y := make([]keyValue, length)
+ return &y
+}
+
+func putKeyValues(x *[]keyValue) {
+ *x = (*x)[:0]
+ keyValuePool.Put(x)
+}
+
+func encodeStructToArray(e *bytes.Buffer, em *encMode, v reflect.Value) (err error) {
+ structType, err := getEncodingStructType(v.Type())
+ if err != nil {
+ return err
+ }
+
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+
+ flds := structType.fields
+
+ encodeHead(e, byte(cborTypeArray), uint64(len(flds)))
+ for i := 0; i < len(flds); i++ {
+ f := flds[i]
+
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ // Get embedded field value. No error is expected.
+ fv, _ = getFieldValue(v, f.idx, func(reflect.Value) (reflect.Value, error) {
+ // Write CBOR nil for null pointer to embedded struct
+ e.Write(cborNil)
+ return reflect.Value{}, nil
+ })
+ if !fv.IsValid() {
+ continue
+ }
+ }
+
+ if err := f.ef(e, em, fv); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func encodeStruct(e *bytes.Buffer, em *encMode, v reflect.Value) (err error) {
+ structType, err := getEncodingStructType(v.Type())
+ if err != nil {
+ return err
+ }
+
+ flds := structType.getFields(em)
+
+ start := 0
+ if em.sort == SortFastShuffle && len(flds) > 0 {
+ start = rand.Intn(len(flds)) //nolint:gosec // Don't need a CSPRNG for deck cutting.
+ }
+
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+
+ // Encode head with struct field count.
+ // Head is rewritten later if actual encoded field count is different from struct field count.
+ encodedHeadLen := encodeHead(e, byte(cborTypeMap), uint64(len(flds)))
+
+ kvbegin := e.Len()
+ kvcount := 0
+ for offset := 0; offset < len(flds); offset++ {
+ f := flds[(start+offset)%len(flds)]
+
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ // Get embedded field value. No error is expected.
+ fv, _ = getFieldValue(v, f.idx, func(reflect.Value) (reflect.Value, error) {
+ // Skip null pointer to embedded struct
+ return reflect.Value{}, nil
+ })
+ if !fv.IsValid() {
+ continue
+ }
+ }
+ if f.omitEmpty {
+ empty, err := f.ief(em, fv)
+ if err != nil {
+ return err
+ }
+ if empty {
+ continue
+ }
+ }
+
+ if !f.keyAsInt && em.fieldName == FieldNameToByteString {
+ e.Write(f.cborNameByteString)
+ } else { // int or text string
+ e.Write(f.cborName)
+ }
+
+ if err := f.ef(e, em, fv); err != nil {
+ return err
+ }
+
+ kvcount++
+ }
+
+ if len(flds) == kvcount {
+ // Encoded element count in head is the same as actual element count.
+ return nil
+ }
+
+ // Overwrite the bytes that were reserved for the head before encoding the map entries.
+ var actualHeadLen int
+ {
+ headbuf := *bytes.NewBuffer(e.Bytes()[kvbegin-encodedHeadLen : kvbegin-encodedHeadLen : kvbegin])
+ actualHeadLen = encodeHead(&headbuf, byte(cborTypeMap), uint64(kvcount))
+ }
+
+ if actualHeadLen == encodedHeadLen {
+ // The bytes reserved for the encoded head were exactly the right size, so the
+ // encoded entries are already in their final positions.
+ return nil
+ }
+
+ // We reserved more bytes than needed for the encoded head, based on the number of fields
+ // encoded. The encoded entries are offset to the right by the number of excess reserved
+ // bytes. Shift the entries left to remove the gap.
+ excessReservedBytes := encodedHeadLen - actualHeadLen
+ dst := e.Bytes()[kvbegin-excessReservedBytes : e.Len()-excessReservedBytes]
+ src := e.Bytes()[kvbegin:e.Len()]
+ copy(dst, src)
+
+ // After shifting, the excess bytes are at the end of the output buffer and they are
+ // garbage.
+ e.Truncate(e.Len() - excessReservedBytes)
+ return nil
+}
+
+func encodeIntf(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if v.IsNil() {
+ e.Write(cborNil)
+ return nil
+ }
+ return encode(e, em, v.Elem())
+}
+
+func encodeTime(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ t := v.Interface().(time.Time)
+ if t.IsZero() {
+ e.Write(cborNil) // Even if tag is required, encode as CBOR null.
+ return nil
+ }
+ if em.timeTag == EncTagRequired {
+ tagNumber := 1
+ if em.time == TimeRFC3339 || em.time == TimeRFC3339Nano {
+ tagNumber = 0
+ }
+ encodeHead(e, byte(cborTypeTag), uint64(tagNumber))
+ }
+ switch em.time {
+ case TimeUnix:
+ secs := t.Unix()
+ return encodeInt(e, em, reflect.ValueOf(secs))
+
+ case TimeUnixMicro:
+ t = t.UTC().Round(time.Microsecond)
+ f := float64(t.UnixNano()) / 1e9
+ return encodeFloat(e, em, reflect.ValueOf(f))
+
+ case TimeUnixDynamic:
+ t = t.UTC().Round(time.Microsecond)
+ secs, nsecs := t.Unix(), uint64(t.Nanosecond())
+ if nsecs == 0 {
+ return encodeInt(e, em, reflect.ValueOf(secs))
+ }
+ f := float64(secs) + float64(nsecs)/1e9
+ return encodeFloat(e, em, reflect.ValueOf(f))
+
+ case TimeRFC3339:
+ s := t.Format(time.RFC3339)
+ return encodeString(e, em, reflect.ValueOf(s))
+
+ default: // TimeRFC3339Nano
+ s := t.Format(time.RFC3339Nano)
+ return encodeString(e, em, reflect.ValueOf(s))
+ }
+}
+
+func encodeBigInt(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.bigIntConvert == BigIntConvertReject {
+ return &UnsupportedTypeError{Type: typeBigInt}
+ }
+
+ vbi := v.Interface().(big.Int)
+ sign := vbi.Sign()
+ bi := new(big.Int).SetBytes(vbi.Bytes()) // bi is absolute value of v
+ if sign < 0 {
+ // For negative number, convert to CBOR encoded number (-v-1).
+ bi.Sub(bi, big.NewInt(1))
+ }
+
+ if em.bigIntConvert == BigIntConvertShortest {
+ if bi.IsUint64() {
+ if sign >= 0 {
+ // Encode as CBOR pos int (major type 0)
+ encodeHead(e, byte(cborTypePositiveInt), bi.Uint64())
+ return nil
+ }
+ // Encode as CBOR neg int (major type 1)
+ encodeHead(e, byte(cborTypeNegativeInt), bi.Uint64())
+ return nil
+ }
+ }
+
+ tagNum := 2
+ if sign < 0 {
+ tagNum = 3
+ }
+ // Write tag number
+ encodeHead(e, byte(cborTypeTag), uint64(tagNum))
+ // Write bignum byte string
+ b := bi.Bytes()
+ encodeHead(e, byte(cborTypeByteString), uint64(len(b)))
+ e.Write(b)
+ return nil
+}
+
+type binaryMarshalerEncoder struct {
+ alternateEncode encodeFunc
+ alternateIsEmpty isEmptyFunc
+}
+
+func (bme binaryMarshalerEncoder) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.binaryMarshaler != BinaryMarshalerByteString {
+ return bme.alternateEncode(e, em, v)
+ }
+
+ vt := v.Type()
+ m, ok := v.Interface().(encoding.BinaryMarshaler)
+ if !ok {
+ pv := reflect.New(vt)
+ pv.Elem().Set(v)
+ m = pv.Interface().(encoding.BinaryMarshaler)
+ }
+ data, err := m.MarshalBinary()
+ if err != nil {
+ return err
+ }
+ if b := em.encTagBytes(vt); b != nil {
+ e.Write(b)
+ }
+ encodeHead(e, byte(cborTypeByteString), uint64(len(data)))
+ e.Write(data)
+ return nil
+}
+
+func (bme binaryMarshalerEncoder) isEmpty(em *encMode, v reflect.Value) (bool, error) {
+ if em.binaryMarshaler != BinaryMarshalerByteString {
+ return bme.alternateIsEmpty(em, v)
+ }
+
+ m, ok := v.Interface().(encoding.BinaryMarshaler)
+ if !ok {
+ pv := reflect.New(v.Type())
+ pv.Elem().Set(v)
+ m = pv.Interface().(encoding.BinaryMarshaler)
+ }
+ data, err := m.MarshalBinary()
+ if err != nil {
+ return false, err
+ }
+ return len(data) == 0, nil
+}
+
+func encodeMarshalerType(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.tagsMd == TagsForbidden && v.Type() == typeRawTag {
+ return errors.New("cbor: cannot encode cbor.RawTag when TagsMd is TagsForbidden")
+ }
+ m, ok := v.Interface().(Marshaler)
+ if !ok {
+ pv := reflect.New(v.Type())
+ pv.Elem().Set(v)
+ m = pv.Interface().(Marshaler)
+ }
+ data, err := m.MarshalCBOR()
+ if err != nil {
+ return err
+ }
+
+ // Verify returned CBOR data item from MarshalCBOR() is well-formed and passes tag validity for builtin tags 0-3.
+ d := decoder{data: data, dm: getMarshalerDecMode(em.indefLength, em.tagsMd)}
+ err = d.wellformed(false, true)
+ if err != nil {
+ return &MarshalerError{typ: v.Type(), err: err}
+ }
+
+ e.Write(data)
+ return nil
+}
+
+func encodeTag(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.tagsMd == TagsForbidden {
+ return errors.New("cbor: cannot encode cbor.Tag when TagsMd is TagsForbidden")
+ }
+
+ t := v.Interface().(Tag)
+
+ if t.Number == 0 && t.Content == nil {
+ // Marshal uninitialized cbor.Tag
+ e.Write(cborNil)
+ return nil
+ }
+
+ // Marshal tag number
+ encodeHead(e, byte(cborTypeTag), t.Number)
+
+ vem := *em // shallow copy
+
+ // For built-in tags, disable settings that may introduce tag validity errors when
+ // marshaling certain Content values.
+ switch t.Number {
+ case tagNumRFC3339Time:
+ vem.stringType = StringToTextString
+ vem.stringMajorType = cborTypeTextString
+ case tagNumUnsignedBignum, tagNumNegativeBignum:
+ vem.byteSliceLaterFormat = ByteSliceLaterFormatNone
+ vem.byteSliceLaterEncodingTag = 0
+ }
+
+ // Marshal tag content
+ return encode(e, &vem, reflect.ValueOf(t.Content))
+}
+
+// encodeHead writes CBOR head of specified type t and returns number of bytes written.
+func encodeHead(e *bytes.Buffer, t byte, n uint64) int {
+ if n <= maxAdditionalInformationWithoutArgument {
+ const headSize = 1
+ e.WriteByte(t | byte(n))
+ return headSize
+ }
+
+ if n <= math.MaxUint8 {
+ const headSize = 2
+ scratch := [headSize]byte{
+ t | byte(additionalInformationWith1ByteArgument),
+ byte(n),
+ }
+ e.Write(scratch[:])
+ return headSize
+ }
+
+ if n <= math.MaxUint16 {
+ const headSize = 3
+ var scratch [headSize]byte
+ scratch[0] = t | byte(additionalInformationWith2ByteArgument)
+ binary.BigEndian.PutUint16(scratch[1:], uint16(n))
+ e.Write(scratch[:])
+ return headSize
+ }
+
+ if n <= math.MaxUint32 {
+ const headSize = 5
+ var scratch [headSize]byte
+ scratch[0] = t | byte(additionalInformationWith4ByteArgument)
+ binary.BigEndian.PutUint32(scratch[1:], uint32(n))
+ e.Write(scratch[:])
+ return headSize
+ }
+
+ const headSize = 9
+ var scratch [headSize]byte
+ scratch[0] = t | byte(additionalInformationWith8ByteArgument)
+ binary.BigEndian.PutUint64(scratch[1:], n)
+ e.Write(scratch[:])
+ return headSize
+}
+
+var (
+ typeMarshaler = reflect.TypeOf((*Marshaler)(nil)).Elem()
+ typeBinaryMarshaler = reflect.TypeOf((*encoding.BinaryMarshaler)(nil)).Elem()
+ typeRawMessage = reflect.TypeOf(RawMessage(nil))
+ typeByteString = reflect.TypeOf(ByteString(""))
+)
+
+func getEncodeFuncInternal(t reflect.Type) (ef encodeFunc, ief isEmptyFunc) {
+ k := t.Kind()
+ if k == reflect.Ptr {
+ return getEncodeIndirectValueFunc(t), isEmptyPtr
+ }
+ switch t {
+ case typeSimpleValue:
+ return encodeMarshalerType, isEmptyUint
+
+ case typeTag:
+ return encodeTag, alwaysNotEmpty
+
+ case typeTime:
+ return encodeTime, alwaysNotEmpty
+
+ case typeBigInt:
+ return encodeBigInt, alwaysNotEmpty
+
+ case typeRawMessage:
+ return encodeMarshalerType, isEmptySlice
+
+ case typeByteString:
+ return encodeMarshalerType, isEmptyString
+ }
+ if reflect.PtrTo(t).Implements(typeMarshaler) {
+ return encodeMarshalerType, alwaysNotEmpty
+ }
+ if reflect.PtrTo(t).Implements(typeBinaryMarshaler) {
+ defer func() {
+ // capture encoding method used for modes that disable BinaryMarshaler
+ bme := binaryMarshalerEncoder{
+ alternateEncode: ef,
+ alternateIsEmpty: ief,
+ }
+ ef = bme.encode
+ ief = bme.isEmpty
+ }()
+ }
+ switch k {
+ case reflect.Bool:
+ return encodeBool, isEmptyBool
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return encodeInt, isEmptyInt
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return encodeUint, isEmptyUint
+
+ case reflect.Float32, reflect.Float64:
+ return encodeFloat, isEmptyFloat
+
+ case reflect.String:
+ return encodeString, isEmptyString
+
+ case reflect.Slice:
+ if t.Elem().Kind() == reflect.Uint8 {
+ return encodeByteString, isEmptySlice
+ }
+ fallthrough
+
+ case reflect.Array:
+ f, _ := getEncodeFunc(t.Elem())
+ if f == nil {
+ return nil, nil
+ }
+ return arrayEncodeFunc{f: f}.encode, isEmptySlice
+
+ case reflect.Map:
+ f := getEncodeMapFunc(t)
+ if f == nil {
+ return nil, nil
+ }
+ return f, isEmptyMap
+
+ case reflect.Struct:
+ // Get struct's special field "_" tag options
+ if f, ok := t.FieldByName("_"); ok {
+ tag := f.Tag.Get("cbor")
+ if tag != "-" {
+ if hasToArrayOption(tag) {
+ return encodeStructToArray, isEmptyStruct
+ }
+ }
+ }
+ return encodeStruct, isEmptyStruct
+
+ case reflect.Interface:
+ return encodeIntf, isEmptyIntf
+ }
+ return nil, nil
+}
+
+func getEncodeIndirectValueFunc(t reflect.Type) encodeFunc {
+ for t.Kind() == reflect.Ptr {
+ t = t.Elem()
+ }
+ f, _ := getEncodeFunc(t)
+ if f == nil {
+ return nil
+ }
+ return func(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ for v.Kind() == reflect.Ptr && !v.IsNil() {
+ v = v.Elem()
+ }
+ if v.Kind() == reflect.Ptr && v.IsNil() {
+ e.Write(cborNil)
+ return nil
+ }
+ return f(e, em, v)
+ }
+}
+
+func alwaysNotEmpty(_ *encMode, _ reflect.Value) (empty bool, err error) {
+ return false, nil
+}
+
+func isEmptyBool(_ *encMode, v reflect.Value) (bool, error) {
+ return !v.Bool(), nil
+}
+
+func isEmptyInt(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Int() == 0, nil
+}
+
+func isEmptyUint(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Uint() == 0, nil
+}
+
+func isEmptyFloat(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Float() == 0.0, nil
+}
+
+func isEmptyString(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Len() == 0, nil
+}
+
+func isEmptySlice(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Len() == 0, nil
+}
+
+func isEmptyMap(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Len() == 0, nil
+}
+
+func isEmptyPtr(_ *encMode, v reflect.Value) (bool, error) {
+ return v.IsNil(), nil
+}
+
+func isEmptyIntf(_ *encMode, v reflect.Value) (bool, error) {
+ return v.IsNil(), nil
+}
+
+func isEmptyStruct(em *encMode, v reflect.Value) (bool, error) {
+ structType, err := getEncodingStructType(v.Type())
+ if err != nil {
+ return false, err
+ }
+
+ if em.omitEmpty == OmitEmptyGoValue {
+ return false, nil
+ }
+
+ if structType.toArray {
+ return len(structType.fields) == 0, nil
+ }
+
+ if len(structType.fields) > len(structType.omitEmptyFieldsIdx) {
+ return false, nil
+ }
+
+ for _, i := range structType.omitEmptyFieldsIdx {
+ f := structType.fields[i]
+
+ // Get field value
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ // Get embedded field value. No error is expected.
+ fv, _ = getFieldValue(v, f.idx, func(reflect.Value) (reflect.Value, error) {
+ // Skip null pointer to embedded struct
+ return reflect.Value{}, nil
+ })
+ if !fv.IsValid() {
+ continue
+ }
+ }
+
+ empty, err := f.ief(em, fv)
+ if err != nil {
+ return false, err
+ }
+ if !empty {
+ return false, nil
+ }
+ }
+ return true, nil
+}
+
+func cannotFitFloat32(f64 float64) bool {
+ f32 := float32(f64)
+ return float64(f32) != f64
+}
+
+// float32NaNFromReflectValue extracts float32 NaN from reflect.Value while preserving NaN's quiet bit.
+func float32NaNFromReflectValue(v reflect.Value) float32 {
+ // Keith Randall's workaround for issue https://github.com/golang/go/issues/36400
+ p := reflect.New(v.Type())
+ p.Elem().Set(v)
+ f32 := p.Convert(reflect.TypeOf((*float32)(nil))).Elem().Interface().(float32)
+ return f32
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/encode_map.go b/vendor/github.com/fxamacker/cbor/v2/encode_map.go
new file mode 100644
index 0000000000..8b4b4bbc59
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode_map.go
@@ -0,0 +1,94 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+//go:build go1.20
+
+package cbor
+
+import (
+ "bytes"
+ "reflect"
+ "sync"
+)
+
+type mapKeyValueEncodeFunc struct {
+ kf, ef encodeFunc
+ kpool, vpool sync.Pool
+}
+
+func (me *mapKeyValueEncodeFunc) encodeKeyValues(e *bytes.Buffer, em *encMode, v reflect.Value, kvs []keyValue) error {
+ iterk := me.kpool.Get().(*reflect.Value)
+ defer func() {
+ iterk.SetZero()
+ me.kpool.Put(iterk)
+ }()
+ iterv := me.vpool.Get().(*reflect.Value)
+ defer func() {
+ iterv.SetZero()
+ me.vpool.Put(iterv)
+ }()
+
+ if kvs == nil {
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ iterk.SetIterKey(iter)
+ iterv.SetIterValue(iter)
+
+ if err := me.kf(e, em, *iterk); err != nil {
+ return err
+ }
+ if err := me.ef(e, em, *iterv); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+
+ initial := e.Len()
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ iterk.SetIterKey(iter)
+ iterv.SetIterValue(iter)
+
+ offset := e.Len()
+ if err := me.kf(e, em, *iterk); err != nil {
+ return err
+ }
+ valueOffset := e.Len()
+ if err := me.ef(e, em, *iterv); err != nil {
+ return err
+ }
+ kvs[i] = keyValue{
+ offset: offset - initial,
+ valueOffset: valueOffset - initial,
+ nextOffset: e.Len() - initial,
+ }
+ }
+
+ return nil
+}
+
+func getEncodeMapFunc(t reflect.Type) encodeFunc {
+ kf, _ := getEncodeFunc(t.Key())
+ ef, _ := getEncodeFunc(t.Elem())
+ if kf == nil || ef == nil {
+ return nil
+ }
+ mkv := &mapKeyValueEncodeFunc{
+ kf: kf,
+ ef: ef,
+ kpool: sync.Pool{
+ New: func() interface{} {
+ rk := reflect.New(t.Key()).Elem()
+ return &rk
+ },
+ },
+ vpool: sync.Pool{
+ New: func() interface{} {
+ rv := reflect.New(t.Elem()).Elem()
+ return &rv
+ },
+ },
+ }
+ return mapEncodeFunc{
+ e: mkv.encodeKeyValues,
+ }.encode
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/encode_map_go117.go b/vendor/github.com/fxamacker/cbor/v2/encode_map_go117.go
new file mode 100644
index 0000000000..31c39336dd
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode_map_go117.go
@@ -0,0 +1,60 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+//go:build !go1.20
+
+package cbor
+
+import (
+ "bytes"
+ "reflect"
+)
+
+type mapKeyValueEncodeFunc struct {
+ kf, ef encodeFunc
+}
+
+func (me *mapKeyValueEncodeFunc) encodeKeyValues(e *bytes.Buffer, em *encMode, v reflect.Value, kvs []keyValue) error {
+ if kvs == nil {
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ if err := me.kf(e, em, iter.Key()); err != nil {
+ return err
+ }
+ if err := me.ef(e, em, iter.Value()); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+
+ initial := e.Len()
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ offset := e.Len()
+ if err := me.kf(e, em, iter.Key()); err != nil {
+ return err
+ }
+ valueOffset := e.Len()
+ if err := me.ef(e, em, iter.Value()); err != nil {
+ return err
+ }
+ kvs[i] = keyValue{
+ offset: offset - initial,
+ valueOffset: valueOffset - initial,
+ nextOffset: e.Len() - initial,
+ }
+ }
+
+ return nil
+}
+
+func getEncodeMapFunc(t reflect.Type) encodeFunc {
+ kf, _ := getEncodeFunc(t.Key())
+ ef, _ := getEncodeFunc(t.Elem())
+ if kf == nil || ef == nil {
+ return nil
+ }
+ mkv := &mapKeyValueEncodeFunc{kf: kf, ef: ef}
+ return mapEncodeFunc{
+ e: mkv.encodeKeyValues,
+ }.encode
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/simplevalue.go b/vendor/github.com/fxamacker/cbor/v2/simplevalue.go
new file mode 100644
index 0000000000..de175cee4a
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/simplevalue.go
@@ -0,0 +1,69 @@
+package cbor
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+)
+
+// SimpleValue represents CBOR simple value.
+// CBOR simple value is:
+// - an extension point like CBOR tag.
+// - a subset of CBOR major type 7 that isn't floating-point.
+// - "identified by a number between 0 and 255, but distinct from that number itself".
+// For example, "a simple value 2 is not equivalent to an integer 2" as a CBOR map key.
+//
+// CBOR simple values identified by 20..23 are: "false", "true" , "null", and "undefined".
+// Other CBOR simple values are currently unassigned/reserved by IANA.
+type SimpleValue uint8
+
+var (
+ typeSimpleValue = reflect.TypeOf(SimpleValue(0))
+)
+
+// MarshalCBOR encodes SimpleValue as CBOR simple value (major type 7).
+func (sv SimpleValue) MarshalCBOR() ([]byte, error) {
+ // RFC 8949 3.3. Floating-Point Numbers and Values with No Content says:
+ // "An encoder MUST NOT issue two-byte sequences that start with 0xf8
+ // (major type 7, additional information 24) and continue with a byte
+ // less than 0x20 (32 decimal). Such sequences are not well-formed.
+ // (This implies that an encoder cannot encode false, true, null, or
+ // undefined in two-byte sequences and that only the one-byte variants
+ // of these are well-formed; more generally speaking, each simple value
+ // only has a single representation variant)."
+
+ switch {
+ case sv <= maxSimpleValueInAdditionalInformation:
+ return []byte{byte(cborTypePrimitives) | byte(sv)}, nil
+
+ case sv >= minSimpleValueIn1ByteArgument:
+ return []byte{byte(cborTypePrimitives) | additionalInformationWith1ByteArgument, byte(sv)}, nil
+
+ default:
+ return nil, &UnsupportedValueError{msg: fmt.Sprintf("SimpleValue(%d)", sv)}
+ }
+}
+
+// UnmarshalCBOR decodes CBOR simple value (major type 7) to SimpleValue.
+func (sv *SimpleValue) UnmarshalCBOR(data []byte) error {
+ if sv == nil {
+ return errors.New("cbor.SimpleValue: UnmarshalCBOR on nil pointer")
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ typ, ai, val := d.getHead()
+
+ if typ != cborTypePrimitives {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: "SimpleValue"}
+ }
+ if ai > additionalInformationWith1ByteArgument {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: "SimpleValue", errorMsg: "not simple values"}
+ }
+
+ // It is safe to cast val to uint8 here because
+ // - data is already verified to be well-formed CBOR simple value and
+ // - val is <= math.MaxUint8.
+ *sv = SimpleValue(val)
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/stream.go b/vendor/github.com/fxamacker/cbor/v2/stream.go
new file mode 100644
index 0000000000..507ab6c184
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/stream.go
@@ -0,0 +1,277 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "errors"
+ "io"
+ "reflect"
+)
+
+// Decoder reads and decodes CBOR values from io.Reader.
+type Decoder struct {
+ r io.Reader
+ d decoder
+ buf []byte
+ off int // next read offset in buf
+ bytesRead int
+}
+
+// NewDecoder returns a new decoder that reads and decodes from r using
+// the default decoding options.
+func NewDecoder(r io.Reader) *Decoder {
+ return defaultDecMode.NewDecoder(r)
+}
+
+// Decode reads CBOR value and decodes it into the value pointed to by v.
+func (dec *Decoder) Decode(v interface{}) error {
+ _, err := dec.readNext()
+ if err != nil {
+ // Return validation error or read error.
+ return err
+ }
+
+ dec.d.reset(dec.buf[dec.off:])
+ err = dec.d.value(v)
+
+ // Increment dec.off even if decoding err is not nil because
+ // dec.d.off points to the next CBOR data item if current
+ // CBOR data item is valid but failed to be decoded into v.
+ // This allows next CBOR data item to be decoded in next
+ // call to this function.
+ dec.off += dec.d.off
+ dec.bytesRead += dec.d.off
+
+ return err
+}
+
+// Skip skips to the next CBOR data item (if there is any),
+// otherwise it returns error such as io.EOF, io.UnexpectedEOF, etc.
+func (dec *Decoder) Skip() error {
+ n, err := dec.readNext()
+ if err != nil {
+ // Return validation error or read error.
+ return err
+ }
+
+ dec.off += n
+ dec.bytesRead += n
+ return nil
+}
+
+// NumBytesRead returns the number of bytes read.
+func (dec *Decoder) NumBytesRead() int {
+ return dec.bytesRead
+}
+
+// Buffered returns a reader for data remaining in Decoder's buffer.
+// Returned reader is valid until the next call to Decode or Skip.
+func (dec *Decoder) Buffered() io.Reader {
+ return bytes.NewReader(dec.buf[dec.off:])
+}
+
+// readNext() reads next CBOR data item from Reader to buffer.
+// It returns the size of next CBOR data item.
+// It also returns validation error or read error if any.
+func (dec *Decoder) readNext() (int, error) {
+ var readErr error
+ var validErr error
+
+ for {
+ // Process any unread data in dec.buf.
+ if dec.off < len(dec.buf) {
+ dec.d.reset(dec.buf[dec.off:])
+ off := dec.off // Save offset before data validation
+ validErr = dec.d.wellformed(true, false)
+ dec.off = off // Restore offset
+
+ if validErr == nil {
+ return dec.d.off, nil
+ }
+
+ if validErr != io.ErrUnexpectedEOF {
+ return 0, validErr
+ }
+
+ // Process last read error on io.ErrUnexpectedEOF.
+ if readErr != nil {
+ if readErr == io.EOF {
+ // current CBOR data item is incomplete.
+ return 0, io.ErrUnexpectedEOF
+ }
+ return 0, readErr
+ }
+ }
+
+ // More data is needed and there was no read error.
+ var n int
+ for n == 0 {
+ n, readErr = dec.read()
+ if n == 0 && readErr != nil {
+ // No more data can be read and read error is encountered.
+ // At this point, validErr is either nil or io.ErrUnexpectedEOF.
+ if readErr == io.EOF {
+ if validErr == io.ErrUnexpectedEOF {
+ // current CBOR data item is incomplete.
+ return 0, io.ErrUnexpectedEOF
+ }
+ }
+ return 0, readErr
+ }
+ }
+
+ // At this point, dec.buf contains new data from last read (n > 0).
+ }
+}
+
+// read() reads data from Reader to buffer.
+// It returns number of bytes read and any read error encountered.
+// Postconditions:
+// - dec.buf contains previously unread data and new data.
+// - dec.off is 0.
+func (dec *Decoder) read() (int, error) {
+ // Grow buf if needed.
+ const minRead = 512
+ if cap(dec.buf)-len(dec.buf)+dec.off < minRead {
+ oldUnreadBuf := dec.buf[dec.off:]
+ dec.buf = make([]byte, len(dec.buf)-dec.off, 2*cap(dec.buf)+minRead)
+ dec.overwriteBuf(oldUnreadBuf)
+ }
+
+ // Copy unread data over read data and reset off to 0.
+ if dec.off > 0 {
+ dec.overwriteBuf(dec.buf[dec.off:])
+ }
+
+ // Read from reader and reslice buf.
+ n, err := dec.r.Read(dec.buf[len(dec.buf):cap(dec.buf)])
+ dec.buf = dec.buf[0 : len(dec.buf)+n]
+ return n, err
+}
+
+func (dec *Decoder) overwriteBuf(newBuf []byte) {
+ n := copy(dec.buf, newBuf)
+ dec.buf = dec.buf[:n]
+ dec.off = 0
+}
+
+// Encoder writes CBOR values to io.Writer.
+type Encoder struct {
+ w io.Writer
+ em *encMode
+ indefTypes []cborType
+}
+
+// NewEncoder returns a new encoder that writes to w using the default encoding options.
+func NewEncoder(w io.Writer) *Encoder {
+ return defaultEncMode.NewEncoder(w)
+}
+
+// Encode writes the CBOR encoding of v.
+func (enc *Encoder) Encode(v interface{}) error {
+ if len(enc.indefTypes) > 0 && v != nil {
+ indefType := enc.indefTypes[len(enc.indefTypes)-1]
+ if indefType == cborTypeTextString {
+ k := reflect.TypeOf(v).Kind()
+ if k != reflect.String {
+ return errors.New("cbor: cannot encode item type " + k.String() + " for indefinite-length text string")
+ }
+ } else if indefType == cborTypeByteString {
+ t := reflect.TypeOf(v)
+ k := t.Kind()
+ if (k != reflect.Array && k != reflect.Slice) || t.Elem().Kind() != reflect.Uint8 {
+ return errors.New("cbor: cannot encode item type " + k.String() + " for indefinite-length byte string")
+ }
+ }
+ }
+
+ buf := getEncodeBuffer()
+
+ err := encode(buf, enc.em, reflect.ValueOf(v))
+ if err == nil {
+ _, err = enc.w.Write(buf.Bytes())
+ }
+
+ putEncodeBuffer(buf)
+ return err
+}
+
+// StartIndefiniteByteString starts byte string encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes definite length byte strings
+// ("chunks") as one contiguous string until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteByteString() error {
+ return enc.startIndefinite(cborTypeByteString)
+}
+
+// StartIndefiniteTextString starts text string encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes definite length text strings
+// ("chunks") as one contiguous string until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteTextString() error {
+ return enc.startIndefinite(cborTypeTextString)
+}
+
+// StartIndefiniteArray starts array encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes elements of the array
+// until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteArray() error {
+ return enc.startIndefinite(cborTypeArray)
+}
+
+// StartIndefiniteMap starts array encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes elements of the map
+// until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteMap() error {
+ return enc.startIndefinite(cborTypeMap)
+}
+
+// EndIndefinite closes last opened indefinite length value.
+func (enc *Encoder) EndIndefinite() error {
+ if len(enc.indefTypes) == 0 {
+ return errors.New("cbor: cannot encode \"break\" code outside indefinite length values")
+ }
+ _, err := enc.w.Write([]byte{cborBreakFlag})
+ if err == nil {
+ enc.indefTypes = enc.indefTypes[:len(enc.indefTypes)-1]
+ }
+ return err
+}
+
+var cborIndefHeader = map[cborType][]byte{
+ cborTypeByteString: {cborByteStringWithIndefiniteLengthHead},
+ cborTypeTextString: {cborTextStringWithIndefiniteLengthHead},
+ cborTypeArray: {cborArrayWithIndefiniteLengthHead},
+ cborTypeMap: {cborMapWithIndefiniteLengthHead},
+}
+
+func (enc *Encoder) startIndefinite(typ cborType) error {
+ if enc.em.indefLength == IndefLengthForbidden {
+ return &IndefiniteLengthError{typ}
+ }
+ _, err := enc.w.Write(cborIndefHeader[typ])
+ if err == nil {
+ enc.indefTypes = append(enc.indefTypes, typ)
+ }
+ return err
+}
+
+// RawMessage is a raw encoded CBOR value.
+type RawMessage []byte
+
+// MarshalCBOR returns m or CBOR nil if m is nil.
+func (m RawMessage) MarshalCBOR() ([]byte, error) {
+ if len(m) == 0 {
+ return cborNil, nil
+ }
+ return m, nil
+}
+
+// UnmarshalCBOR creates a copy of data and saves to *m.
+func (m *RawMessage) UnmarshalCBOR(data []byte) error {
+ if m == nil {
+ return errors.New("cbor.RawMessage: UnmarshalCBOR on nil pointer")
+ }
+ *m = append((*m)[0:0], data...)
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/structfields.go b/vendor/github.com/fxamacker/cbor/v2/structfields.go
new file mode 100644
index 0000000000..81228acf0f
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/structfields.go
@@ -0,0 +1,260 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "reflect"
+ "sort"
+ "strings"
+)
+
+type field struct {
+ name string
+ nameAsInt int64 // used to decoder to match field name with CBOR int
+ cborName []byte
+ cborNameByteString []byte // major type 2 name encoding iff cborName has major type 3
+ idx []int
+ typ reflect.Type
+ ef encodeFunc
+ ief isEmptyFunc
+ typInfo *typeInfo // used to decoder to reuse type info
+ tagged bool // used to choose dominant field (at the same level tagged fields dominate untagged fields)
+ omitEmpty bool // used to skip empty field
+ keyAsInt bool // used to encode/decode field name as int
+}
+
+type fields []*field
+
+// indexFieldSorter sorts fields by field idx at each level, breaking ties with idx depth.
+type indexFieldSorter struct {
+ fields fields
+}
+
+func (x *indexFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *indexFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *indexFieldSorter) Less(i, j int) bool {
+ iIdx, jIdx := x.fields[i].idx, x.fields[j].idx
+ for k := 0; k < len(iIdx) && k < len(jIdx); k++ {
+ if iIdx[k] != jIdx[k] {
+ return iIdx[k] < jIdx[k]
+ }
+ }
+ return len(iIdx) <= len(jIdx)
+}
+
+// nameLevelAndTagFieldSorter sorts fields by field name, idx depth, and presence of tag.
+type nameLevelAndTagFieldSorter struct {
+ fields fields
+}
+
+func (x *nameLevelAndTagFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *nameLevelAndTagFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *nameLevelAndTagFieldSorter) Less(i, j int) bool {
+ fi, fj := x.fields[i], x.fields[j]
+ if fi.name != fj.name {
+ return fi.name < fj.name
+ }
+ if len(fi.idx) != len(fj.idx) {
+ return len(fi.idx) < len(fj.idx)
+ }
+ if fi.tagged != fj.tagged {
+ return fi.tagged
+ }
+ return i < j // Field i and j have the same name, depth, and tagged status. Nothing else matters.
+}
+
+// getFields returns visible fields of struct type t following visibility rules for JSON encoding.
+func getFields(t reflect.Type) (flds fields, structOptions string) {
+ // Get special field "_" tag options
+ if f, ok := t.FieldByName("_"); ok {
+ tag := f.Tag.Get("cbor")
+ if tag != "-" {
+ structOptions = tag
+ }
+ }
+
+ // nTypes contains next level anonymous fields' types and indexes
+ // (there can be multiple fields of the same type at the same level)
+ flds, nTypes := appendFields(t, nil, nil, nil)
+
+ if len(nTypes) > 0 {
+
+ var cTypes map[reflect.Type][][]int // current level anonymous fields' types and indexes
+ vTypes := map[reflect.Type]bool{t: true} // visited field types at less nested levels
+
+ for len(nTypes) > 0 {
+ cTypes, nTypes = nTypes, nil
+
+ for t, idx := range cTypes {
+ // If there are multiple anonymous fields of the same struct type at the same level, all are ignored.
+ if len(idx) > 1 {
+ continue
+ }
+
+ // Anonymous field of the same type at deeper nested level is ignored.
+ if vTypes[t] {
+ continue
+ }
+ vTypes[t] = true
+
+ flds, nTypes = appendFields(t, idx[0], flds, nTypes)
+ }
+ }
+ }
+
+ sort.Sort(&nameLevelAndTagFieldSorter{flds})
+
+ // Keep visible fields.
+ j := 0 // index of next unique field
+ for i := 0; i < len(flds); {
+ name := flds[i].name
+ if i == len(flds)-1 || // last field
+ name != flds[i+1].name || // field i has unique field name
+ len(flds[i].idx) < len(flds[i+1].idx) || // field i is at a less nested level than field i+1
+ (flds[i].tagged && !flds[i+1].tagged) { // field i is tagged while field i+1 is not
+ flds[j] = flds[i]
+ j++
+ }
+
+ // Skip fields with the same field name.
+ for i++; i < len(flds) && name == flds[i].name; i++ { //nolint:revive
+ }
+ }
+ if j != len(flds) {
+ flds = flds[:j]
+ }
+
+ // Sort fields by field index
+ sort.Sort(&indexFieldSorter{flds})
+
+ return flds, structOptions
+}
+
+// appendFields appends type t's exportable fields to flds and anonymous struct fields to nTypes .
+func appendFields(
+ t reflect.Type,
+ idx []int,
+ flds fields,
+ nTypes map[reflect.Type][][]int,
+) (
+ _flds fields,
+ _nTypes map[reflect.Type][][]int,
+) {
+ for i := 0; i < t.NumField(); i++ {
+ f := t.Field(i)
+
+ ft := f.Type
+ for ft.Kind() == reflect.Ptr {
+ ft = ft.Elem()
+ }
+
+ if !isFieldExportable(f, ft.Kind()) {
+ continue
+ }
+
+ tag := f.Tag.Get("cbor")
+ if tag == "" {
+ tag = f.Tag.Get("json")
+ }
+ if tag == "-" {
+ continue
+ }
+
+ tagged := tag != ""
+
+ // Parse field tag options
+ var tagFieldName string
+ var omitempty, keyasint bool
+ for j := 0; tag != ""; j++ {
+ var token string
+ idx := strings.IndexByte(tag, ',')
+ if idx == -1 {
+ token, tag = tag, ""
+ } else {
+ token, tag = tag[:idx], tag[idx+1:]
+ }
+ if j == 0 {
+ tagFieldName = token
+ } else {
+ switch token {
+ case "omitempty":
+ omitempty = true
+ case "keyasint":
+ keyasint = true
+ }
+ }
+ }
+
+ fieldName := tagFieldName
+ if tagFieldName == "" {
+ fieldName = f.Name
+ }
+
+ fIdx := make([]int, len(idx)+1)
+ copy(fIdx, idx)
+ fIdx[len(fIdx)-1] = i
+
+ if !f.Anonymous || ft.Kind() != reflect.Struct || tagFieldName != "" {
+ flds = append(flds, &field{
+ name: fieldName,
+ idx: fIdx,
+ typ: f.Type,
+ omitEmpty: omitempty,
+ keyAsInt: keyasint,
+ tagged: tagged})
+ } else {
+ if nTypes == nil {
+ nTypes = make(map[reflect.Type][][]int)
+ }
+ nTypes[ft] = append(nTypes[ft], fIdx)
+ }
+ }
+
+ return flds, nTypes
+}
+
+// isFieldExportable returns true if f is an exportable (regular or anonymous) field or
+// a nonexportable anonymous field of struct type.
+// Nonexportable anonymous field of struct type can contain exportable fields.
+func isFieldExportable(f reflect.StructField, fk reflect.Kind) bool { //nolint:gocritic // ignore hugeParam
+ exportable := f.PkgPath == ""
+ return exportable || (f.Anonymous && fk == reflect.Struct)
+}
+
+type embeddedFieldNullPtrFunc func(reflect.Value) (reflect.Value, error)
+
+// getFieldValue returns field value of struct v by index. When encountering null pointer
+// to anonymous (embedded) struct field, f is called with the last traversed field value.
+func getFieldValue(v reflect.Value, idx []int, f embeddedFieldNullPtrFunc) (fv reflect.Value, err error) {
+ fv = v
+ for i, n := range idx {
+ fv = fv.Field(n)
+
+ if i < len(idx)-1 {
+ if fv.Kind() == reflect.Ptr && fv.Type().Elem().Kind() == reflect.Struct {
+ if fv.IsNil() {
+ // Null pointer to embedded struct field
+ fv, err = f(fv)
+ if err != nil || !fv.IsValid() {
+ return fv, err
+ }
+ }
+ fv = fv.Elem()
+ }
+ }
+ }
+ return fv, nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/tag.go b/vendor/github.com/fxamacker/cbor/v2/tag.go
new file mode 100644
index 0000000000..5c4d2b7a42
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/tag.go
@@ -0,0 +1,299 @@
+package cbor
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+ "sync"
+)
+
+// Tag represents CBOR tag data, including tag number and unmarshaled tag content. Marshaling and
+// unmarshaling of tag content is subject to any encode and decode options that would apply to
+// enclosed data item if it were to appear outside of a tag.
+type Tag struct {
+ Number uint64
+ Content interface{}
+}
+
+// RawTag represents CBOR tag data, including tag number and raw tag content.
+// RawTag implements Unmarshaler and Marshaler interfaces.
+type RawTag struct {
+ Number uint64
+ Content RawMessage
+}
+
+// UnmarshalCBOR sets *t with tag number and raw tag content copied from data.
+func (t *RawTag) UnmarshalCBOR(data []byte) error {
+ if t == nil {
+ return errors.New("cbor.RawTag: UnmarshalCBOR on nil pointer")
+ }
+
+ // Decoding CBOR null and undefined to cbor.RawTag is no-op.
+ if len(data) == 1 && (data[0] == 0xf6 || data[0] == 0xf7) {
+ return nil
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ // Unmarshal tag number.
+ typ, _, num := d.getHead()
+ if typ != cborTypeTag {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: typeRawTag.String()}
+ }
+ t.Number = num
+
+ // Unmarshal tag content.
+ c := d.data[d.off:]
+ t.Content = make([]byte, len(c))
+ copy(t.Content, c)
+ return nil
+}
+
+// MarshalCBOR returns CBOR encoding of t.
+func (t RawTag) MarshalCBOR() ([]byte, error) {
+ if t.Number == 0 && len(t.Content) == 0 {
+ // Marshal uninitialized cbor.RawTag
+ b := make([]byte, len(cborNil))
+ copy(b, cborNil)
+ return b, nil
+ }
+
+ e := getEncodeBuffer()
+
+ encodeHead(e, byte(cborTypeTag), t.Number)
+
+ content := t.Content
+ if len(content) == 0 {
+ content = cborNil
+ }
+
+ buf := make([]byte, len(e.Bytes())+len(content))
+ n := copy(buf, e.Bytes())
+ copy(buf[n:], content)
+
+ putEncodeBuffer(e)
+ return buf, nil
+}
+
+// DecTagMode specifies how decoder handles tag number.
+type DecTagMode int
+
+const (
+ // DecTagIgnored makes decoder ignore tag number (skips if present).
+ DecTagIgnored DecTagMode = iota
+
+ // DecTagOptional makes decoder verify tag number if it's present.
+ DecTagOptional
+
+ // DecTagRequired makes decoder verify tag number and tag number must be present.
+ DecTagRequired
+
+ maxDecTagMode
+)
+
+func (dtm DecTagMode) valid() bool {
+ return dtm >= 0 && dtm < maxDecTagMode
+}
+
+// EncTagMode specifies how encoder handles tag number.
+type EncTagMode int
+
+const (
+ // EncTagNone makes encoder not encode tag number.
+ EncTagNone EncTagMode = iota
+
+ // EncTagRequired makes encoder encode tag number.
+ EncTagRequired
+
+ maxEncTagMode
+)
+
+func (etm EncTagMode) valid() bool {
+ return etm >= 0 && etm < maxEncTagMode
+}
+
+// TagOptions specifies how encoder and decoder handle tag number.
+type TagOptions struct {
+ DecTag DecTagMode
+ EncTag EncTagMode
+}
+
+// TagSet is an interface to add and remove tag info. It is used by EncMode and DecMode
+// to provide CBOR tag support.
+type TagSet interface {
+ // Add adds given tag number(s), content type, and tag options to TagSet.
+ Add(opts TagOptions, contentType reflect.Type, num uint64, nestedNum ...uint64) error
+
+ // Remove removes given tag content type from TagSet.
+ Remove(contentType reflect.Type)
+
+ tagProvider
+}
+
+type tagProvider interface {
+ getTagItemFromType(t reflect.Type) *tagItem
+ getTypeFromTagNum(num []uint64) reflect.Type
+}
+
+type tagItem struct {
+ num []uint64
+ cborTagNum []byte
+ contentType reflect.Type
+ opts TagOptions
+}
+
+func (t *tagItem) equalTagNum(num []uint64) bool {
+ // Fast path to compare 1 tag number
+ if len(t.num) == 1 && len(num) == 1 && t.num[0] == num[0] {
+ return true
+ }
+
+ if len(t.num) != len(num) {
+ return false
+ }
+
+ for i := 0; i < len(t.num); i++ {
+ if t.num[i] != num[i] {
+ return false
+ }
+ }
+
+ return true
+}
+
+type (
+ tagSet map[reflect.Type]*tagItem
+
+ syncTagSet struct {
+ sync.RWMutex
+ t tagSet
+ }
+)
+
+func (t tagSet) getTagItemFromType(typ reflect.Type) *tagItem {
+ return t[typ]
+}
+
+func (t tagSet) getTypeFromTagNum(num []uint64) reflect.Type {
+ for typ, tag := range t {
+ if tag.equalTagNum(num) {
+ return typ
+ }
+ }
+ return nil
+}
+
+// NewTagSet returns TagSet (safe for concurrency).
+func NewTagSet() TagSet {
+ return &syncTagSet{t: make(map[reflect.Type]*tagItem)}
+}
+
+// Add adds given tag number(s), content type, and tag options to TagSet.
+func (t *syncTagSet) Add(opts TagOptions, contentType reflect.Type, num uint64, nestedNum ...uint64) error {
+ if contentType == nil {
+ return errors.New("cbor: cannot add nil content type to TagSet")
+ }
+ for contentType.Kind() == reflect.Ptr {
+ contentType = contentType.Elem()
+ }
+ tag, err := newTagItem(opts, contentType, num, nestedNum...)
+ if err != nil {
+ return err
+ }
+ t.Lock()
+ defer t.Unlock()
+ for typ, ti := range t.t {
+ if typ == contentType {
+ return errors.New("cbor: content type " + contentType.String() + " already exists in TagSet")
+ }
+ if ti.equalTagNum(tag.num) {
+ return fmt.Errorf("cbor: tag number %v already exists in TagSet", tag.num)
+ }
+ }
+ t.t[contentType] = tag
+ return nil
+}
+
+// Remove removes given tag content type from TagSet.
+func (t *syncTagSet) Remove(contentType reflect.Type) {
+ for contentType.Kind() == reflect.Ptr {
+ contentType = contentType.Elem()
+ }
+ t.Lock()
+ delete(t.t, contentType)
+ t.Unlock()
+}
+
+func (t *syncTagSet) getTagItemFromType(typ reflect.Type) *tagItem {
+ t.RLock()
+ ti := t.t[typ]
+ t.RUnlock()
+ return ti
+}
+
+func (t *syncTagSet) getTypeFromTagNum(num []uint64) reflect.Type {
+ t.RLock()
+ rt := t.t.getTypeFromTagNum(num)
+ t.RUnlock()
+ return rt
+}
+
+func newTagItem(opts TagOptions, contentType reflect.Type, num uint64, nestedNum ...uint64) (*tagItem, error) {
+ if opts.DecTag == DecTagIgnored && opts.EncTag == EncTagNone {
+ return nil, errors.New("cbor: cannot add tag with DecTagIgnored and EncTagNone options to TagSet")
+ }
+ if contentType.PkgPath() == "" || contentType.Kind() == reflect.Interface {
+ return nil, errors.New("cbor: can only add named types to TagSet, got " + contentType.String())
+ }
+ if contentType == typeTime {
+ return nil, errors.New("cbor: cannot add time.Time to TagSet, use EncOptions.TimeTag and DecOptions.TimeTag instead")
+ }
+ if contentType == typeBigInt {
+ return nil, errors.New("cbor: cannot add big.Int to TagSet, it's built-in and supported automatically")
+ }
+ if contentType == typeTag {
+ return nil, errors.New("cbor: cannot add cbor.Tag to TagSet")
+ }
+ if contentType == typeRawTag {
+ return nil, errors.New("cbor: cannot add cbor.RawTag to TagSet")
+ }
+ if num == 0 || num == 1 {
+ return nil, errors.New("cbor: cannot add tag number 0 or 1 to TagSet, use EncOptions.TimeTag and DecOptions.TimeTag instead")
+ }
+ if num == 2 || num == 3 {
+ return nil, errors.New("cbor: cannot add tag number 2 or 3 to TagSet, it's built-in and supported automatically")
+ }
+ if num == tagNumSelfDescribedCBOR {
+ return nil, errors.New("cbor: cannot add tag number 55799 to TagSet, it's built-in and ignored automatically")
+ }
+
+ te := tagItem{num: []uint64{num}, opts: opts, contentType: contentType}
+ te.num = append(te.num, nestedNum...)
+
+ // Cache encoded tag numbers
+ e := getEncodeBuffer()
+ for _, n := range te.num {
+ encodeHead(e, byte(cborTypeTag), n)
+ }
+ te.cborTagNum = make([]byte, e.Len())
+ copy(te.cborTagNum, e.Bytes())
+ putEncodeBuffer(e)
+
+ return &te, nil
+}
+
+var (
+ typeTag = reflect.TypeOf(Tag{})
+ typeRawTag = reflect.TypeOf(RawTag{})
+)
+
+// WrongTagError describes mismatch between CBOR tag and registered tag.
+type WrongTagError struct {
+ RegisteredType reflect.Type
+ RegisteredTagNum []uint64
+ TagNum []uint64
+}
+
+func (e *WrongTagError) Error() string {
+ return fmt.Sprintf("cbor: wrong tag number for %s, got %v, expected %v", e.RegisteredType.String(), e.TagNum, e.RegisteredTagNum)
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/valid.go b/vendor/github.com/fxamacker/cbor/v2/valid.go
new file mode 100644
index 0000000000..b40793b95e
--- /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/go-logr/logr/README.md b/vendor/github.com/go-logr/logr/README.md
index 8969526a6e..7c7f0c69cd 100644
--- a/vendor/github.com/go-logr/logr/README.md
+++ b/vendor/github.com/go-logr/logr/README.md
@@ -1,6 +1,7 @@
# A minimal logging API for Go
[](https://pkg.go.dev/github.com/go-logr/logr)
+[](https://goreportcard.com/report/github.com/go-logr/logr)
[](https://securityscorecards.dev/viewer/?platform=github.com&org=go-logr&repo=logr)
logr offers an(other) opinion on how Go programs and libraries can do logging
diff --git a/vendor/github.com/go-logr/logr/funcr/funcr.go b/vendor/github.com/go-logr/logr/funcr/funcr.go
index fb2f866f4b..30568e768d 100644
--- a/vendor/github.com/go-logr/logr/funcr/funcr.go
+++ b/vendor/github.com/go-logr/logr/funcr/funcr.go
@@ -236,15 +236,14 @@ func newFormatter(opts Options, outfmt outputFormat) Formatter {
// implementation. It should be constructed with NewFormatter. Some of
// its methods directly implement logr.LogSink.
type Formatter struct {
- outputFormat outputFormat
- prefix string
- values []any
- valuesStr string
- parentValuesStr string
- depth int
- opts *Options
- group string // for slog groups
- groupDepth int
+ outputFormat outputFormat
+ prefix string
+ values []any
+ valuesStr string
+ depth int
+ opts *Options
+ groupName string // for slog groups
+ groups []groupDef
}
// outputFormat indicates which outputFormat to use.
@@ -257,6 +256,13 @@ const (
outputJSON
)
+// groupDef represents a saved group. The values may be empty, but we don't
+// know if we need to render the group until the final record is rendered.
+type groupDef struct {
+ name string
+ values string
+}
+
// PseudoStruct is a list of key-value pairs that gets logged as a struct.
type PseudoStruct []any
@@ -264,76 +270,102 @@ type PseudoStruct []any
func (f Formatter) render(builtins, args []any) string {
// Empirically bytes.Buffer is faster than strings.Builder for this.
buf := bytes.NewBuffer(make([]byte, 0, 1024))
+
if f.outputFormat == outputJSON {
- buf.WriteByte('{') // for the whole line
+ buf.WriteByte('{') // for the whole record
}
+ // Render builtins
vals := builtins
if hook := f.opts.RenderBuiltinsHook; hook != nil {
vals = hook(f.sanitize(vals))
}
- f.flatten(buf, vals, false, false) // keys are ours, no need to escape
+ f.flatten(buf, vals, false) // keys are ours, no need to escape
continuing := len(builtins) > 0
- if f.parentValuesStr != "" {
- if continuing {
- buf.WriteByte(f.comma())
+ // Turn the inner-most group into a string
+ argsStr := func() string {
+ buf := bytes.NewBuffer(make([]byte, 0, 1024))
+
+ vals = args
+ if hook := f.opts.RenderArgsHook; hook != nil {
+ vals = hook(f.sanitize(vals))
}
- buf.WriteString(f.parentValuesStr)
- continuing = true
- }
+ f.flatten(buf, vals, true) // escape user-provided keys
- groupDepth := f.groupDepth
- if f.group != "" {
- if f.valuesStr != "" || len(args) != 0 {
- if continuing {
- buf.WriteByte(f.comma())
- }
- buf.WriteString(f.quoted(f.group, true)) // escape user-provided keys
- buf.WriteByte(f.colon())
- buf.WriteByte('{') // for the group
- continuing = false
- } else {
- // The group was empty
- groupDepth--
+ return buf.String()
+ }()
+
+ // Render the stack of groups from the inside out.
+ bodyStr := f.renderGroup(f.groupName, f.valuesStr, argsStr)
+ for i := len(f.groups) - 1; i >= 0; i-- {
+ grp := &f.groups[i]
+ if grp.values == "" && bodyStr == "" {
+ // no contents, so we must elide the whole group
+ continue
}
+ bodyStr = f.renderGroup(grp.name, grp.values, bodyStr)
}
- if f.valuesStr != "" {
+ if bodyStr != "" {
if continuing {
buf.WriteByte(f.comma())
}
- buf.WriteString(f.valuesStr)
- continuing = true
+ buf.WriteString(bodyStr)
}
- vals = args
- if hook := f.opts.RenderArgsHook; hook != nil {
- vals = hook(f.sanitize(vals))
+ if f.outputFormat == outputJSON {
+ buf.WriteByte('}') // for the whole record
}
- f.flatten(buf, vals, continuing, true) // escape user-provided keys
- for i := 0; i < groupDepth; i++ {
- buf.WriteByte('}') // for the groups
+ return buf.String()
+}
+
+// renderGroup returns a string representation of the named group with rendered
+// values and args. If the name is empty, this will return the values and args,
+// joined. If the name is not empty, this will return a single key-value pair,
+// where the value is a grouping of the values and args. If the values and
+// args are both empty, this will return an empty string, even if the name was
+// specified.
+func (f Formatter) renderGroup(name string, values string, args string) string {
+ buf := bytes.NewBuffer(make([]byte, 0, 1024))
+
+ needClosingBrace := false
+ if name != "" && (values != "" || args != "") {
+ buf.WriteString(f.quoted(name, true)) // escape user-provided keys
+ buf.WriteByte(f.colon())
+ buf.WriteByte('{')
+ needClosingBrace = true
}
- if f.outputFormat == outputJSON {
- buf.WriteByte('}') // for the whole line
+ continuing := false
+ if values != "" {
+ buf.WriteString(values)
+ continuing = true
+ }
+
+ if args != "" {
+ if continuing {
+ buf.WriteByte(f.comma())
+ }
+ buf.WriteString(args)
+ }
+
+ if needClosingBrace {
+ buf.WriteByte('}')
}
return buf.String()
}
-// flatten renders a list of key-value pairs into a buffer. If continuing is
-// true, it assumes that the buffer has previous values and will emit a
-// separator (which depends on the output format) before the first pair it
-// writes. If escapeKeys is true, the keys are assumed to have
-// non-JSON-compatible characters in them and must be evaluated for escapes.
+// flatten renders a list of key-value pairs into a buffer. If escapeKeys is
+// true, the keys are assumed to have non-JSON-compatible characters in them
+// and must be evaluated for escapes.
//
// This function returns a potentially modified version of kvList, which
// ensures that there is a value for every key (adding a value if needed) and
// that each key is a string (substituting a key if needed).
-func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, continuing bool, escapeKeys bool) []any {
+func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, escapeKeys bool) []any {
// This logic overlaps with sanitize() but saves one type-cast per key,
// which can be measurable.
if len(kvList)%2 != 0 {
@@ -354,7 +386,7 @@ func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, continuing bool, esc
}
v := kvList[i+1]
- if i > 0 || continuing {
+ if i > 0 {
if f.outputFormat == outputJSON {
buf.WriteByte(f.comma())
} else {
@@ -766,46 +798,17 @@ func (f Formatter) sanitize(kvList []any) []any {
// startGroup opens a new group scope (basically a sub-struct), which locks all
// the current saved values and starts them anew. This is needed to satisfy
// slog.
-func (f *Formatter) startGroup(group string) {
+func (f *Formatter) startGroup(name string) {
// Unnamed groups are just inlined.
- if group == "" {
+ if name == "" {
return
}
- // Any saved values can no longer be changed.
- buf := bytes.NewBuffer(make([]byte, 0, 1024))
- continuing := false
-
- if f.parentValuesStr != "" {
- buf.WriteString(f.parentValuesStr)
- continuing = true
- }
-
- if f.group != "" && f.valuesStr != "" {
- if continuing {
- buf.WriteByte(f.comma())
- }
- buf.WriteString(f.quoted(f.group, true)) // escape user-provided keys
- buf.WriteByte(f.colon())
- buf.WriteByte('{') // for the group
- continuing = false
- }
-
- if f.valuesStr != "" {
- if continuing {
- buf.WriteByte(f.comma())
- }
- buf.WriteString(f.valuesStr)
- }
-
- // NOTE: We don't close the scope here - that's done later, when a log line
- // is actually rendered (because we have N scopes to close).
-
- f.parentValuesStr = buf.String()
+ n := len(f.groups)
+ f.groups = append(f.groups[:n:n], groupDef{f.groupName, f.valuesStr})
// Start collecting new values.
- f.group = group
- f.groupDepth++
+ f.groupName = name
f.valuesStr = ""
f.values = nil
}
@@ -900,7 +903,7 @@ func (f *Formatter) AddValues(kvList []any) {
// Pre-render values, so we don't have to do it on each Info/Error call.
buf := bytes.NewBuffer(make([]byte, 0, 1024))
- f.flatten(buf, vals, false, true) // escape user-provided keys
+ f.flatten(buf, vals, true) // escape user-provided keys
f.valuesStr = buf.String()
}
diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go
index f78ab684a0..d971fbe34b 100644
--- a/vendor/github.com/go-openapi/swag/util.go
+++ b/vendor/github.com/go-openapi/swag/util.go
@@ -341,12 +341,21 @@ type zeroable interface {
// 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() {
+ 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
- v := reflect.ValueOf(data)
switch v.Kind() {
case reflect.String:
return v.Len() == 0
@@ -358,14 +367,13 @@ func IsZero(data interface{}) bool {
return v.Uint() == 0
case reflect.Float32, reflect.Float64:
return v.Float() == 0
- case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
- return v.IsNil()
case reflect.Struct, reflect.Array:
return reflect.DeepEqual(data, reflect.Zero(v.Type()).Interface())
case reflect.Invalid:
return true
+ default:
+ return false
}
- return false
}
// AddInitialisms add additional initialisms
diff --git a/vendor/github.com/golang/protobuf/jsonpb/decode.go b/vendor/github.com/golang/protobuf/jsonpb/decode.go
deleted file mode 100644
index c6f66f1039..0000000000
--- a/vendor/github.com/golang/protobuf/jsonpb/decode.go
+++ /dev/null
@@ -1,531 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package jsonpb
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "math"
- "reflect"
- "strconv"
- "strings"
- "time"
-
- "github.com/golang/protobuf/proto"
- "google.golang.org/protobuf/encoding/protojson"
- protoV2 "google.golang.org/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
-)
-
-const wrapJSONUnmarshalV2 = false
-
-// UnmarshalNext unmarshals the next JSON object from d into m.
-func UnmarshalNext(d *json.Decoder, m proto.Message) error {
- return new(Unmarshaler).UnmarshalNext(d, m)
-}
-
-// Unmarshal unmarshals a JSON object from r into m.
-func Unmarshal(r io.Reader, m proto.Message) error {
- return new(Unmarshaler).Unmarshal(r, m)
-}
-
-// UnmarshalString unmarshals a JSON object from s into m.
-func UnmarshalString(s string, m proto.Message) error {
- return new(Unmarshaler).Unmarshal(strings.NewReader(s), m)
-}
-
-// Unmarshaler is a configurable object for converting from a JSON
-// representation to a protocol buffer object.
-type Unmarshaler struct {
- // AllowUnknownFields specifies whether to allow messages to contain
- // unknown JSON fields, as opposed to failing to unmarshal.
- AllowUnknownFields bool
-
- // AnyResolver is used to resolve the google.protobuf.Any well-known type.
- // If unset, the global registry is used by default.
- AnyResolver AnyResolver
-}
-
-// JSONPBUnmarshaler is implemented by protobuf messages that customize the way
-// they are unmarshaled from JSON. Messages that implement this should also
-// implement JSONPBMarshaler so that the custom format can be produced.
-//
-// The JSON unmarshaling must follow the JSON to proto specification:
-//
-// https://developers.google.com/protocol-buffers/docs/proto3#json
-//
-// Deprecated: Custom types should implement protobuf reflection instead.
-type JSONPBUnmarshaler interface {
- UnmarshalJSONPB(*Unmarshaler, []byte) error
-}
-
-// Unmarshal unmarshals a JSON object from r into m.
-func (u *Unmarshaler) Unmarshal(r io.Reader, m proto.Message) error {
- return u.UnmarshalNext(json.NewDecoder(r), m)
-}
-
-// UnmarshalNext unmarshals the next JSON object from d into m.
-func (u *Unmarshaler) UnmarshalNext(d *json.Decoder, m proto.Message) error {
- if m == nil {
- return errors.New("invalid nil message")
- }
-
- // Parse the next JSON object from the stream.
- raw := json.RawMessage{}
- if err := d.Decode(&raw); err != nil {
- return err
- }
-
- // Check for custom unmarshalers first since they may not properly
- // implement protobuf reflection that the logic below relies on.
- if jsu, ok := m.(JSONPBUnmarshaler); ok {
- return jsu.UnmarshalJSONPB(u, raw)
- }
-
- mr := proto.MessageReflect(m)
-
- // NOTE: For historical reasons, a top-level null is treated as a noop.
- // This is incorrect, but kept for compatibility.
- if string(raw) == "null" && mr.Descriptor().FullName() != "google.protobuf.Value" {
- return nil
- }
-
- if wrapJSONUnmarshalV2 {
- // NOTE: If input message is non-empty, we need to preserve merge semantics
- // of the old jsonpb implementation. These semantics are not supported by
- // the protobuf JSON specification.
- isEmpty := true
- mr.Range(func(protoreflect.FieldDescriptor, protoreflect.Value) bool {
- isEmpty = false // at least one iteration implies non-empty
- return false
- })
- if !isEmpty {
- // Perform unmarshaling into a newly allocated, empty message.
- mr = mr.New()
-
- // Use a defer to copy all unmarshaled fields into the original message.
- dst := proto.MessageReflect(m)
- defer mr.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
- dst.Set(fd, v)
- return true
- })
- }
-
- // Unmarshal using the v2 JSON unmarshaler.
- opts := protojson.UnmarshalOptions{
- DiscardUnknown: u.AllowUnknownFields,
- }
- if u.AnyResolver != nil {
- opts.Resolver = anyResolver{u.AnyResolver}
- }
- return opts.Unmarshal(raw, mr.Interface())
- } else {
- if err := u.unmarshalMessage(mr, raw); err != nil {
- return err
- }
- return protoV2.CheckInitialized(mr.Interface())
- }
-}
-
-func (u *Unmarshaler) unmarshalMessage(m protoreflect.Message, in []byte) error {
- md := m.Descriptor()
- fds := md.Fields()
-
- if jsu, ok := proto.MessageV1(m.Interface()).(JSONPBUnmarshaler); ok {
- return jsu.UnmarshalJSONPB(u, in)
- }
-
- if string(in) == "null" && md.FullName() != "google.protobuf.Value" {
- return nil
- }
-
- switch wellKnownType(md.FullName()) {
- case "Any":
- var jsonObject map[string]json.RawMessage
- if err := json.Unmarshal(in, &jsonObject); err != nil {
- return err
- }
-
- rawTypeURL, ok := jsonObject["@type"]
- if !ok {
- return errors.New("Any JSON doesn't have '@type'")
- }
- typeURL, err := unquoteString(string(rawTypeURL))
- if err != nil {
- return fmt.Errorf("can't unmarshal Any's '@type': %q", rawTypeURL)
- }
- m.Set(fds.ByNumber(1), protoreflect.ValueOfString(typeURL))
-
- var m2 protoreflect.Message
- if u.AnyResolver != nil {
- mi, err := u.AnyResolver.Resolve(typeURL)
- if err != nil {
- return err
- }
- m2 = proto.MessageReflect(mi)
- } else {
- mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL)
- if err != nil {
- if err == protoregistry.NotFound {
- return fmt.Errorf("could not resolve Any message type: %v", typeURL)
- }
- return err
- }
- m2 = mt.New()
- }
-
- if wellKnownType(m2.Descriptor().FullName()) != "" {
- rawValue, ok := jsonObject["value"]
- if !ok {
- return errors.New("Any JSON doesn't have 'value'")
- }
- if err := u.unmarshalMessage(m2, rawValue); err != nil {
- return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err)
- }
- } else {
- delete(jsonObject, "@type")
- rawJSON, err := json.Marshal(jsonObject)
- if err != nil {
- return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", err)
- }
- if err = u.unmarshalMessage(m2, rawJSON); err != nil {
- return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err)
- }
- }
-
- rawWire, err := protoV2.Marshal(m2.Interface())
- if err != nil {
- return fmt.Errorf("can't marshal proto %v into Any.Value: %v", typeURL, err)
- }
- m.Set(fds.ByNumber(2), protoreflect.ValueOfBytes(rawWire))
- return nil
- case "BoolValue", "BytesValue", "StringValue",
- "Int32Value", "UInt32Value", "FloatValue",
- "Int64Value", "UInt64Value", "DoubleValue":
- fd := fds.ByNumber(1)
- v, err := u.unmarshalValue(m.NewField(fd), in, fd)
- if err != nil {
- return err
- }
- m.Set(fd, v)
- return nil
- case "Duration":
- v, err := unquoteString(string(in))
- if err != nil {
- return err
- }
- d, err := time.ParseDuration(v)
- if err != nil {
- return fmt.Errorf("bad Duration: %v", err)
- }
-
- sec := d.Nanoseconds() / 1e9
- nsec := d.Nanoseconds() % 1e9
- m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec)))
- m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec)))
- return nil
- case "Timestamp":
- v, err := unquoteString(string(in))
- if err != nil {
- return err
- }
- t, err := time.Parse(time.RFC3339Nano, v)
- if err != nil {
- return fmt.Errorf("bad Timestamp: %v", err)
- }
-
- sec := t.Unix()
- nsec := t.Nanosecond()
- m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec)))
- m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec)))
- return nil
- case "Value":
- switch {
- case string(in) == "null":
- m.Set(fds.ByNumber(1), protoreflect.ValueOfEnum(0))
- case string(in) == "true":
- m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(true))
- case string(in) == "false":
- m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(false))
- case hasPrefixAndSuffix('"', in, '"'):
- s, err := unquoteString(string(in))
- if err != nil {
- return fmt.Errorf("unrecognized type for Value %q", in)
- }
- m.Set(fds.ByNumber(3), protoreflect.ValueOfString(s))
- case hasPrefixAndSuffix('[', in, ']'):
- v := m.Mutable(fds.ByNumber(6))
- return u.unmarshalMessage(v.Message(), in)
- case hasPrefixAndSuffix('{', in, '}'):
- v := m.Mutable(fds.ByNumber(5))
- return u.unmarshalMessage(v.Message(), in)
- default:
- f, err := strconv.ParseFloat(string(in), 0)
- if err != nil {
- return fmt.Errorf("unrecognized type for Value %q", in)
- }
- m.Set(fds.ByNumber(2), protoreflect.ValueOfFloat64(f))
- }
- return nil
- case "ListValue":
- var jsonArray []json.RawMessage
- if err := json.Unmarshal(in, &jsonArray); err != nil {
- return fmt.Errorf("bad ListValue: %v", err)
- }
-
- lv := m.Mutable(fds.ByNumber(1)).List()
- for _, raw := range jsonArray {
- ve := lv.NewElement()
- if err := u.unmarshalMessage(ve.Message(), raw); err != nil {
- return err
- }
- lv.Append(ve)
- }
- return nil
- case "Struct":
- var jsonObject map[string]json.RawMessage
- if err := json.Unmarshal(in, &jsonObject); err != nil {
- return fmt.Errorf("bad StructValue: %v", err)
- }
-
- mv := m.Mutable(fds.ByNumber(1)).Map()
- for key, raw := range jsonObject {
- kv := protoreflect.ValueOf(key).MapKey()
- vv := mv.NewValue()
- if err := u.unmarshalMessage(vv.Message(), raw); err != nil {
- return fmt.Errorf("bad value in StructValue for key %q: %v", key, err)
- }
- mv.Set(kv, vv)
- }
- return nil
- }
-
- var jsonObject map[string]json.RawMessage
- if err := json.Unmarshal(in, &jsonObject); err != nil {
- return err
- }
-
- // Handle known fields.
- for i := 0; i < fds.Len(); i++ {
- fd := fds.Get(i)
- if fd.IsWeak() && fd.Message().IsPlaceholder() {
- continue // weak reference is not linked in
- }
-
- // Search for any raw JSON value associated with this field.
- var raw json.RawMessage
- name := string(fd.Name())
- if fd.Kind() == protoreflect.GroupKind {
- name = string(fd.Message().Name())
- }
- if v, ok := jsonObject[name]; ok {
- delete(jsonObject, name)
- raw = v
- }
- name = string(fd.JSONName())
- if v, ok := jsonObject[name]; ok {
- delete(jsonObject, name)
- raw = v
- }
-
- field := m.NewField(fd)
- // Unmarshal the field value.
- if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd) && !isSingularJSONPBUnmarshaler(field, fd)) {
- continue
- }
- v, err := u.unmarshalValue(field, raw, fd)
- if err != nil {
- return err
- }
- m.Set(fd, v)
- }
-
- // Handle extension fields.
- for name, raw := range jsonObject {
- if !strings.HasPrefix(name, "[") || !strings.HasSuffix(name, "]") {
- continue
- }
-
- // Resolve the extension field by name.
- xname := protoreflect.FullName(name[len("[") : len(name)-len("]")])
- xt, _ := protoregistry.GlobalTypes.FindExtensionByName(xname)
- if xt == nil && isMessageSet(md) {
- xt, _ = protoregistry.GlobalTypes.FindExtensionByName(xname.Append("message_set_extension"))
- }
- if xt == nil {
- continue
- }
- delete(jsonObject, name)
- fd := xt.TypeDescriptor()
- if fd.ContainingMessage().FullName() != m.Descriptor().FullName() {
- return fmt.Errorf("extension field %q does not extend message %q", xname, m.Descriptor().FullName())
- }
-
- field := m.NewField(fd)
- // Unmarshal the field value.
- if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd) && !isSingularJSONPBUnmarshaler(field, fd)) {
- continue
- }
- v, err := u.unmarshalValue(field, raw, fd)
- if err != nil {
- return err
- }
- m.Set(fd, v)
- }
-
- if !u.AllowUnknownFields && len(jsonObject) > 0 {
- for name := range jsonObject {
- return fmt.Errorf("unknown field %q in %v", name, md.FullName())
- }
- }
- return nil
-}
-
-func isSingularWellKnownValue(fd protoreflect.FieldDescriptor) bool {
- if fd.Cardinality() == protoreflect.Repeated {
- return false
- }
- if md := fd.Message(); md != nil {
- return md.FullName() == "google.protobuf.Value"
- }
- if ed := fd.Enum(); ed != nil {
- return ed.FullName() == "google.protobuf.NullValue"
- }
- return false
-}
-
-func isSingularJSONPBUnmarshaler(v protoreflect.Value, fd protoreflect.FieldDescriptor) bool {
- if fd.Message() != nil && fd.Cardinality() != protoreflect.Repeated {
- _, ok := proto.MessageV1(v.Interface()).(JSONPBUnmarshaler)
- return ok
- }
- return false
-}
-
-func (u *Unmarshaler) unmarshalValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) {
- switch {
- case fd.IsList():
- var jsonArray []json.RawMessage
- if err := json.Unmarshal(in, &jsonArray); err != nil {
- return v, err
- }
- lv := v.List()
- for _, raw := range jsonArray {
- ve, err := u.unmarshalSingularValue(lv.NewElement(), raw, fd)
- if err != nil {
- return v, err
- }
- lv.Append(ve)
- }
- return v, nil
- case fd.IsMap():
- var jsonObject map[string]json.RawMessage
- if err := json.Unmarshal(in, &jsonObject); err != nil {
- return v, err
- }
- kfd := fd.MapKey()
- vfd := fd.MapValue()
- mv := v.Map()
- for key, raw := range jsonObject {
- var kv protoreflect.MapKey
- if kfd.Kind() == protoreflect.StringKind {
- kv = protoreflect.ValueOf(key).MapKey()
- } else {
- v, err := u.unmarshalSingularValue(kfd.Default(), []byte(key), kfd)
- if err != nil {
- return v, err
- }
- kv = v.MapKey()
- }
-
- vv, err := u.unmarshalSingularValue(mv.NewValue(), raw, vfd)
- if err != nil {
- return v, err
- }
- mv.Set(kv, vv)
- }
- return v, nil
- default:
- return u.unmarshalSingularValue(v, in, fd)
- }
-}
-
-var nonFinite = map[string]float64{
- `"NaN"`: math.NaN(),
- `"Infinity"`: math.Inf(+1),
- `"-Infinity"`: math.Inf(-1),
-}
-
-func (u *Unmarshaler) unmarshalSingularValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) {
- switch fd.Kind() {
- case protoreflect.BoolKind:
- return unmarshalValue(in, new(bool))
- case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
- return unmarshalValue(trimQuote(in), new(int32))
- case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
- return unmarshalValue(trimQuote(in), new(int64))
- case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
- return unmarshalValue(trimQuote(in), new(uint32))
- case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
- return unmarshalValue(trimQuote(in), new(uint64))
- case protoreflect.FloatKind:
- if f, ok := nonFinite[string(in)]; ok {
- return protoreflect.ValueOfFloat32(float32(f)), nil
- }
- return unmarshalValue(trimQuote(in), new(float32))
- case protoreflect.DoubleKind:
- if f, ok := nonFinite[string(in)]; ok {
- return protoreflect.ValueOfFloat64(float64(f)), nil
- }
- return unmarshalValue(trimQuote(in), new(float64))
- case protoreflect.StringKind:
- return unmarshalValue(in, new(string))
- case protoreflect.BytesKind:
- return unmarshalValue(in, new([]byte))
- case protoreflect.EnumKind:
- if hasPrefixAndSuffix('"', in, '"') {
- vd := fd.Enum().Values().ByName(protoreflect.Name(trimQuote(in)))
- if vd == nil {
- return v, fmt.Errorf("unknown value %q for enum %s", in, fd.Enum().FullName())
- }
- return protoreflect.ValueOfEnum(vd.Number()), nil
- }
- return unmarshalValue(in, new(protoreflect.EnumNumber))
- case protoreflect.MessageKind, protoreflect.GroupKind:
- err := u.unmarshalMessage(v.Message(), in)
- return v, err
- default:
- panic(fmt.Sprintf("invalid kind %v", fd.Kind()))
- }
-}
-
-func unmarshalValue(in []byte, v interface{}) (protoreflect.Value, error) {
- err := json.Unmarshal(in, v)
- return protoreflect.ValueOf(reflect.ValueOf(v).Elem().Interface()), err
-}
-
-func unquoteString(in string) (out string, err error) {
- err = json.Unmarshal([]byte(in), &out)
- return out, err
-}
-
-func hasPrefixAndSuffix(prefix byte, in []byte, suffix byte) bool {
- if len(in) >= 2 && in[0] == prefix && in[len(in)-1] == suffix {
- return true
- }
- return false
-}
-
-// trimQuote is like unquoteString but simply strips surrounding quotes.
-// This is incorrect, but is behavior done by the legacy implementation.
-func trimQuote(in []byte) []byte {
- if len(in) >= 2 && in[0] == '"' && in[len(in)-1] == '"' {
- in = in[1 : len(in)-1]
- }
- return in
-}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/encode.go b/vendor/github.com/golang/protobuf/jsonpb/encode.go
deleted file mode 100644
index e9438a93f3..0000000000
--- a/vendor/github.com/golang/protobuf/jsonpb/encode.go
+++ /dev/null
@@ -1,560 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package jsonpb
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "math"
- "reflect"
- "sort"
- "strconv"
- "strings"
- "time"
-
- "github.com/golang/protobuf/proto"
- "google.golang.org/protobuf/encoding/protojson"
- protoV2 "google.golang.org/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
-)
-
-const wrapJSONMarshalV2 = false
-
-// Marshaler is a configurable object for marshaling protocol buffer messages
-// to the specified JSON representation.
-type Marshaler struct {
- // OrigName specifies whether to use the original protobuf name for fields.
- OrigName bool
-
- // EnumsAsInts specifies whether to render enum values as integers,
- // as opposed to string values.
- EnumsAsInts bool
-
- // EmitDefaults specifies whether to render fields with zero values.
- EmitDefaults bool
-
- // Indent controls whether the output is compact or not.
- // If empty, the output is compact JSON. Otherwise, every JSON object
- // entry and JSON array value will be on its own line.
- // Each line will be preceded by repeated copies of Indent, where the
- // number of copies is the current indentation depth.
- Indent string
-
- // AnyResolver is used to resolve the google.protobuf.Any well-known type.
- // If unset, the global registry is used by default.
- AnyResolver AnyResolver
-}
-
-// JSONPBMarshaler is implemented by protobuf messages that customize the
-// way they are marshaled to JSON. Messages that implement this should also
-// implement JSONPBUnmarshaler so that the custom format can be parsed.
-//
-// The JSON marshaling must follow the proto to JSON specification:
-//
-// https://developers.google.com/protocol-buffers/docs/proto3#json
-//
-// Deprecated: Custom types should implement protobuf reflection instead.
-type JSONPBMarshaler interface {
- MarshalJSONPB(*Marshaler) ([]byte, error)
-}
-
-// Marshal serializes a protobuf message as JSON into w.
-func (jm *Marshaler) Marshal(w io.Writer, m proto.Message) error {
- b, err := jm.marshal(m)
- if len(b) > 0 {
- if _, err := w.Write(b); err != nil {
- return err
- }
- }
- return err
-}
-
-// MarshalToString serializes a protobuf message as JSON in string form.
-func (jm *Marshaler) MarshalToString(m proto.Message) (string, error) {
- b, err := jm.marshal(m)
- if err != nil {
- return "", err
- }
- return string(b), nil
-}
-
-func (jm *Marshaler) marshal(m proto.Message) ([]byte, error) {
- v := reflect.ValueOf(m)
- if m == nil || (v.Kind() == reflect.Ptr && v.IsNil()) {
- return nil, errors.New("Marshal called with nil")
- }
-
- // Check for custom marshalers first since they may not properly
- // implement protobuf reflection that the logic below relies on.
- if jsm, ok := m.(JSONPBMarshaler); ok {
- return jsm.MarshalJSONPB(jm)
- }
-
- if wrapJSONMarshalV2 {
- opts := protojson.MarshalOptions{
- UseProtoNames: jm.OrigName,
- UseEnumNumbers: jm.EnumsAsInts,
- EmitUnpopulated: jm.EmitDefaults,
- Indent: jm.Indent,
- }
- if jm.AnyResolver != nil {
- opts.Resolver = anyResolver{jm.AnyResolver}
- }
- return opts.Marshal(proto.MessageReflect(m).Interface())
- } else {
- // Check for unpopulated required fields first.
- m2 := proto.MessageReflect(m)
- if err := protoV2.CheckInitialized(m2.Interface()); err != nil {
- return nil, err
- }
-
- w := jsonWriter{Marshaler: jm}
- err := w.marshalMessage(m2, "", "")
- return w.buf, err
- }
-}
-
-type jsonWriter struct {
- *Marshaler
- buf []byte
-}
-
-func (w *jsonWriter) write(s string) {
- w.buf = append(w.buf, s...)
-}
-
-func (w *jsonWriter) marshalMessage(m protoreflect.Message, indent, typeURL string) error {
- if jsm, ok := proto.MessageV1(m.Interface()).(JSONPBMarshaler); ok {
- b, err := jsm.MarshalJSONPB(w.Marshaler)
- if err != nil {
- return err
- }
- if typeURL != "" {
- // we are marshaling this object to an Any type
- var js map[string]*json.RawMessage
- if err = json.Unmarshal(b, &js); err != nil {
- return fmt.Errorf("type %T produced invalid JSON: %v", m.Interface(), err)
- }
- turl, err := json.Marshal(typeURL)
- if err != nil {
- return fmt.Errorf("failed to marshal type URL %q to JSON: %v", typeURL, err)
- }
- js["@type"] = (*json.RawMessage)(&turl)
- if b, err = json.Marshal(js); err != nil {
- return err
- }
- }
- w.write(string(b))
- return nil
- }
-
- md := m.Descriptor()
- fds := md.Fields()
-
- // Handle well-known types.
- const secondInNanos = int64(time.Second / time.Nanosecond)
- switch wellKnownType(md.FullName()) {
- case "Any":
- return w.marshalAny(m, indent)
- case "BoolValue", "BytesValue", "StringValue",
- "Int32Value", "UInt32Value", "FloatValue",
- "Int64Value", "UInt64Value", "DoubleValue":
- fd := fds.ByNumber(1)
- return w.marshalValue(fd, m.Get(fd), indent)
- case "Duration":
- const maxSecondsInDuration = 315576000000
- // "Generated output always contains 0, 3, 6, or 9 fractional digits,
- // depending on required precision."
- s := m.Get(fds.ByNumber(1)).Int()
- ns := m.Get(fds.ByNumber(2)).Int()
- if s < -maxSecondsInDuration || s > maxSecondsInDuration {
- return fmt.Errorf("seconds out of range %v", s)
- }
- if ns <= -secondInNanos || ns >= secondInNanos {
- return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos)
- }
- if (s > 0 && ns < 0) || (s < 0 && ns > 0) {
- return errors.New("signs of seconds and nanos do not match")
- }
- var sign string
- if s < 0 || ns < 0 {
- sign, s, ns = "-", -1*s, -1*ns
- }
- x := fmt.Sprintf("%s%d.%09d", sign, s, ns)
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, ".000")
- w.write(fmt.Sprintf(`"%vs"`, x))
- return nil
- case "Timestamp":
- // "RFC 3339, where generated output will always be Z-normalized
- // and uses 0, 3, 6 or 9 fractional digits."
- s := m.Get(fds.ByNumber(1)).Int()
- ns := m.Get(fds.ByNumber(2)).Int()
- if ns < 0 || ns >= secondInNanos {
- return fmt.Errorf("ns out of range [0, %v)", secondInNanos)
- }
- t := time.Unix(s, ns).UTC()
- // time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits).
- x := t.Format("2006-01-02T15:04:05.000000000")
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, ".000")
- w.write(fmt.Sprintf(`"%vZ"`, x))
- return nil
- case "Value":
- // JSON value; which is a null, number, string, bool, object, or array.
- od := md.Oneofs().Get(0)
- fd := m.WhichOneof(od)
- if fd == nil {
- return errors.New("nil Value")
- }
- return w.marshalValue(fd, m.Get(fd), indent)
- case "Struct", "ListValue":
- // JSON object or array.
- fd := fds.ByNumber(1)
- return w.marshalValue(fd, m.Get(fd), indent)
- }
-
- w.write("{")
- if w.Indent != "" {
- w.write("\n")
- }
-
- firstField := true
- if typeURL != "" {
- if err := w.marshalTypeURL(indent, typeURL); err != nil {
- return err
- }
- firstField = false
- }
-
- for i := 0; i < fds.Len(); {
- fd := fds.Get(i)
- if od := fd.ContainingOneof(); od != nil {
- fd = m.WhichOneof(od)
- i += od.Fields().Len()
- if fd == nil {
- continue
- }
- } else {
- i++
- }
-
- v := m.Get(fd)
-
- if !m.Has(fd) {
- if !w.EmitDefaults || fd.ContainingOneof() != nil {
- continue
- }
- if fd.Cardinality() != protoreflect.Repeated && (fd.Message() != nil || fd.Syntax() == protoreflect.Proto2) {
- v = protoreflect.Value{} // use "null" for singular messages or proto2 scalars
- }
- }
-
- if !firstField {
- w.writeComma()
- }
- if err := w.marshalField(fd, v, indent); err != nil {
- return err
- }
- firstField = false
- }
-
- // Handle proto2 extensions.
- if md.ExtensionRanges().Len() > 0 {
- // Collect a sorted list of all extension descriptor and values.
- type ext struct {
- desc protoreflect.FieldDescriptor
- val protoreflect.Value
- }
- var exts []ext
- m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
- if fd.IsExtension() {
- exts = append(exts, ext{fd, v})
- }
- return true
- })
- sort.Slice(exts, func(i, j int) bool {
- return exts[i].desc.Number() < exts[j].desc.Number()
- })
-
- for _, ext := range exts {
- if !firstField {
- w.writeComma()
- }
- if err := w.marshalField(ext.desc, ext.val, indent); err != nil {
- return err
- }
- firstField = false
- }
- }
-
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- }
- w.write("}")
- return nil
-}
-
-func (w *jsonWriter) writeComma() {
- if w.Indent != "" {
- w.write(",\n")
- } else {
- w.write(",")
- }
-}
-
-func (w *jsonWriter) marshalAny(m protoreflect.Message, indent string) error {
- // "If the Any contains a value that has a special JSON mapping,
- // it will be converted as follows: {"@type": xxx, "value": yyy}.
- // Otherwise, the value will be converted into a JSON object,
- // and the "@type" field will be inserted to indicate the actual data type."
- md := m.Descriptor()
- typeURL := m.Get(md.Fields().ByNumber(1)).String()
- rawVal := m.Get(md.Fields().ByNumber(2)).Bytes()
-
- var m2 protoreflect.Message
- if w.AnyResolver != nil {
- mi, err := w.AnyResolver.Resolve(typeURL)
- if err != nil {
- return err
- }
- m2 = proto.MessageReflect(mi)
- } else {
- mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL)
- if err != nil {
- return err
- }
- m2 = mt.New()
- }
-
- if err := protoV2.Unmarshal(rawVal, m2.Interface()); err != nil {
- return err
- }
-
- if wellKnownType(m2.Descriptor().FullName()) == "" {
- return w.marshalMessage(m2, indent, typeURL)
- }
-
- w.write("{")
- if w.Indent != "" {
- w.write("\n")
- }
- if err := w.marshalTypeURL(indent, typeURL); err != nil {
- return err
- }
- w.writeComma()
- if w.Indent != "" {
- w.write(indent)
- w.write(w.Indent)
- w.write(`"value": `)
- } else {
- w.write(`"value":`)
- }
- if err := w.marshalMessage(m2, indent+w.Indent, ""); err != nil {
- return err
- }
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- }
- w.write("}")
- return nil
-}
-
-func (w *jsonWriter) marshalTypeURL(indent, typeURL string) error {
- if w.Indent != "" {
- w.write(indent)
- w.write(w.Indent)
- }
- w.write(`"@type":`)
- if w.Indent != "" {
- w.write(" ")
- }
- b, err := json.Marshal(typeURL)
- if err != nil {
- return err
- }
- w.write(string(b))
- return nil
-}
-
-// marshalField writes field description and value to the Writer.
-func (w *jsonWriter) marshalField(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error {
- if w.Indent != "" {
- w.write(indent)
- w.write(w.Indent)
- }
- w.write(`"`)
- switch {
- case fd.IsExtension():
- // For message set, use the fname of the message as the extension name.
- name := string(fd.FullName())
- if isMessageSet(fd.ContainingMessage()) {
- name = strings.TrimSuffix(name, ".message_set_extension")
- }
-
- w.write("[" + name + "]")
- case w.OrigName:
- name := string(fd.Name())
- if fd.Kind() == protoreflect.GroupKind {
- name = string(fd.Message().Name())
- }
- w.write(name)
- default:
- w.write(string(fd.JSONName()))
- }
- w.write(`":`)
- if w.Indent != "" {
- w.write(" ")
- }
- return w.marshalValue(fd, v, indent)
-}
-
-func (w *jsonWriter) marshalValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error {
- switch {
- case fd.IsList():
- w.write("[")
- comma := ""
- lv := v.List()
- for i := 0; i < lv.Len(); i++ {
- w.write(comma)
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- w.write(w.Indent)
- w.write(w.Indent)
- }
- if err := w.marshalSingularValue(fd, lv.Get(i), indent+w.Indent); err != nil {
- return err
- }
- comma = ","
- }
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- w.write(w.Indent)
- }
- w.write("]")
- return nil
- case fd.IsMap():
- kfd := fd.MapKey()
- vfd := fd.MapValue()
- mv := v.Map()
-
- // Collect a sorted list of all map keys and values.
- type entry struct{ key, val protoreflect.Value }
- var entries []entry
- mv.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool {
- entries = append(entries, entry{k.Value(), v})
- return true
- })
- sort.Slice(entries, func(i, j int) bool {
- switch kfd.Kind() {
- case protoreflect.BoolKind:
- return !entries[i].key.Bool() && entries[j].key.Bool()
- case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
- return entries[i].key.Int() < entries[j].key.Int()
- case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
- return entries[i].key.Uint() < entries[j].key.Uint()
- case protoreflect.StringKind:
- return entries[i].key.String() < entries[j].key.String()
- default:
- panic("invalid kind")
- }
- })
-
- w.write(`{`)
- comma := ""
- for _, entry := range entries {
- w.write(comma)
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- w.write(w.Indent)
- w.write(w.Indent)
- }
-
- s := fmt.Sprint(entry.key.Interface())
- b, err := json.Marshal(s)
- if err != nil {
- return err
- }
- w.write(string(b))
-
- w.write(`:`)
- if w.Indent != "" {
- w.write(` `)
- }
-
- if err := w.marshalSingularValue(vfd, entry.val, indent+w.Indent); err != nil {
- return err
- }
- comma = ","
- }
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- w.write(w.Indent)
- }
- w.write(`}`)
- return nil
- default:
- return w.marshalSingularValue(fd, v, indent)
- }
-}
-
-func (w *jsonWriter) marshalSingularValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error {
- switch {
- case !v.IsValid():
- w.write("null")
- return nil
- case fd.Message() != nil:
- return w.marshalMessage(v.Message(), indent+w.Indent, "")
- case fd.Enum() != nil:
- if fd.Enum().FullName() == "google.protobuf.NullValue" {
- w.write("null")
- return nil
- }
-
- vd := fd.Enum().Values().ByNumber(v.Enum())
- if vd == nil || w.EnumsAsInts {
- w.write(strconv.Itoa(int(v.Enum())))
- } else {
- w.write(`"` + string(vd.Name()) + `"`)
- }
- return nil
- default:
- switch v.Interface().(type) {
- case float32, float64:
- switch {
- case math.IsInf(v.Float(), +1):
- w.write(`"Infinity"`)
- return nil
- case math.IsInf(v.Float(), -1):
- w.write(`"-Infinity"`)
- return nil
- case math.IsNaN(v.Float()):
- w.write(`"NaN"`)
- return nil
- }
- case int64, uint64:
- w.write(fmt.Sprintf(`"%d"`, v.Interface()))
- return nil
- }
-
- b, err := json.Marshal(v.Interface())
- if err != nil {
- return err
- }
- w.write(string(b))
- return nil
- }
-}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/json.go b/vendor/github.com/golang/protobuf/jsonpb/json.go
deleted file mode 100644
index 480e2448de..0000000000
--- a/vendor/github.com/golang/protobuf/jsonpb/json.go
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package jsonpb provides functionality to marshal and unmarshal between a
-// protocol buffer message and JSON. It follows the specification at
-// https://developers.google.com/protocol-buffers/docs/proto3#json.
-//
-// Do not rely on the default behavior of the standard encoding/json package
-// when called on generated message types as it does not operate correctly.
-//
-// Deprecated: Use the "google.golang.org/protobuf/encoding/protojson"
-// package instead.
-package jsonpb
-
-import (
- "github.com/golang/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
- "google.golang.org/protobuf/runtime/protoimpl"
-)
-
-// AnyResolver takes a type URL, present in an Any message,
-// and resolves it into an instance of the associated message.
-type AnyResolver interface {
- Resolve(typeURL string) (proto.Message, error)
-}
-
-type anyResolver struct{ AnyResolver }
-
-func (r anyResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) {
- return r.FindMessageByURL(string(message))
-}
-
-func (r anyResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) {
- m, err := r.Resolve(url)
- if err != nil {
- return nil, err
- }
- return protoimpl.X.MessageTypeOf(m), nil
-}
-
-func (r anyResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {
- return protoregistry.GlobalTypes.FindExtensionByName(field)
-}
-
-func (r anyResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {
- return protoregistry.GlobalTypes.FindExtensionByNumber(message, field)
-}
-
-func wellKnownType(s protoreflect.FullName) string {
- if s.Parent() == "google.protobuf" {
- switch s.Name() {
- case "Empty", "Any",
- "BoolValue", "BytesValue", "StringValue",
- "Int32Value", "UInt32Value", "FloatValue",
- "Int64Value", "UInt64Value", "DoubleValue",
- "Duration", "Timestamp",
- "NullValue", "Struct", "Value", "ListValue":
- return string(s.Name())
- }
- }
- return ""
-}
-
-func isMessageSet(md protoreflect.MessageDescriptor) bool {
- ms, ok := md.(interface{ IsMessageSet() bool })
- return ok && ms.IsMessageSet()
-}
diff --git a/vendor/github.com/google/cel-go/cel/BUILD.bazel b/vendor/github.com/google/cel-go/cel/BUILD.bazel
index 0905f63539..6e2fc073d4 100644
--- a/vendor/github.com/google/cel-go/cel/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/cel/BUILD.bazel
@@ -10,9 +10,12 @@ go_library(
"cel.go",
"decls.go",
"env.go",
+ "folding.go",
"io.go",
+ "inlining.go",
"library.go",
"macro.go",
+ "optimizer.go",
"options.go",
"program.go",
"validator.go",
@@ -56,7 +59,11 @@ go_test(
"cel_test.go",
"decls_test.go",
"env_test.go",
+ "folding_test.go",
"io_test.go",
+ "inlining_test.go",
+ "optimizer_test.go",
+ "validator_test.go",
],
data = [
"//cel/testdata:gen_test_fds",
@@ -70,6 +77,7 @@ go_test(
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
"//common/types/traits:go_default_library",
+ "//ext:go_default_library",
"//test:go_default_library",
"//test/proto2pb:go_default_library",
"//test/proto3pb:go_default_library",
diff --git a/vendor/github.com/google/cel-go/cel/decls.go b/vendor/github.com/google/cel-go/cel/decls.go
index 0f9501341b..b59e3708de 100644
--- a/vendor/github.com/google/cel-go/cel/decls.go
+++ b/vendor/github.com/google/cel-go/cel/decls.go
@@ -353,43 +353,3 @@ func ExprDeclToDeclaration(d *exprpb.Decl) (EnvOption, error) {
return nil, fmt.Errorf("unsupported decl: %v", d)
}
}
-
-func typeValueToKind(tv ref.Type) (Kind, error) {
- switch tv {
- case types.BoolType:
- return BoolKind, nil
- case types.DoubleType:
- return DoubleKind, nil
- case types.IntType:
- return IntKind, nil
- case types.UintType:
- return UintKind, nil
- case types.ListType:
- return ListKind, nil
- case types.MapType:
- return MapKind, nil
- case types.StringType:
- return StringKind, nil
- case types.BytesType:
- return BytesKind, nil
- case types.DurationType:
- return DurationKind, nil
- case types.TimestampType:
- return TimestampKind, nil
- case types.NullType:
- return NullTypeKind, nil
- case types.TypeType:
- return TypeKind, nil
- default:
- switch tv.TypeName() {
- case "dyn":
- return DynKind, nil
- case "google.protobuf.Any":
- return AnyKind, nil
- case "optional":
- return OpaqueKind, nil
- default:
- return 0, fmt.Errorf("no known conversion for type of %s", tv.TypeName())
- }
- }
-}
diff --git a/vendor/github.com/google/cel-go/cel/env.go b/vendor/github.com/google/cel-go/cel/env.go
index b5c3b4cc55..6568a8b809 100644
--- a/vendor/github.com/google/cel-go/cel/env.go
+++ b/vendor/github.com/google/cel-go/cel/env.go
@@ -38,26 +38,42 @@ type Source = common.Source
// Ast representing the checked or unchecked expression, its source, and related metadata such as
// source position information.
type Ast struct {
- expr *exprpb.Expr
- info *exprpb.SourceInfo
- source Source
- refMap map[int64]*celast.ReferenceInfo
- typeMap map[int64]*types.Type
+ source Source
+ impl *celast.AST
+}
+
+// NativeRep converts the AST to a Go-native representation.
+func (ast *Ast) NativeRep() *celast.AST {
+ return ast.impl
}
// Expr returns the proto serializable instance of the parsed/checked expression.
+//
+// Deprecated: prefer cel.AstToCheckedExpr() or cel.AstToParsedExpr() and call GetExpr()
+// the result instead.
func (ast *Ast) Expr() *exprpb.Expr {
- return ast.expr
+ if ast == nil {
+ return nil
+ }
+ pbExpr, _ := celast.ExprToProto(ast.impl.Expr())
+ return pbExpr
}
// IsChecked returns whether the Ast value has been successfully type-checked.
func (ast *Ast) IsChecked() bool {
- return ast.typeMap != nil && len(ast.typeMap) > 0
+ if ast == nil {
+ return false
+ }
+ return ast.impl.IsChecked()
}
// SourceInfo returns character offset and newline position information about expression elements.
func (ast *Ast) SourceInfo() *exprpb.SourceInfo {
- return ast.info
+ if ast == nil {
+ return nil
+ }
+ pbInfo, _ := celast.SourceInfoToProto(ast.impl.SourceInfo())
+ return pbInfo
}
// ResultType returns the output type of the expression if the Ast has been type-checked, else
@@ -65,9 +81,6 @@ func (ast *Ast) SourceInfo() *exprpb.SourceInfo {
//
// Deprecated: use OutputType
func (ast *Ast) ResultType() *exprpb.Type {
- if !ast.IsChecked() {
- return chkdecls.Dyn
- }
out := ast.OutputType()
t, err := TypeToExprType(out)
if err != nil {
@@ -79,16 +92,18 @@ func (ast *Ast) ResultType() *exprpb.Type {
// OutputType returns the output type of the expression if the Ast has been type-checked, else
// returns cel.DynType as the parse step cannot infer types.
func (ast *Ast) OutputType() *Type {
- t, found := ast.typeMap[ast.expr.GetId()]
- if !found {
- return DynType
+ if ast == nil {
+ return types.ErrorType
}
- return t
+ return ast.impl.GetType(ast.impl.Expr().ID())
}
// Source returns a view of the input used to create the Ast. This source may be complete or
// constructed from the SourceInfo.
func (ast *Ast) Source() Source {
+ if ast == nil {
+ return nil
+ }
return ast.source
}
@@ -198,29 +213,28 @@ func NewCustomEnv(opts ...EnvOption) (*Env, error) {
// It is possible to have both non-nil Ast and Issues values returned from this call: however,
// the mere presence of an Ast does not imply that it is valid for use.
func (e *Env) Check(ast *Ast) (*Ast, *Issues) {
- // Note, errors aren't currently possible on the Ast to ParsedExpr conversion.
- pe, _ := AstToParsedExpr(ast)
-
// Construct the internal checker env, erroring if there is an issue adding the declarations.
chk, err := e.initChecker()
if err != nil {
errs := common.NewErrors(ast.Source())
errs.ReportError(common.NoLocation, err.Error())
- return nil, NewIssuesWithSourceInfo(errs, ast.SourceInfo())
+ return nil, NewIssuesWithSourceInfo(errs, ast.impl.SourceInfo())
}
- res, errs := checker.Check(pe, ast.Source(), chk)
+ checked, errs := checker.Check(ast.impl, ast.Source(), chk)
if len(errs.GetErrors()) > 0 {
- return nil, NewIssuesWithSourceInfo(errs, ast.SourceInfo())
+ return nil, NewIssuesWithSourceInfo(errs, ast.impl.SourceInfo())
}
// Manually create the Ast to ensure that the Ast source information (which may be more
// detailed than the information provided by Check), is returned to the caller.
ast = &Ast{
- source: ast.Source(),
- expr: res.Expr,
- info: res.SourceInfo,
- refMap: res.ReferenceMap,
- typeMap: res.TypeMap}
+ source: ast.Source(),
+ impl: checked}
+
+ // Avoid creating a validator config if it's not needed.
+ if len(e.validators) == 0 {
+ return ast, nil
+ }
// Generate a validator configuration from the set of configured validators.
vConfig := newValidatorConfig()
@@ -230,9 +244,9 @@ func (e *Env) Check(ast *Ast) (*Ast, *Issues) {
}
}
// Apply additional validators on the type-checked result.
- iss := NewIssuesWithSourceInfo(errs, ast.SourceInfo())
+ iss := NewIssuesWithSourceInfo(errs, ast.impl.SourceInfo())
for _, v := range e.validators {
- v.Validate(e, vConfig, res, iss)
+ v.Validate(e, vConfig, checked, iss)
}
if iss.Err() != nil {
return nil, iss
@@ -429,16 +443,11 @@ func (e *Env) Parse(txt string) (*Ast, *Issues) {
// It is possible to have both non-nil Ast and Issues values returned from this call; however,
// the mere presence of an Ast does not imply that it is valid for use.
func (e *Env) ParseSource(src Source) (*Ast, *Issues) {
- res, errs := e.prsr.Parse(src)
+ parsed, errs := e.prsr.Parse(src)
if len(errs.GetErrors()) > 0 {
return nil, &Issues{errs: errs}
}
- // Manually create the Ast to ensure that the text source information is propagated on
- // subsequent calls to Check.
- return &Ast{
- source: src,
- expr: res.GetExpr(),
- info: res.GetSourceInfo()}, nil
+ return &Ast{source: src, impl: parsed}, nil
}
// Program generates an evaluable instance of the Ast within the environment (Env).
@@ -534,8 +543,9 @@ func (e *Env) PartialVars(vars any) (interpreter.PartialActivation, error) {
// TODO: Consider adding an option to generate a Program.Residual to avoid round-tripping to an
// Ast format and then Program again.
func (e *Env) ResidualAst(a *Ast, details *EvalDetails) (*Ast, error) {
- pruned := interpreter.PruneAst(a.Expr(), a.SourceInfo().GetMacroCalls(), details.State())
- expr, err := AstToString(ParsedExprToAst(pruned))
+ pruned := interpreter.PruneAst(a.impl.Expr(), a.impl.SourceInfo().MacroCalls(), details.State())
+ newAST := &Ast{source: a.Source(), impl: pruned}
+ expr, err := AstToString(newAST)
if err != nil {
return nil, err
}
@@ -556,16 +566,10 @@ func (e *Env) ResidualAst(a *Ast, details *EvalDetails) (*Ast, error) {
// EstimateCost estimates the cost of a type checked CEL expression using the length estimates of input data and
// extension functions provided by estimator.
func (e *Env) EstimateCost(ast *Ast, estimator checker.CostEstimator, opts ...checker.CostOption) (checker.CostEstimate, error) {
- checked := &celast.CheckedAST{
- Expr: ast.Expr(),
- SourceInfo: ast.SourceInfo(),
- TypeMap: ast.typeMap,
- ReferenceMap: ast.refMap,
- }
extendedOpts := make([]checker.CostOption, 0, len(e.costOptions))
extendedOpts = append(extendedOpts, opts...)
extendedOpts = append(extendedOpts, e.costOptions...)
- return checker.Cost(checked, estimator, extendedOpts...)
+ return checker.Cost(ast.impl, estimator, extendedOpts...)
}
// configure applies a series of EnvOptions to the current environment.
@@ -707,7 +711,7 @@ type Error = common.Error
// Note: in the future, non-fatal warnings and notices may be inspectable via the Issues struct.
type Issues struct {
errs *common.Errors
- info *exprpb.SourceInfo
+ info *celast.SourceInfo
}
// NewIssues returns an Issues struct from a common.Errors object.
@@ -718,7 +722,7 @@ func NewIssues(errs *common.Errors) *Issues {
// NewIssuesWithSourceInfo returns an Issues struct from a common.Errors object with SourceInfo metatata
// which can be used with the `ReportErrorAtID` method for additional error reports within the context
// information that's inferred from an expression id.
-func NewIssuesWithSourceInfo(errs *common.Errors, info *exprpb.SourceInfo) *Issues {
+func NewIssuesWithSourceInfo(errs *common.Errors, info *celast.SourceInfo) *Issues {
return &Issues{
errs: errs,
info: info,
@@ -768,30 +772,7 @@ func (i *Issues) String() string {
// The source metadata for the expression at `id`, if present, is attached to the error report.
// To ensure that source metadata is attached to error reports, use NewIssuesWithSourceInfo.
func (i *Issues) ReportErrorAtID(id int64, message string, args ...any) {
- i.errs.ReportErrorAtID(id, locationByID(id, i.info), message, args...)
-}
-
-// locationByID returns a common.Location given an expression id.
-//
-// TODO: move this functionality into the native SourceInfo and an overhaul of the common.Source
-// as this implementation relies on the abstractions present in the protobuf SourceInfo object,
-// and is replicated in the checker.
-func locationByID(id int64, sourceInfo *exprpb.SourceInfo) common.Location {
- positions := sourceInfo.GetPositions()
- var line = 1
- if offset, found := positions[id]; found {
- col := int(offset)
- for _, lineOffset := range sourceInfo.GetLineOffsets() {
- if lineOffset < offset {
- line++
- col = int(offset - lineOffset)
- } else {
- break
- }
- }
- return common.NewLocation(line, col)
- }
- return common.NoLocation
+ i.errs.ReportErrorAtID(id, i.info.GetStartLocation(id), message, args...)
}
// getStdEnv lazy initializes the CEL standard environment.
@@ -822,6 +803,13 @@ func (p *interopCELTypeProvider) FindStructType(typeName string) (*types.Type, b
return nil, false
}
+// FindStructFieldNames returns an empty set of field for the interop provider.
+//
+// To inspect the field names, migrate to a `types.Provider` implementation.
+func (p *interopCELTypeProvider) FindStructFieldNames(typeName string) ([]string, bool) {
+ return []string{}, false
+}
+
// FindStructFieldType returns a types.FieldType instance for the given fully-qualified typeName and field
// name, if one exists.
//
diff --git a/vendor/github.com/google/cel-go/cel/folding.go b/vendor/github.com/google/cel-go/cel/folding.go
new file mode 100644
index 0000000000..d7060896d3
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/folding.go
@@ -0,0 +1,559 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cel
+
+import (
+ "fmt"
+
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/operators"
+ "github.com/google/cel-go/common/overloads"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+ "github.com/google/cel-go/common/types/traits"
+)
+
+// ConstantFoldingOption defines a functional option for configuring constant folding.
+type ConstantFoldingOption func(opt *constantFoldingOptimizer) (*constantFoldingOptimizer, error)
+
+// MaxConstantFoldIterations limits the number of times literals may be folding during optimization.
+//
+// Defaults to 100 if not set.
+func MaxConstantFoldIterations(limit int) ConstantFoldingOption {
+ return func(opt *constantFoldingOptimizer) (*constantFoldingOptimizer, error) {
+ opt.maxFoldIterations = limit
+ return opt, nil
+ }
+}
+
+// NewConstantFoldingOptimizer creates an optimizer which inlines constant scalar an aggregate
+// literal values within function calls and select statements with their evaluated result.
+func NewConstantFoldingOptimizer(opts ...ConstantFoldingOption) (ASTOptimizer, error) {
+ folder := &constantFoldingOptimizer{
+ maxFoldIterations: defaultMaxConstantFoldIterations,
+ }
+ var err error
+ for _, o := range opts {
+ folder, err = o(folder)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return folder, nil
+}
+
+type constantFoldingOptimizer struct {
+ maxFoldIterations int
+}
+
+// Optimize queries the expression graph for scalar and aggregate literal expressions within call and
+// select statements and then evaluates them and replaces the call site with the literal result.
+//
+// Note: only values which can be represented as literals in CEL syntax are supported.
+func (opt *constantFoldingOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST) *ast.AST {
+ root := ast.NavigateAST(a)
+
+ // Walk the list of foldable expression and continue to fold until there are no more folds left.
+ // All of the fold candidates returned by the constantExprMatcher should succeed unless there's
+ // a logic bug with the selection of expressions.
+ foldableExprs := ast.MatchDescendants(root, constantExprMatcher)
+ foldCount := 0
+ for len(foldableExprs) != 0 && foldCount < opt.maxFoldIterations {
+ for _, fold := range foldableExprs {
+ // If the expression could be folded because it's a non-strict call, and the
+ // branches are pruned, continue to the next fold.
+ if fold.Kind() == ast.CallKind && maybePruneBranches(ctx, fold) {
+ continue
+ }
+ // Otherwise, assume all context is needed to evaluate the expression.
+ err := tryFold(ctx, a, fold)
+ if err != nil {
+ ctx.ReportErrorAtID(fold.ID(), "constant-folding evaluation failed: %v", err.Error())
+ return a
+ }
+ }
+ foldCount++
+ foldableExprs = ast.MatchDescendants(root, constantExprMatcher)
+ }
+ // Once all of the constants have been folded, try to run through the remaining comprehensions
+ // one last time. In this case, there's no guarantee they'll run, so we only update the
+ // target comprehension node with the literal value if the evaluation succeeds.
+ for _, compre := range ast.MatchDescendants(root, ast.KindMatcher(ast.ComprehensionKind)) {
+ tryFold(ctx, a, compre)
+ }
+
+ // If the output is a list, map, or struct which contains optional entries, then prune it
+ // to make sure that the optionals, if resolved, do not surface in the output literal.
+ pruneOptionalElements(ctx, root)
+
+ // Ensure that all intermediate values in the folded expression can be represented as valid
+ // CEL literals within the AST structure. Use `PostOrderVisit` rather than `MatchDescendents`
+ // to avoid extra allocations during this final pass through the AST.
+ ast.PostOrderVisit(root, ast.NewExprVisitor(func(e ast.Expr) {
+ if e.Kind() != ast.LiteralKind {
+ return
+ }
+ val := e.AsLiteral()
+ adapted, err := adaptLiteral(ctx, val)
+ if err != nil {
+ ctx.ReportErrorAtID(root.ID(), "constant-folding evaluation failed: %v", err.Error())
+ return
+ }
+ ctx.UpdateExpr(e, adapted)
+ }))
+
+ return a
+}
+
+// tryFold attempts to evaluate a sub-expression to a literal.
+//
+// If the evaluation succeeds, the input expr value will be modified to become a literal, otherwise
+// the method will return an error.
+func tryFold(ctx *OptimizerContext, a *ast.AST, expr ast.Expr) error {
+ // Assume all context is needed to evaluate the expression.
+ subAST := &Ast{
+ impl: ast.NewCheckedAST(ast.NewAST(expr, a.SourceInfo()), a.TypeMap(), a.ReferenceMap()),
+ }
+ prg, err := ctx.Program(subAST)
+ if err != nil {
+ return err
+ }
+ out, _, err := prg.Eval(NoVars())
+ if err != nil {
+ return err
+ }
+ // Update the fold expression to be a literal.
+ ctx.UpdateExpr(expr, ctx.NewLiteral(out))
+ return nil
+}
+
+// maybePruneBranches inspects the non-strict call expression to determine whether
+// a branch can be removed. Evaluation will naturally prune logical and / or calls,
+// but conditional will not be pruned cleanly, so this is one small area where the
+// constant folding step reimplements a portion of the evaluator.
+func maybePruneBranches(ctx *OptimizerContext, expr ast.NavigableExpr) bool {
+ call := expr.AsCall()
+ args := call.Args()
+ switch call.FunctionName() {
+ case operators.LogicalAnd, operators.LogicalOr:
+ return maybeShortcircuitLogic(ctx, call.FunctionName(), args, expr)
+ case operators.Conditional:
+ cond := args[0]
+ truthy := args[1]
+ falsy := args[2]
+ if cond.Kind() != ast.LiteralKind {
+ return false
+ }
+ if cond.AsLiteral() == types.True {
+ ctx.UpdateExpr(expr, truthy)
+ } else {
+ ctx.UpdateExpr(expr, falsy)
+ }
+ return true
+ case operators.In:
+ haystack := args[1]
+ if haystack.Kind() == ast.ListKind && haystack.AsList().Size() == 0 {
+ ctx.UpdateExpr(expr, ctx.NewLiteral(types.False))
+ return true
+ }
+ needle := args[0]
+ if needle.Kind() == ast.LiteralKind && haystack.Kind() == ast.ListKind {
+ needleValue := needle.AsLiteral()
+ list := haystack.AsList()
+ for _, e := range list.Elements() {
+ if e.Kind() == ast.LiteralKind && e.AsLiteral().Equal(needleValue) == types.True {
+ ctx.UpdateExpr(expr, ctx.NewLiteral(types.True))
+ return true
+ }
+ }
+ }
+ }
+ return false
+}
+
+func maybeShortcircuitLogic(ctx *OptimizerContext, function string, args []ast.Expr, expr ast.NavigableExpr) bool {
+ shortcircuit := types.False
+ skip := types.True
+ if function == operators.LogicalOr {
+ shortcircuit = types.True
+ skip = types.False
+ }
+ newArgs := []ast.Expr{}
+ for _, arg := range args {
+ if arg.Kind() != ast.LiteralKind {
+ newArgs = append(newArgs, arg)
+ continue
+ }
+ if arg.AsLiteral() == skip {
+ continue
+ }
+ if arg.AsLiteral() == shortcircuit {
+ ctx.UpdateExpr(expr, arg)
+ return true
+ }
+ }
+ if len(newArgs) == 0 {
+ newArgs = append(newArgs, args[0])
+ ctx.UpdateExpr(expr, newArgs[0])
+ return true
+ }
+ if len(newArgs) == 1 {
+ ctx.UpdateExpr(expr, newArgs[0])
+ return true
+ }
+ ctx.UpdateExpr(expr, ctx.NewCall(function, newArgs...))
+ return true
+}
+
+// pruneOptionalElements works from the bottom up to resolve optional elements within
+// aggregate literals.
+//
+// Note, many aggregate literals will be resolved as arguments to functions or select
+// statements, so this method exists to handle the case where the literal could not be
+// fully resolved or exists outside of a call, select, or comprehension context.
+func pruneOptionalElements(ctx *OptimizerContext, root ast.NavigableExpr) {
+ aggregateLiterals := ast.MatchDescendants(root, aggregateLiteralMatcher)
+ for _, lit := range aggregateLiterals {
+ switch lit.Kind() {
+ case ast.ListKind:
+ pruneOptionalListElements(ctx, lit)
+ case ast.MapKind:
+ pruneOptionalMapEntries(ctx, lit)
+ case ast.StructKind:
+ pruneOptionalStructFields(ctx, lit)
+ }
+ }
+}
+
+func pruneOptionalListElements(ctx *OptimizerContext, e ast.Expr) {
+ l := e.AsList()
+ elems := l.Elements()
+ optIndices := l.OptionalIndices()
+ if len(optIndices) == 0 {
+ return
+ }
+ updatedElems := []ast.Expr{}
+ updatedIndices := []int32{}
+ newOptIndex := -1
+ for _, e := range elems {
+ newOptIndex++
+ if !l.IsOptional(int32(newOptIndex)) {
+ updatedElems = append(updatedElems, e)
+ continue
+ }
+ if e.Kind() != ast.LiteralKind {
+ updatedElems = append(updatedElems, e)
+ updatedIndices = append(updatedIndices, int32(newOptIndex))
+ continue
+ }
+ optElemVal, ok := e.AsLiteral().(*types.Optional)
+ if !ok {
+ updatedElems = append(updatedElems, e)
+ updatedIndices = append(updatedIndices, int32(newOptIndex))
+ continue
+ }
+ if !optElemVal.HasValue() {
+ newOptIndex-- // Skipping causes the list to get smaller.
+ continue
+ }
+ ctx.UpdateExpr(e, ctx.NewLiteral(optElemVal.GetValue()))
+ updatedElems = append(updatedElems, e)
+ }
+ ctx.UpdateExpr(e, ctx.NewList(updatedElems, updatedIndices))
+}
+
+func pruneOptionalMapEntries(ctx *OptimizerContext, e ast.Expr) {
+ m := e.AsMap()
+ entries := m.Entries()
+ updatedEntries := []ast.EntryExpr{}
+ modified := false
+ for _, e := range entries {
+ entry := e.AsMapEntry()
+ key := entry.Key()
+ val := entry.Value()
+ // If the entry is not optional, or the value-side of the optional hasn't
+ // been resolved to a literal, then preserve the entry as-is.
+ if !entry.IsOptional() || val.Kind() != ast.LiteralKind {
+ updatedEntries = append(updatedEntries, e)
+ continue
+ }
+ optElemVal, ok := val.AsLiteral().(*types.Optional)
+ if !ok {
+ updatedEntries = append(updatedEntries, e)
+ continue
+ }
+ // When the key is not a literal, but the value is, then it needs to be
+ // restored to an optional value.
+ if key.Kind() != ast.LiteralKind {
+ undoOptVal, err := adaptLiteral(ctx, optElemVal)
+ if err != nil {
+ ctx.ReportErrorAtID(val.ID(), "invalid map value literal %v: %v", optElemVal, err)
+ }
+ ctx.UpdateExpr(val, undoOptVal)
+ updatedEntries = append(updatedEntries, e)
+ continue
+ }
+ modified = true
+ if !optElemVal.HasValue() {
+ continue
+ }
+ ctx.UpdateExpr(val, ctx.NewLiteral(optElemVal.GetValue()))
+ updatedEntry := ctx.NewMapEntry(key, val, false)
+ updatedEntries = append(updatedEntries, updatedEntry)
+ }
+ if modified {
+ ctx.UpdateExpr(e, ctx.NewMap(updatedEntries))
+ }
+}
+
+func pruneOptionalStructFields(ctx *OptimizerContext, e ast.Expr) {
+ s := e.AsStruct()
+ fields := s.Fields()
+ updatedFields := []ast.EntryExpr{}
+ modified := false
+ for _, f := range fields {
+ field := f.AsStructField()
+ val := field.Value()
+ if !field.IsOptional() || val.Kind() != ast.LiteralKind {
+ updatedFields = append(updatedFields, f)
+ continue
+ }
+ optElemVal, ok := val.AsLiteral().(*types.Optional)
+ if !ok {
+ updatedFields = append(updatedFields, f)
+ continue
+ }
+ modified = true
+ if !optElemVal.HasValue() {
+ continue
+ }
+ ctx.UpdateExpr(val, ctx.NewLiteral(optElemVal.GetValue()))
+ updatedField := ctx.NewStructField(field.Name(), val, false)
+ updatedFields = append(updatedFields, updatedField)
+ }
+ if modified {
+ ctx.UpdateExpr(e, ctx.NewStruct(s.TypeName(), updatedFields))
+ }
+}
+
+// adaptLiteral converts a runtime CEL value to its equivalent literal expression.
+//
+// For strongly typed values, the type-provider will be used to reconstruct the fields
+// which are present in the literal and their equivalent initialization values.
+func adaptLiteral(ctx *OptimizerContext, val ref.Val) (ast.Expr, error) {
+ switch t := val.Type().(type) {
+ case *types.Type:
+ switch t {
+ case types.BoolType, types.BytesType, types.DoubleType, types.IntType,
+ types.NullType, types.StringType, types.UintType:
+ return ctx.NewLiteral(val), nil
+ case types.DurationType:
+ return ctx.NewCall(
+ overloads.TypeConvertDuration,
+ ctx.NewLiteral(val.ConvertToType(types.StringType)),
+ ), nil
+ case types.TimestampType:
+ return ctx.NewCall(
+ overloads.TypeConvertTimestamp,
+ ctx.NewLiteral(val.ConvertToType(types.StringType)),
+ ), nil
+ case types.OptionalType:
+ opt := val.(*types.Optional)
+ if !opt.HasValue() {
+ return ctx.NewCall("optional.none"), nil
+ }
+ target, err := adaptLiteral(ctx, opt.GetValue())
+ if err != nil {
+ return nil, err
+ }
+ return ctx.NewCall("optional.of", target), nil
+ case types.TypeType:
+ return ctx.NewIdent(val.(*types.Type).TypeName()), nil
+ case types.ListType:
+ l, ok := val.(traits.Lister)
+ if !ok {
+ return nil, fmt.Errorf("failed to adapt %v to literal", val)
+ }
+ elems := make([]ast.Expr, l.Size().(types.Int))
+ idx := 0
+ it := l.Iterator()
+ for it.HasNext() == types.True {
+ elemVal := it.Next()
+ elemExpr, err := adaptLiteral(ctx, elemVal)
+ if err != nil {
+ return nil, err
+ }
+ elems[idx] = elemExpr
+ idx++
+ }
+ return ctx.NewList(elems, []int32{}), nil
+ case types.MapType:
+ m, ok := val.(traits.Mapper)
+ if !ok {
+ return nil, fmt.Errorf("failed to adapt %v to literal", val)
+ }
+ entries := make([]ast.EntryExpr, m.Size().(types.Int))
+ idx := 0
+ it := m.Iterator()
+ for it.HasNext() == types.True {
+ keyVal := it.Next()
+ keyExpr, err := adaptLiteral(ctx, keyVal)
+ if err != nil {
+ return nil, err
+ }
+ valVal := m.Get(keyVal)
+ valExpr, err := adaptLiteral(ctx, valVal)
+ if err != nil {
+ return nil, err
+ }
+ entries[idx] = ctx.NewMapEntry(keyExpr, valExpr, false)
+ idx++
+ }
+ return ctx.NewMap(entries), nil
+ default:
+ provider := ctx.CELTypeProvider()
+ fields, found := provider.FindStructFieldNames(t.TypeName())
+ if !found {
+ return nil, fmt.Errorf("failed to adapt %v to literal", val)
+ }
+ tester := val.(traits.FieldTester)
+ indexer := val.(traits.Indexer)
+ fieldInits := []ast.EntryExpr{}
+ for _, f := range fields {
+ field := types.String(f)
+ if tester.IsSet(field) != types.True {
+ continue
+ }
+ fieldVal := indexer.Get(field)
+ fieldExpr, err := adaptLiteral(ctx, fieldVal)
+ if err != nil {
+ return nil, err
+ }
+ fieldInits = append(fieldInits, ctx.NewStructField(f, fieldExpr, false))
+ }
+ return ctx.NewStruct(t.TypeName(), fieldInits), nil
+ }
+ }
+ return nil, fmt.Errorf("failed to adapt %v to literal", val)
+}
+
+// constantExprMatcher matches calls, select statements, and comprehensions whose arguments
+// are all constant scalar or aggregate literal values.
+//
+// Only comprehensions which are not nested are included as possible constant folds, and only
+// if all variables referenced in the comprehension stack exist are only iteration or
+// accumulation variables.
+func constantExprMatcher(e ast.NavigableExpr) bool {
+ switch e.Kind() {
+ case ast.CallKind:
+ return constantCallMatcher(e)
+ case ast.SelectKind:
+ sel := e.AsSelect() // guaranteed to be a navigable value
+ return constantMatcher(sel.Operand().(ast.NavigableExpr))
+ case ast.ComprehensionKind:
+ if isNestedComprehension(e) {
+ return false
+ }
+ vars := map[string]bool{}
+ constantExprs := true
+ visitor := ast.NewExprVisitor(func(e ast.Expr) {
+ if e.Kind() == ast.ComprehensionKind {
+ nested := e.AsComprehension()
+ vars[nested.AccuVar()] = true
+ vars[nested.IterVar()] = true
+ }
+ if e.Kind() == ast.IdentKind && !vars[e.AsIdent()] {
+ constantExprs = false
+ }
+ })
+ ast.PreOrderVisit(e, visitor)
+ return constantExprs
+ default:
+ return false
+ }
+}
+
+// constantCallMatcher identifies strict and non-strict calls which can be folded.
+func constantCallMatcher(e ast.NavigableExpr) bool {
+ call := e.AsCall()
+ children := e.Children()
+ fnName := call.FunctionName()
+ if fnName == operators.LogicalAnd {
+ for _, child := range children {
+ if child.Kind() == ast.LiteralKind {
+ return true
+ }
+ }
+ }
+ if fnName == operators.LogicalOr {
+ for _, child := range children {
+ if child.Kind() == ast.LiteralKind {
+ return true
+ }
+ }
+ }
+ if fnName == operators.Conditional {
+ cond := children[0]
+ if cond.Kind() == ast.LiteralKind && cond.AsLiteral().Type() == types.BoolType {
+ return true
+ }
+ }
+ if fnName == operators.In {
+ haystack := children[1]
+ if haystack.Kind() == ast.ListKind && haystack.AsList().Size() == 0 {
+ return true
+ }
+ needle := children[0]
+ if needle.Kind() == ast.LiteralKind && haystack.Kind() == ast.ListKind {
+ needleValue := needle.AsLiteral()
+ list := haystack.AsList()
+ for _, e := range list.Elements() {
+ if e.Kind() == ast.LiteralKind && e.AsLiteral().Equal(needleValue) == types.True {
+ return true
+ }
+ }
+ }
+ }
+ // convert all other calls with constant arguments
+ for _, child := range children {
+ if !constantMatcher(child) {
+ return false
+ }
+ }
+ return true
+}
+
+func isNestedComprehension(e ast.NavigableExpr) bool {
+ parent, found := e.Parent()
+ for found {
+ if parent.Kind() == ast.ComprehensionKind {
+ return true
+ }
+ parent, found = parent.Parent()
+ }
+ return false
+}
+
+func aggregateLiteralMatcher(e ast.NavigableExpr) bool {
+ return e.Kind() == ast.ListKind || e.Kind() == ast.MapKind || e.Kind() == ast.StructKind
+}
+
+var (
+ constantMatcher = ast.ConstantValueMatcher()
+)
+
+const (
+ defaultMaxConstantFoldIterations = 100
+)
diff --git a/vendor/github.com/google/cel-go/cel/inlining.go b/vendor/github.com/google/cel-go/cel/inlining.go
new file mode 100644
index 0000000000..78d5bea65b
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/inlining.go
@@ -0,0 +1,228 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cel
+
+import (
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/containers"
+ "github.com/google/cel-go/common/operators"
+ "github.com/google/cel-go/common/overloads"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/traits"
+)
+
+// InlineVariable holds a variable name to be matched and an AST representing
+// the expression graph which should be used to replace it.
+type InlineVariable struct {
+ name string
+ alias string
+ def *ast.AST
+}
+
+// Name returns the qualified variable or field selection to replace.
+func (v *InlineVariable) Name() string {
+ return v.name
+}
+
+// Alias returns the alias to use when performing cel.bind() calls during inlining.
+func (v *InlineVariable) Alias() string {
+ return v.alias
+}
+
+// Expr returns the inlined expression value.
+func (v *InlineVariable) Expr() ast.Expr {
+ return v.def.Expr()
+}
+
+// Type indicates the inlined expression type.
+func (v *InlineVariable) Type() *Type {
+ return v.def.GetType(v.def.Expr().ID())
+}
+
+// NewInlineVariable declares a variable name to be replaced by a checked expression.
+func NewInlineVariable(name string, definition *Ast) *InlineVariable {
+ return NewInlineVariableWithAlias(name, name, definition)
+}
+
+// NewInlineVariableWithAlias declares a variable name to be replaced by a checked expression.
+// If the variable occurs more than once, the provided alias will be used to replace the expressions
+// where the variable name occurs.
+func NewInlineVariableWithAlias(name, alias string, definition *Ast) *InlineVariable {
+ return &InlineVariable{name: name, alias: alias, def: definition.impl}
+}
+
+// NewInliningOptimizer creates and optimizer which replaces variables with expression definitions.
+//
+// If a variable occurs one time, the variable is replaced by the inline definition. If the
+// variable occurs more than once, the variable occurences are replaced by a cel.bind() call.
+func NewInliningOptimizer(inlineVars ...*InlineVariable) ASTOptimizer {
+ return &inliningOptimizer{variables: inlineVars}
+}
+
+type inliningOptimizer struct {
+ variables []*InlineVariable
+}
+
+func (opt *inliningOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST) *ast.AST {
+ root := ast.NavigateAST(a)
+ for _, inlineVar := range opt.variables {
+ matches := ast.MatchDescendants(root, opt.matchVariable(inlineVar.Name()))
+ // Skip cases where the variable isn't in the expression graph
+ if len(matches) == 0 {
+ continue
+ }
+
+ // For a single match, do a direct replacement of the expression sub-graph.
+ if len(matches) == 1 || !isBindable(matches, inlineVar.Expr(), inlineVar.Type()) {
+ for _, match := range matches {
+ // Copy the inlined AST expr and source info.
+ copyExpr := ctx.CopyASTAndMetadata(inlineVar.def)
+ opt.inlineExpr(ctx, match, copyExpr, inlineVar.Type())
+ }
+ continue
+ }
+
+ // For multiple matches, find the least common ancestor (lca) and insert the
+ // variable as a cel.bind() macro.
+ var lca ast.NavigableExpr = root
+ lcaAncestorCount := 0
+ ancestors := map[int64]int{}
+ for _, match := range matches {
+ // Update the identifier matches with the provided alias.
+ parent, found := match, true
+ for found {
+ ancestorCount, hasAncestor := ancestors[parent.ID()]
+ if !hasAncestor {
+ ancestors[parent.ID()] = 1
+ parent, found = parent.Parent()
+ continue
+ }
+ if lcaAncestorCount < ancestorCount || (lcaAncestorCount == ancestorCount && lca.Depth() < parent.Depth()) {
+ lca = parent
+ lcaAncestorCount = ancestorCount
+ }
+ ancestors[parent.ID()] = ancestorCount + 1
+ parent, found = parent.Parent()
+ }
+ aliasExpr := ctx.NewIdent(inlineVar.Alias())
+ opt.inlineExpr(ctx, match, aliasExpr, inlineVar.Type())
+ }
+
+ // Copy the inlined AST expr and source info.
+ copyExpr := ctx.CopyASTAndMetadata(inlineVar.def)
+ // Update the least common ancestor by inserting a cel.bind() call to the alias.
+ inlined, bindMacro := ctx.NewBindMacro(lca.ID(), inlineVar.Alias(), copyExpr, lca)
+ opt.inlineExpr(ctx, lca, inlined, inlineVar.Type())
+ ctx.SetMacroCall(lca.ID(), bindMacro)
+ }
+ return a
+}
+
+// inlineExpr replaces the current expression with the inlined one, unless the location of the inlining
+// happens within a presence test, e.g. has(a.b.c) -> inline alpha for a.b.c in which case an attempt is
+// made to determine whether the inlined value can be presence or existence tested.
+func (opt *inliningOptimizer) inlineExpr(ctx *OptimizerContext, prev ast.NavigableExpr, inlined ast.Expr, inlinedType *Type) {
+ switch prev.Kind() {
+ case ast.SelectKind:
+ sel := prev.AsSelect()
+ if !sel.IsTestOnly() {
+ ctx.UpdateExpr(prev, inlined)
+ return
+ }
+ opt.rewritePresenceExpr(ctx, prev, inlined, inlinedType)
+ default:
+ ctx.UpdateExpr(prev, inlined)
+ }
+}
+
+// rewritePresenceExpr converts the inlined expression, when it occurs within a has() macro, to type-safe
+// expression appropriate for the inlined type, if possible.
+//
+// If the rewrite is not possible an error is reported at the inline expression site.
+func (opt *inliningOptimizer) rewritePresenceExpr(ctx *OptimizerContext, prev, inlined ast.Expr, inlinedType *Type) {
+ // If the input inlined expression is not a select expression it won't work with the has()
+ // macro. Attempt to rewrite the presence test in terms of the typed input, otherwise error.
+ if inlined.Kind() == ast.SelectKind {
+ presenceTest, hasMacro := ctx.NewHasMacro(prev.ID(), inlined)
+ ctx.UpdateExpr(prev, presenceTest)
+ ctx.SetMacroCall(prev.ID(), hasMacro)
+ return
+ }
+
+ ctx.ClearMacroCall(prev.ID())
+ if inlinedType.IsAssignableType(NullType) {
+ ctx.UpdateExpr(prev,
+ ctx.NewCall(operators.NotEquals,
+ inlined,
+ ctx.NewLiteral(types.NullValue),
+ ))
+ return
+ }
+ if inlinedType.HasTrait(traits.SizerType) {
+ ctx.UpdateExpr(prev,
+ ctx.NewCall(operators.NotEquals,
+ ctx.NewMemberCall(overloads.Size, inlined),
+ ctx.NewLiteral(types.IntZero),
+ ))
+ return
+ }
+ ctx.ReportErrorAtID(prev.ID(), "unable to inline expression type %v into presence test", inlinedType)
+}
+
+// isBindable indicates whether the inlined type can be used within a cel.bind() if the expression
+// being replaced occurs within a presence test. Value types with a size() method or field selection
+// support can be bound.
+//
+// In future iterations, support may also be added for indexer types which can be rewritten as an `in`
+// expression; however, this would imply a rewrite of the inlined expression that may not be necessary
+// in most cases.
+func isBindable(matches []ast.NavigableExpr, inlined ast.Expr, inlinedType *Type) bool {
+ if inlinedType.IsAssignableType(NullType) ||
+ inlinedType.HasTrait(traits.SizerType) {
+ return true
+ }
+ for _, m := range matches {
+ if m.Kind() != ast.SelectKind {
+ continue
+ }
+ sel := m.AsSelect()
+ if sel.IsTestOnly() {
+ return false
+ }
+ }
+ return true
+}
+
+// matchVariable matches simple identifiers, select expressions, and presence test expressions
+// which match the (potentially) qualified variable name provided as input.
+//
+// Note, this function does not support inlining against select expressions which includes optional
+// field selection. This may be a future refinement.
+func (opt *inliningOptimizer) matchVariable(varName string) ast.ExprMatcher {
+ return func(e ast.NavigableExpr) bool {
+ if e.Kind() == ast.IdentKind && e.AsIdent() == varName {
+ return true
+ }
+ if e.Kind() == ast.SelectKind {
+ sel := e.AsSelect()
+ // While the `ToQualifiedName` call could take the select directly, this
+ // would skip presence tests from possible matches, which we would like
+ // to include.
+ qualName, found := containers.ToQualifiedName(sel.Operand())
+ return found && qualName+"."+sel.FieldName() == varName
+ }
+ return false
+ }
+}
diff --git a/vendor/github.com/google/cel-go/cel/io.go b/vendor/github.com/google/cel-go/cel/io.go
index 80f63140e3..3133fb9d7d 100644
--- a/vendor/github.com/google/cel-go/cel/io.go
+++ b/vendor/github.com/google/cel-go/cel/io.go
@@ -47,17 +47,11 @@ func CheckedExprToAst(checkedExpr *exprpb.CheckedExpr) *Ast {
//
// Prefer CheckedExprToAst if loading expressions from storage.
func CheckedExprToAstWithSource(checkedExpr *exprpb.CheckedExpr, src Source) (*Ast, error) {
- checkedAST, err := ast.CheckedExprToCheckedAST(checkedExpr)
+ checked, err := ast.ToAST(checkedExpr)
if err != nil {
return nil, err
}
- return &Ast{
- expr: checkedAST.Expr,
- info: checkedAST.SourceInfo,
- source: src,
- refMap: checkedAST.ReferenceMap,
- typeMap: checkedAST.TypeMap,
- }, nil
+ return &Ast{source: src, impl: checked}, nil
}
// AstToCheckedExpr converts an Ast to an protobuf CheckedExpr value.
@@ -67,13 +61,7 @@ func AstToCheckedExpr(a *Ast) (*exprpb.CheckedExpr, error) {
if !a.IsChecked() {
return nil, fmt.Errorf("cannot convert unchecked ast")
}
- cAst := &ast.CheckedAST{
- Expr: a.expr,
- SourceInfo: a.info,
- ReferenceMap: a.refMap,
- TypeMap: a.typeMap,
- }
- return ast.CheckedASTToCheckedExpr(cAst)
+ return ast.ToProto(a.impl)
}
// ParsedExprToAst converts a parsed expression proto message to an Ast.
@@ -89,18 +77,12 @@ func ParsedExprToAst(parsedExpr *exprpb.ParsedExpr) *Ast {
//
// Prefer ParsedExprToAst if loading expressions from storage.
func ParsedExprToAstWithSource(parsedExpr *exprpb.ParsedExpr, src Source) *Ast {
- si := parsedExpr.GetSourceInfo()
- if si == nil {
- si = &exprpb.SourceInfo{}
- }
+ info, _ := ast.ProtoToSourceInfo(parsedExpr.GetSourceInfo())
if src == nil {
- src = common.NewInfoSource(si)
- }
- return &Ast{
- expr: parsedExpr.GetExpr(),
- info: si,
- source: src,
+ src = common.NewInfoSource(parsedExpr.GetSourceInfo())
}
+ e, _ := ast.ProtoToExpr(parsedExpr.GetExpr())
+ return &Ast{source: src, impl: ast.NewAST(e, info)}
}
// AstToParsedExpr converts an Ast to an protobuf ParsedExpr value.
@@ -116,9 +98,7 @@ func AstToParsedExpr(a *Ast) (*exprpb.ParsedExpr, error) {
// Note, the conversion may not be an exact replica of the original expression, but will produce
// a string that is semantically equivalent and whose textual representation is stable.
func AstToString(a *Ast) (string, error) {
- expr := a.Expr()
- info := a.SourceInfo()
- return parser.Unparse(expr, info)
+ return parser.Unparse(a.impl.Expr(), a.impl.SourceInfo())
}
// RefValueToValue converts between ref.Val and api.expr.Value.
diff --git a/vendor/github.com/google/cel-go/cel/library.go b/vendor/github.com/google/cel-go/cel/library.go
index 4d232085c2..deddc14e59 100644
--- a/vendor/github.com/google/cel-go/cel/library.go
+++ b/vendor/github.com/google/cel-go/cel/library.go
@@ -20,6 +20,7 @@ import (
"strings"
"time"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/overloads"
"github.com/google/cel-go/common/stdlib"
@@ -28,8 +29,6 @@ import (
"github.com/google/cel-go/common/types/traits"
"github.com/google/cel-go/interpreter"
"github.com/google/cel-go/parser"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
const (
@@ -313,7 +312,7 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
Types(types.OptionalType),
// Configure the optMap and optFlatMap macros.
- Macros(NewReceiverMacro(optMapMacro, 2, optMap)),
+ Macros(ReceiverMacro(optMapMacro, 2, optMap)),
// Global and member functions for working with optional values.
Function(optionalOfFunc,
@@ -374,7 +373,7 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
Overload("optional_map_index_value", []*Type{OptionalType(mapTypeKV), paramTypeK}, optionalTypeV)),
}
if lib.version >= 1 {
- opts = append(opts, Macros(NewReceiverMacro(optFlatMapMacro, 2, optFlatMap)))
+ opts = append(opts, Macros(ReceiverMacro(optFlatMapMacro, 2, optFlatMap)))
}
return opts
}
@@ -386,57 +385,57 @@ func (lib *optionalLib) ProgramOptions() []ProgramOption {
}
}
-func optMap(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
+func optMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *Error) {
varIdent := args[0]
varName := ""
- switch varIdent.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- varName = varIdent.GetIdentExpr().GetName()
+ switch varIdent.Kind() {
+ case ast.IdentKind:
+ varName = varIdent.AsIdent()
default:
- return nil, meh.NewError(varIdent.GetId(), "optMap() variable name must be a simple identifier")
+ return nil, meh.NewError(varIdent.ID(), "optMap() variable name must be a simple identifier")
}
mapExpr := args[1]
- return meh.GlobalCall(
+ return meh.NewCall(
operators.Conditional,
- meh.ReceiverCall(hasValueFunc, target),
- meh.GlobalCall(optionalOfFunc,
- meh.Fold(
- unusedIterVar,
+ meh.NewMemberCall(hasValueFunc, target),
+ meh.NewCall(optionalOfFunc,
+ meh.NewComprehension(
meh.NewList(),
+ unusedIterVar,
varName,
- meh.ReceiverCall(valueFunc, target),
- meh.LiteralBool(false),
- meh.Ident(varName),
+ meh.NewMemberCall(valueFunc, target),
+ meh.NewLiteral(types.False),
+ meh.NewIdent(varName),
mapExpr,
),
),
- meh.GlobalCall(optionalNoneFunc),
+ meh.NewCall(optionalNoneFunc),
), nil
}
-func optFlatMap(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
+func optFlatMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *Error) {
varIdent := args[0]
varName := ""
- switch varIdent.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- varName = varIdent.GetIdentExpr().GetName()
+ switch varIdent.Kind() {
+ case ast.IdentKind:
+ varName = varIdent.AsIdent()
default:
- return nil, meh.NewError(varIdent.GetId(), "optFlatMap() variable name must be a simple identifier")
+ return nil, meh.NewError(varIdent.ID(), "optFlatMap() variable name must be a simple identifier")
}
mapExpr := args[1]
- return meh.GlobalCall(
+ return meh.NewCall(
operators.Conditional,
- meh.ReceiverCall(hasValueFunc, target),
- meh.Fold(
- unusedIterVar,
+ meh.NewMemberCall(hasValueFunc, target),
+ meh.NewComprehension(
meh.NewList(),
+ unusedIterVar,
varName,
- meh.ReceiverCall(valueFunc, target),
- meh.LiteralBool(false),
- meh.Ident(varName),
+ meh.NewMemberCall(valueFunc, target),
+ meh.NewLiteral(types.False),
+ meh.NewIdent(varName),
mapExpr,
),
- meh.GlobalCall(optionalNoneFunc),
+ meh.NewCall(optionalNoneFunc),
), nil
}
diff --git a/vendor/github.com/google/cel-go/cel/macro.go b/vendor/github.com/google/cel-go/cel/macro.go
index 1eb414c8be..4db1fd57a9 100644
--- a/vendor/github.com/google/cel-go/cel/macro.go
+++ b/vendor/github.com/google/cel-go/cel/macro.go
@@ -15,6 +15,11 @@
package cel
import (
+ "fmt"
+
+ "github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
"github.com/google/cel-go/parser"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
@@ -26,7 +31,14 @@ import (
// a Macro should be created per arg-count or as a var arg macro.
type Macro = parser.Macro
-// MacroExpander converts a call and its associated arguments into a new CEL abstract syntax tree.
+// MacroFactory defines an expansion function which converts a call and its arguments to a cel.Expr value.
+type MacroFactory = parser.MacroExpander
+
+// MacroExprFactory assists with the creation of Expr values in a manner which is consistent
+// the internal semantics and id generation behaviors of the parser and checker libraries.
+type MacroExprFactory = parser.ExprHelper
+
+// MacroExpander converts a call and its associated arguments into a protobuf Expr representation.
//
// If the MacroExpander determines within the implementation that an expansion is not needed it may return
// a nil Expr value to indicate a non-match. However, if an expansion is to be performed, but the arguments
@@ -36,48 +48,197 @@ type Macro = parser.Macro
// and produces as output an Expr ast node.
//
// Note: when the Macro.IsReceiverStyle() method returns true, the target argument will be nil.
-type MacroExpander = parser.MacroExpander
+type MacroExpander func(eh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error)
// MacroExprHelper exposes helper methods for creating new expressions within a CEL abstract syntax tree.
-type MacroExprHelper = parser.ExprHelper
+// ExprHelper assists with the manipulation of proto-based Expr values in a manner which is
+// consistent with the source position and expression id generation code leveraged by both
+// the parser and type-checker.
+type MacroExprHelper interface {
+ // Copy the input expression with a brand new set of identifiers.
+ Copy(*exprpb.Expr) *exprpb.Expr
+
+ // LiteralBool creates an Expr value for a bool literal.
+ LiteralBool(value bool) *exprpb.Expr
+
+ // LiteralBytes creates an Expr value for a byte literal.
+ LiteralBytes(value []byte) *exprpb.Expr
+
+ // LiteralDouble creates an Expr value for double literal.
+ LiteralDouble(value float64) *exprpb.Expr
+
+ // LiteralInt creates an Expr value for an int literal.
+ LiteralInt(value int64) *exprpb.Expr
+
+ // LiteralString creates am Expr value for a string literal.
+ LiteralString(value string) *exprpb.Expr
+
+ // LiteralUint creates an Expr value for a uint literal.
+ LiteralUint(value uint64) *exprpb.Expr
+
+ // NewList creates a CreateList instruction where the list is comprised of the optional set
+ // of elements provided as arguments.
+ NewList(elems ...*exprpb.Expr) *exprpb.Expr
+
+ // NewMap creates a CreateStruct instruction for a map where the map is comprised of the
+ // optional set of key, value entries.
+ NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr
+
+ // NewMapEntry creates a Map Entry for the key, value pair.
+ NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry
+
+ // NewObject creates a CreateStruct instruction for an object with a given type name and
+ // optional set of field initializers.
+ NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr
+
+ // NewObjectFieldInit creates a new Object field initializer from the field name and value.
+ NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry
+
+ // Fold creates a fold comprehension instruction.
+ //
+ // - iterVar is the iteration variable name.
+ // - iterRange represents the expression that resolves to a list or map where the elements or
+ // keys (respectively) will be iterated over.
+ // - accuVar is the accumulation variable name, typically parser.AccumulatorName.
+ // - accuInit is the initial expression whose value will be set for the accuVar prior to
+ // folding.
+ // - condition is the expression to test to determine whether to continue folding.
+ // - step is the expression to evaluation at the conclusion of a single fold iteration.
+ // - result is the computation to evaluate at the conclusion of the fold.
+ //
+ // The accuVar should not shadow variable names that you would like to reference within the
+ // environment in the step and condition expressions. Presently, the name __result__ is commonly
+ // used by built-in macros but this may change in the future.
+ Fold(iterVar string,
+ iterRange *exprpb.Expr,
+ accuVar string,
+ accuInit *exprpb.Expr,
+ condition *exprpb.Expr,
+ step *exprpb.Expr,
+ result *exprpb.Expr) *exprpb.Expr
+
+ // Ident creates an identifier Expr value.
+ Ident(name string) *exprpb.Expr
+
+ // AccuIdent returns an accumulator identifier for use with comprehension results.
+ AccuIdent() *exprpb.Expr
+
+ // GlobalCall creates a function call Expr value for a global (free) function.
+ GlobalCall(function string, args ...*exprpb.Expr) *exprpb.Expr
+
+ // ReceiverCall creates a function call Expr value for a receiver-style function.
+ ReceiverCall(function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr
+
+ // PresenceTest creates a Select TestOnly Expr value for modelling has() semantics.
+ PresenceTest(operand *exprpb.Expr, field string) *exprpb.Expr
+
+ // Select create a field traversal Expr value.
+ Select(operand *exprpb.Expr, field string) *exprpb.Expr
+
+ // OffsetLocation returns the Location of the expression identifier.
+ OffsetLocation(exprID int64) common.Location
+
+ // NewError associates an error message with a given expression id.
+ NewError(exprID int64, message string) *Error
+}
+
+// GlobalMacro creates a Macro for a global function with the specified arg count.
+func GlobalMacro(function string, argCount int, factory MacroFactory) Macro {
+ return parser.NewGlobalMacro(function, argCount, factory)
+}
+
+// ReceiverMacro creates a Macro for a receiver function matching the specified arg count.
+func ReceiverMacro(function string, argCount int, factory MacroFactory) Macro {
+ return parser.NewReceiverMacro(function, argCount, factory)
+}
+
+// GlobalVarArgMacro creates a Macro for a global function with a variable arg count.
+func GlobalVarArgMacro(function string, factory MacroFactory) Macro {
+ return parser.NewGlobalVarArgMacro(function, factory)
+}
+
+// ReceiverVarArgMacro creates a Macro for a receiver function matching a variable arg count.
+func ReceiverVarArgMacro(function string, factory MacroFactory) Macro {
+ return parser.NewReceiverVarArgMacro(function, factory)
+}
// NewGlobalMacro creates a Macro for a global function with the specified arg count.
+//
+// Deprecated: use GlobalMacro
func NewGlobalMacro(function string, argCount int, expander MacroExpander) Macro {
- return parser.NewGlobalMacro(function, argCount, expander)
+ expand := adaptingExpander{expander}
+ return parser.NewGlobalMacro(function, argCount, expand.Expander)
}
// NewReceiverMacro creates a Macro for a receiver function matching the specified arg count.
+//
+// Deprecated: use ReceiverMacro
func NewReceiverMacro(function string, argCount int, expander MacroExpander) Macro {
- return parser.NewReceiverMacro(function, argCount, expander)
+ expand := adaptingExpander{expander}
+ return parser.NewReceiverMacro(function, argCount, expand.Expander)
}
// NewGlobalVarArgMacro creates a Macro for a global function with a variable arg count.
+//
+// Deprecated: use GlobalVarArgMacro
func NewGlobalVarArgMacro(function string, expander MacroExpander) Macro {
- return parser.NewGlobalVarArgMacro(function, expander)
+ expand := adaptingExpander{expander}
+ return parser.NewGlobalVarArgMacro(function, expand.Expander)
}
// NewReceiverVarArgMacro creates a Macro for a receiver function matching a variable arg count.
+//
+// Deprecated: use ReceiverVarArgMacro
func NewReceiverVarArgMacro(function string, expander MacroExpander) Macro {
- return parser.NewReceiverVarArgMacro(function, expander)
+ expand := adaptingExpander{expander}
+ return parser.NewReceiverVarArgMacro(function, expand.Expander)
}
// HasMacroExpander expands the input call arguments into a presence test, e.g. has(.field)
func HasMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
- return parser.MakeHas(meh, target, args)
+ ph, err := toParserHelper(meh)
+ if err != nil {
+ return nil, err
+ }
+ arg, err := adaptToExpr(args[0])
+ if err != nil {
+ return nil, err
+ }
+ if arg.Kind() == ast.SelectKind {
+ s := arg.AsSelect()
+ return adaptToProto(ph.NewPresenceTest(s.Operand(), s.FieldName()))
+ }
+ return nil, ph.NewError(arg.ID(), "invalid argument to has() macro")
}
// ExistsMacroExpander expands the input call arguments into a comprehension that returns true if any of the
// elements in the range match the predicate expressions:
// .exists(, )
func ExistsMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
- return parser.MakeExists(meh, target, args)
+ ph, err := toParserHelper(meh)
+ if err != nil {
+ return nil, err
+ }
+ out, err := parser.MakeExists(ph, mustAdaptToExpr(target), mustAdaptToExprs(args))
+ if err != nil {
+ return nil, err
+ }
+ return adaptToProto(out)
}
// ExistsOneMacroExpander expands the input call arguments into a comprehension that returns true if exactly
// one of the elements in the range match the predicate expressions:
// .exists_one(, )
func ExistsOneMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
- return parser.MakeExistsOne(meh, target, args)
+ ph, err := toParserHelper(meh)
+ if err != nil {
+ return nil, err
+ }
+ out, err := parser.MakeExistsOne(ph, mustAdaptToExpr(target), mustAdaptToExprs(args))
+ if err != nil {
+ return nil, err
+ }
+ return adaptToProto(out)
}
// MapMacroExpander expands the input call arguments into a comprehension that transforms each element in the
@@ -91,14 +252,30 @@ func ExistsOneMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*ex
// In the second form only iterVar values which return true when provided to the predicate expression
// are transformed.
func MapMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
- return parser.MakeMap(meh, target, args)
+ ph, err := toParserHelper(meh)
+ if err != nil {
+ return nil, err
+ }
+ out, err := parser.MakeMap(ph, mustAdaptToExpr(target), mustAdaptToExprs(args))
+ if err != nil {
+ return nil, err
+ }
+ return adaptToProto(out)
}
// FilterMacroExpander expands the input call arguments into a comprehension which produces a list which contains
// only elements which match the provided predicate expression:
// .filter(, )
func FilterMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
- return parser.MakeFilter(meh, target, args)
+ ph, err := toParserHelper(meh)
+ if err != nil {
+ return nil, err
+ }
+ out, err := parser.MakeFilter(ph, mustAdaptToExpr(target), mustAdaptToExprs(args))
+ if err != nil {
+ return nil, err
+ }
+ return adaptToProto(out)
}
var (
@@ -142,3 +319,258 @@ var (
// NoMacros provides an alias to an empty list of macros
NoMacros = []Macro{}
)
+
+type adaptingExpander struct {
+ legacyExpander MacroExpander
+}
+
+func (adapt *adaptingExpander) Expander(eh parser.ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
+ var legacyTarget *exprpb.Expr = nil
+ var err *Error = nil
+ if target != nil {
+ legacyTarget, err = adaptToProto(target)
+ if err != nil {
+ return nil, err
+ }
+ }
+ legacyArgs := make([]*exprpb.Expr, len(args))
+ for i, arg := range args {
+ legacyArgs[i], err = adaptToProto(arg)
+ if err != nil {
+ return nil, err
+ }
+ }
+ ah := &adaptingHelper{modernHelper: eh}
+ legacyExpr, err := adapt.legacyExpander(ah, legacyTarget, legacyArgs)
+ if err != nil {
+ return nil, err
+ }
+ ex, err := adaptToExpr(legacyExpr)
+ if err != nil {
+ return nil, err
+ }
+ return ex, nil
+}
+
+func wrapErr(id int64, message string, err error) *common.Error {
+ return &common.Error{
+ Location: common.NoLocation,
+ Message: fmt.Sprintf("%s: %v", message, err),
+ ExprID: id,
+ }
+}
+
+type adaptingHelper struct {
+ modernHelper parser.ExprHelper
+}
+
+// Copy the input expression with a brand new set of identifiers.
+func (ah *adaptingHelper) Copy(e *exprpb.Expr) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.Copy(mustAdaptToExpr(e)))
+}
+
+// LiteralBool creates an Expr value for a bool literal.
+func (ah *adaptingHelper) LiteralBool(value bool) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Bool(value)))
+}
+
+// LiteralBytes creates an Expr value for a byte literal.
+func (ah *adaptingHelper) LiteralBytes(value []byte) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Bytes(value)))
+}
+
+// LiteralDouble creates an Expr value for double literal.
+func (ah *adaptingHelper) LiteralDouble(value float64) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Double(value)))
+}
+
+// LiteralInt creates an Expr value for an int literal.
+func (ah *adaptingHelper) LiteralInt(value int64) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Int(value)))
+}
+
+// LiteralString creates am Expr value for a string literal.
+func (ah *adaptingHelper) LiteralString(value string) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.String(value)))
+}
+
+// LiteralUint creates an Expr value for a uint literal.
+func (ah *adaptingHelper) LiteralUint(value uint64) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewLiteral(types.Uint(value)))
+}
+
+// NewList creates a CreateList instruction where the list is comprised of the optional set
+// of elements provided as arguments.
+func (ah *adaptingHelper) NewList(elems ...*exprpb.Expr) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewList(mustAdaptToExprs(elems)...))
+}
+
+// NewMap creates a CreateStruct instruction for a map where the map is comprised of the
+// optional set of key, value entries.
+func (ah *adaptingHelper) NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
+ adaptedEntries := make([]ast.EntryExpr, len(entries))
+ for i, e := range entries {
+ adaptedEntries[i] = mustAdaptToEntryExpr(e)
+ }
+ return mustAdaptToProto(ah.modernHelper.NewMap(adaptedEntries...))
+}
+
+// NewMapEntry creates a Map Entry for the key, value pair.
+func (ah *adaptingHelper) NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
+ return mustAdaptToProtoEntry(
+ ah.modernHelper.NewMapEntry(mustAdaptToExpr(key), mustAdaptToExpr(val), optional))
+}
+
+// NewObject creates a CreateStruct instruction for an object with a given type name and
+// optional set of field initializers.
+func (ah *adaptingHelper) NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
+ adaptedEntries := make([]ast.EntryExpr, len(fieldInits))
+ for i, e := range fieldInits {
+ adaptedEntries[i] = mustAdaptToEntryExpr(e)
+ }
+ return mustAdaptToProto(ah.modernHelper.NewStruct(typeName, adaptedEntries...))
+}
+
+// NewObjectFieldInit creates a new Object field initializer from the field name and value.
+func (ah *adaptingHelper) NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
+ return mustAdaptToProtoEntry(
+ ah.modernHelper.NewStructField(field, mustAdaptToExpr(init), optional))
+}
+
+// Fold creates a fold comprehension instruction.
+//
+// - iterVar is the iteration variable name.
+// - iterRange represents the expression that resolves to a list or map where the elements or
+// keys (respectively) will be iterated over.
+// - accuVar is the accumulation variable name, typically parser.AccumulatorName.
+// - accuInit is the initial expression whose value will be set for the accuVar prior to
+// folding.
+// - condition is the expression to test to determine whether to continue folding.
+// - step is the expression to evaluation at the conclusion of a single fold iteration.
+// - result is the computation to evaluate at the conclusion of the fold.
+//
+// The accuVar should not shadow variable names that you would like to reference within the
+// environment in the step and condition expressions. Presently, the name __result__ is commonly
+// used by built-in macros but this may change in the future.
+func (ah *adaptingHelper) Fold(iterVar string,
+ iterRange *exprpb.Expr,
+ accuVar string,
+ accuInit *exprpb.Expr,
+ condition *exprpb.Expr,
+ step *exprpb.Expr,
+ result *exprpb.Expr) *exprpb.Expr {
+ return mustAdaptToProto(
+ ah.modernHelper.NewComprehension(
+ mustAdaptToExpr(iterRange),
+ iterVar,
+ accuVar,
+ mustAdaptToExpr(accuInit),
+ mustAdaptToExpr(condition),
+ mustAdaptToExpr(step),
+ mustAdaptToExpr(result),
+ ),
+ )
+}
+
+// Ident creates an identifier Expr value.
+func (ah *adaptingHelper) Ident(name string) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewIdent(name))
+}
+
+// AccuIdent returns an accumulator identifier for use with comprehension results.
+func (ah *adaptingHelper) AccuIdent() *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewAccuIdent())
+}
+
+// GlobalCall creates a function call Expr value for a global (free) function.
+func (ah *adaptingHelper) GlobalCall(function string, args ...*exprpb.Expr) *exprpb.Expr {
+ return mustAdaptToProto(ah.modernHelper.NewCall(function, mustAdaptToExprs(args)...))
+}
+
+// ReceiverCall creates a function call Expr value for a receiver-style function.
+func (ah *adaptingHelper) ReceiverCall(function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr {
+ return mustAdaptToProto(
+ ah.modernHelper.NewMemberCall(function, mustAdaptToExpr(target), mustAdaptToExprs(args)...))
+}
+
+// PresenceTest creates a Select TestOnly Expr value for modelling has() semantics.
+func (ah *adaptingHelper) PresenceTest(operand *exprpb.Expr, field string) *exprpb.Expr {
+ op := mustAdaptToExpr(operand)
+ return mustAdaptToProto(ah.modernHelper.NewPresenceTest(op, field))
+}
+
+// Select create a field traversal Expr value.
+func (ah *adaptingHelper) Select(operand *exprpb.Expr, field string) *exprpb.Expr {
+ op := mustAdaptToExpr(operand)
+ return mustAdaptToProto(ah.modernHelper.NewSelect(op, field))
+}
+
+// OffsetLocation returns the Location of the expression identifier.
+func (ah *adaptingHelper) OffsetLocation(exprID int64) common.Location {
+ return ah.modernHelper.OffsetLocation(exprID)
+}
+
+// NewError associates an error message with a given expression id.
+func (ah *adaptingHelper) NewError(exprID int64, message string) *Error {
+ return ah.modernHelper.NewError(exprID, message)
+}
+
+func mustAdaptToExprs(exprs []*exprpb.Expr) []ast.Expr {
+ adapted := make([]ast.Expr, len(exprs))
+ for i, e := range exprs {
+ adapted[i] = mustAdaptToExpr(e)
+ }
+ return adapted
+}
+
+func mustAdaptToExpr(e *exprpb.Expr) ast.Expr {
+ out, _ := adaptToExpr(e)
+ return out
+}
+
+func adaptToExpr(e *exprpb.Expr) (ast.Expr, *Error) {
+ if e == nil {
+ return nil, nil
+ }
+ out, err := ast.ProtoToExpr(e)
+ if err != nil {
+ return nil, wrapErr(e.GetId(), "proto conversion failure", err)
+ }
+ return out, nil
+}
+
+func mustAdaptToEntryExpr(e *exprpb.Expr_CreateStruct_Entry) ast.EntryExpr {
+ out, _ := ast.ProtoToEntryExpr(e)
+ return out
+}
+
+func mustAdaptToProto(e ast.Expr) *exprpb.Expr {
+ out, _ := adaptToProto(e)
+ return out
+}
+
+func adaptToProto(e ast.Expr) (*exprpb.Expr, *Error) {
+ if e == nil {
+ return nil, nil
+ }
+ out, err := ast.ExprToProto(e)
+ if err != nil {
+ return nil, wrapErr(e.ID(), "expr conversion failure", err)
+ }
+ return out, nil
+}
+
+func mustAdaptToProtoEntry(e ast.EntryExpr) *exprpb.Expr_CreateStruct_Entry {
+ out, _ := ast.EntryExprToProto(e)
+ return out
+}
+
+func toParserHelper(meh MacroExprHelper) (parser.ExprHelper, *Error) {
+ ah, ok := meh.(*adaptingHelper)
+ if !ok {
+ return nil, common.NewError(0,
+ fmt.Sprintf("unsupported macro helper: %v (%T)", meh, meh),
+ common.NoLocation)
+ }
+ return ah.modernHelper, nil
+}
diff --git a/vendor/github.com/google/cel-go/cel/optimizer.go b/vendor/github.com/google/cel-go/cel/optimizer.go
new file mode 100644
index 0000000000..f26df46234
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/optimizer.go
@@ -0,0 +1,509 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cel
+
+import (
+ "github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+)
+
+// StaticOptimizer contains a sequence of ASTOptimizer instances which will be applied in order.
+//
+// The static optimizer normalizes expression ids and type-checking run between optimization
+// passes to ensure that the final optimized output is a valid expression with metadata consistent
+// with what would have been generated from a parsed and checked expression.
+//
+// Note: source position information is best-effort and likely wrong, but optimized expressions
+// should be suitable for calls to parser.Unparse.
+type StaticOptimizer struct {
+ optimizers []ASTOptimizer
+}
+
+// NewStaticOptimizer creates a StaticOptimizer with a sequence of ASTOptimizer's to be applied
+// to a checked expression.
+func NewStaticOptimizer(optimizers ...ASTOptimizer) *StaticOptimizer {
+ return &StaticOptimizer{
+ optimizers: optimizers,
+ }
+}
+
+// Optimize applies a sequence of optimizations to an Ast within a given environment.
+//
+// If issues are encountered, the Issues.Err() return value will be non-nil.
+func (opt *StaticOptimizer) Optimize(env *Env, a *Ast) (*Ast, *Issues) {
+ // Make a copy of the AST to be optimized.
+ optimized := ast.Copy(a.impl)
+ ids := newIDGenerator(ast.MaxID(a.impl))
+
+ // Create the optimizer context, could be pooled in the future.
+ issues := NewIssues(common.NewErrors(a.Source()))
+ baseFac := ast.NewExprFactory()
+ exprFac := &optimizerExprFactory{
+ idGenerator: ids,
+ fac: baseFac,
+ sourceInfo: optimized.SourceInfo(),
+ }
+ ctx := &OptimizerContext{
+ optimizerExprFactory: exprFac,
+ Env: env,
+ Issues: issues,
+ }
+
+ // Apply the optimizations sequentially.
+ for _, o := range opt.optimizers {
+ optimized = o.Optimize(ctx, optimized)
+ if issues.Err() != nil {
+ return nil, issues
+ }
+ // Normalize expression id metadata including coordination with macro call metadata.
+ freshIDGen := newIDGenerator(0)
+ info := optimized.SourceInfo()
+ expr := optimized.Expr()
+ normalizeIDs(freshIDGen.renumberStable, expr, info)
+ cleanupMacroRefs(expr, info)
+
+ // Recheck the updated expression for any possible type-agreement or validation errors.
+ parsed := &Ast{
+ source: a.Source(),
+ impl: ast.NewAST(expr, info)}
+ checked, iss := ctx.Check(parsed)
+ if iss.Err() != nil {
+ return nil, iss
+ }
+ optimized = checked.impl
+ }
+
+ // Return the optimized result.
+ return &Ast{
+ source: a.Source(),
+ impl: optimized,
+ }, nil
+}
+
+// normalizeIDs ensures that the metadata present with an AST is reset in a manner such
+// that the ids within the expression correspond to the ids within macros.
+func normalizeIDs(idGen ast.IDGenerator, optimized ast.Expr, info *ast.SourceInfo) {
+ optimized.RenumberIDs(idGen)
+
+ if len(info.MacroCalls()) == 0 {
+ return
+ }
+
+ // First, update the macro call ids themselves.
+ callIDMap := map[int64]int64{}
+ for id := range info.MacroCalls() {
+ callIDMap[id] = idGen(id)
+ }
+ // Then update the macro call definitions which refer to these ids, but
+ // ensure that the updates don't collide and remove macro entries which haven't
+ // been visited / updated yet.
+ type macroUpdate struct {
+ id int64
+ call ast.Expr
+ }
+ macroUpdates := []macroUpdate{}
+ for oldID, newID := range callIDMap {
+ call, found := info.GetMacroCall(oldID)
+ if !found {
+ continue
+ }
+ call.RenumberIDs(idGen)
+ macroUpdates = append(macroUpdates, macroUpdate{id: newID, call: call})
+ info.ClearMacroCall(oldID)
+ }
+ for _, u := range macroUpdates {
+ info.SetMacroCall(u.id, u.call)
+ }
+}
+
+func cleanupMacroRefs(expr ast.Expr, info *ast.SourceInfo) {
+ if len(info.MacroCalls()) == 0 {
+ return
+ }
+ // Sanitize the macro call references once the optimized expression has been computed
+ // and the ids normalized between the expression and the macros.
+ exprRefMap := make(map[int64]struct{})
+ ast.PostOrderVisit(expr, ast.NewExprVisitor(func(e ast.Expr) {
+ if e.ID() == 0 {
+ return
+ }
+ exprRefMap[e.ID()] = struct{}{}
+ }))
+ // Update the macro call id references to ensure that macro pointers are
+ // updated consistently across macros.
+ for _, call := range info.MacroCalls() {
+ ast.PostOrderVisit(call, ast.NewExprVisitor(func(e ast.Expr) {
+ if e.ID() == 0 {
+ return
+ }
+ exprRefMap[e.ID()] = struct{}{}
+ }))
+ }
+ for id := range info.MacroCalls() {
+ if _, found := exprRefMap[id]; !found {
+ info.ClearMacroCall(id)
+ }
+ }
+}
+
+// newIDGenerator ensures that new ids are only created the first time they are encountered.
+func newIDGenerator(seed int64) *idGenerator {
+ return &idGenerator{
+ idMap: make(map[int64]int64),
+ seed: seed,
+ }
+}
+
+type idGenerator struct {
+ idMap map[int64]int64
+ seed int64
+}
+
+func (gen *idGenerator) nextID() int64 {
+ gen.seed++
+ return gen.seed
+}
+
+func (gen *idGenerator) renumberStable(id int64) int64 {
+ if id == 0 {
+ return 0
+ }
+ if newID, found := gen.idMap[id]; found {
+ return newID
+ }
+ nextID := gen.nextID()
+ gen.idMap[id] = nextID
+ return nextID
+}
+
+// OptimizerContext embeds Env and Issues instances to make it easy to type-check and evaluate
+// subexpressions and report any errors encountered along the way. The context also embeds the
+// optimizerExprFactory which can be used to generate new sub-expressions with expression ids
+// consistent with the expectations of a parsed expression.
+type OptimizerContext struct {
+ *Env
+ *optimizerExprFactory
+ *Issues
+}
+
+// ASTOptimizer applies an optimization over an AST and returns the optimized result.
+type ASTOptimizer interface {
+ // Optimize optimizes a type-checked AST within an Environment and accumulates any issues.
+ Optimize(*OptimizerContext, *ast.AST) *ast.AST
+}
+
+type optimizerExprFactory struct {
+ *idGenerator
+ fac ast.ExprFactory
+ sourceInfo *ast.SourceInfo
+}
+
+// NewAST creates an AST from the current expression using the tracked source info which
+// is modified and managed by the OptimizerContext.
+func (opt *optimizerExprFactory) NewAST(expr ast.Expr) *ast.AST {
+ return ast.NewAST(expr, opt.sourceInfo)
+}
+
+// CopyAST creates a renumbered copy of `Expr` and `SourceInfo` values of the input AST, where the
+// renumbering uses the same scheme as the core optimizer logic ensuring there are no collisions
+// between copies.
+//
+// Use this method before attempting to merge the expression from AST into another.
+func (opt *optimizerExprFactory) CopyAST(a *ast.AST) (ast.Expr, *ast.SourceInfo) {
+ idGen := newIDGenerator(opt.nextID())
+ defer func() { opt.seed = idGen.nextID() }()
+ copyExpr := opt.fac.CopyExpr(a.Expr())
+ copyInfo := ast.CopySourceInfo(a.SourceInfo())
+ normalizeIDs(idGen.renumberStable, copyExpr, copyInfo)
+ return copyExpr, copyInfo
+}
+
+// CopyASTAndMetadata copies the input AST and propagates the macro metadata into the AST being
+// optimized.
+func (opt *optimizerExprFactory) CopyASTAndMetadata(a *ast.AST) ast.Expr {
+ copyExpr, copyInfo := opt.CopyAST(a)
+ for macroID, call := range copyInfo.MacroCalls() {
+ opt.SetMacroCall(macroID, call)
+ }
+ return copyExpr
+}
+
+// ClearMacroCall clears the macro at the given expression id.
+func (opt *optimizerExprFactory) ClearMacroCall(id int64) {
+ opt.sourceInfo.ClearMacroCall(id)
+}
+
+// SetMacroCall sets the macro call metadata for the given macro id within the tracked source info
+// metadata.
+func (opt *optimizerExprFactory) SetMacroCall(id int64, expr ast.Expr) {
+ opt.sourceInfo.SetMacroCall(id, expr)
+}
+
+// NewBindMacro creates an AST expression representing the expanded bind() macro, and a macro expression
+// representing the unexpanded call signature to be inserted into the source info macro call metadata.
+func (opt *optimizerExprFactory) NewBindMacro(macroID int64, varName string, varInit, remaining ast.Expr) (astExpr, macroExpr ast.Expr) {
+ varID := opt.nextID()
+ remainingID := opt.nextID()
+ remaining = opt.fac.CopyExpr(remaining)
+ remaining.RenumberIDs(func(id int64) int64 {
+ if id == macroID {
+ return remainingID
+ }
+ return id
+ })
+ if call, exists := opt.sourceInfo.GetMacroCall(macroID); exists {
+ opt.SetMacroCall(remainingID, opt.fac.CopyExpr(call))
+ }
+
+ astExpr = opt.fac.NewComprehension(macroID,
+ opt.fac.NewList(opt.nextID(), []ast.Expr{}, []int32{}),
+ "#unused",
+ varName,
+ opt.fac.CopyExpr(varInit),
+ opt.fac.NewLiteral(opt.nextID(), types.False),
+ opt.fac.NewIdent(varID, varName),
+ remaining)
+
+ macroExpr = opt.fac.NewMemberCall(0, "bind",
+ opt.fac.NewIdent(opt.nextID(), "cel"),
+ opt.fac.NewIdent(varID, varName),
+ opt.fac.CopyExpr(varInit),
+ opt.fac.CopyExpr(remaining))
+ opt.sanitizeMacro(macroID, macroExpr)
+ return
+}
+
+// NewCall creates a global function call invocation expression.
+//
+// Example:
+//
+// countByField(list, fieldName)
+// - function: countByField
+// - args: [list, fieldName]
+func (opt *optimizerExprFactory) NewCall(function string, args ...ast.Expr) ast.Expr {
+ return opt.fac.NewCall(opt.nextID(), function, args...)
+}
+
+// NewMemberCall creates a member function call invocation expression where 'target' is the receiver of the call.
+//
+// Example:
+//
+// list.countByField(fieldName)
+// - function: countByField
+// - target: list
+// - args: [fieldName]
+func (opt *optimizerExprFactory) NewMemberCall(function string, target ast.Expr, args ...ast.Expr) ast.Expr {
+ return opt.fac.NewMemberCall(opt.nextID(), function, target, args...)
+}
+
+// NewIdent creates a new identifier expression.
+//
+// Examples:
+//
+// - simple_var_name
+// - qualified.subpackage.var_name
+func (opt *optimizerExprFactory) NewIdent(name string) ast.Expr {
+ return opt.fac.NewIdent(opt.nextID(), name)
+}
+
+// NewLiteral creates a new literal expression value.
+//
+// The range of valid values for a literal generated during optimization is different than for expressions
+// generated via parsing / type-checking, as the ref.Val may be _any_ CEL value so long as the value can
+// be converted back to a literal-like form.
+func (opt *optimizerExprFactory) NewLiteral(value ref.Val) ast.Expr {
+ return opt.fac.NewLiteral(opt.nextID(), value)
+}
+
+// NewList creates a list expression with a set of optional indices.
+//
+// Examples:
+//
+// [a, b]
+// - elems: [a, b]
+// - optIndices: []
+//
+// [a, ?b, ?c]
+// - elems: [a, b, c]
+// - optIndices: [1, 2]
+func (opt *optimizerExprFactory) NewList(elems []ast.Expr, optIndices []int32) ast.Expr {
+ return opt.fac.NewList(opt.nextID(), elems, optIndices)
+}
+
+// NewMap creates a map from a set of entry expressions which contain a key and value expression.
+func (opt *optimizerExprFactory) NewMap(entries []ast.EntryExpr) ast.Expr {
+ return opt.fac.NewMap(opt.nextID(), entries)
+}
+
+// NewMapEntry creates a map entry with a key and value expression and a flag to indicate whether the
+// entry is optional.
+//
+// Examples:
+//
+// {a: b}
+// - key: a
+// - value: b
+// - optional: false
+//
+// {?a: ?b}
+// - key: a
+// - value: b
+// - optional: true
+func (opt *optimizerExprFactory) NewMapEntry(key, value ast.Expr, isOptional bool) ast.EntryExpr {
+ return opt.fac.NewMapEntry(opt.nextID(), key, value, isOptional)
+}
+
+// NewHasMacro generates a test-only select expression to be included within an AST and an unexpanded
+// has() macro call signature to be inserted into the source info macro call metadata.
+func (opt *optimizerExprFactory) NewHasMacro(macroID int64, s ast.Expr) (astExpr, macroExpr ast.Expr) {
+ sel := s.AsSelect()
+ astExpr = opt.fac.NewPresenceTest(macroID, sel.Operand(), sel.FieldName())
+ macroExpr = opt.fac.NewCall(0, "has",
+ opt.NewSelect(opt.fac.CopyExpr(sel.Operand()), sel.FieldName()))
+ opt.sanitizeMacro(macroID, macroExpr)
+ return
+}
+
+// NewSelect creates a select expression where a field value is selected from an operand.
+//
+// Example:
+//
+// msg.field_name
+// - operand: msg
+// - field: field_name
+func (opt *optimizerExprFactory) NewSelect(operand ast.Expr, field string) ast.Expr {
+ return opt.fac.NewSelect(opt.nextID(), operand, field)
+}
+
+// NewStruct creates a new typed struct value with an set of field initializations.
+//
+// Example:
+//
+// pkg.TypeName{field: value}
+// - typeName: pkg.TypeName
+// - fields: [{field: value}]
+func (opt *optimizerExprFactory) NewStruct(typeName string, fields []ast.EntryExpr) ast.Expr {
+ return opt.fac.NewStruct(opt.nextID(), typeName, fields)
+}
+
+// NewStructField creates a struct field initialization.
+//
+// Examples:
+//
+// {count: 3u}
+// - field: count
+// - value: 3u
+// - optional: false
+//
+// {?count: x}
+// - field: count
+// - value: x
+// - optional: true
+func (opt *optimizerExprFactory) NewStructField(field string, value ast.Expr, isOptional bool) ast.EntryExpr {
+ return opt.fac.NewStructField(opt.nextID(), field, value, isOptional)
+}
+
+// UpdateExpr updates the target expression with the updated content while preserving macro metadata.
+//
+// There are four scenarios during the update to consider:
+// 1. target is not macro, updated is not macro
+// 2. target is macro, updated is not macro
+// 3. target is macro, updated is macro
+// 4. target is not macro, updated is macro
+//
+// When the target is a macro already, it may either be updated to a new macro function
+// body if the update is also a macro, or it may be removed altogether if the update is
+// a macro.
+//
+// When the update is a macro, then the target references within other macros must be
+// updated to point to the new updated macro. Otherwise, other macros which pointed to
+// the target body must be replaced with copies of the updated expression body.
+func (opt *optimizerExprFactory) UpdateExpr(target, updated ast.Expr) {
+ // Update the expression
+ target.SetKindCase(updated)
+
+ // Early return if there's no macros present sa the source info reflects the
+ // macro set from the target and updated expressions.
+ if len(opt.sourceInfo.MacroCalls()) == 0 {
+ return
+ }
+ // Determine whether the target expression was a macro.
+ _, targetIsMacro := opt.sourceInfo.GetMacroCall(target.ID())
+
+ // Determine whether the updated expression was a macro.
+ updatedMacro, updatedIsMacro := opt.sourceInfo.GetMacroCall(updated.ID())
+
+ if updatedIsMacro {
+ // If the updated call was a macro, then updated id maps to target id,
+ // and the updated macro moves into the target id slot.
+ opt.sourceInfo.ClearMacroCall(updated.ID())
+ opt.sourceInfo.SetMacroCall(target.ID(), updatedMacro)
+ } else if targetIsMacro {
+ // Otherwise if the target expr was a macro, but is no longer, clear
+ // the macro reference.
+ opt.sourceInfo.ClearMacroCall(target.ID())
+ }
+
+ // Punch holes in the updated value where macros references exist.
+ macroExpr := opt.fac.CopyExpr(target)
+ macroRefVisitor := ast.NewExprVisitor(func(e ast.Expr) {
+ if _, exists := opt.sourceInfo.GetMacroCall(e.ID()); exists {
+ e.SetKindCase(nil)
+ }
+ })
+ ast.PostOrderVisit(macroExpr, macroRefVisitor)
+
+ // Update any references to the expression within a macro
+ macroVisitor := ast.NewExprVisitor(func(call ast.Expr) {
+ // Update the target expression to point to the macro expression which
+ // will be empty if the updated expression was a macro.
+ if call.ID() == target.ID() {
+ call.SetKindCase(opt.fac.CopyExpr(macroExpr))
+ }
+ // Update the macro call expression if it refers to the updated expression
+ // id which has since been remapped to the target id.
+ if call.ID() == updated.ID() {
+ // Either ensure the expression is a macro reference or a populated with
+ // the relevant sub-expression if the updated expr was not a macro.
+ if updatedIsMacro {
+ call.SetKindCase(nil)
+ } else {
+ call.SetKindCase(opt.fac.CopyExpr(macroExpr))
+ }
+ // Since SetKindCase does not renumber the id, ensure the references to
+ // the old 'updated' id are mapped to the target id.
+ call.RenumberIDs(func(id int64) int64 {
+ if id == updated.ID() {
+ return target.ID()
+ }
+ return id
+ })
+ }
+ })
+ for _, call := range opt.sourceInfo.MacroCalls() {
+ ast.PostOrderVisit(call, macroVisitor)
+ }
+}
+
+func (opt *optimizerExprFactory) sanitizeMacro(macroID int64, macroExpr ast.Expr) {
+ macroRefVisitor := ast.NewExprVisitor(func(e ast.Expr) {
+ if _, exists := opt.sourceInfo.GetMacroCall(e.ID()); exists && e.ID() != macroID {
+ e.SetKindCase(nil)
+ }
+ })
+ ast.PostOrderVisit(macroExpr, macroRefVisitor)
+}
diff --git a/vendor/github.com/google/cel-go/cel/options.go b/vendor/github.com/google/cel-go/cel/options.go
index 05867730d3..3c53e21afa 100644
--- a/vendor/github.com/google/cel-go/cel/options.go
+++ b/vendor/github.com/google/cel-go/cel/options.go
@@ -448,6 +448,8 @@ const (
OptTrackCost EvalOption = 1 << iota
// OptCheckStringFormat enables compile-time checking of string.format calls for syntax/cardinality.
+ //
+ // Deprecated: use ext.StringsValidateFormatCalls() as this option is now a no-op.
OptCheckStringFormat EvalOption = 1 << iota
)
diff --git a/vendor/github.com/google/cel-go/cel/program.go b/vendor/github.com/google/cel-go/cel/program.go
index 2dd72f7501..ece9fbdafa 100644
--- a/vendor/github.com/google/cel-go/cel/program.go
+++ b/vendor/github.com/google/cel-go/cel/program.go
@@ -19,7 +19,6 @@ import (
"fmt"
"sync"
- celast "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/interpreter"
@@ -152,7 +151,7 @@ func (p *prog) clone() *prog {
// ProgramOption values.
//
// If the program cannot be configured the prog will be nil, with a non-nil error response.
-func newProgram(e *Env, ast *Ast, opts []ProgramOption) (Program, error) {
+func newProgram(e *Env, a *Ast, opts []ProgramOption) (Program, error) {
// Build the dispatcher, interpreter, and default program value.
disp := interpreter.NewDispatcher()
@@ -213,34 +212,6 @@ func newProgram(e *Env, ast *Ast, opts []ProgramOption) (Program, error) {
if len(p.regexOptimizations) > 0 {
decorators = append(decorators, interpreter.CompileRegexConstants(p.regexOptimizations...))
}
- // Enable compile-time checking of syntax/cardinality for string.format calls.
- if p.evalOpts&OptCheckStringFormat == OptCheckStringFormat {
- var isValidType func(id int64, validTypes ...ref.Type) (bool, error)
- if ast.IsChecked() {
- isValidType = func(id int64, validTypes ...ref.Type) (bool, error) {
- t := ast.typeMap[id]
- if t.Kind() == DynKind {
- return true, nil
- }
- for _, vt := range validTypes {
- k, err := typeValueToKind(vt)
- if err != nil {
- return false, err
- }
- if t.Kind() == k {
- return true, nil
- }
- }
- return false, nil
- }
- } else {
- // if the AST isn't type-checked, short-circuit validation
- isValidType = func(id int64, validTypes ...ref.Type) (bool, error) {
- return true, nil
- }
- }
- decorators = append(decorators, interpreter.InterpolateFormattedString(isValidType))
- }
// Enable exhaustive eval, state tracking and cost tracking last since they require a factory.
if p.evalOpts&(OptExhaustiveEval|OptTrackState|OptTrackCost) != 0 {
@@ -274,33 +245,16 @@ func newProgram(e *Env, ast *Ast, opts []ProgramOption) (Program, error) {
decs = append(decs, interpreter.Observe(observers...))
}
- return p.clone().initInterpretable(ast, decs)
+ return p.clone().initInterpretable(a, decs)
}
return newProgGen(factory)
}
- return p.initInterpretable(ast, decorators)
+ return p.initInterpretable(a, decorators)
}
-func (p *prog) initInterpretable(ast *Ast, decs []interpreter.InterpretableDecorator) (*prog, error) {
- // Unchecked programs do not contain type and reference information and may be slower to execute.
- if !ast.IsChecked() {
- interpretable, err :=
- p.interpreter.NewUncheckedInterpretable(ast.Expr(), decs...)
- if err != nil {
- return nil, err
- }
- p.interpretable = interpretable
- return p, nil
- }
-
- // When the AST has been checked it contains metadata that can be used to speed up program execution.
- checked := &celast.CheckedAST{
- Expr: ast.Expr(),
- SourceInfo: ast.SourceInfo(),
- TypeMap: ast.typeMap,
- ReferenceMap: ast.refMap,
- }
- interpretable, err := p.interpreter.NewInterpretable(checked, decs...)
+func (p *prog) initInterpretable(a *Ast, decs []interpreter.InterpretableDecorator) (*prog, error) {
+ // When the AST has been exprAST it contains metadata that can be used to speed up program execution.
+ interpretable, err := p.interpreter.NewInterpretable(a.impl, decs...)
if err != nil {
return nil, err
}
@@ -580,8 +534,6 @@ func (p *evalActivationPool) Put(value any) {
}
var (
- emptyEvalState = interpreter.NewEvalState()
-
// activationPool is an internally managed pool of Activation values that wrap map[string]any inputs
activationPool = newEvalActivationPool()
diff --git a/vendor/github.com/google/cel-go/cel/validator.go b/vendor/github.com/google/cel-go/cel/validator.go
index 78b3113818..b50c674520 100644
--- a/vendor/github.com/google/cel-go/cel/validator.go
+++ b/vendor/github.com/google/cel-go/cel/validator.go
@@ -21,8 +21,6 @@ import (
"github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/overloads"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
const (
@@ -69,7 +67,7 @@ type ASTValidator interface {
//
// See individual validators for more information on their configuration keys and configuration
// properties.
- Validate(*Env, ValidatorConfig, *ast.CheckedAST, *Issues)
+ Validate(*Env, ValidatorConfig, *ast.AST, *Issues)
}
// ValidatorConfig provides an accessor method for querying validator configuration state.
@@ -180,7 +178,7 @@ func ValidateComprehensionNestingLimit(limit int) ASTValidator {
return nestingLimitValidator{limit: limit}
}
-type argChecker func(env *Env, call, arg ast.NavigableExpr) error
+type argChecker func(env *Env, call, arg ast.Expr) error
func newFormatValidator(funcName string, argNum int, check argChecker) formatValidator {
return formatValidator{
@@ -203,8 +201,8 @@ func (v formatValidator) Name() string {
// Validate searches the AST for uses of a given function name with a constant argument and performs a check
// on whether the argument is a valid literal value.
-func (v formatValidator) Validate(e *Env, _ ValidatorConfig, a *ast.CheckedAST, iss *Issues) {
- root := ast.NavigateCheckedAST(a)
+func (v formatValidator) Validate(e *Env, _ ValidatorConfig, a *ast.AST, iss *Issues) {
+ root := ast.NavigateAST(a)
funcCalls := ast.MatchDescendants(root, ast.FunctionMatcher(v.funcName))
for _, call := range funcCalls {
callArgs := call.AsCall().Args()
@@ -221,8 +219,8 @@ func (v formatValidator) Validate(e *Env, _ ValidatorConfig, a *ast.CheckedAST,
}
}
-func evalCall(env *Env, call, arg ast.NavigableExpr) error {
- ast := ParsedExprToAst(&exprpb.ParsedExpr{Expr: call.ToExpr()})
+func evalCall(env *Env, call, arg ast.Expr) error {
+ ast := &Ast{impl: ast.NewAST(call, ast.NewSourceInfo(nil))}
prg, err := env.Program(ast)
if err != nil {
return err
@@ -231,7 +229,7 @@ func evalCall(env *Env, call, arg ast.NavigableExpr) error {
return err
}
-func compileRegex(_ *Env, _, arg ast.NavigableExpr) error {
+func compileRegex(_ *Env, _, arg ast.Expr) error {
pattern := arg.AsLiteral().Value().(string)
_, err := regexp.Compile(pattern)
return err
@@ -244,25 +242,14 @@ func (homogeneousAggregateLiteralValidator) Name() string {
return homogeneousValidatorName
}
-// Configure implements the ASTValidatorConfigurer interface and currently sets the list of standard
-// and exempt functions from homogeneous aggregate literal checks.
-//
-// TODO: Move this call into the string.format() ASTValidator once ported.
-func (homogeneousAggregateLiteralValidator) Configure(c MutableValidatorConfig) error {
- emptyList := []string{}
- exemptFunctions := c.GetOrDefault(HomogeneousAggregateLiteralExemptFunctions, emptyList).([]string)
- exemptFunctions = append(exemptFunctions, "format")
- return c.Set(HomogeneousAggregateLiteralExemptFunctions, exemptFunctions)
-}
-
// Validate validates that all lists and map literals have homogeneous types, i.e. don't contain dyn types.
//
// This validator makes an exception for list and map literals which occur at any level of nesting within
// string format calls.
-func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig, a *ast.CheckedAST, iss *Issues) {
+func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig, a *ast.AST, iss *Issues) {
var exemptedFunctions []string
exemptedFunctions = c.GetOrDefault(HomogeneousAggregateLiteralExemptFunctions, exemptedFunctions).([]string)
- root := ast.NavigateCheckedAST(a)
+ root := ast.NavigateAST(a)
listExprs := ast.MatchDescendants(root, ast.KindMatcher(ast.ListKind))
for _, listExpr := range listExprs {
if inExemptFunction(listExpr, exemptedFunctions) {
@@ -273,7 +260,7 @@ func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig
optIndices := l.OptionalIndices()
var elemType *Type
for i, e := range elements {
- et := e.Type()
+ et := a.GetType(e.ID())
if isOptionalIndex(i, optIndices) {
et = et.Parameters()[0]
}
@@ -296,9 +283,10 @@ func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig
entries := m.Entries()
var keyType, valType *Type
for _, e := range entries {
- key, val := e.Key(), e.Value()
- kt, vt := key.Type(), val.Type()
- if e.IsOptional() {
+ mapEntry := e.AsMapEntry()
+ key, val := mapEntry.Key(), mapEntry.Value()
+ kt, vt := a.GetType(key.ID()), a.GetType(val.ID())
+ if mapEntry.IsOptional() {
vt = vt.Parameters()[0]
}
if keyType == nil && valType == nil {
@@ -316,7 +304,8 @@ func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig
}
func inExemptFunction(e ast.NavigableExpr, exemptFunctions []string) bool {
- if parent, found := e.Parent(); found {
+ parent, found := e.Parent()
+ for found {
if parent.Kind() == ast.CallKind {
fnName := parent.AsCall().FunctionName()
for _, exempt := range exemptFunctions {
@@ -325,9 +314,7 @@ func inExemptFunction(e ast.NavigableExpr, exemptFunctions []string) bool {
}
}
}
- if parent.Kind() == ast.ListKind || parent.Kind() == ast.MapKind {
- return inExemptFunction(parent, exemptFunctions)
- }
+ parent, found = parent.Parent()
}
return false
}
@@ -353,8 +340,8 @@ func (v nestingLimitValidator) Name() string {
return "cel.lib.std.validate.comprehension_nesting_limit"
}
-func (v nestingLimitValidator) Validate(e *Env, _ ValidatorConfig, a *ast.CheckedAST, iss *Issues) {
- root := ast.NavigateCheckedAST(a)
+func (v nestingLimitValidator) Validate(e *Env, _ ValidatorConfig, a *ast.AST, iss *Issues) {
+ root := ast.NavigateAST(a)
comprehensions := ast.MatchDescendants(root, ast.KindMatcher(ast.ComprehensionKind))
if len(comprehensions) <= v.limit {
return
diff --git a/vendor/github.com/google/cel-go/checker/BUILD.bazel b/vendor/github.com/google/cel-go/checker/BUILD.bazel
index 0459d35239..997fa91d15 100644
--- a/vendor/github.com/google/cel-go/checker/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/checker/BUILD.bazel
@@ -60,7 +60,6 @@ go_test(
"//test:go_default_library",
"//test/proto2pb:go_default_library",
"//test/proto3pb:go_default_library",
- "@com_github_antlr_antlr4_runtime_go_antlr_v4//:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
],
)
diff --git a/vendor/github.com/google/cel-go/checker/checker.go b/vendor/github.com/google/cel-go/checker/checker.go
index 720e4fa968..57fb3ce5ea 100644
--- a/vendor/github.com/google/cel-go/checker/checker.go
+++ b/vendor/github.com/google/cel-go/checker/checker.go
@@ -18,6 +18,7 @@ package checker
import (
"fmt"
+ "reflect"
"github.com/google/cel-go/common"
"github.com/google/cel-go/common/ast"
@@ -25,139 +26,98 @@ import (
"github.com/google/cel-go/common/decls"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/types"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/types/ref"
)
type checker struct {
+ *ast.AST
+ ast.ExprFactory
env *Env
errors *typeErrors
mappings *mapping
freeTypeVarCounter int
- sourceInfo *exprpb.SourceInfo
- types map[int64]*types.Type
- references map[int64]*ast.ReferenceInfo
}
// Check performs type checking, giving a typed AST.
-// The input is a ParsedExpr proto and an env which encapsulates
-// type binding of variables, declarations of built-in functions,
-// descriptions of protocol buffers, and a registry for errors.
-// Returns a CheckedExpr proto, which might not be usable if
-// there are errors in the error registry.
-func Check(parsedExpr *exprpb.ParsedExpr, source common.Source, env *Env) (*ast.CheckedAST, *common.Errors) {
+//
+// The input is a parsed AST and an env which encapsulates type binding of variables,
+// declarations of built-in functions, descriptions of protocol buffers, and a registry for
+// errors.
+//
+// Returns a type-checked AST, which might not be usable if there are errors in the error
+// registry.
+func Check(parsed *ast.AST, source common.Source, env *Env) (*ast.AST, *common.Errors) {
errs := common.NewErrors(source)
+ typeMap := make(map[int64]*types.Type)
+ refMap := make(map[int64]*ast.ReferenceInfo)
c := checker{
+ AST: ast.NewCheckedAST(parsed, typeMap, refMap),
+ ExprFactory: ast.NewExprFactory(),
env: env,
errors: &typeErrors{errs: errs},
mappings: newMapping(),
freeTypeVarCounter: 0,
- sourceInfo: parsedExpr.GetSourceInfo(),
- types: make(map[int64]*types.Type),
- references: make(map[int64]*ast.ReferenceInfo),
}
- c.check(parsedExpr.GetExpr())
+ c.check(c.Expr())
- // Walk over the final type map substituting any type parameters either by their bound value or
- // by DYN.
- m := make(map[int64]*types.Type)
- for id, t := range c.types {
- m[id] = substitute(c.mappings, t, true)
+ // Walk over the final type map substituting any type parameters either by their bound value
+ // or by DYN.
+ for id, t := range c.TypeMap() {
+ c.SetType(id, substitute(c.mappings, t, true))
}
-
- return &ast.CheckedAST{
- Expr: parsedExpr.GetExpr(),
- SourceInfo: parsedExpr.GetSourceInfo(),
- TypeMap: m,
- ReferenceMap: c.references,
- }, errs
+ return c.AST, errs
}
-func (c *checker) check(e *exprpb.Expr) {
+func (c *checker) check(e ast.Expr) {
if e == nil {
return
}
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- literal := e.GetConstExpr()
- switch literal.GetConstantKind().(type) {
- case *exprpb.Constant_BoolValue:
- c.checkBoolLiteral(e)
- case *exprpb.Constant_BytesValue:
- c.checkBytesLiteral(e)
- case *exprpb.Constant_DoubleValue:
- c.checkDoubleLiteral(e)
- case *exprpb.Constant_Int64Value:
- c.checkInt64Literal(e)
- case *exprpb.Constant_NullValue:
- c.checkNullLiteral(e)
- case *exprpb.Constant_StringValue:
- c.checkStringLiteral(e)
- case *exprpb.Constant_Uint64Value:
- c.checkUint64Literal(e)
+ switch e.Kind() {
+ case ast.LiteralKind:
+ literal := ref.Val(e.AsLiteral())
+ switch literal.Type() {
+ case types.BoolType, types.BytesType, types.DoubleType, types.IntType,
+ types.NullType, types.StringType, types.UintType:
+ c.setType(e, literal.Type().(*types.Type))
+ default:
+ c.errors.unexpectedASTType(e.ID(), c.location(e), "literal", literal.Type().TypeName())
}
- case *exprpb.Expr_IdentExpr:
+ case ast.IdentKind:
c.checkIdent(e)
- case *exprpb.Expr_SelectExpr:
+ case ast.SelectKind:
c.checkSelect(e)
- case *exprpb.Expr_CallExpr:
+ case ast.CallKind:
c.checkCall(e)
- case *exprpb.Expr_ListExpr:
+ case ast.ListKind:
c.checkCreateList(e)
- case *exprpb.Expr_StructExpr:
+ case ast.MapKind:
+ c.checkCreateMap(e)
+ case ast.StructKind:
c.checkCreateStruct(e)
- case *exprpb.Expr_ComprehensionExpr:
+ case ast.ComprehensionKind:
c.checkComprehension(e)
default:
- c.errors.unexpectedASTType(e.GetId(), c.location(e), e)
+ c.errors.unexpectedASTType(e.ID(), c.location(e), "unspecified", reflect.TypeOf(e).Name())
}
}
-func (c *checker) checkInt64Literal(e *exprpb.Expr) {
- c.setType(e, types.IntType)
-}
-
-func (c *checker) checkUint64Literal(e *exprpb.Expr) {
- c.setType(e, types.UintType)
-}
-
-func (c *checker) checkStringLiteral(e *exprpb.Expr) {
- c.setType(e, types.StringType)
-}
-
-func (c *checker) checkBytesLiteral(e *exprpb.Expr) {
- c.setType(e, types.BytesType)
-}
-
-func (c *checker) checkDoubleLiteral(e *exprpb.Expr) {
- c.setType(e, types.DoubleType)
-}
-
-func (c *checker) checkBoolLiteral(e *exprpb.Expr) {
- c.setType(e, types.BoolType)
-}
-
-func (c *checker) checkNullLiteral(e *exprpb.Expr) {
- c.setType(e, types.NullType)
-}
-
-func (c *checker) checkIdent(e *exprpb.Expr) {
- identExpr := e.GetIdentExpr()
+func (c *checker) checkIdent(e ast.Expr) {
+ identName := e.AsIdent()
// Check to see if the identifier is declared.
- if ident := c.env.LookupIdent(identExpr.GetName()); ident != nil {
+ if ident := c.env.LookupIdent(identName); ident != nil {
c.setType(e, ident.Type())
c.setReference(e, ast.NewIdentReference(ident.Name(), ident.Value()))
// Overwrite the identifier with its fully qualified name.
- identExpr.Name = ident.Name()
+ e.SetKindCase(c.NewIdent(e.ID(), ident.Name()))
return
}
c.setType(e, types.ErrorType)
- c.errors.undeclaredReference(e.GetId(), c.location(e), c.env.container.Name(), identExpr.GetName())
+ c.errors.undeclaredReference(e.ID(), c.location(e), c.env.container.Name(), identName)
}
-func (c *checker) checkSelect(e *exprpb.Expr) {
- sel := e.GetSelectExpr()
+func (c *checker) checkSelect(e ast.Expr) {
+ sel := e.AsSelect()
// Before traversing down the tree, try to interpret as qualified name.
qname, found := containers.ToQualifiedName(e)
if found {
@@ -170,31 +130,26 @@ func (c *checker) checkSelect(e *exprpb.Expr) {
// variable name.
c.setType(e, ident.Type())
c.setReference(e, ast.NewIdentReference(ident.Name(), ident.Value()))
- identName := ident.Name()
- e.ExprKind = &exprpb.Expr_IdentExpr{
- IdentExpr: &exprpb.Expr_Ident{
- Name: identName,
- },
- }
+ e.SetKindCase(c.NewIdent(e.ID(), ident.Name()))
return
}
}
- resultType := c.checkSelectField(e, sel.GetOperand(), sel.GetField(), false)
- if sel.TestOnly {
+ resultType := c.checkSelectField(e, sel.Operand(), sel.FieldName(), false)
+ if sel.IsTestOnly() {
resultType = types.BoolType
}
c.setType(e, substitute(c.mappings, resultType, false))
}
-func (c *checker) checkOptSelect(e *exprpb.Expr) {
+func (c *checker) checkOptSelect(e ast.Expr) {
// Collect metadata related to the opt select call packaged by the parser.
- call := e.GetCallExpr()
- operand := call.GetArgs()[0]
- field := call.GetArgs()[1]
+ call := e.AsCall()
+ operand := call.Args()[0]
+ field := call.Args()[1]
fieldName, isString := maybeUnwrapString(field)
if !isString {
- c.errors.notAnOptionalFieldSelection(field.GetId(), c.location(field), field)
+ c.errors.notAnOptionalFieldSelection(field.ID(), c.location(field), field)
return
}
@@ -204,7 +159,7 @@ func (c *checker) checkOptSelect(e *exprpb.Expr) {
c.setReference(e, ast.NewFunctionReference("select_optional_field"))
}
-func (c *checker) checkSelectField(e, operand *exprpb.Expr, field string, optional bool) *types.Type {
+func (c *checker) checkSelectField(e, operand ast.Expr, field string, optional bool) *types.Type {
// Interpret as field selection, first traversing down the operand.
c.check(operand)
operandType := substitute(c.mappings, c.getType(operand), false)
@@ -222,7 +177,7 @@ func (c *checker) checkSelectField(e, operand *exprpb.Expr, field string, option
// Objects yield their field type declaration as the selection result type, but only if
// the field is defined.
messageType := targetType
- if fieldType, found := c.lookupFieldType(e.GetId(), messageType.TypeName(), field); found {
+ if fieldType, found := c.lookupFieldType(e.ID(), messageType.TypeName(), field); found {
resultType = fieldType
}
case types.TypeParamKind:
@@ -236,7 +191,7 @@ func (c *checker) checkSelectField(e, operand *exprpb.Expr, field string, option
// Dynamic / error values are treated as DYN type. Errors are handled this way as well
// in order to allow forward progress on the check.
if !isDynOrError(targetType) {
- c.errors.typeDoesNotSupportFieldSelection(e.GetId(), c.location(e), targetType)
+ c.errors.typeDoesNotSupportFieldSelection(e.ID(), c.location(e), targetType)
}
resultType = types.DynType
}
@@ -248,35 +203,34 @@ func (c *checker) checkSelectField(e, operand *exprpb.Expr, field string, option
return resultType
}
-func (c *checker) checkCall(e *exprpb.Expr) {
+func (c *checker) checkCall(e ast.Expr) {
// Note: similar logic exists within the `interpreter/planner.go`. If making changes here
// please consider the impact on planner.go and consolidate implementations or mirror code
// as appropriate.
- call := e.GetCallExpr()
- fnName := call.GetFunction()
+ call := e.AsCall()
+ fnName := call.FunctionName()
if fnName == operators.OptSelect {
c.checkOptSelect(e)
return
}
- args := call.GetArgs()
+ args := call.Args()
// Traverse arguments.
for _, arg := range args {
c.check(arg)
}
- target := call.GetTarget()
// Regular static call with simple name.
- if target == nil {
+ if !call.IsMemberFunction() {
// Check for the existence of the function.
fn := c.env.LookupFunction(fnName)
if fn == nil {
- c.errors.undeclaredReference(e.GetId(), c.location(e), c.env.container.Name(), fnName)
+ c.errors.undeclaredReference(e.ID(), c.location(e), c.env.container.Name(), fnName)
c.setType(e, types.ErrorType)
return
}
// Overwrite the function name with its fully qualified resolved name.
- call.Function = fn.Name()
+ e.SetKindCase(c.NewCall(e.ID(), fn.Name(), args...))
// Check to see whether the overload resolves.
c.resolveOverloadOrError(e, fn, nil, args)
return
@@ -287,6 +241,7 @@ func (c *checker) checkCall(e *exprpb.Expr) {
// target a.b.
//
// Check whether the target is a namespaced function name.
+ target := call.Target()
qualifiedPrefix, maybeQualified := containers.ToQualifiedName(target)
if maybeQualified {
maybeQualifiedName := qualifiedPrefix + "." + fnName
@@ -295,15 +250,14 @@ func (c *checker) checkCall(e *exprpb.Expr) {
// The function name is namespaced and so preserving the target operand would
// be an inaccurate representation of the desired evaluation behavior.
// Overwrite with fully-qualified resolved function name sans receiver target.
- call.Target = nil
- call.Function = fn.Name()
+ e.SetKindCase(c.NewCall(e.ID(), fn.Name(), args...))
c.resolveOverloadOrError(e, fn, nil, args)
return
}
}
// Regular instance call.
- c.check(call.Target)
+ c.check(target)
fn := c.env.LookupFunction(fnName)
// Function found, attempt overload resolution.
if fn != nil {
@@ -312,11 +266,11 @@ func (c *checker) checkCall(e *exprpb.Expr) {
}
// Function name not declared, record error.
c.setType(e, types.ErrorType)
- c.errors.undeclaredReference(e.GetId(), c.location(e), c.env.container.Name(), fnName)
+ c.errors.undeclaredReference(e.ID(), c.location(e), c.env.container.Name(), fnName)
}
func (c *checker) resolveOverloadOrError(
- e *exprpb.Expr, fn *decls.FunctionDecl, target *exprpb.Expr, args []*exprpb.Expr) {
+ e ast.Expr, fn *decls.FunctionDecl, target ast.Expr, args []ast.Expr) {
// Attempt to resolve the overload.
resolution := c.resolveOverload(e, fn, target, args)
// No such overload, error noted in the resolveOverload call, type recorded here.
@@ -330,7 +284,7 @@ func (c *checker) resolveOverloadOrError(
}
func (c *checker) resolveOverload(
- call *exprpb.Expr, fn *decls.FunctionDecl, target *exprpb.Expr, args []*exprpb.Expr) *overloadResolution {
+ call ast.Expr, fn *decls.FunctionDecl, target ast.Expr, args []ast.Expr) *overloadResolution {
var argTypes []*types.Type
if target != nil {
@@ -362,8 +316,8 @@ func (c *checker) resolveOverload(
for i, argType := range argTypes {
if !c.isAssignable(argType, types.BoolType) {
c.errors.typeMismatch(
- args[i].GetId(),
- c.locationByID(args[i].GetId()),
+ args[i].ID(),
+ c.locationByID(args[i].ID()),
types.BoolType,
argType)
resultType = types.ErrorType
@@ -408,29 +362,29 @@ func (c *checker) resolveOverload(
for i, argType := range argTypes {
argTypes[i] = substitute(c.mappings, argType, true)
}
- c.errors.noMatchingOverload(call.GetId(), c.location(call), fn.Name(), argTypes, target != nil)
+ c.errors.noMatchingOverload(call.ID(), c.location(call), fn.Name(), argTypes, target != nil)
return nil
}
return newResolution(checkedRef, resultType)
}
-func (c *checker) checkCreateList(e *exprpb.Expr) {
- create := e.GetListExpr()
+func (c *checker) checkCreateList(e ast.Expr) {
+ create := e.AsList()
var elemsType *types.Type
- optionalIndices := create.GetOptionalIndices()
+ optionalIndices := create.OptionalIndices()
optionals := make(map[int32]bool, len(optionalIndices))
for _, optInd := range optionalIndices {
optionals[optInd] = true
}
- for i, e := range create.GetElements() {
+ for i, e := range create.Elements() {
c.check(e)
elemType := c.getType(e)
if optionals[int32(i)] {
var isOptional bool
elemType, isOptional = maybeUnwrapOptional(elemType)
if !isOptional && !isDyn(elemType) {
- c.errors.typeMismatch(e.GetId(), c.location(e), types.NewOptionalType(elemType), elemType)
+ c.errors.typeMismatch(e.ID(), c.location(e), types.NewOptionalType(elemType), elemType)
}
}
elemsType = c.joinTypes(e, elemsType, elemType)
@@ -442,32 +396,24 @@ func (c *checker) checkCreateList(e *exprpb.Expr) {
c.setType(e, types.NewListType(elemsType))
}
-func (c *checker) checkCreateStruct(e *exprpb.Expr) {
- str := e.GetStructExpr()
- if str.GetMessageName() != "" {
- c.checkCreateMessage(e)
- } else {
- c.checkCreateMap(e)
- }
-}
-
-func (c *checker) checkCreateMap(e *exprpb.Expr) {
- mapVal := e.GetStructExpr()
+func (c *checker) checkCreateMap(e ast.Expr) {
+ mapVal := e.AsMap()
var mapKeyType *types.Type
var mapValueType *types.Type
- for _, ent := range mapVal.GetEntries() {
- key := ent.GetMapKey()
+ for _, e := range mapVal.Entries() {
+ entry := e.AsMapEntry()
+ key := entry.Key()
c.check(key)
mapKeyType = c.joinTypes(key, mapKeyType, c.getType(key))
- val := ent.GetValue()
+ val := entry.Value()
c.check(val)
valType := c.getType(val)
- if ent.GetOptionalEntry() {
+ if entry.IsOptional() {
var isOptional bool
valType, isOptional = maybeUnwrapOptional(valType)
if !isOptional && !isDyn(valType) {
- c.errors.typeMismatch(val.GetId(), c.location(val), types.NewOptionalType(valType), valType)
+ c.errors.typeMismatch(val.ID(), c.location(val), types.NewOptionalType(valType), valType)
}
}
mapValueType = c.joinTypes(val, mapValueType, valType)
@@ -480,25 +426,28 @@ func (c *checker) checkCreateMap(e *exprpb.Expr) {
c.setType(e, types.NewMapType(mapKeyType, mapValueType))
}
-func (c *checker) checkCreateMessage(e *exprpb.Expr) {
- msgVal := e.GetStructExpr()
+func (c *checker) checkCreateStruct(e ast.Expr) {
+ msgVal := e.AsStruct()
// Determine the type of the message.
resultType := types.ErrorType
- ident := c.env.LookupIdent(msgVal.GetMessageName())
+ ident := c.env.LookupIdent(msgVal.TypeName())
if ident == nil {
c.errors.undeclaredReference(
- e.GetId(), c.location(e), c.env.container.Name(), msgVal.GetMessageName())
+ e.ID(), c.location(e), c.env.container.Name(), msgVal.TypeName())
c.setType(e, types.ErrorType)
return
}
// Ensure the type name is fully qualified in the AST.
typeName := ident.Name()
- msgVal.MessageName = typeName
- c.setReference(e, ast.NewIdentReference(ident.Name(), nil))
+ if msgVal.TypeName() != typeName {
+ e.SetKindCase(c.NewStruct(e.ID(), typeName, msgVal.Fields()))
+ msgVal = e.AsStruct()
+ }
+ c.setReference(e, ast.NewIdentReference(typeName, nil))
identKind := ident.Type().Kind()
if identKind != types.ErrorKind {
if identKind != types.TypeKind {
- c.errors.notAType(e.GetId(), c.location(e), ident.Type().DeclaredTypeName())
+ c.errors.notAType(e.ID(), c.location(e), ident.Type().DeclaredTypeName())
} else {
resultType = ident.Type().Parameters()[0]
// Backwards compatibility test between well-known types and message types
@@ -509,7 +458,7 @@ func (c *checker) checkCreateMessage(e *exprpb.Expr) {
} else if resultType.Kind() == types.StructKind {
typeName = resultType.DeclaredTypeName()
} else {
- c.errors.notAMessageType(e.GetId(), c.location(e), resultType.DeclaredTypeName())
+ c.errors.notAMessageType(e.ID(), c.location(e), resultType.DeclaredTypeName())
resultType = types.ErrorType
}
}
@@ -517,37 +466,38 @@ func (c *checker) checkCreateMessage(e *exprpb.Expr) {
c.setType(e, resultType)
// Check the field initializers.
- for _, ent := range msgVal.GetEntries() {
- field := ent.GetFieldKey()
- value := ent.GetValue()
+ for _, f := range msgVal.Fields() {
+ field := f.AsStructField()
+ fieldName := field.Name()
+ value := field.Value()
c.check(value)
fieldType := types.ErrorType
- ft, found := c.lookupFieldType(ent.GetId(), typeName, field)
+ ft, found := c.lookupFieldType(f.ID(), typeName, fieldName)
if found {
fieldType = ft
}
valType := c.getType(value)
- if ent.GetOptionalEntry() {
+ if field.IsOptional() {
var isOptional bool
valType, isOptional = maybeUnwrapOptional(valType)
if !isOptional && !isDyn(valType) {
- c.errors.typeMismatch(value.GetId(), c.location(value), types.NewOptionalType(valType), valType)
+ c.errors.typeMismatch(value.ID(), c.location(value), types.NewOptionalType(valType), valType)
}
}
if !c.isAssignable(fieldType, valType) {
- c.errors.fieldTypeMismatch(ent.GetId(), c.locationByID(ent.GetId()), field, fieldType, valType)
+ c.errors.fieldTypeMismatch(f.ID(), c.locationByID(f.ID()), fieldName, fieldType, valType)
}
}
}
-func (c *checker) checkComprehension(e *exprpb.Expr) {
- comp := e.GetComprehensionExpr()
- c.check(comp.GetIterRange())
- c.check(comp.GetAccuInit())
- accuType := c.getType(comp.GetAccuInit())
- rangeType := substitute(c.mappings, c.getType(comp.GetIterRange()), false)
+func (c *checker) checkComprehension(e ast.Expr) {
+ comp := e.AsComprehension()
+ c.check(comp.IterRange())
+ c.check(comp.AccuInit())
+ accuType := c.getType(comp.AccuInit())
+ rangeType := substitute(c.mappings, c.getType(comp.IterRange()), false)
var varType *types.Type
switch rangeType.Kind() {
@@ -564,32 +514,32 @@ func (c *checker) checkComprehension(e *exprpb.Expr) {
// Set the range iteration variable to type DYN as well.
varType = types.DynType
default:
- c.errors.notAComprehensionRange(comp.GetIterRange().GetId(), c.location(comp.GetIterRange()), rangeType)
+ c.errors.notAComprehensionRange(comp.IterRange().ID(), c.location(comp.IterRange()), rangeType)
varType = types.ErrorType
}
// Create a scope for the comprehension since it has a local accumulation variable.
// This scope will contain the accumulation variable used to compute the result.
c.env = c.env.enterScope()
- c.env.AddIdents(decls.NewVariable(comp.GetAccuVar(), accuType))
+ c.env.AddIdents(decls.NewVariable(comp.AccuVar(), accuType))
// Create a block scope for the loop.
c.env = c.env.enterScope()
- c.env.AddIdents(decls.NewVariable(comp.GetIterVar(), varType))
+ c.env.AddIdents(decls.NewVariable(comp.IterVar(), varType))
// Check the variable references in the condition and step.
- c.check(comp.GetLoopCondition())
- c.assertType(comp.GetLoopCondition(), types.BoolType)
- c.check(comp.GetLoopStep())
- c.assertType(comp.GetLoopStep(), accuType)
+ c.check(comp.LoopCondition())
+ c.assertType(comp.LoopCondition(), types.BoolType)
+ c.check(comp.LoopStep())
+ c.assertType(comp.LoopStep(), accuType)
// Exit the loop's block scope before checking the result.
c.env = c.env.exitScope()
- c.check(comp.GetResult())
+ c.check(comp.Result())
// Exit the comprehension scope.
c.env = c.env.exitScope()
- c.setType(e, substitute(c.mappings, c.getType(comp.GetResult()), false))
+ c.setType(e, substitute(c.mappings, c.getType(comp.Result()), false))
}
// Checks compatibility of joined types, and returns the most general common type.
-func (c *checker) joinTypes(e *exprpb.Expr, previous, current *types.Type) *types.Type {
+func (c *checker) joinTypes(e ast.Expr, previous, current *types.Type) *types.Type {
if previous == nil {
return current
}
@@ -599,7 +549,7 @@ func (c *checker) joinTypes(e *exprpb.Expr, previous, current *types.Type) *type
if c.dynAggregateLiteralElementTypesEnabled() {
return types.DynType
}
- c.errors.typeMismatch(e.GetId(), c.location(e), previous, current)
+ c.errors.typeMismatch(e.ID(), c.location(e), previous, current)
return types.ErrorType
}
@@ -633,41 +583,41 @@ func (c *checker) isAssignableList(l1, l2 []*types.Type) bool {
return false
}
-func maybeUnwrapString(e *exprpb.Expr) (string, bool) {
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- literal := e.GetConstExpr()
- switch literal.GetConstantKind().(type) {
- case *exprpb.Constant_StringValue:
- return literal.GetStringValue(), true
+func maybeUnwrapString(e ast.Expr) (string, bool) {
+ switch e.Kind() {
+ case ast.LiteralKind:
+ literal := e.AsLiteral()
+ switch v := literal.(type) {
+ case types.String:
+ return string(v), true
}
}
return "", false
}
-func (c *checker) setType(e *exprpb.Expr, t *types.Type) {
- if old, found := c.types[e.GetId()]; found && !old.IsExactType(t) {
- c.errors.incompatibleType(e.GetId(), c.location(e), e, old, t)
+func (c *checker) setType(e ast.Expr, t *types.Type) {
+ if old, found := c.TypeMap()[e.ID()]; found && !old.IsExactType(t) {
+ c.errors.incompatibleType(e.ID(), c.location(e), e, old, t)
return
}
- c.types[e.GetId()] = t
+ c.SetType(e.ID(), t)
}
-func (c *checker) getType(e *exprpb.Expr) *types.Type {
- return c.types[e.GetId()]
+func (c *checker) getType(e ast.Expr) *types.Type {
+ return c.TypeMap()[e.ID()]
}
-func (c *checker) setReference(e *exprpb.Expr, r *ast.ReferenceInfo) {
- if old, found := c.references[e.GetId()]; found && !old.Equals(r) {
- c.errors.referenceRedefinition(e.GetId(), c.location(e), e, old, r)
+func (c *checker) setReference(e ast.Expr, r *ast.ReferenceInfo) {
+ if old, found := c.ReferenceMap()[e.ID()]; found && !old.Equals(r) {
+ c.errors.referenceRedefinition(e.ID(), c.location(e), e, old, r)
return
}
- c.references[e.GetId()] = r
+ c.SetReference(e.ID(), r)
}
-func (c *checker) assertType(e *exprpb.Expr, t *types.Type) {
+func (c *checker) assertType(e ast.Expr, t *types.Type) {
if !c.isAssignable(t, c.getType(e)) {
- c.errors.typeMismatch(e.GetId(), c.location(e), t, c.getType(e))
+ c.errors.typeMismatch(e.ID(), c.location(e), t, c.getType(e))
}
}
@@ -683,26 +633,12 @@ func newResolution(r *ast.ReferenceInfo, t *types.Type) *overloadResolution {
}
}
-func (c *checker) location(e *exprpb.Expr) common.Location {
- return c.locationByID(e.GetId())
+func (c *checker) location(e ast.Expr) common.Location {
+ return c.locationByID(e.ID())
}
func (c *checker) locationByID(id int64) common.Location {
- positions := c.sourceInfo.GetPositions()
- var line = 1
- if offset, found := positions[id]; found {
- col := int(offset)
- for _, lineOffset := range c.sourceInfo.GetLineOffsets() {
- if lineOffset < offset {
- line++
- col = int(offset - lineOffset)
- } else {
- break
- }
- }
- return common.NewLocation(line, col)
- }
- return common.NoLocation
+ return c.SourceInfo().GetStartLocation(id)
}
func (c *checker) lookupFieldType(exprID int64, structType, fieldName string) (*types.Type, bool) {
diff --git a/vendor/github.com/google/cel-go/checker/cost.go b/vendor/github.com/google/cel-go/checker/cost.go
index fd3f735051..04244694d8 100644
--- a/vendor/github.com/google/cel-go/checker/cost.go
+++ b/vendor/github.com/google/cel-go/checker/cost.go
@@ -22,8 +22,6 @@ import (
"github.com/google/cel-go/common/overloads"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/parser"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// WARNING: Any changes to cost calculations in this file require a corresponding change in interpreter/runtimecost.go
@@ -58,7 +56,7 @@ type AstNode interface {
// Type returns the deduced type of the AstNode.
Type() *types.Type
// Expr returns the expression of the AstNode.
- Expr() *exprpb.Expr
+ Expr() ast.Expr
// ComputedSize returns a size estimate of the AstNode derived from information available in the CEL expression.
// For constants and inline list and map declarations, the exact size is returned. For concatenated list, strings
// and bytes, the size is derived from the size estimates of the operands. nil is returned if there is no
@@ -69,7 +67,7 @@ type AstNode interface {
type astNode struct {
path []string
t *types.Type
- expr *exprpb.Expr
+ expr ast.Expr
derivedSize *SizeEstimate
}
@@ -81,7 +79,7 @@ func (e astNode) Type() *types.Type {
return e.t
}
-func (e astNode) Expr() *exprpb.Expr {
+func (e astNode) Expr() ast.Expr {
return e.expr
}
@@ -90,29 +88,27 @@ func (e astNode) ComputedSize() *SizeEstimate {
return e.derivedSize
}
var v uint64
- switch ek := e.expr.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- switch ck := ek.ConstExpr.GetConstantKind().(type) {
- case *exprpb.Constant_StringValue:
+ switch e.expr.Kind() {
+ case ast.LiteralKind:
+ switch ck := e.expr.AsLiteral().(type) {
+ case types.String:
// converting to runes here is an O(n) operation, but
// this is consistent with how size is computed at runtime,
// and how the language definition defines string size
- v = uint64(len([]rune(ck.StringValue)))
- case *exprpb.Constant_BytesValue:
- v = uint64(len(ck.BytesValue))
- case *exprpb.Constant_BoolValue, *exprpb.Constant_DoubleValue, *exprpb.Constant_DurationValue,
- *exprpb.Constant_Int64Value, *exprpb.Constant_TimestampValue, *exprpb.Constant_Uint64Value,
- *exprpb.Constant_NullValue:
+ v = uint64(len([]rune(ck)))
+ case types.Bytes:
+ v = uint64(len(ck))
+ case types.Bool, types.Double, types.Duration,
+ types.Int, types.Timestamp, types.Uint,
+ types.Null:
v = uint64(1)
default:
return nil
}
- case *exprpb.Expr_ListExpr:
- v = uint64(len(ek.ListExpr.GetElements()))
- case *exprpb.Expr_StructExpr:
- if ek.StructExpr.GetMessageName() == "" {
- v = uint64(len(ek.StructExpr.GetEntries()))
- }
+ case ast.ListKind:
+ v = uint64(e.expr.AsList().Size())
+ case ast.MapKind:
+ v = uint64(e.expr.AsMap().Size())
default:
return nil
}
@@ -265,7 +261,7 @@ type coster struct {
iterRanges iterRangeScopes
// computedSizes tracks the computed sizes of call results.
computedSizes map[int64]SizeEstimate
- checkedAST *ast.CheckedAST
+ checkedAST *ast.AST
estimator CostEstimator
overloadEstimators map[string]FunctionEstimator
// presenceTestCost will either be a zero or one based on whether has() macros count against cost computations.
@@ -275,8 +271,8 @@ type coster struct {
// Use a stack of iterVar -> iterRange Expr Ids to handle shadowed variable names.
type iterRangeScopes map[string][]int64
-func (vs iterRangeScopes) push(varName string, expr *exprpb.Expr) {
- vs[varName] = append(vs[varName], expr.GetId())
+func (vs iterRangeScopes) push(varName string, expr ast.Expr) {
+ vs[varName] = append(vs[varName], expr.ID())
}
func (vs iterRangeScopes) pop(varName string) {
@@ -324,9 +320,9 @@ func OverloadCostEstimate(overloadID string, functionCoster FunctionEstimator) C
}
// Cost estimates the cost of the parsed and type checked CEL expression.
-func Cost(checker *ast.CheckedAST, estimator CostEstimator, opts ...CostOption) (CostEstimate, error) {
+func Cost(checked *ast.AST, estimator CostEstimator, opts ...CostOption) (CostEstimate, error) {
c := &coster{
- checkedAST: checker,
+ checkedAST: checked,
estimator: estimator,
overloadEstimators: map[string]FunctionEstimator{},
exprPath: map[int64][]string{},
@@ -340,28 +336,30 @@ func Cost(checker *ast.CheckedAST, estimator CostEstimator, opts ...CostOption)
return CostEstimate{}, err
}
}
- return c.cost(checker.Expr), nil
+ return c.cost(checked.Expr()), nil
}
-func (c *coster) cost(e *exprpb.Expr) CostEstimate {
+func (c *coster) cost(e ast.Expr) CostEstimate {
if e == nil {
return CostEstimate{}
}
var cost CostEstimate
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
+ switch e.Kind() {
+ case ast.LiteralKind:
cost = constCost
- case *exprpb.Expr_IdentExpr:
+ case ast.IdentKind:
cost = c.costIdent(e)
- case *exprpb.Expr_SelectExpr:
+ case ast.SelectKind:
cost = c.costSelect(e)
- case *exprpb.Expr_CallExpr:
+ case ast.CallKind:
cost = c.costCall(e)
- case *exprpb.Expr_ListExpr:
+ case ast.ListKind:
cost = c.costCreateList(e)
- case *exprpb.Expr_StructExpr:
+ case ast.MapKind:
+ cost = c.costCreateMap(e)
+ case ast.StructKind:
cost = c.costCreateStruct(e)
- case *exprpb.Expr_ComprehensionExpr:
+ case ast.ComprehensionKind:
cost = c.costComprehension(e)
default:
return CostEstimate{}
@@ -369,53 +367,51 @@ func (c *coster) cost(e *exprpb.Expr) CostEstimate {
return cost
}
-func (c *coster) costIdent(e *exprpb.Expr) CostEstimate {
- identExpr := e.GetIdentExpr()
-
+func (c *coster) costIdent(e ast.Expr) CostEstimate {
+ identName := e.AsIdent()
// build and track the field path
- if iterRange, ok := c.iterRanges.peek(identExpr.GetName()); ok {
- switch c.checkedAST.TypeMap[iterRange].Kind() {
+ if iterRange, ok := c.iterRanges.peek(identName); ok {
+ switch c.checkedAST.GetType(iterRange).Kind() {
case types.ListKind:
c.addPath(e, append(c.exprPath[iterRange], "@items"))
case types.MapKind:
c.addPath(e, append(c.exprPath[iterRange], "@keys"))
}
} else {
- c.addPath(e, []string{identExpr.GetName()})
+ c.addPath(e, []string{identName})
}
return selectAndIdentCost
}
-func (c *coster) costSelect(e *exprpb.Expr) CostEstimate {
- sel := e.GetSelectExpr()
+func (c *coster) costSelect(e ast.Expr) CostEstimate {
+ sel := e.AsSelect()
var sum CostEstimate
- if sel.GetTestOnly() {
+ if sel.IsTestOnly() {
// recurse, but do not add any cost
// this is equivalent to how evalTestOnly increments the runtime cost counter
// but does not add any additional cost for the qualifier, except here we do
// the reverse (ident adds cost)
sum = sum.Add(c.presenceTestCost)
- sum = sum.Add(c.cost(sel.GetOperand()))
+ sum = sum.Add(c.cost(sel.Operand()))
return sum
}
- sum = sum.Add(c.cost(sel.GetOperand()))
- targetType := c.getType(sel.GetOperand())
+ sum = sum.Add(c.cost(sel.Operand()))
+ targetType := c.getType(sel.Operand())
switch targetType.Kind() {
case types.MapKind, types.StructKind, types.TypeParamKind:
sum = sum.Add(selectAndIdentCost)
}
// build and track the field path
- c.addPath(e, append(c.getPath(sel.GetOperand()), sel.GetField()))
+ c.addPath(e, append(c.getPath(sel.Operand()), sel.FieldName()))
return sum
}
-func (c *coster) costCall(e *exprpb.Expr) CostEstimate {
- call := e.GetCallExpr()
- target := call.GetTarget()
- args := call.GetArgs()
+func (c *coster) costCall(e ast.Expr) CostEstimate {
+ call := e.AsCall()
+ args := call.Args()
var sum CostEstimate
@@ -426,22 +422,20 @@ func (c *coster) costCall(e *exprpb.Expr) CostEstimate {
argTypes[i] = c.newAstNode(arg)
}
- ref := c.checkedAST.ReferenceMap[e.GetId()]
- if ref == nil || len(ref.OverloadIDs) == 0 {
+ overloadIDs := c.checkedAST.GetOverloadIDs(e.ID())
+ if len(overloadIDs) == 0 {
return CostEstimate{}
}
var targetType AstNode
- if target != nil {
- if call.Target != nil {
- sum = sum.Add(c.cost(call.GetTarget()))
- targetType = c.newAstNode(call.GetTarget())
- }
+ if call.IsMemberFunction() {
+ sum = sum.Add(c.cost(call.Target()))
+ targetType = c.newAstNode(call.Target())
}
// Pick a cost estimate range that covers all the overload cost estimation ranges
fnCost := CostEstimate{Min: uint64(math.MaxUint64), Max: 0}
var resultSize *SizeEstimate
- for _, overload := range ref.OverloadIDs {
- overloadCost := c.functionCost(call.GetFunction(), overload, &targetType, argTypes, argCosts)
+ for _, overload := range overloadIDs {
+ overloadCost := c.functionCost(call.FunctionName(), overload, &targetType, argTypes, argCosts)
fnCost = fnCost.Union(overloadCost.CostEstimate)
if overloadCost.ResultSize != nil {
if resultSize == nil {
@@ -464,64 +458,56 @@ func (c *coster) costCall(e *exprpb.Expr) CostEstimate {
}
}
if resultSize != nil {
- c.computedSizes[e.GetId()] = *resultSize
+ c.computedSizes[e.ID()] = *resultSize
}
return sum.Add(fnCost)
}
-func (c *coster) costCreateList(e *exprpb.Expr) CostEstimate {
- create := e.GetListExpr()
+func (c *coster) costCreateList(e ast.Expr) CostEstimate {
+ create := e.AsList()
var sum CostEstimate
- for _, e := range create.GetElements() {
+ for _, e := range create.Elements() {
sum = sum.Add(c.cost(e))
}
return sum.Add(createListBaseCost)
}
-func (c *coster) costCreateStruct(e *exprpb.Expr) CostEstimate {
- str := e.GetStructExpr()
- if str.MessageName != "" {
- return c.costCreateMessage(e)
- }
- return c.costCreateMap(e)
-}
-
-func (c *coster) costCreateMap(e *exprpb.Expr) CostEstimate {
- mapVal := e.GetStructExpr()
+func (c *coster) costCreateMap(e ast.Expr) CostEstimate {
+ mapVal := e.AsMap()
var sum CostEstimate
- for _, ent := range mapVal.GetEntries() {
- key := ent.GetMapKey()
- sum = sum.Add(c.cost(key))
-
- sum = sum.Add(c.cost(ent.GetValue()))
+ for _, ent := range mapVal.Entries() {
+ entry := ent.AsMapEntry()
+ sum = sum.Add(c.cost(entry.Key()))
+ sum = sum.Add(c.cost(entry.Value()))
}
return sum.Add(createMapBaseCost)
}
-func (c *coster) costCreateMessage(e *exprpb.Expr) CostEstimate {
- msgVal := e.GetStructExpr()
+func (c *coster) costCreateStruct(e ast.Expr) CostEstimate {
+ msgVal := e.AsStruct()
var sum CostEstimate
- for _, ent := range msgVal.GetEntries() {
- sum = sum.Add(c.cost(ent.GetValue()))
+ for _, ent := range msgVal.Fields() {
+ field := ent.AsStructField()
+ sum = sum.Add(c.cost(field.Value()))
}
return sum.Add(createMessageBaseCost)
}
-func (c *coster) costComprehension(e *exprpb.Expr) CostEstimate {
- comp := e.GetComprehensionExpr()
+func (c *coster) costComprehension(e ast.Expr) CostEstimate {
+ comp := e.AsComprehension()
var sum CostEstimate
- sum = sum.Add(c.cost(comp.GetIterRange()))
- sum = sum.Add(c.cost(comp.GetAccuInit()))
+ sum = sum.Add(c.cost(comp.IterRange()))
+ sum = sum.Add(c.cost(comp.AccuInit()))
// Track the iterRange of each IterVar for field path construction
- c.iterRanges.push(comp.GetIterVar(), comp.GetIterRange())
- loopCost := c.cost(comp.GetLoopCondition())
- stepCost := c.cost(comp.GetLoopStep())
- c.iterRanges.pop(comp.GetIterVar())
- sum = sum.Add(c.cost(comp.Result))
- rangeCnt := c.sizeEstimate(c.newAstNode(comp.GetIterRange()))
+ c.iterRanges.push(comp.IterVar(), comp.IterRange())
+ loopCost := c.cost(comp.LoopCondition())
+ stepCost := c.cost(comp.LoopStep())
+ c.iterRanges.pop(comp.IterVar())
+ sum = sum.Add(c.cost(comp.Result()))
+ rangeCnt := c.sizeEstimate(c.newAstNode(comp.IterRange()))
- c.computedSizes[e.GetId()] = rangeCnt
+ c.computedSizes[e.ID()] = rangeCnt
rangeCost := rangeCnt.MultiplyByCost(stepCost.Add(loopCost))
sum = sum.Add(rangeCost)
@@ -674,26 +660,26 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
return CallEstimate{CostEstimate: CostEstimate{Min: 1, Max: 1}.Add(argCostSum())}
}
-func (c *coster) getType(e *exprpb.Expr) *types.Type {
- return c.checkedAST.TypeMap[e.GetId()]
+func (c *coster) getType(e ast.Expr) *types.Type {
+ return c.checkedAST.GetType(e.ID())
}
-func (c *coster) getPath(e *exprpb.Expr) []string {
- return c.exprPath[e.GetId()]
+func (c *coster) getPath(e ast.Expr) []string {
+ return c.exprPath[e.ID()]
}
-func (c *coster) addPath(e *exprpb.Expr, path []string) {
- c.exprPath[e.GetId()] = path
+func (c *coster) addPath(e ast.Expr, path []string) {
+ c.exprPath[e.ID()] = path
}
-func (c *coster) newAstNode(e *exprpb.Expr) *astNode {
+func (c *coster) newAstNode(e ast.Expr) *astNode {
path := c.getPath(e)
if len(path) > 0 && path[0] == parser.AccumulatorName {
// only provide paths to root vars; omit accumulator vars
path = nil
}
var derivedSize *SizeEstimate
- if size, ok := c.computedSizes[e.GetId()]; ok {
+ if size, ok := c.computedSizes[e.ID()]; ok {
derivedSize = &size
}
return &astNode{
diff --git a/vendor/github.com/google/cel-go/checker/decls/decls.go b/vendor/github.com/google/cel-go/checker/decls/decls.go
index 0d91bef514..c0e5de469f 100644
--- a/vendor/github.com/google/cel-go/checker/decls/decls.go
+++ b/vendor/github.com/google/cel-go/checker/decls/decls.go
@@ -67,7 +67,7 @@ func NewAbstractType(name string, paramTypes ...*exprpb.Type) *exprpb.Type {
// NewOptionalType constructs an abstract type indicating that the parameterized type
// may be contained within the object.
func NewOptionalType(paramType *exprpb.Type) *exprpb.Type {
- return NewAbstractType("optional", paramType)
+ return NewAbstractType("optional_type", paramType)
}
// NewFunctionType creates a function invocation contract, typically only used
diff --git a/vendor/github.com/google/cel-go/checker/env.go b/vendor/github.com/google/cel-go/checker/env.go
index 70682b17c6..d5ac05014e 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 c2b96498d1..8b3bf0b8b6 100644
--- a/vendor/github.com/google/cel-go/checker/errors.go
+++ b/vendor/github.com/google/cel-go/checker/errors.go
@@ -15,13 +15,9 @@
package checker
import (
- "reflect"
-
"github.com/google/cel-go/common"
"github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/types"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// typeErrors is a specialization of Errors.
@@ -34,9 +30,9 @@ func (e *typeErrors) fieldTypeMismatch(id int64, l common.Location, name string,
name, FormatCELType(field), FormatCELType(value))
}
-func (e *typeErrors) incompatibleType(id int64, l common.Location, ex *exprpb.Expr, prev, next *types.Type) {
+func (e *typeErrors) incompatibleType(id int64, l common.Location, ex ast.Expr, prev, next *types.Type) {
e.errs.ReportErrorAtID(id, l,
- "incompatible type already exists for expression: %v(%d) old:%v, new:%v", ex, ex.GetId(), prev, next)
+ "incompatible type already exists for expression: %v(%d) old:%v, new:%v", ex, ex.ID(), prev, next)
}
func (e *typeErrors) noMatchingOverload(id int64, l common.Location, name string, args []*types.Type, isInstance bool) {
@@ -49,7 +45,7 @@ func (e *typeErrors) notAComprehensionRange(id int64, l common.Location, t *type
FormatCELType(t))
}
-func (e *typeErrors) notAnOptionalFieldSelection(id int64, l common.Location, field *exprpb.Expr) {
+func (e *typeErrors) notAnOptionalFieldSelection(id int64, l common.Location, field ast.Expr) {
e.errs.ReportErrorAtID(id, l, "unsupported optional field selection: %v", field)
}
@@ -61,9 +57,9 @@ func (e *typeErrors) notAMessageType(id int64, l common.Location, typeName strin
e.errs.ReportErrorAtID(id, l, "'%s' is not a message type", typeName)
}
-func (e *typeErrors) referenceRedefinition(id int64, l common.Location, ex *exprpb.Expr, prev, next *ast.ReferenceInfo) {
+func (e *typeErrors) referenceRedefinition(id int64, l common.Location, ex ast.Expr, prev, next *ast.ReferenceInfo) {
e.errs.ReportErrorAtID(id, l,
- "reference already exists for expression: %v(%d) old:%v, new:%v", ex, ex.GetId(), prev, next)
+ "reference already exists for expression: %v(%d) old:%v, new:%v", ex, ex.ID(), prev, next)
}
func (e *typeErrors) typeDoesNotSupportFieldSelection(id int64, l common.Location, t *types.Type) {
@@ -87,6 +83,6 @@ func (e *typeErrors) unexpectedFailedResolution(id int64, l common.Location, typ
e.errs.ReportErrorAtID(id, l, "unexpected failed resolution of '%s'", typeName)
}
-func (e *typeErrors) unexpectedASTType(id int64, l common.Location, ex *exprpb.Expr) {
- e.errs.ReportErrorAtID(id, l, "unrecognized ast type: %v", reflect.TypeOf(ex))
+func (e *typeErrors) unexpectedASTType(id int64, l common.Location, kind, typeName string) {
+ e.errs.ReportErrorAtID(id, l, "unexpected %s type: %v", kind, typeName)
}
diff --git a/vendor/github.com/google/cel-go/checker/printer.go b/vendor/github.com/google/cel-go/checker/printer.go
index 15cba06ee9..7a3984f02c 100644
--- a/vendor/github.com/google/cel-go/checker/printer.go
+++ b/vendor/github.com/google/cel-go/checker/printer.go
@@ -17,40 +17,40 @@ package checker
import (
"sort"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/debug"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
type semanticAdorner struct {
- checks *exprpb.CheckedExpr
+ checked *ast.AST
}
var _ debug.Adorner = &semanticAdorner{}
func (a *semanticAdorner) GetMetadata(elem any) string {
result := ""
- e, isExpr := elem.(*exprpb.Expr)
+ e, isExpr := elem.(ast.Expr)
if !isExpr {
return result
}
- t := a.checks.TypeMap[e.GetId()]
+ t := a.checked.TypeMap()[e.ID()]
if t != nil {
result += "~"
- result += FormatCheckedType(t)
+ result += FormatCELType(t)
}
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr,
- *exprpb.Expr_CallExpr,
- *exprpb.Expr_StructExpr,
- *exprpb.Expr_SelectExpr:
- if ref, found := a.checks.ReferenceMap[e.GetId()]; found {
- if len(ref.GetOverloadId()) == 0 {
+ switch e.Kind() {
+ case ast.IdentKind,
+ ast.CallKind,
+ ast.ListKind,
+ ast.StructKind,
+ ast.SelectKind:
+ if ref, found := a.checked.ReferenceMap()[e.ID()]; found {
+ if len(ref.OverloadIDs) == 0 {
result += "^" + ref.Name
} else {
- sort.Strings(ref.GetOverloadId())
- for i, overload := range ref.GetOverloadId() {
+ sort.Strings(ref.OverloadIDs)
+ for i, overload := range ref.OverloadIDs {
if i == 0 {
result += "^"
} else {
@@ -68,7 +68,7 @@ func (a *semanticAdorner) GetMetadata(elem any) string {
// Print returns a string representation of the Expr message,
// annotated with types from the CheckedExpr. The Expr must
// be a sub-expression embedded in the CheckedExpr.
-func Print(e *exprpb.Expr, checks *exprpb.CheckedExpr) string {
- a := &semanticAdorner{checks: checks}
+func Print(e ast.Expr, checked *ast.AST) string {
+ a := &semanticAdorner{checked: checked}
return debug.ToAdornedDebugString(e, a)
}
diff --git a/vendor/github.com/google/cel-go/checker/types.go b/vendor/github.com/google/cel-go/checker/types.go
index e2373d1b7c..4c65b2737c 100644
--- a/vendor/github.com/google/cel-go/checker/types.go
+++ b/vendor/github.com/google/cel-go/checker/types.go
@@ -41,7 +41,7 @@ func isError(t *types.Type) bool {
func isOptional(t *types.Type) bool {
if t.Kind() == types.OpaqueKind {
- return t.TypeName() == "optional"
+ return t.TypeName() == "optional_type"
}
return false
}
@@ -137,7 +137,11 @@ func internalIsAssignable(m *mapping, t1, t2 *types.Type) bool {
case types.BoolKind, types.BytesKind, types.DoubleKind, types.IntKind, types.StringKind, types.UintKind,
types.AnyKind, types.DurationKind, types.TimestampKind,
types.StructKind:
- return t1.IsAssignableType(t2)
+ // Test whether t2 is assignable from t1. The order of this check won't usually matter;
+ // however, there may be cases where type capabilities are expanded beyond what is supported
+ // in the current common/types package. For example, an interface designation for a group of
+ // Struct types.
+ return t2.IsAssignableType(t1)
case types.TypeKind:
return kind2 == types.TypeKind
case types.OpaqueKind, types.ListKind, types.MapKind:
@@ -256,7 +260,7 @@ func notReferencedIn(m *mapping, t, withinType *types.Type) bool {
return true
}
return notReferencedIn(m, t, wtSub)
- case types.OpaqueKind, types.ListKind, types.MapKind:
+ case types.OpaqueKind, types.ListKind, types.MapKind, types.TypeKind:
for _, pt := range withinType.Parameters() {
if !notReferencedIn(m, t, pt) {
return false
@@ -288,7 +292,8 @@ func substitute(m *mapping, t *types.Type, typeParamToDyn bool) *types.Type {
substitute(m, t.Parameters()[1], typeParamToDyn))
case types.TypeKind:
if len(t.Parameters()) > 0 {
- return types.NewTypeTypeWithParam(substitute(m, t.Parameters()[0], typeParamToDyn))
+ tParam := t.Parameters()[0]
+ return types.NewTypeTypeWithParam(substitute(m, tParam, typeParamToDyn))
}
return t
default:
diff --git a/vendor/github.com/google/cel-go/common/ast/BUILD.bazel b/vendor/github.com/google/cel-go/common/ast/BUILD.bazel
index 7269cdff5f..5c40c37813 100644
--- a/vendor/github.com/google/cel-go/common/ast/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/ast/BUILD.bazel
@@ -1,12 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
package(
- default_visibility = [
- "//cel:__subpackages__",
- "//checker:__subpackages__",
- "//common:__subpackages__",
- "//interpreter:__subpackages__",
- ],
+ default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0
)
@@ -14,10 +9,14 @@ go_library(
name = "go_default_library",
srcs = [
"ast.go",
+ "conversion.go",
"expr.go",
+ "factory.go",
+ "navigable.go",
],
importpath = "github.com/google/cel-go/common/ast",
deps = [
+ "//common:go_default_library",
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
@@ -29,7 +28,9 @@ go_test(
name = "go_default_test",
srcs = [
"ast_test.go",
+ "conversion_test.go",
"expr_test.go",
+ "navigable_test.go",
],
embed = [
":go_default_library",
@@ -48,5 +49,6 @@ go_test(
"//test/proto3pb:go_default_library",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
+ "@org_golang_google_protobuf//encoding/prototext:go_default_library",
],
-)
\ No newline at end of file
+)
diff --git a/vendor/github.com/google/cel-go/common/ast/ast.go b/vendor/github.com/google/cel-go/common/ast/ast.go
index b3c150793a..355ddd49a2 100644
--- a/vendor/github.com/google/cel-go/common/ast/ast.go
+++ b/vendor/github.com/google/cel-go/common/ast/ast.go
@@ -16,74 +16,361 @@
package ast
import (
- "fmt"
-
+ "github.com/google/cel-go/common"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
+)
- structpb "google.golang.org/protobuf/types/known/structpb"
+// AST contains a protobuf expression and source info along with CEL-native type and reference information.
+type AST struct {
+ expr Expr
+ sourceInfo *SourceInfo
+ typeMap map[int64]*types.Type
+ refMap map[int64]*ReferenceInfo
+}
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
-)
+// Expr returns the root ast.Expr value in the AST.
+func (a *AST) Expr() Expr {
+ if a == nil {
+ return nilExpr
+ }
+ return a.expr
+}
+
+// SourceInfo returns the source metadata associated with the parse / type-check passes.
+func (a *AST) SourceInfo() *SourceInfo {
+ if a == nil {
+ return nil
+ }
+ return a.sourceInfo
+}
-// CheckedAST contains a protobuf expression and source info along with CEL-native type and reference information.
-type CheckedAST struct {
- Expr *exprpb.Expr
- SourceInfo *exprpb.SourceInfo
- TypeMap map[int64]*types.Type
- ReferenceMap map[int64]*ReferenceInfo
-}
-
-// CheckedASTToCheckedExpr converts a CheckedAST to a CheckedExpr protobouf.
-func CheckedASTToCheckedExpr(ast *CheckedAST) (*exprpb.CheckedExpr, error) {
- refMap := make(map[int64]*exprpb.Reference, len(ast.ReferenceMap))
- for id, ref := range ast.ReferenceMap {
- r, err := ReferenceInfoToReferenceExpr(ref)
- if err != nil {
- return nil, err
+// GetType returns the type for the expression at the given id, if one exists, else types.DynType.
+func (a *AST) GetType(id int64) *types.Type {
+ if t, found := a.TypeMap()[id]; found {
+ return t
+ }
+ return types.DynType
+}
+
+// SetType sets the type of the expression node at the given id.
+func (a *AST) SetType(id int64, t *types.Type) {
+ if a == nil {
+ return
+ }
+ a.typeMap[id] = t
+}
+
+// TypeMap returns the map of expression ids to type-checked types.
+//
+// If the AST is not type-checked, the map will be empty.
+func (a *AST) TypeMap() map[int64]*types.Type {
+ if a == nil {
+ return map[int64]*types.Type{}
+ }
+ return a.typeMap
+}
+
+// GetOverloadIDs returns the set of overload function names for a given expression id.
+//
+// If the expression id is not a function call, or the AST is not type-checked, the result will be empty.
+func (a *AST) GetOverloadIDs(id int64) []string {
+ if ref, found := a.ReferenceMap()[id]; found {
+ return ref.OverloadIDs
+ }
+ return []string{}
+}
+
+// ReferenceMap returns the map of expression id to identifier, constant, and function references.
+func (a *AST) ReferenceMap() map[int64]*ReferenceInfo {
+ if a == nil {
+ return map[int64]*ReferenceInfo{}
+ }
+ return a.refMap
+}
+
+// SetReference adds a reference to the checked AST type map.
+func (a *AST) SetReference(id int64, r *ReferenceInfo) {
+ if a == nil {
+ return
+ }
+ a.refMap[id] = r
+}
+
+// IsChecked returns whether the AST is type-checked.
+func (a *AST) IsChecked() bool {
+ return a != nil && len(a.TypeMap()) > 0
+}
+
+// NewAST creates a base AST instance with an ast.Expr and ast.SourceInfo value.
+func NewAST(e Expr, sourceInfo *SourceInfo) *AST {
+ if e == nil {
+ e = nilExpr
+ }
+ return &AST{
+ expr: e,
+ sourceInfo: sourceInfo,
+ typeMap: make(map[int64]*types.Type),
+ refMap: make(map[int64]*ReferenceInfo),
+ }
+}
+
+// NewCheckedAST wraps an parsed AST and augments it with type and reference metadata.
+func NewCheckedAST(parsed *AST, typeMap map[int64]*types.Type, refMap map[int64]*ReferenceInfo) *AST {
+ return &AST{
+ expr: parsed.Expr(),
+ sourceInfo: parsed.SourceInfo(),
+ typeMap: typeMap,
+ refMap: refMap,
+ }
+}
+
+// Copy creates a deep copy of the Expr and SourceInfo values in the input AST.
+//
+// Copies of the Expr value are generated using an internal default ExprFactory.
+func Copy(a *AST) *AST {
+ if a == nil {
+ return nil
+ }
+ e := defaultFactory.CopyExpr(a.expr)
+ if !a.IsChecked() {
+ return NewAST(e, CopySourceInfo(a.SourceInfo()))
+ }
+ typesCopy := make(map[int64]*types.Type, len(a.typeMap))
+ for id, t := range a.typeMap {
+ typesCopy[id] = t
+ }
+ refsCopy := make(map[int64]*ReferenceInfo, len(a.refMap))
+ for id, r := range a.refMap {
+ refsCopy[id] = r
+ }
+ return NewCheckedAST(NewAST(e, CopySourceInfo(a.SourceInfo())), typesCopy, refsCopy)
+}
+
+// MaxID returns the upper-bound, non-inclusive, of ids present within the AST's Expr value.
+func MaxID(a *AST) int64 {
+ visitor := &maxIDVisitor{maxID: 1}
+ PostOrderVisit(a.Expr(), visitor)
+ for id, call := range a.SourceInfo().MacroCalls() {
+ PostOrderVisit(call, visitor)
+ if id > visitor.maxID {
+ visitor.maxID = id + 1
}
- refMap[id] = r
}
- typeMap := make(map[int64]*exprpb.Type, len(ast.TypeMap))
- for id, typ := range ast.TypeMap {
- t, err := types.TypeToExprType(typ)
- if err != nil {
- return nil, err
+ return visitor.maxID + 1
+}
+
+// NewSourceInfo creates a simple SourceInfo object from an input common.Source value.
+func NewSourceInfo(src common.Source) *SourceInfo {
+ var lineOffsets []int32
+ var desc string
+ baseLine := int32(0)
+ baseCol := int32(0)
+ if src != nil {
+ desc = src.Description()
+ lineOffsets = src.LineOffsets()
+ // Determine whether the source metadata should be computed relative
+ // to a base line and column value. This can be determined by requesting
+ // the location for offset 0 from the source object.
+ if loc, found := src.OffsetLocation(0); found {
+ baseLine = int32(loc.Line()) - 1
+ baseCol = int32(loc.Column())
}
- typeMap[id] = t
- }
- return &exprpb.CheckedExpr{
- Expr: ast.Expr,
- SourceInfo: ast.SourceInfo,
- ReferenceMap: refMap,
- TypeMap: typeMap,
- }, nil
-}
-
-// CheckedExprToCheckedAST converts a CheckedExpr protobuf to a CheckedAST instance.
-func CheckedExprToCheckedAST(checked *exprpb.CheckedExpr) (*CheckedAST, error) {
- refMap := make(map[int64]*ReferenceInfo, len(checked.GetReferenceMap()))
- for id, ref := range checked.GetReferenceMap() {
- r, err := ReferenceExprToReferenceInfo(ref)
- if err != nil {
- return nil, err
+ }
+ return &SourceInfo{
+ desc: desc,
+ lines: lineOffsets,
+ baseLine: baseLine,
+ baseCol: baseCol,
+ offsetRanges: make(map[int64]OffsetRange),
+ macroCalls: make(map[int64]Expr),
+ }
+}
+
+// CopySourceInfo creates a deep copy of the MacroCalls within the input SourceInfo.
+//
+// Copies of macro Expr values are generated using an internal default ExprFactory.
+func CopySourceInfo(info *SourceInfo) *SourceInfo {
+ if info == nil {
+ return nil
+ }
+ rangesCopy := make(map[int64]OffsetRange, len(info.offsetRanges))
+ for id, off := range info.offsetRanges {
+ rangesCopy[id] = off
+ }
+ callsCopy := make(map[int64]Expr, len(info.macroCalls))
+ for id, call := range info.macroCalls {
+ callsCopy[id] = defaultFactory.CopyExpr(call)
+ }
+ return &SourceInfo{
+ syntax: info.syntax,
+ desc: info.desc,
+ lines: info.lines,
+ baseLine: info.baseLine,
+ baseCol: info.baseCol,
+ offsetRanges: rangesCopy,
+ macroCalls: callsCopy,
+ }
+}
+
+// SourceInfo records basic information about the expression as a textual input and
+// as a parsed expression value.
+type SourceInfo struct {
+ syntax string
+ desc string
+ lines []int32
+ baseLine int32
+ baseCol int32
+ offsetRanges map[int64]OffsetRange
+ macroCalls map[int64]Expr
+}
+
+// SyntaxVersion returns the syntax version associated with the text expression.
+func (s *SourceInfo) SyntaxVersion() string {
+ if s == nil {
+ return ""
+ }
+ return s.syntax
+}
+
+// Description provides information about where the expression came from.
+func (s *SourceInfo) Description() string {
+ if s == nil {
+ return ""
+ }
+ return s.desc
+}
+
+// LineOffsets returns a list of the 0-based character offsets in the input text where newlines appear.
+func (s *SourceInfo) LineOffsets() []int32 {
+ if s == nil {
+ return []int32{}
+ }
+ return s.lines
+}
+
+// MacroCalls returns a map of expression id to ast.Expr value where the id represents the expression
+// node where the macro was inserted into the AST, and the ast.Expr value represents the original call
+// signature which was replaced.
+func (s *SourceInfo) MacroCalls() map[int64]Expr {
+ if s == nil {
+ return map[int64]Expr{}
+ }
+ return s.macroCalls
+}
+
+// GetMacroCall returns the original ast.Expr value for the given expression if it was generated via
+// a macro replacement.
+//
+// Note, parsing options must be enabled to track macro calls before this method will return a value.
+func (s *SourceInfo) GetMacroCall(id int64) (Expr, bool) {
+ e, found := s.MacroCalls()[id]
+ return e, found
+}
+
+// SetMacroCall records a macro call at a specific location.
+func (s *SourceInfo) SetMacroCall(id int64, e Expr) {
+ if s != nil {
+ s.macroCalls[id] = e
+ }
+}
+
+// ClearMacroCall removes the macro call at the given expression id.
+func (s *SourceInfo) ClearMacroCall(id int64) {
+ if s != nil {
+ delete(s.macroCalls, id)
+ }
+}
+
+// OffsetRanges returns a map of expression id to OffsetRange values where the range indicates either:
+// the start and end position in the input stream where the expression occurs, or the start position
+// only. If the range only captures start position, the stop position of the range will be equal to
+// the start.
+func (s *SourceInfo) OffsetRanges() map[int64]OffsetRange {
+ if s == nil {
+ return map[int64]OffsetRange{}
+ }
+ return s.offsetRanges
+}
+
+// GetOffsetRange retrieves an OffsetRange for the given expression id if one exists.
+func (s *SourceInfo) GetOffsetRange(id int64) (OffsetRange, bool) {
+ if s == nil {
+ return OffsetRange{}, false
+ }
+ o, found := s.offsetRanges[id]
+ return o, found
+}
+
+// SetOffsetRange sets the OffsetRange for the given expression id.
+func (s *SourceInfo) SetOffsetRange(id int64, o OffsetRange) {
+ if s == nil {
+ return
+ }
+ s.offsetRanges[id] = o
+}
+
+// GetStartLocation calculates the human-readable 1-based line and 0-based column of the first character
+// of the expression node at the id.
+func (s *SourceInfo) GetStartLocation(id int64) common.Location {
+ if o, found := s.GetOffsetRange(id); found {
+ line := 1
+ col := int(o.Start)
+ for _, lineOffset := range s.LineOffsets() {
+ if lineOffset < o.Start {
+ line++
+ col = int(o.Start - lineOffset)
+ } else {
+ break
+ }
}
- refMap[id] = r
+ return common.NewLocation(line, col)
}
- typeMap := make(map[int64]*types.Type, len(checked.GetTypeMap()))
- for id, typ := range checked.GetTypeMap() {
- t, err := types.ExprTypeToType(typ)
- if err != nil {
- return nil, err
+ return common.NoLocation
+}
+
+// GetStopLocation calculates the human-readable 1-based line and 0-based column of the last character for
+// the expression node at the given id.
+//
+// If the SourceInfo was generated from a serialized protobuf representation, the stop location will
+// be identical to the start location for the expression.
+func (s *SourceInfo) GetStopLocation(id int64) common.Location {
+ if o, found := s.GetOffsetRange(id); found {
+ line := 1
+ col := int(o.Stop)
+ for _, lineOffset := range s.LineOffsets() {
+ if lineOffset < o.Stop {
+ line++
+ col = int(o.Stop - lineOffset)
+ } else {
+ break
+ }
}
- typeMap[id] = t
+ return common.NewLocation(line, col)
}
- return &CheckedAST{
- Expr: checked.GetExpr(),
- SourceInfo: checked.GetSourceInfo(),
- ReferenceMap: refMap,
- TypeMap: typeMap,
- }, nil
+ return common.NoLocation
+}
+
+// ComputeOffset calculates the 0-based character offset from a 1-based line and 0-based column.
+func (s *SourceInfo) ComputeOffset(line, col int32) int32 {
+ if s != nil {
+ line = s.baseLine + line
+ col = s.baseCol + col
+ }
+ if line == 1 {
+ return col
+ }
+ if line < 1 || line > int32(len(s.LineOffsets())) {
+ return -1
+ }
+ offset := s.LineOffsets()[line-2]
+ return offset + col
+}
+
+// OffsetRange captures the start and stop positions of a section of text in the input expression.
+type OffsetRange struct {
+ Start int32
+ Stop int32
}
// ReferenceInfo contains a CEL native representation of an identifier reference which may refer to
@@ -149,78 +436,21 @@ func (r *ReferenceInfo) Equals(other *ReferenceInfo) bool {
return true
}
-// ReferenceInfoToReferenceExpr converts a ReferenceInfo instance to a protobuf Reference suitable for serialization.
-func ReferenceInfoToReferenceExpr(info *ReferenceInfo) (*exprpb.Reference, error) {
- c, err := ValToConstant(info.Value)
- if err != nil {
- return nil, err
- }
- return &exprpb.Reference{
- Name: info.Name,
- OverloadId: info.OverloadIDs,
- Value: c,
- }, nil
+type maxIDVisitor struct {
+ maxID int64
+ *baseVisitor
}
-// ReferenceExprToReferenceInfo converts a protobuf Reference into a CEL-native ReferenceInfo instance.
-func ReferenceExprToReferenceInfo(ref *exprpb.Reference) (*ReferenceInfo, error) {
- v, err := ConstantToVal(ref.GetValue())
- if err != nil {
- return nil, err
+// VisitExpr updates the max identifier if the incoming expression id is greater than previously observed.
+func (v *maxIDVisitor) VisitExpr(e Expr) {
+ if v.maxID < e.ID() {
+ v.maxID = e.ID()
}
- return &ReferenceInfo{
- Name: ref.GetName(),
- OverloadIDs: ref.GetOverloadId(),
- Value: v,
- }, nil
}
-// ValToConstant converts a CEL-native ref.Val to a protobuf Constant.
-//
-// Only simple scalar types are supported by this method.
-func ValToConstant(v ref.Val) (*exprpb.Constant, error) {
- if v == nil {
- return nil, nil
- }
- switch v.Type() {
- case types.BoolType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_BoolValue{BoolValue: v.Value().(bool)}}, nil
- case types.BytesType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_BytesValue{BytesValue: v.Value().([]byte)}}, nil
- case types.DoubleType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_DoubleValue{DoubleValue: v.Value().(float64)}}, nil
- case types.IntType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_Int64Value{Int64Value: v.Value().(int64)}}, nil
- case types.NullType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_NullValue{NullValue: structpb.NullValue_NULL_VALUE}}, nil
- case types.StringType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: v.Value().(string)}}, nil
- case types.UintType:
- return &exprpb.Constant{ConstantKind: &exprpb.Constant_Uint64Value{Uint64Value: v.Value().(uint64)}}, nil
- }
- return nil, fmt.Errorf("unsupported constant kind: %v", v.Type())
-}
-
-// ConstantToVal converts a protobuf Constant to a CEL-native ref.Val.
-func ConstantToVal(c *exprpb.Constant) (ref.Val, error) {
- if c == nil {
- return nil, nil
- }
- switch c.GetConstantKind().(type) {
- case *exprpb.Constant_BoolValue:
- return types.Bool(c.GetBoolValue()), nil
- case *exprpb.Constant_BytesValue:
- return types.Bytes(c.GetBytesValue()), nil
- case *exprpb.Constant_DoubleValue:
- return types.Double(c.GetDoubleValue()), nil
- case *exprpb.Constant_Int64Value:
- return types.Int(c.GetInt64Value()), nil
- case *exprpb.Constant_NullValue:
- return types.NullValue, nil
- case *exprpb.Constant_StringValue:
- return types.String(c.GetStringValue()), nil
- case *exprpb.Constant_Uint64Value:
- return types.Uint(c.GetUint64Value()), nil
- }
- return nil, fmt.Errorf("unsupported constant kind: %v", c.GetConstantKind())
+// VisitEntryExpr updates the max identifier if the incoming entry id is greater than previously observed.
+func (v *maxIDVisitor) VisitEntryExpr(e EntryExpr) {
+ if v.maxID < e.ID() {
+ v.maxID = e.ID()
+ }
}
diff --git a/vendor/github.com/google/cel-go/common/ast/conversion.go b/vendor/github.com/google/cel-go/common/ast/conversion.go
new file mode 100644
index 0000000000..8f2c4bd1e6
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/ast/conversion.go
@@ -0,0 +1,632 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ast
+
+import (
+ "fmt"
+
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+
+ structpb "google.golang.org/protobuf/types/known/structpb"
+
+ exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+)
+
+// ToProto converts an AST to a CheckedExpr protobouf.
+func ToProto(ast *AST) (*exprpb.CheckedExpr, error) {
+ refMap := make(map[int64]*exprpb.Reference, len(ast.ReferenceMap()))
+ for id, ref := range ast.ReferenceMap() {
+ r, err := ReferenceInfoToProto(ref)
+ if err != nil {
+ return nil, err
+ }
+ refMap[id] = r
+ }
+ typeMap := make(map[int64]*exprpb.Type, len(ast.TypeMap()))
+ for id, typ := range ast.TypeMap() {
+ t, err := types.TypeToExprType(typ)
+ if err != nil {
+ return nil, err
+ }
+ typeMap[id] = t
+ }
+ e, err := ExprToProto(ast.Expr())
+ if err != nil {
+ return nil, err
+ }
+ info, err := SourceInfoToProto(ast.SourceInfo())
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.CheckedExpr{
+ Expr: e,
+ SourceInfo: info,
+ ReferenceMap: refMap,
+ TypeMap: typeMap,
+ }, nil
+}
+
+// ToAST converts a CheckedExpr protobuf to an AST instance.
+func ToAST(checked *exprpb.CheckedExpr) (*AST, error) {
+ refMap := make(map[int64]*ReferenceInfo, len(checked.GetReferenceMap()))
+ for id, ref := range checked.GetReferenceMap() {
+ r, err := ProtoToReferenceInfo(ref)
+ if err != nil {
+ return nil, err
+ }
+ refMap[id] = r
+ }
+ typeMap := make(map[int64]*types.Type, len(checked.GetTypeMap()))
+ for id, typ := range checked.GetTypeMap() {
+ t, err := types.ExprTypeToType(typ)
+ if err != nil {
+ return nil, err
+ }
+ typeMap[id] = t
+ }
+ info, err := ProtoToSourceInfo(checked.GetSourceInfo())
+ if err != nil {
+ return nil, err
+ }
+ root, err := ProtoToExpr(checked.GetExpr())
+ if err != nil {
+ return nil, err
+ }
+ ast := NewCheckedAST(NewAST(root, info), typeMap, refMap)
+ return ast, nil
+}
+
+// ProtoToExpr converts a protobuf Expr value to an ast.Expr value.
+func ProtoToExpr(e *exprpb.Expr) (Expr, error) {
+ factory := NewExprFactory()
+ return exprInternal(factory, e)
+}
+
+// ProtoToEntryExpr converts a protobuf struct/map entry to an ast.EntryExpr
+func ProtoToEntryExpr(e *exprpb.Expr_CreateStruct_Entry) (EntryExpr, error) {
+ factory := NewExprFactory()
+ switch e.GetKeyKind().(type) {
+ case *exprpb.Expr_CreateStruct_Entry_FieldKey:
+ return exprStructField(factory, e.GetId(), e)
+ case *exprpb.Expr_CreateStruct_Entry_MapKey:
+ return exprMapEntry(factory, e.GetId(), e)
+ }
+ return nil, fmt.Errorf("unsupported expr entry kind: %v", e)
+}
+
+func exprInternal(factory ExprFactory, e *exprpb.Expr) (Expr, error) {
+ id := e.GetId()
+ switch e.GetExprKind().(type) {
+ case *exprpb.Expr_CallExpr:
+ return exprCall(factory, id, e.GetCallExpr())
+ case *exprpb.Expr_ComprehensionExpr:
+ return exprComprehension(factory, id, e.GetComprehensionExpr())
+ case *exprpb.Expr_ConstExpr:
+ return exprLiteral(factory, id, e.GetConstExpr())
+ case *exprpb.Expr_IdentExpr:
+ return exprIdent(factory, id, e.GetIdentExpr())
+ case *exprpb.Expr_ListExpr:
+ return exprList(factory, id, e.GetListExpr())
+ case *exprpb.Expr_SelectExpr:
+ return exprSelect(factory, id, e.GetSelectExpr())
+ case *exprpb.Expr_StructExpr:
+ s := e.GetStructExpr()
+ if s.GetMessageName() != "" {
+ return exprStruct(factory, id, s)
+ }
+ return exprMap(factory, id, s)
+ }
+ return factory.NewUnspecifiedExpr(id), nil
+}
+
+func exprCall(factory ExprFactory, id int64, call *exprpb.Expr_Call) (Expr, error) {
+ var err error
+ args := make([]Expr, len(call.GetArgs()))
+ for i, a := range call.GetArgs() {
+ args[i], err = exprInternal(factory, a)
+ if err != nil {
+ return nil, err
+ }
+ }
+ if call.GetTarget() == nil {
+ return factory.NewCall(id, call.GetFunction(), args...), nil
+ }
+
+ target, err := exprInternal(factory, call.GetTarget())
+ if err != nil {
+ return nil, err
+ }
+ return factory.NewMemberCall(id, call.GetFunction(), target, args...), nil
+}
+
+func exprComprehension(factory ExprFactory, id int64, comp *exprpb.Expr_Comprehension) (Expr, error) {
+ iterRange, err := exprInternal(factory, comp.GetIterRange())
+ if err != nil {
+ return nil, err
+ }
+ accuInit, err := exprInternal(factory, comp.GetAccuInit())
+ if err != nil {
+ return nil, err
+ }
+ loopCond, err := exprInternal(factory, comp.GetLoopCondition())
+ if err != nil {
+ return nil, err
+ }
+ loopStep, err := exprInternal(factory, comp.GetLoopStep())
+ if err != nil {
+ return nil, err
+ }
+ result, err := exprInternal(factory, comp.GetResult())
+ if err != nil {
+ return nil, err
+ }
+ return factory.NewComprehension(id,
+ iterRange,
+ comp.GetIterVar(),
+ comp.GetAccuVar(),
+ accuInit,
+ loopCond,
+ loopStep,
+ result), nil
+}
+
+func exprLiteral(factory ExprFactory, id int64, c *exprpb.Constant) (Expr, error) {
+ val, err := ConstantToVal(c)
+ if err != nil {
+ return nil, err
+ }
+ return factory.NewLiteral(id, val), nil
+}
+
+func exprIdent(factory ExprFactory, id int64, i *exprpb.Expr_Ident) (Expr, error) {
+ return factory.NewIdent(id, i.GetName()), nil
+}
+
+func exprList(factory ExprFactory, id int64, l *exprpb.Expr_CreateList) (Expr, error) {
+ elems := make([]Expr, len(l.GetElements()))
+ for i, e := range l.GetElements() {
+ elem, err := exprInternal(factory, e)
+ if err != nil {
+ return nil, err
+ }
+ elems[i] = elem
+ }
+ return factory.NewList(id, elems, l.GetOptionalIndices()), nil
+}
+
+func exprMap(factory ExprFactory, id int64, s *exprpb.Expr_CreateStruct) (Expr, error) {
+ entries := make([]EntryExpr, len(s.GetEntries()))
+ var err error
+ for i, entry := range s.GetEntries() {
+ entries[i], err = exprMapEntry(factory, entry.GetId(), entry)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return factory.NewMap(id, entries), nil
+}
+
+func exprMapEntry(factory ExprFactory, id int64, e *exprpb.Expr_CreateStruct_Entry) (EntryExpr, error) {
+ k, err := exprInternal(factory, e.GetMapKey())
+ if err != nil {
+ return nil, err
+ }
+ v, err := exprInternal(factory, e.GetValue())
+ if err != nil {
+ return nil, err
+ }
+ return factory.NewMapEntry(id, k, v, e.GetOptionalEntry()), nil
+}
+
+func exprSelect(factory ExprFactory, id int64, s *exprpb.Expr_Select) (Expr, error) {
+ op, err := exprInternal(factory, s.GetOperand())
+ if err != nil {
+ return nil, err
+ }
+ if s.GetTestOnly() {
+ return factory.NewPresenceTest(id, op, s.GetField()), nil
+ }
+ return factory.NewSelect(id, op, s.GetField()), nil
+}
+
+func exprStruct(factory ExprFactory, id int64, s *exprpb.Expr_CreateStruct) (Expr, error) {
+ fields := make([]EntryExpr, len(s.GetEntries()))
+ var err error
+ for i, field := range s.GetEntries() {
+ fields[i], err = exprStructField(factory, field.GetId(), field)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return factory.NewStruct(id, s.GetMessageName(), fields), nil
+}
+
+func exprStructField(factory ExprFactory, id int64, f *exprpb.Expr_CreateStruct_Entry) (EntryExpr, error) {
+ v, err := exprInternal(factory, f.GetValue())
+ if err != nil {
+ return nil, err
+ }
+ return factory.NewStructField(id, f.GetFieldKey(), v, f.GetOptionalEntry()), nil
+}
+
+// ExprToProto serializes an ast.Expr value to a protobuf Expr representation.
+func ExprToProto(e Expr) (*exprpb.Expr, error) {
+ if e == nil {
+ return &exprpb.Expr{}, nil
+ }
+ switch e.Kind() {
+ case CallKind:
+ return protoCall(e.ID(), e.AsCall())
+ case ComprehensionKind:
+ return protoComprehension(e.ID(), e.AsComprehension())
+ case IdentKind:
+ return protoIdent(e.ID(), e.AsIdent())
+ case ListKind:
+ return protoList(e.ID(), e.AsList())
+ case LiteralKind:
+ return protoLiteral(e.ID(), e.AsLiteral())
+ case MapKind:
+ return protoMap(e.ID(), e.AsMap())
+ case SelectKind:
+ return protoSelect(e.ID(), e.AsSelect())
+ case StructKind:
+ return protoStruct(e.ID(), e.AsStruct())
+ case UnspecifiedExprKind:
+ // Handle the case where a macro reference may be getting translated.
+ // A nested macro 'pointer' is a non-zero expression id with no kind set.
+ if e.ID() != 0 {
+ return &exprpb.Expr{Id: e.ID()}, nil
+ }
+ return &exprpb.Expr{}, nil
+ }
+ return nil, fmt.Errorf("unsupported expr kind: %v", e)
+}
+
+// EntryExprToProto converts an ast.EntryExpr to a protobuf CreateStruct entry
+func EntryExprToProto(e EntryExpr) (*exprpb.Expr_CreateStruct_Entry, error) {
+ switch e.Kind() {
+ case MapEntryKind:
+ return protoMapEntry(e.ID(), e.AsMapEntry())
+ case StructFieldKind:
+ return protoStructField(e.ID(), e.AsStructField())
+ case UnspecifiedEntryExprKind:
+ return &exprpb.Expr_CreateStruct_Entry{}, nil
+ }
+ return nil, fmt.Errorf("unsupported expr entry kind: %v", e)
+}
+
+func protoCall(id int64, call CallExpr) (*exprpb.Expr, error) {
+ var err error
+ var target *exprpb.Expr
+ if call.IsMemberFunction() {
+ target, err = ExprToProto(call.Target())
+ if err != nil {
+ return nil, err
+ }
+ }
+ callArgs := call.Args()
+ args := make([]*exprpb.Expr, len(callArgs))
+ for i, a := range callArgs {
+ args[i], err = ExprToProto(a)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_CallExpr{
+ CallExpr: &exprpb.Expr_Call{
+ Function: call.FunctionName(),
+ Target: target,
+ Args: args,
+ },
+ },
+ }, nil
+}
+
+func protoComprehension(id int64, comp ComprehensionExpr) (*exprpb.Expr, error) {
+ iterRange, err := ExprToProto(comp.IterRange())
+ if err != nil {
+ return nil, err
+ }
+ accuInit, err := ExprToProto(comp.AccuInit())
+ if err != nil {
+ return nil, err
+ }
+ loopCond, err := ExprToProto(comp.LoopCondition())
+ if err != nil {
+ return nil, err
+ }
+ loopStep, err := ExprToProto(comp.LoopStep())
+ if err != nil {
+ return nil, err
+ }
+ result, err := ExprToProto(comp.Result())
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_ComprehensionExpr{
+ ComprehensionExpr: &exprpb.Expr_Comprehension{
+ IterVar: comp.IterVar(),
+ IterRange: iterRange,
+ AccuVar: comp.AccuVar(),
+ AccuInit: accuInit,
+ LoopCondition: loopCond,
+ LoopStep: loopStep,
+ Result: result,
+ },
+ },
+ }, nil
+}
+
+func protoIdent(id int64, name string) (*exprpb.Expr, error) {
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_IdentExpr{
+ IdentExpr: &exprpb.Expr_Ident{
+ Name: name,
+ },
+ },
+ }, nil
+}
+
+func protoList(id int64, list ListExpr) (*exprpb.Expr, error) {
+ var err error
+ elems := make([]*exprpb.Expr, list.Size())
+ for i, e := range list.Elements() {
+ elems[i], err = ExprToProto(e)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_ListExpr{
+ ListExpr: &exprpb.Expr_CreateList{
+ Elements: elems,
+ OptionalIndices: list.OptionalIndices(),
+ },
+ },
+ }, nil
+}
+
+func protoLiteral(id int64, val ref.Val) (*exprpb.Expr, error) {
+ c, err := ValToConstant(val)
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_ConstExpr{
+ ConstExpr: c,
+ },
+ }, nil
+}
+
+func protoMap(id int64, m MapExpr) (*exprpb.Expr, error) {
+ entries := make([]*exprpb.Expr_CreateStruct_Entry, len(m.Entries()))
+ var err error
+ for i, e := range m.Entries() {
+ entries[i], err = EntryExprToProto(e)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_StructExpr{
+ StructExpr: &exprpb.Expr_CreateStruct{
+ Entries: entries,
+ },
+ },
+ }, nil
+}
+
+func protoMapEntry(id int64, e MapEntry) (*exprpb.Expr_CreateStruct_Entry, error) {
+ k, err := ExprToProto(e.Key())
+ if err != nil {
+ return nil, err
+ }
+ v, err := ExprToProto(e.Value())
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Expr_CreateStruct_Entry{
+ Id: id,
+ KeyKind: &exprpb.Expr_CreateStruct_Entry_MapKey{
+ MapKey: k,
+ },
+ Value: v,
+ OptionalEntry: e.IsOptional(),
+ }, nil
+}
+
+func protoSelect(id int64, s SelectExpr) (*exprpb.Expr, error) {
+ op, err := ExprToProto(s.Operand())
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_SelectExpr{
+ SelectExpr: &exprpb.Expr_Select{
+ Operand: op,
+ Field: s.FieldName(),
+ TestOnly: s.IsTestOnly(),
+ },
+ },
+ }, nil
+}
+
+func protoStruct(id int64, s StructExpr) (*exprpb.Expr, error) {
+ entries := make([]*exprpb.Expr_CreateStruct_Entry, len(s.Fields()))
+ var err error
+ for i, e := range s.Fields() {
+ entries[i], err = EntryExprToProto(e)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return &exprpb.Expr{
+ Id: id,
+ ExprKind: &exprpb.Expr_StructExpr{
+ StructExpr: &exprpb.Expr_CreateStruct{
+ MessageName: s.TypeName(),
+ Entries: entries,
+ },
+ },
+ }, nil
+}
+
+func protoStructField(id int64, f StructField) (*exprpb.Expr_CreateStruct_Entry, error) {
+ v, err := ExprToProto(f.Value())
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Expr_CreateStruct_Entry{
+ Id: id,
+ KeyKind: &exprpb.Expr_CreateStruct_Entry_FieldKey{
+ FieldKey: f.Name(),
+ },
+ Value: v,
+ OptionalEntry: f.IsOptional(),
+ }, nil
+}
+
+// SourceInfoToProto serializes an ast.SourceInfo value to a protobuf SourceInfo object.
+func SourceInfoToProto(info *SourceInfo) (*exprpb.SourceInfo, error) {
+ if info == nil {
+ return &exprpb.SourceInfo{}, nil
+ }
+ sourceInfo := &exprpb.SourceInfo{
+ SyntaxVersion: info.SyntaxVersion(),
+ Location: info.Description(),
+ LineOffsets: info.LineOffsets(),
+ Positions: make(map[int64]int32, len(info.OffsetRanges())),
+ MacroCalls: make(map[int64]*exprpb.Expr, len(info.MacroCalls())),
+ }
+ for id, offset := range info.OffsetRanges() {
+ sourceInfo.Positions[id] = offset.Start
+ }
+ for id, e := range info.MacroCalls() {
+ call, err := ExprToProto(e)
+ if err != nil {
+ return nil, err
+ }
+ sourceInfo.MacroCalls[id] = call
+ }
+ return sourceInfo, nil
+}
+
+// ProtoToSourceInfo deserializes the protobuf into a native SourceInfo value.
+func ProtoToSourceInfo(info *exprpb.SourceInfo) (*SourceInfo, error) {
+ sourceInfo := &SourceInfo{
+ syntax: info.GetSyntaxVersion(),
+ desc: info.GetLocation(),
+ lines: info.GetLineOffsets(),
+ offsetRanges: make(map[int64]OffsetRange, len(info.GetPositions())),
+ macroCalls: make(map[int64]Expr, len(info.GetMacroCalls())),
+ }
+ for id, offset := range info.GetPositions() {
+ sourceInfo.SetOffsetRange(id, OffsetRange{Start: offset, Stop: offset})
+ }
+ for id, e := range info.GetMacroCalls() {
+ call, err := ProtoToExpr(e)
+ if err != nil {
+ return nil, err
+ }
+ sourceInfo.SetMacroCall(id, call)
+ }
+ return sourceInfo, nil
+}
+
+// ReferenceInfoToProto converts a ReferenceInfo instance to a protobuf Reference suitable for serialization.
+func ReferenceInfoToProto(info *ReferenceInfo) (*exprpb.Reference, error) {
+ c, err := ValToConstant(info.Value)
+ if err != nil {
+ return nil, err
+ }
+ return &exprpb.Reference{
+ Name: info.Name,
+ OverloadId: info.OverloadIDs,
+ Value: c,
+ }, nil
+}
+
+// ProtoToReferenceInfo converts a protobuf Reference into a CEL-native ReferenceInfo instance.
+func ProtoToReferenceInfo(ref *exprpb.Reference) (*ReferenceInfo, error) {
+ v, err := ConstantToVal(ref.GetValue())
+ if err != nil {
+ return nil, err
+ }
+ return &ReferenceInfo{
+ Name: ref.GetName(),
+ OverloadIDs: ref.GetOverloadId(),
+ Value: v,
+ }, nil
+}
+
+// ValToConstant converts a CEL-native ref.Val to a protobuf Constant.
+//
+// Only simple scalar types are supported by this method.
+func ValToConstant(v ref.Val) (*exprpb.Constant, error) {
+ if v == nil {
+ return nil, nil
+ }
+ switch v.Type() {
+ case types.BoolType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_BoolValue{BoolValue: v.Value().(bool)}}, nil
+ case types.BytesType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_BytesValue{BytesValue: v.Value().([]byte)}}, nil
+ case types.DoubleType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_DoubleValue{DoubleValue: v.Value().(float64)}}, nil
+ case types.IntType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_Int64Value{Int64Value: v.Value().(int64)}}, nil
+ case types.NullType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_NullValue{NullValue: structpb.NullValue_NULL_VALUE}}, nil
+ case types.StringType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: v.Value().(string)}}, nil
+ case types.UintType:
+ return &exprpb.Constant{ConstantKind: &exprpb.Constant_Uint64Value{Uint64Value: v.Value().(uint64)}}, nil
+ }
+ return nil, fmt.Errorf("unsupported constant kind: %v", v.Type())
+}
+
+// ConstantToVal converts a protobuf Constant to a CEL-native ref.Val.
+func ConstantToVal(c *exprpb.Constant) (ref.Val, error) {
+ if c == nil {
+ return nil, nil
+ }
+ switch c.GetConstantKind().(type) {
+ case *exprpb.Constant_BoolValue:
+ return types.Bool(c.GetBoolValue()), nil
+ case *exprpb.Constant_BytesValue:
+ return types.Bytes(c.GetBytesValue()), nil
+ case *exprpb.Constant_DoubleValue:
+ return types.Double(c.GetDoubleValue()), nil
+ case *exprpb.Constant_Int64Value:
+ return types.Int(c.GetInt64Value()), nil
+ case *exprpb.Constant_NullValue:
+ return types.NullValue, nil
+ case *exprpb.Constant_StringValue:
+ return types.String(c.GetStringValue()), nil
+ case *exprpb.Constant_Uint64Value:
+ return types.Uint(c.GetUint64Value()), nil
+ }
+ return nil, fmt.Errorf("unsupported constant kind: %v", c.GetConstantKind())
+}
diff --git a/vendor/github.com/google/cel-go/common/ast/expr.go b/vendor/github.com/google/cel-go/common/ast/expr.go
index b63884a602..c9d88bbaab 100644
--- a/vendor/github.com/google/cel-go/common/ast/expr.go
+++ b/vendor/github.com/google/cel-go/common/ast/expr.go
@@ -15,168 +15,61 @@
package ast
import (
- "github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// ExprKind represents the expression node kind.
type ExprKind int
const (
- // UnspecifiedKind represents an unset expression with no specified properties.
- UnspecifiedKind ExprKind = iota
+ // UnspecifiedExprKind represents an unset expression with no specified properties.
+ UnspecifiedExprKind ExprKind = iota
- // LiteralKind represents a primitive scalar literal.
- LiteralKind
+ // CallKind represents a function call.
+ CallKind
+
+ // ComprehensionKind represents a comprehension expression generated by a macro.
+ ComprehensionKind
// IdentKind represents a simple variable, constant, or type identifier.
IdentKind
- // SelectKind represents a field selection expression.
- SelectKind
-
- // CallKind represents a function call.
- CallKind
-
// ListKind represents a list literal expression.
ListKind
+ // LiteralKind represents a primitive scalar literal.
+ LiteralKind
+
// MapKind represents a map literal expression.
MapKind
+ // SelectKind represents a field selection expression.
+ SelectKind
+
// StructKind represents a struct literal expression.
StructKind
-
- // ComprehensionKind represents a comprehension expression generated by a macro.
- ComprehensionKind
)
-// NavigateCheckedAST converts a CheckedAST to a NavigableExpr
-func NavigateCheckedAST(ast *CheckedAST) NavigableExpr {
- return newNavigableExpr(nil, ast.Expr, ast.TypeMap)
-}
-
-// ExprMatcher takes a NavigableExpr in and indicates whether the value is a match.
+// Expr represents the base expression node in a CEL abstract syntax tree.
//
-// This function type should be use with the `Match` and `MatchList` calls.
-type ExprMatcher func(NavigableExpr) bool
-
-// ConstantValueMatcher returns an ExprMatcher which will return true if the input NavigableExpr
-// is comprised of all constant values, such as a simple literal or even list and map literal.
-func ConstantValueMatcher() ExprMatcher {
- return matchIsConstantValue
-}
-
-// KindMatcher returns an ExprMatcher which will return true if the input NavigableExpr.Kind() matches
-// the specified `kind`.
-func KindMatcher(kind ExprKind) ExprMatcher {
- return func(e NavigableExpr) bool {
- return e.Kind() == kind
- }
-}
-
-// FunctionMatcher returns an ExprMatcher which will match NavigableExpr nodes of CallKind type whose
-// function name is equal to `funcName`.
-func FunctionMatcher(funcName string) ExprMatcher {
- return func(e NavigableExpr) bool {
- if e.Kind() != CallKind {
- return false
- }
- return e.AsCall().FunctionName() == funcName
- }
-}
-
-// AllMatcher returns true for all descendants of a NavigableExpr, effectively flattening them into a list.
-//
-// Such a result would work well with subsequent MatchList calls.
-func AllMatcher() ExprMatcher {
- return func(NavigableExpr) bool {
- return true
- }
-}
-
-// MatchDescendants takes a NavigableExpr and ExprMatcher and produces a list of NavigableExpr values of the
-// descendants which match.
-func MatchDescendants(expr NavigableExpr, matcher ExprMatcher) []NavigableExpr {
- return matchListInternal([]NavigableExpr{expr}, matcher, true)
-}
-
-// MatchSubset applies an ExprMatcher to a list of NavigableExpr values and their descendants, producing a
-// subset of NavigableExpr values which match.
-func MatchSubset(exprs []NavigableExpr, matcher ExprMatcher) []NavigableExpr {
- visit := make([]NavigableExpr, len(exprs))
- copy(visit, exprs)
- return matchListInternal(visit, matcher, false)
-}
-
-func matchListInternal(visit []NavigableExpr, matcher ExprMatcher, visitDescendants bool) []NavigableExpr {
- var matched []NavigableExpr
- for len(visit) != 0 {
- e := visit[0]
- if matcher(e) {
- matched = append(matched, e)
- }
- if visitDescendants {
- visit = append(visit[1:], e.Children()...)
- } else {
- visit = visit[1:]
- }
- }
- return matched
-}
-
-func matchIsConstantValue(e NavigableExpr) bool {
- if e.Kind() == LiteralKind {
- return true
- }
- if e.Kind() == StructKind || e.Kind() == MapKind || e.Kind() == ListKind {
- for _, child := range e.Children() {
- if !matchIsConstantValue(child) {
- return false
- }
- }
- return true
- }
- return false
-}
-
-// NavigableExpr represents the base navigable expression value.
-//
-// Depending on the `Kind()` value, the NavigableExpr may be converted to a concrete expression types
+// Depending on the `Kind()` value, the Expr may be converted to a concrete expression types
// as indicated by the `As` methods.
-//
-// NavigableExpr values and their concrete expression types should be nil-safe. Conversion of an expr
-// to the wrong kind should produce a nil value.
-type NavigableExpr interface {
+type Expr interface {
// ID of the expression as it appears in the AST
ID() int64
// Kind of the expression node. See ExprKind for the valid enum values.
Kind() ExprKind
- // Type of the expression node.
- Type() *types.Type
-
- // Parent returns the parent expression node, if one exists.
- Parent() (NavigableExpr, bool)
-
- // Children returns a list of child expression nodes.
- Children() []NavigableExpr
-
- // ToExpr adapts this NavigableExpr to a protobuf representation.
- ToExpr() *exprpb.Expr
-
- // AsCall adapts the expr into a NavigableCallExpr
+ // AsCall adapts the expr into a CallExpr
//
// The Kind() must be equal to a CallKind for the conversion to be well-defined.
- AsCall() NavigableCallExpr
+ AsCall() CallExpr
- // AsComprehension adapts the expr into a NavigableComprehensionExpr.
+ // AsComprehension adapts the expr into a ComprehensionExpr.
//
// The Kind() must be equal to a ComprehensionKind for the conversion to be well-defined.
- AsComprehension() NavigableComprehensionExpr
+ AsComprehension() ComprehensionExpr
// AsIdent adapts the expr into an identifier string.
//
@@ -188,67 +81,123 @@ type NavigableExpr interface {
// The Kind() must be equal to a LiteralKind for the conversion to be well-defined.
AsLiteral() ref.Val
- // AsList adapts the expr into a NavigableListExpr.
+ // AsList adapts the expr into a ListExpr.
//
// The Kind() must be equal to a ListKind for the conversion to be well-defined.
- AsList() NavigableListExpr
+ AsList() ListExpr
- // AsMap adapts the expr into a NavigableMapExpr.
+ // AsMap adapts the expr into a MapExpr.
//
// The Kind() must be equal to a MapKind for the conversion to be well-defined.
- AsMap() NavigableMapExpr
+ AsMap() MapExpr
- // AsSelect adapts the expr into a NavigableSelectExpr.
+ // AsSelect adapts the expr into a SelectExpr.
//
// The Kind() must be equal to a SelectKind for the conversion to be well-defined.
- AsSelect() NavigableSelectExpr
+ AsSelect() SelectExpr
- // AsStruct adapts the expr into a NavigableStructExpr.
+ // AsStruct adapts the expr into a StructExpr.
//
// The Kind() must be equal to a StructKind for the conversion to be well-defined.
- AsStruct() NavigableStructExpr
+ AsStruct() StructExpr
- // marker interface method
- isNavigable()
+ // RenumberIDs performs an in-place update of the expression and all of its descendents numeric ids.
+ RenumberIDs(IDGenerator)
+
+ // SetKindCase replaces the contents of the current expression with the contents of the other.
+ //
+ // The SetKindCase takes ownership of any expression instances references within the input Expr.
+ // A shallow copy is made of the Expr value itself, but not a deep one.
+ //
+ // This method should only be used during AST rewrites using temporary Expr values.
+ SetKindCase(Expr)
+
+ // isExpr is a marker interface.
+ isExpr()
}
-// NavigableCallExpr defines an interface for inspecting a function call and its arugments.
-type NavigableCallExpr interface {
+// EntryExprKind represents the possible EntryExpr kinds.
+type EntryExprKind int
+
+const (
+ // UnspecifiedEntryExprKind indicates that the entry expr is not set.
+ UnspecifiedEntryExprKind EntryExprKind = iota
+
+ // MapEntryKind indicates that the entry is a MapEntry type with key and value expressions.
+ MapEntryKind
+
+ // StructFieldKind indicates that the entry is a StructField with a field name and initializer
+ // expression.
+ StructFieldKind
+)
+
+// EntryExpr represents the base entry expression in a CEL map or struct literal.
+type EntryExpr interface {
+ // ID of the entry as it appears in the AST.
+ ID() int64
+
+ // Kind of the entry expression node. See EntryExprKind for valid enum values.
+ Kind() EntryExprKind
+
+ // AsMapEntry casts the EntryExpr to a MapEntry.
+ //
+ // The Kind() must be equal to MapEntryKind for the conversion to be well-defined.
+ AsMapEntry() MapEntry
+
+ // AsStructField casts the EntryExpr to a StructField
+ //
+ // The Kind() must be equal to StructFieldKind for the conversion to be well-defined.
+ AsStructField() StructField
+
+ // RenumberIDs performs an in-place update of the expression and all of its descendents numeric ids.
+ RenumberIDs(IDGenerator)
+
+ isEntryExpr()
+}
+
+// IDGenerator produces unique ids suitable for tagging expression nodes
+type IDGenerator func(originalID int64) int64
+
+// CallExpr defines an interface for inspecting a function call and its arugments.
+type CallExpr interface {
// FunctionName returns the name of the function.
FunctionName() string
+ // IsMemberFunction returns whether the call has a non-nil target indicating it is a member function
+ IsMemberFunction() bool
+
// Target returns the target of the expression if one is present.
- Target() NavigableExpr
+ Target() Expr
// Args returns the list of call arguments, excluding the target.
- Args() []NavigableExpr
-
- // ReturnType returns the result type of the call.
- ReturnType() *types.Type
+ Args() []Expr
// marker interface method
- isNavigable()
+ isExpr()
}
-// NavigableListExpr defines an interface for inspecting a list literal expression.
-type NavigableListExpr interface {
+// ListExpr defines an interface for inspecting a list literal expression.
+type ListExpr interface {
// Elements returns the list elements as navigable expressions.
- Elements() []NavigableExpr
+ Elements() []Expr
// OptionalIndicies returns the list of optional indices in the list literal.
OptionalIndices() []int32
+ // IsOptional indicates whether the given element index is optional.
+ IsOptional(int32) bool
+
// Size returns the number of elements in the list.
Size() int
// marker interface method
- isNavigable()
+ isExpr()
}
-// NavigableSelectExpr defines an interface for inspecting a select expression.
-type NavigableSelectExpr interface {
+// SelectExpr defines an interface for inspecting a select expression.
+type SelectExpr interface {
// Operand returns the selection operand expression.
- Operand() NavigableExpr
+ Operand() Expr
// FieldName returns the field name being selected from the operand.
FieldName() string
@@ -257,67 +206,67 @@ type NavigableSelectExpr interface {
IsTestOnly() bool
// marker interface method
- isNavigable()
+ isExpr()
}
-// NavigableMapExpr defines an interface for inspecting a map expression.
-type NavigableMapExpr interface {
- // Entries returns the map key value pairs as NavigableEntry values.
- Entries() []NavigableEntry
+// MapExpr defines an interface for inspecting a map expression.
+type MapExpr interface {
+ // Entries returns the map key value pairs as EntryExpr values.
+ Entries() []EntryExpr
// Size returns the number of entries in the map.
Size() int
// marker interface method
- isNavigable()
+ isExpr()
}
-// NavigableEntry defines an interface for inspecting a map entry.
-type NavigableEntry interface {
+// MapEntry defines an interface for inspecting a map entry.
+type MapEntry interface {
// Key returns the map entry key expression.
- Key() NavigableExpr
+ Key() Expr
// Value returns the map entry value expression.
- Value() NavigableExpr
+ Value() Expr
// IsOptional returns whether the entry is optional.
IsOptional() bool
// marker interface method
- isNavigable()
+ isEntryExpr()
}
-// NavigableStructExpr defines an interfaces for inspecting a struct and its field initializers.
-type NavigableStructExpr interface {
+// StructExpr defines an interfaces for inspecting a struct and its field initializers.
+type StructExpr interface {
// TypeName returns the struct type name.
TypeName() string
- // Fields returns the set of field initializers in the struct expression as NavigableField values.
- Fields() []NavigableField
+ // Fields returns the set of field initializers in the struct expression as EntryExpr values.
+ Fields() []EntryExpr
// marker interface method
- isNavigable()
+ isExpr()
}
-// NavigableField defines an interface for inspecting a struct field initialization.
-type NavigableField interface {
- // FieldName returns the name of the field.
- FieldName() string
+// StructField defines an interface for inspecting a struct field initialization.
+type StructField interface {
+ // Name returns the name of the field.
+ Name() string
// Value returns the field initialization expression.
- Value() NavigableExpr
+ Value() Expr
// IsOptional returns whether the field is optional.
IsOptional() bool
// marker interface method
- isNavigable()
+ isEntryExpr()
}
-// NavigableComprehensionExpr defines an interface for inspecting a comprehension expression.
-type NavigableComprehensionExpr interface {
+// ComprehensionExpr defines an interface for inspecting a comprehension expression.
+type ComprehensionExpr interface {
// IterRange returns the iteration range expression.
- IterRange() NavigableExpr
+ IterRange() Expr
// IterVar returns the iteration variable name.
IterVar() string
@@ -326,384 +275,586 @@ type NavigableComprehensionExpr interface {
AccuVar() string
// AccuInit returns the accumulation variable initialization expression.
- AccuInit() NavigableExpr
+ AccuInit() Expr
// LoopCondition returns the loop condition expression.
- LoopCondition() NavigableExpr
+ LoopCondition() Expr
// LoopStep returns the loop step expression.
- LoopStep() NavigableExpr
+ LoopStep() Expr
// Result returns the comprehension result expression.
- Result() NavigableExpr
+ Result() Expr
// marker interface method
- isNavigable()
+ isExpr()
}
-func newNavigableExpr(parent NavigableExpr, expr *exprpb.Expr, typeMap map[int64]*types.Type) NavigableExpr {
- kind, factory := kindOf(expr)
- nav := &navigableExprImpl{
- parent: parent,
- kind: kind,
- expr: expr,
- typeMap: typeMap,
- createChildren: factory,
+var _ Expr = &expr{}
+
+type expr struct {
+ id int64
+ exprKindCase
+}
+
+type exprKindCase interface {
+ Kind() ExprKind
+
+ renumberIDs(IDGenerator)
+
+ isExpr()
+}
+
+func (e *expr) ID() int64 {
+ if e == nil {
+ return 0
}
- return nav
+ return e.id
}
-type navigableExprImpl struct {
- parent NavigableExpr
- kind ExprKind
- expr *exprpb.Expr
- typeMap map[int64]*types.Type
- createChildren childFactory
+func (e *expr) Kind() ExprKind {
+ if e == nil || e.exprKindCase == nil {
+ return UnspecifiedExprKind
+ }
+ return e.exprKindCase.Kind()
}
-func (nav *navigableExprImpl) ID() int64 {
- return nav.ToExpr().GetId()
+func (e *expr) AsCall() CallExpr {
+ if e.Kind() != CallKind {
+ return nilCall
+ }
+ return e.exprKindCase.(CallExpr)
}
-func (nav *navigableExprImpl) Kind() ExprKind {
- return nav.kind
+func (e *expr) AsComprehension() ComprehensionExpr {
+ if e.Kind() != ComprehensionKind {
+ return nilCompre
+ }
+ return e.exprKindCase.(ComprehensionExpr)
}
-func (nav *navigableExprImpl) Type() *types.Type {
- if t, found := nav.typeMap[nav.ID()]; found {
- return t
+func (e *expr) AsIdent() string {
+ if e.Kind() != IdentKind {
+ return ""
}
- return types.DynType
+ return string(e.exprKindCase.(baseIdentExpr))
}
-func (nav *navigableExprImpl) Parent() (NavigableExpr, bool) {
- if nav.parent != nil {
- return nav.parent, true
+func (e *expr) AsLiteral() ref.Val {
+ if e.Kind() != LiteralKind {
+ return nil
}
- return nil, false
+ return e.exprKindCase.(*baseLiteral).Val
}
-func (nav *navigableExprImpl) Children() []NavigableExpr {
- return nav.createChildren(nav)
+func (e *expr) AsList() ListExpr {
+ if e.Kind() != ListKind {
+ return nilList
+ }
+ return e.exprKindCase.(ListExpr)
}
-func (nav *navigableExprImpl) ToExpr() *exprpb.Expr {
- return nav.expr
+func (e *expr) AsMap() MapExpr {
+ if e.Kind() != MapKind {
+ return nilMap
+ }
+ return e.exprKindCase.(MapExpr)
}
-func (nav *navigableExprImpl) AsCall() NavigableCallExpr {
- return navigableCallImpl{navigableExprImpl: nav}
+func (e *expr) AsSelect() SelectExpr {
+ if e.Kind() != SelectKind {
+ return nilSel
+ }
+ return e.exprKindCase.(SelectExpr)
}
-func (nav *navigableExprImpl) AsComprehension() NavigableComprehensionExpr {
- return navigableComprehensionImpl{navigableExprImpl: nav}
+func (e *expr) AsStruct() StructExpr {
+ if e.Kind() != StructKind {
+ return nilStruct
+ }
+ return e.exprKindCase.(StructExpr)
}
-func (nav *navigableExprImpl) AsIdent() string {
- return nav.ToExpr().GetIdentExpr().GetName()
+func (e *expr) SetKindCase(other Expr) {
+ if e == nil {
+ return
+ }
+ if other == nil {
+ e.exprKindCase = nil
+ return
+ }
+ switch other.Kind() {
+ case CallKind:
+ c := other.AsCall()
+ e.exprKindCase = &baseCallExpr{
+ function: c.FunctionName(),
+ target: c.Target(),
+ args: c.Args(),
+ isMember: c.IsMemberFunction(),
+ }
+ case ComprehensionKind:
+ c := other.AsComprehension()
+ e.exprKindCase = &baseComprehensionExpr{
+ iterRange: c.IterRange(),
+ iterVar: c.IterVar(),
+ accuVar: c.AccuVar(),
+ accuInit: c.AccuInit(),
+ loopCond: c.LoopCondition(),
+ loopStep: c.LoopStep(),
+ result: c.Result(),
+ }
+ case IdentKind:
+ e.exprKindCase = baseIdentExpr(other.AsIdent())
+ case ListKind:
+ l := other.AsList()
+ optIndexMap := make(map[int32]struct{}, len(l.OptionalIndices()))
+ for _, idx := range l.OptionalIndices() {
+ optIndexMap[idx] = struct{}{}
+ }
+ e.exprKindCase = &baseListExpr{
+ elements: l.Elements(),
+ optIndices: l.OptionalIndices(),
+ optIndexMap: optIndexMap,
+ }
+ case LiteralKind:
+ e.exprKindCase = &baseLiteral{Val: other.AsLiteral()}
+ case MapKind:
+ e.exprKindCase = &baseMapExpr{
+ entries: other.AsMap().Entries(),
+ }
+ case SelectKind:
+ s := other.AsSelect()
+ e.exprKindCase = &baseSelectExpr{
+ operand: s.Operand(),
+ field: s.FieldName(),
+ testOnly: s.IsTestOnly(),
+ }
+ case StructKind:
+ s := other.AsStruct()
+ e.exprKindCase = &baseStructExpr{
+ typeName: s.TypeName(),
+ fields: s.Fields(),
+ }
+ case UnspecifiedExprKind:
+ e.exprKindCase = nil
+ }
}
-func (nav *navigableExprImpl) AsLiteral() ref.Val {
- if nav.Kind() != LiteralKind {
- return nil
+func (e *expr) RenumberIDs(idGen IDGenerator) {
+ if e == nil {
+ return
}
- val, err := ConstantToVal(nav.ToExpr().GetConstExpr())
- if err != nil {
- panic(err)
+ e.id = idGen(e.id)
+ if e.exprKindCase != nil {
+ e.exprKindCase.renumberIDs(idGen)
}
- return val
}
-func (nav *navigableExprImpl) AsList() NavigableListExpr {
- return navigableListImpl{navigableExprImpl: nav}
+type baseCallExpr struct {
+ function string
+ target Expr
+ args []Expr
+ isMember bool
}
-func (nav *navigableExprImpl) AsMap() NavigableMapExpr {
- return navigableMapImpl{navigableExprImpl: nav}
+func (*baseCallExpr) Kind() ExprKind {
+ return CallKind
}
-func (nav *navigableExprImpl) AsSelect() NavigableSelectExpr {
- return navigableSelectImpl{navigableExprImpl: nav}
+func (e *baseCallExpr) FunctionName() string {
+ if e == nil {
+ return ""
+ }
+ return e.function
}
-func (nav *navigableExprImpl) AsStruct() NavigableStructExpr {
- return navigableStructImpl{navigableExprImpl: nav}
+func (e *baseCallExpr) IsMemberFunction() bool {
+ if e == nil {
+ return false
+ }
+ return e.isMember
}
-func (nav *navigableExprImpl) createChild(e *exprpb.Expr) NavigableExpr {
- return newNavigableExpr(nav, e, nav.typeMap)
+func (e *baseCallExpr) Target() Expr {
+ if e == nil || !e.IsMemberFunction() {
+ return nilExpr
+ }
+ return e.target
}
-func (nav *navigableExprImpl) isNavigable() {}
+func (e *baseCallExpr) Args() []Expr {
+ if e == nil {
+ return []Expr{}
+ }
+ return e.args
+}
-type navigableCallImpl struct {
- *navigableExprImpl
+func (e *baseCallExpr) renumberIDs(idGen IDGenerator) {
+ if e.IsMemberFunction() {
+ e.Target().RenumberIDs(idGen)
+ }
+ for _, arg := range e.Args() {
+ arg.RenumberIDs(idGen)
+ }
}
-func (call navigableCallImpl) FunctionName() string {
- return call.ToExpr().GetCallExpr().GetFunction()
+func (*baseCallExpr) isExpr() {}
+
+var _ ComprehensionExpr = &baseComprehensionExpr{}
+
+type baseComprehensionExpr struct {
+ iterRange Expr
+ iterVar string
+ accuVar string
+ accuInit Expr
+ loopCond Expr
+ loopStep Expr
+ result Expr
}
-func (call navigableCallImpl) Target() NavigableExpr {
- t := call.ToExpr().GetCallExpr().GetTarget()
- if t != nil {
- return call.createChild(t)
- }
- return nil
+func (*baseComprehensionExpr) Kind() ExprKind {
+ return ComprehensionKind
}
-func (call navigableCallImpl) Args() []NavigableExpr {
- args := call.ToExpr().GetCallExpr().GetArgs()
- navArgs := make([]NavigableExpr, len(args))
- for i, a := range args {
- navArgs[i] = call.createChild(a)
+func (e *baseComprehensionExpr) IterRange() Expr {
+ if e == nil {
+ return nilExpr
}
- return navArgs
+ return e.iterRange
}
-func (call navigableCallImpl) ReturnType() *types.Type {
- return call.Type()
+func (e *baseComprehensionExpr) IterVar() string {
+ return e.iterVar
}
-type navigableComprehensionImpl struct {
- *navigableExprImpl
+func (e *baseComprehensionExpr) AccuVar() string {
+ return e.accuVar
}
-func (comp navigableComprehensionImpl) IterRange() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetIterRange())
+func (e *baseComprehensionExpr) AccuInit() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.accuInit
}
-func (comp navigableComprehensionImpl) IterVar() string {
- return comp.ToExpr().GetComprehensionExpr().GetIterVar()
+func (e *baseComprehensionExpr) LoopCondition() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.loopCond
}
-func (comp navigableComprehensionImpl) AccuVar() string {
- return comp.ToExpr().GetComprehensionExpr().GetAccuVar()
+func (e *baseComprehensionExpr) LoopStep() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.loopStep
}
-func (comp navigableComprehensionImpl) AccuInit() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetAccuInit())
+func (e *baseComprehensionExpr) Result() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.result
}
-func (comp navigableComprehensionImpl) LoopCondition() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetLoopCondition())
+func (e *baseComprehensionExpr) renumberIDs(idGen IDGenerator) {
+ e.IterRange().RenumberIDs(idGen)
+ e.AccuInit().RenumberIDs(idGen)
+ e.LoopCondition().RenumberIDs(idGen)
+ e.LoopStep().RenumberIDs(idGen)
+ e.Result().RenumberIDs(idGen)
}
-func (comp navigableComprehensionImpl) LoopStep() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetLoopStep())
+func (*baseComprehensionExpr) isExpr() {}
+
+var _ exprKindCase = baseIdentExpr("")
+
+type baseIdentExpr string
+
+func (baseIdentExpr) Kind() ExprKind {
+ return IdentKind
}
-func (comp navigableComprehensionImpl) Result() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetResult())
+func (e baseIdentExpr) renumberIDs(IDGenerator) {}
+
+func (baseIdentExpr) isExpr() {}
+
+var _ exprKindCase = &baseLiteral{}
+var _ ref.Val = &baseLiteral{}
+
+type baseLiteral struct {
+ ref.Val
}
-type navigableListImpl struct {
- *navigableExprImpl
+func (*baseLiteral) Kind() ExprKind {
+ return LiteralKind
}
-func (l navigableListImpl) Elements() []NavigableExpr {
- return l.Children()
+func (l *baseLiteral) renumberIDs(IDGenerator) {}
+
+func (*baseLiteral) isExpr() {}
+
+var _ ListExpr = &baseListExpr{}
+
+type baseListExpr struct {
+ elements []Expr
+ optIndices []int32
+ optIndexMap map[int32]struct{}
}
-func (l navigableListImpl) OptionalIndices() []int32 {
- return l.ToExpr().GetListExpr().GetOptionalIndices()
+func (*baseListExpr) Kind() ExprKind {
+ return ListKind
}
-func (l navigableListImpl) Size() int {
- return len(l.ToExpr().GetListExpr().GetElements())
+func (e *baseListExpr) Elements() []Expr {
+ if e == nil {
+ return []Expr{}
+ }
+ return e.elements
}
-type navigableMapImpl struct {
- *navigableExprImpl
+func (e *baseListExpr) IsOptional(index int32) bool {
+ _, found := e.optIndexMap[index]
+ return found
}
-func (m navigableMapImpl) Entries() []NavigableEntry {
- mapExpr := m.ToExpr().GetStructExpr()
- entries := make([]NavigableEntry, len(mapExpr.GetEntries()))
- for i, e := range mapExpr.GetEntries() {
- entries[i] = navigableEntryImpl{
- key: m.createChild(e.GetMapKey()),
- val: m.createChild(e.GetValue()),
- isOpt: e.GetOptionalEntry(),
- }
+func (e *baseListExpr) OptionalIndices() []int32 {
+ if e == nil {
+ return []int32{}
}
- return entries
+ return e.optIndices
}
-func (m navigableMapImpl) Size() int {
- return len(m.ToExpr().GetStructExpr().GetEntries())
+func (e *baseListExpr) Size() int {
+ return len(e.Elements())
}
-type navigableEntryImpl struct {
- key NavigableExpr
- val NavigableExpr
- isOpt bool
+func (e *baseListExpr) renumberIDs(idGen IDGenerator) {
+ for _, elem := range e.Elements() {
+ elem.RenumberIDs(idGen)
+ }
}
-func (e navigableEntryImpl) Key() NavigableExpr {
- return e.key
-}
+func (*baseListExpr) isExpr() {}
-func (e navigableEntryImpl) Value() NavigableExpr {
- return e.val
+type baseMapExpr struct {
+ entries []EntryExpr
}
-func (e navigableEntryImpl) IsOptional() bool {
- return e.isOpt
+func (*baseMapExpr) Kind() ExprKind {
+ return MapKind
}
-func (e navigableEntryImpl) isNavigable() {}
+func (e *baseMapExpr) Entries() []EntryExpr {
+ if e == nil {
+ return []EntryExpr{}
+ }
+ return e.entries
+}
-type navigableSelectImpl struct {
- *navigableExprImpl
+func (e *baseMapExpr) Size() int {
+ return len(e.Entries())
}
-func (sel navigableSelectImpl) FieldName() string {
- return sel.ToExpr().GetSelectExpr().GetField()
+func (e *baseMapExpr) renumberIDs(idGen IDGenerator) {
+ for _, entry := range e.Entries() {
+ entry.RenumberIDs(idGen)
+ }
}
-func (sel navigableSelectImpl) IsTestOnly() bool {
- return sel.ToExpr().GetSelectExpr().GetTestOnly()
+func (*baseMapExpr) isExpr() {}
+
+type baseSelectExpr struct {
+ operand Expr
+ field string
+ testOnly bool
}
-func (sel navigableSelectImpl) Operand() NavigableExpr {
- return sel.createChild(sel.ToExpr().GetSelectExpr().GetOperand())
+func (*baseSelectExpr) Kind() ExprKind {
+ return SelectKind
}
-type navigableStructImpl struct {
- *navigableExprImpl
+func (e *baseSelectExpr) Operand() Expr {
+ if e == nil || e.operand == nil {
+ return nilExpr
+ }
+ return e.operand
}
-func (s navigableStructImpl) TypeName() string {
- return s.ToExpr().GetStructExpr().GetMessageName()
+func (e *baseSelectExpr) FieldName() string {
+ if e == nil {
+ return ""
+ }
+ return e.field
}
-func (s navigableStructImpl) Fields() []NavigableField {
- fieldInits := s.ToExpr().GetStructExpr().GetEntries()
- fields := make([]NavigableField, len(fieldInits))
- for i, f := range fieldInits {
- fields[i] = navigableFieldImpl{
- name: f.GetFieldKey(),
- val: s.createChild(f.GetValue()),
- isOpt: f.GetOptionalEntry(),
- }
+func (e *baseSelectExpr) IsTestOnly() bool {
+ if e == nil {
+ return false
}
- return fields
+ return e.testOnly
}
-type navigableFieldImpl struct {
- name string
- val NavigableExpr
- isOpt bool
+func (e *baseSelectExpr) renumberIDs(idGen IDGenerator) {
+ e.Operand().RenumberIDs(idGen)
}
-func (f navigableFieldImpl) FieldName() string {
- return f.name
+func (*baseSelectExpr) isExpr() {}
+
+type baseStructExpr struct {
+ typeName string
+ fields []EntryExpr
}
-func (f navigableFieldImpl) Value() NavigableExpr {
- return f.val
+func (*baseStructExpr) Kind() ExprKind {
+ return StructKind
}
-func (f navigableFieldImpl) IsOptional() bool {
- return f.isOpt
+func (e *baseStructExpr) TypeName() string {
+ if e == nil {
+ return ""
+ }
+ return e.typeName
}
-func (f navigableFieldImpl) isNavigable() {}
+func (e *baseStructExpr) Fields() []EntryExpr {
+ if e == nil {
+ return []EntryExpr{}
+ }
+ return e.fields
+}
-func kindOf(expr *exprpb.Expr) (ExprKind, childFactory) {
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- return LiteralKind, noopFactory
- case *exprpb.Expr_IdentExpr:
- return IdentKind, noopFactory
- case *exprpb.Expr_SelectExpr:
- return SelectKind, selectFactory
- case *exprpb.Expr_CallExpr:
- return CallKind, callArgFactory
- case *exprpb.Expr_ListExpr:
- return ListKind, listElemFactory
- case *exprpb.Expr_StructExpr:
- if expr.GetStructExpr().GetMessageName() != "" {
- return StructKind, structEntryFactory
- }
- return MapKind, mapEntryFactory
- case *exprpb.Expr_ComprehensionExpr:
- return ComprehensionKind, comprehensionFactory
- default:
- return UnspecifiedKind, noopFactory
+func (e *baseStructExpr) renumberIDs(idGen IDGenerator) {
+ for _, f := range e.Fields() {
+ f.RenumberIDs(idGen)
}
}
-type childFactory func(*navigableExprImpl) []NavigableExpr
+func (*baseStructExpr) isExpr() {}
+
+type entryExprKindCase interface {
+ Kind() EntryExprKind
+
+ renumberIDs(IDGenerator)
+
+ isEntryExpr()
+}
+
+var _ EntryExpr = &entryExpr{}
+
+type entryExpr struct {
+ id int64
+ entryExprKindCase
+}
-func noopFactory(*navigableExprImpl) []NavigableExpr {
- return nil
+func (e *entryExpr) ID() int64 {
+ return e.id
}
-func selectFactory(nav *navigableExprImpl) []NavigableExpr {
- return []NavigableExpr{
- nav.createChild(nav.ToExpr().GetSelectExpr().GetOperand()),
+func (e *entryExpr) AsMapEntry() MapEntry {
+ if e.Kind() != MapEntryKind {
+ return nilMapEntry
}
+ return e.entryExprKindCase.(MapEntry)
}
-func callArgFactory(nav *navigableExprImpl) []NavigableExpr {
- call := nav.ToExpr().GetCallExpr()
- argCount := len(call.GetArgs())
- if call.GetTarget() != nil {
- argCount++
+func (e *entryExpr) AsStructField() StructField {
+ if e.Kind() != StructFieldKind {
+ return nilStructField
}
- navExprs := make([]NavigableExpr, argCount)
- i := 0
- if call.GetTarget() != nil {
- navExprs[i] = nav.createChild(call.GetTarget())
- i++
+ return e.entryExprKindCase.(StructField)
+}
+
+func (e *entryExpr) RenumberIDs(idGen IDGenerator) {
+ e.id = idGen(e.id)
+ e.entryExprKindCase.renumberIDs(idGen)
+}
+
+type baseMapEntry struct {
+ key Expr
+ value Expr
+ isOptional bool
+}
+
+func (e *baseMapEntry) Kind() EntryExprKind {
+ return MapEntryKind
+}
+
+func (e *baseMapEntry) Key() Expr {
+ if e == nil {
+ return nilExpr
}
- for _, arg := range call.GetArgs() {
- navExprs[i] = nav.createChild(arg)
- i++
+ return e.key
+}
+
+func (e *baseMapEntry) Value() Expr {
+ if e == nil {
+ return nilExpr
}
- return navExprs
+ return e.value
}
-func listElemFactory(nav *navigableExprImpl) []NavigableExpr {
- l := nav.ToExpr().GetListExpr()
- navExprs := make([]NavigableExpr, len(l.GetElements()))
- for i, e := range l.GetElements() {
- navExprs[i] = nav.createChild(e)
+func (e *baseMapEntry) IsOptional() bool {
+ if e == nil {
+ return false
}
- return navExprs
+ return e.isOptional
}
-func structEntryFactory(nav *navigableExprImpl) []NavigableExpr {
- s := nav.ToExpr().GetStructExpr()
- entries := make([]NavigableExpr, len(s.GetEntries()))
- for i, e := range s.GetEntries() {
+func (e *baseMapEntry) renumberIDs(idGen IDGenerator) {
+ e.Key().RenumberIDs(idGen)
+ e.Value().RenumberIDs(idGen)
+}
+
+func (*baseMapEntry) isEntryExpr() {}
+
+type baseStructField struct {
+ field string
+ value Expr
+ isOptional bool
+}
+
+func (f *baseStructField) Kind() EntryExprKind {
+ return StructFieldKind
+}
- entries[i] = nav.createChild(e.GetValue())
+func (f *baseStructField) Name() string {
+ if f == nil {
+ return ""
}
- return entries
+ return f.field
}
-func mapEntryFactory(nav *navigableExprImpl) []NavigableExpr {
- s := nav.ToExpr().GetStructExpr()
- entries := make([]NavigableExpr, len(s.GetEntries())*2)
- j := 0
- for _, e := range s.GetEntries() {
- entries[j] = nav.createChild(e.GetMapKey())
- entries[j+1] = nav.createChild(e.GetValue())
- j += 2
+func (f *baseStructField) Value() Expr {
+ if f == nil {
+ return nilExpr
}
- return entries
+ return f.value
}
-func comprehensionFactory(nav *navigableExprImpl) []NavigableExpr {
- compre := nav.ToExpr().GetComprehensionExpr()
- return []NavigableExpr{
- nav.createChild(compre.GetIterRange()),
- nav.createChild(compre.GetAccuInit()),
- nav.createChild(compre.GetLoopCondition()),
- nav.createChild(compre.GetLoopStep()),
- nav.createChild(compre.GetResult()),
+func (f *baseStructField) IsOptional() bool {
+ if f == nil {
+ return false
}
+ return f.isOptional
}
+
+func (f *baseStructField) renumberIDs(idGen IDGenerator) {
+ f.Value().RenumberIDs(idGen)
+}
+
+func (*baseStructField) isEntryExpr() {}
+
+var (
+ nilExpr *expr = nil
+ nilCall *baseCallExpr = nil
+ nilCompre *baseComprehensionExpr = nil
+ nilList *baseListExpr = nil
+ nilMap *baseMapExpr = nil
+ nilMapEntry *baseMapEntry = nil
+ nilSel *baseSelectExpr = nil
+ nilStruct *baseStructExpr = nil
+ nilStructField *baseStructField = nil
+)
diff --git a/vendor/github.com/google/cel-go/common/ast/factory.go b/vendor/github.com/google/cel-go/common/ast/factory.go
new file mode 100644
index 0000000000..b7f36e72a4
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/ast/factory.go
@@ -0,0 +1,303 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ast
+
+import "github.com/google/cel-go/common/types/ref"
+
+// ExprFactory interfaces defines a set of methods necessary for building native expression values.
+type ExprFactory interface {
+ // CopyExpr creates a deep copy of the input Expr value.
+ CopyExpr(Expr) Expr
+
+ // CopyEntryExpr creates a deep copy of the input EntryExpr value.
+ CopyEntryExpr(EntryExpr) EntryExpr
+
+ // NewCall creates an Expr value representing a global function call.
+ NewCall(id int64, function string, args ...Expr) Expr
+
+ // NewComprehension creates an Expr value representing a comprehension over a value range.
+ NewComprehension(id int64, iterRange Expr, iterVar, accuVar string, accuInit, loopCondition, loopStep, result Expr) Expr
+
+ // NewMemberCall creates an Expr value representing a member function call.
+ NewMemberCall(id int64, function string, receiver Expr, args ...Expr) Expr
+
+ // NewIdent creates an Expr value representing an identifier.
+ NewIdent(id int64, name string) Expr
+
+ // NewAccuIdent creates an Expr value representing an accumulator identifier within a
+ //comprehension.
+ NewAccuIdent(id int64) Expr
+
+ // NewLiteral creates an Expr value representing a literal value, such as a string or integer.
+ NewLiteral(id int64, value ref.Val) Expr
+
+ // NewList creates an Expr value representing a list literal expression with optional indices.
+ //
+ // Optional indicies will typically be empty unless the CEL optional types are enabled.
+ NewList(id int64, elems []Expr, optIndices []int32) Expr
+
+ // NewMap creates an Expr value representing a map literal expression
+ NewMap(id int64, entries []EntryExpr) Expr
+
+ // NewMapEntry creates a MapEntry with a given key, value, and a flag indicating whether
+ // the key is optionally set.
+ NewMapEntry(id int64, key, value Expr, isOptional bool) EntryExpr
+
+ // NewPresenceTest creates an Expr representing a field presence test on an operand expression.
+ NewPresenceTest(id int64, operand Expr, field string) Expr
+
+ // NewSelect creates an Expr representing a field selection on an operand expression.
+ NewSelect(id int64, operand Expr, field string) Expr
+
+ // NewStruct creates an Expr value representing a struct literal with a given type name and a
+ // set of field initializers.
+ NewStruct(id int64, typeName string, fields []EntryExpr) Expr
+
+ // NewStructField creates a StructField with a given field name, value, and a flag indicating
+ // whether the field is optionally set.
+ NewStructField(id int64, field string, value Expr, isOptional bool) EntryExpr
+
+ // NewUnspecifiedExpr creates an empty expression node.
+ NewUnspecifiedExpr(id int64) Expr
+
+ isExprFactory()
+}
+
+type baseExprFactory struct{}
+
+// NewExprFactory creates an ExprFactory instance.
+func NewExprFactory() ExprFactory {
+ return &baseExprFactory{}
+}
+
+func (fac *baseExprFactory) NewCall(id int64, function string, args ...Expr) Expr {
+ if len(args) == 0 {
+ args = []Expr{}
+ }
+ return fac.newExpr(
+ id,
+ &baseCallExpr{
+ function: function,
+ target: nilExpr,
+ args: args,
+ isMember: false,
+ })
+}
+
+func (fac *baseExprFactory) NewMemberCall(id int64, function string, target Expr, args ...Expr) Expr {
+ if len(args) == 0 {
+ args = []Expr{}
+ }
+ return fac.newExpr(
+ id,
+ &baseCallExpr{
+ function: function,
+ target: target,
+ args: args,
+ isMember: true,
+ })
+}
+
+func (fac *baseExprFactory) NewComprehension(id int64, iterRange Expr, iterVar, accuVar string, accuInit, loopCond, loopStep, result Expr) Expr {
+ return fac.newExpr(
+ id,
+ &baseComprehensionExpr{
+ iterRange: iterRange,
+ iterVar: iterVar,
+ accuVar: accuVar,
+ accuInit: accuInit,
+ loopCond: loopCond,
+ loopStep: loopStep,
+ result: result,
+ })
+}
+
+func (fac *baseExprFactory) NewIdent(id int64, name string) Expr {
+ return fac.newExpr(id, baseIdentExpr(name))
+}
+
+func (fac *baseExprFactory) NewAccuIdent(id int64) Expr {
+ return fac.NewIdent(id, "__result__")
+}
+
+func (fac *baseExprFactory) NewLiteral(id int64, value ref.Val) Expr {
+ return fac.newExpr(id, &baseLiteral{Val: value})
+}
+
+func (fac *baseExprFactory) NewList(id int64, elems []Expr, optIndices []int32) Expr {
+ optIndexMap := make(map[int32]struct{}, len(optIndices))
+ for _, idx := range optIndices {
+ optIndexMap[idx] = struct{}{}
+ }
+ return fac.newExpr(id,
+ &baseListExpr{
+ elements: elems,
+ optIndices: optIndices,
+ optIndexMap: optIndexMap,
+ })
+}
+
+func (fac *baseExprFactory) NewMap(id int64, entries []EntryExpr) Expr {
+ return fac.newExpr(id, &baseMapExpr{entries: entries})
+}
+
+func (fac *baseExprFactory) NewMapEntry(id int64, key, value Expr, isOptional bool) EntryExpr {
+ return fac.newEntryExpr(
+ id,
+ &baseMapEntry{
+ key: key,
+ value: value,
+ isOptional: isOptional,
+ })
+}
+
+func (fac *baseExprFactory) NewPresenceTest(id int64, operand Expr, field string) Expr {
+ return fac.newExpr(
+ id,
+ &baseSelectExpr{
+ operand: operand,
+ field: field,
+ testOnly: true,
+ })
+}
+
+func (fac *baseExprFactory) NewSelect(id int64, operand Expr, field string) Expr {
+ return fac.newExpr(
+ id,
+ &baseSelectExpr{
+ operand: operand,
+ field: field,
+ })
+}
+
+func (fac *baseExprFactory) NewStruct(id int64, typeName string, fields []EntryExpr) Expr {
+ return fac.newExpr(
+ id,
+ &baseStructExpr{
+ typeName: typeName,
+ fields: fields,
+ })
+}
+
+func (fac *baseExprFactory) NewStructField(id int64, field string, value Expr, isOptional bool) EntryExpr {
+ return fac.newEntryExpr(
+ id,
+ &baseStructField{
+ field: field,
+ value: value,
+ isOptional: isOptional,
+ })
+}
+
+func (fac *baseExprFactory) NewUnspecifiedExpr(id int64) Expr {
+ return fac.newExpr(id, nil)
+}
+
+func (fac *baseExprFactory) CopyExpr(e Expr) Expr {
+ // unwrap navigable expressions to avoid unnecessary allocations during copying.
+ if nav, ok := e.(*navigableExprImpl); ok {
+ e = nav.Expr
+ }
+ switch e.Kind() {
+ case CallKind:
+ c := e.AsCall()
+ argsCopy := make([]Expr, len(c.Args()))
+ for i, arg := range c.Args() {
+ argsCopy[i] = fac.CopyExpr(arg)
+ }
+ if !c.IsMemberFunction() {
+ return fac.NewCall(e.ID(), c.FunctionName(), argsCopy...)
+ }
+ return fac.NewMemberCall(e.ID(), c.FunctionName(), fac.CopyExpr(c.Target()), argsCopy...)
+ case ComprehensionKind:
+ compre := e.AsComprehension()
+ return fac.NewComprehension(e.ID(),
+ fac.CopyExpr(compre.IterRange()),
+ compre.IterVar(),
+ compre.AccuVar(),
+ fac.CopyExpr(compre.AccuInit()),
+ fac.CopyExpr(compre.LoopCondition()),
+ fac.CopyExpr(compre.LoopStep()),
+ fac.CopyExpr(compre.Result()))
+ case IdentKind:
+ return fac.NewIdent(e.ID(), e.AsIdent())
+ case ListKind:
+ l := e.AsList()
+ elemsCopy := make([]Expr, l.Size())
+ for i, elem := range l.Elements() {
+ elemsCopy[i] = fac.CopyExpr(elem)
+ }
+ return fac.NewList(e.ID(), elemsCopy, l.OptionalIndices())
+ case LiteralKind:
+ return fac.NewLiteral(e.ID(), e.AsLiteral())
+ case MapKind:
+ m := e.AsMap()
+ entriesCopy := make([]EntryExpr, m.Size())
+ for i, entry := range m.Entries() {
+ entriesCopy[i] = fac.CopyEntryExpr(entry)
+ }
+ return fac.NewMap(e.ID(), entriesCopy)
+ case SelectKind:
+ s := e.AsSelect()
+ if s.IsTestOnly() {
+ return fac.NewPresenceTest(e.ID(), fac.CopyExpr(s.Operand()), s.FieldName())
+ }
+ return fac.NewSelect(e.ID(), fac.CopyExpr(s.Operand()), s.FieldName())
+ case StructKind:
+ s := e.AsStruct()
+ fieldsCopy := make([]EntryExpr, len(s.Fields()))
+ for i, field := range s.Fields() {
+ fieldsCopy[i] = fac.CopyEntryExpr(field)
+ }
+ return fac.NewStruct(e.ID(), s.TypeName(), fieldsCopy)
+ default:
+ return fac.NewUnspecifiedExpr(e.ID())
+ }
+}
+
+func (fac *baseExprFactory) CopyEntryExpr(e EntryExpr) EntryExpr {
+ switch e.Kind() {
+ case MapEntryKind:
+ entry := e.AsMapEntry()
+ return fac.NewMapEntry(e.ID(),
+ fac.CopyExpr(entry.Key()), fac.CopyExpr(entry.Value()), entry.IsOptional())
+ case StructFieldKind:
+ field := e.AsStructField()
+ return fac.NewStructField(e.ID(),
+ field.Name(), fac.CopyExpr(field.Value()), field.IsOptional())
+ default:
+ return fac.newEntryExpr(e.ID(), nil)
+ }
+}
+
+func (*baseExprFactory) isExprFactory() {}
+
+func (fac *baseExprFactory) newExpr(id int64, e exprKindCase) Expr {
+ return &expr{
+ id: id,
+ exprKindCase: e,
+ }
+}
+
+func (fac *baseExprFactory) newEntryExpr(id int64, e entryExprKindCase) EntryExpr {
+ return &entryExpr{
+ id: id,
+ entryExprKindCase: e,
+ }
+}
+
+var (
+ defaultFactory = &baseExprFactory{}
+)
diff --git a/vendor/github.com/google/cel-go/common/ast/navigable.go b/vendor/github.com/google/cel-go/common/ast/navigable.go
new file mode 100644
index 0000000000..f5ddf6aac6
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/ast/navigable.go
@@ -0,0 +1,652 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ast
+
+import (
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+)
+
+// NavigableExpr represents the base navigable expression value with methods to inspect the
+// parent and child expressions.
+type NavigableExpr interface {
+ Expr
+
+ // Type of the expression.
+ //
+ // If the expression is type-checked, the type check metadata is returned. If the expression
+ // has not been type-checked, the types.DynType value is returned.
+ Type() *types.Type
+
+ // Parent returns the parent expression node, if one exists.
+ Parent() (NavigableExpr, bool)
+
+ // Children returns a list of child expression nodes.
+ Children() []NavigableExpr
+
+ // Depth indicates the depth in the expression tree.
+ //
+ // The root expression has depth 0.
+ Depth() int
+}
+
+// NavigateAST converts an AST to a NavigableExpr
+func NavigateAST(ast *AST) NavigableExpr {
+ return NavigateExpr(ast, ast.Expr())
+}
+
+// NavigateExpr creates a NavigableExpr whose type information is backed by the input AST.
+//
+// If the expression is already a NavigableExpr, the parent and depth information will be
+// propagated on the new NavigableExpr value; otherwise, the expr value will be treated
+// as though it is the root of the expression graph with a depth of 0.
+func NavigateExpr(ast *AST, expr Expr) NavigableExpr {
+ depth := 0
+ var parent NavigableExpr = nil
+ if nav, ok := expr.(NavigableExpr); ok {
+ depth = nav.Depth()
+ parent, _ = nav.Parent()
+ }
+ return newNavigableExpr(ast, parent, expr, depth)
+}
+
+// ExprMatcher takes a NavigableExpr in and indicates whether the value is a match.
+//
+// This function type should be use with the `Match` and `MatchList` calls.
+type ExprMatcher func(NavigableExpr) bool
+
+// ConstantValueMatcher returns an ExprMatcher which will return true if the input NavigableExpr
+// is comprised of all constant values, such as a simple literal or even list and map literal.
+func ConstantValueMatcher() ExprMatcher {
+ return matchIsConstantValue
+}
+
+// KindMatcher returns an ExprMatcher which will return true if the input NavigableExpr.Kind() matches
+// the specified `kind`.
+func KindMatcher(kind ExprKind) ExprMatcher {
+ return func(e NavigableExpr) bool {
+ return e.Kind() == kind
+ }
+}
+
+// FunctionMatcher returns an ExprMatcher which will match NavigableExpr nodes of CallKind type whose
+// function name is equal to `funcName`.
+func FunctionMatcher(funcName string) ExprMatcher {
+ return func(e NavigableExpr) bool {
+ if e.Kind() != CallKind {
+ return false
+ }
+ return e.AsCall().FunctionName() == funcName
+ }
+}
+
+// AllMatcher returns true for all descendants of a NavigableExpr, effectively flattening them into a list.
+//
+// Such a result would work well with subsequent MatchList calls.
+func AllMatcher() ExprMatcher {
+ return func(NavigableExpr) bool {
+ return true
+ }
+}
+
+// MatchDescendants takes a NavigableExpr and ExprMatcher and produces a list of NavigableExpr values
+// matching the input criteria in post-order (bottom up).
+func MatchDescendants(expr NavigableExpr, matcher ExprMatcher) []NavigableExpr {
+ matches := []NavigableExpr{}
+ navVisitor := &baseVisitor{
+ visitExpr: func(e Expr) {
+ nav := e.(NavigableExpr)
+ if matcher(nav) {
+ matches = append(matches, nav)
+ }
+ },
+ }
+ visit(expr, navVisitor, postOrder, 0, 0)
+ return matches
+}
+
+// MatchSubset applies an ExprMatcher to a list of NavigableExpr values and their descendants, producing a
+// subset of NavigableExpr values which match.
+func MatchSubset(exprs []NavigableExpr, matcher ExprMatcher) []NavigableExpr {
+ matches := []NavigableExpr{}
+ navVisitor := &baseVisitor{
+ visitExpr: func(e Expr) {
+ nav := e.(NavigableExpr)
+ if matcher(nav) {
+ matches = append(matches, nav)
+ }
+ },
+ }
+ for _, expr := range exprs {
+ visit(expr, navVisitor, postOrder, 0, 1)
+ }
+ return matches
+}
+
+// Visitor defines an object for visiting Expr and EntryExpr nodes within an expression graph.
+type Visitor interface {
+ // VisitExpr visits the input expression.
+ VisitExpr(Expr)
+
+ // VisitEntryExpr visits the input entry expression, i.e. a struct field or map entry.
+ VisitEntryExpr(EntryExpr)
+}
+
+type baseVisitor struct {
+ visitExpr func(Expr)
+ visitEntryExpr func(EntryExpr)
+}
+
+// VisitExpr visits the Expr if the internal expr visitor has been configured.
+func (v *baseVisitor) VisitExpr(e Expr) {
+ if v.visitExpr != nil {
+ v.visitExpr(e)
+ }
+}
+
+// VisitEntryExpr visits the entry if the internal expr entry visitor has been configured.
+func (v *baseVisitor) VisitEntryExpr(e EntryExpr) {
+ if v.visitEntryExpr != nil {
+ v.visitEntryExpr(e)
+ }
+}
+
+// NewExprVisitor creates a visitor which only visits expression nodes.
+func NewExprVisitor(v func(Expr)) Visitor {
+ return &baseVisitor{
+ visitExpr: v,
+ visitEntryExpr: nil,
+ }
+}
+
+// PostOrderVisit walks the expression graph and calls the visitor in post-order (bottom-up).
+func PostOrderVisit(expr Expr, visitor Visitor) {
+ visit(expr, visitor, postOrder, 0, 0)
+}
+
+// PreOrderVisit walks the expression graph and calls the visitor in pre-order (top-down).
+func PreOrderVisit(expr Expr, visitor Visitor) {
+ visit(expr, visitor, preOrder, 0, 0)
+}
+
+type visitOrder int
+
+const (
+ preOrder = iota + 1
+ postOrder
+)
+
+// TODO: consider exposing a way to configure a limit for the max visit depth.
+// It's possible that we could want to configure this on the NewExprVisitor()
+// and through MatchDescendents() / MaxID().
+func visit(expr Expr, visitor Visitor, order visitOrder, depth, maxDepth int) {
+ if maxDepth > 0 && depth == maxDepth {
+ return
+ }
+ if order == preOrder {
+ visitor.VisitExpr(expr)
+ }
+ switch expr.Kind() {
+ case CallKind:
+ c := expr.AsCall()
+ if c.IsMemberFunction() {
+ visit(c.Target(), visitor, order, depth+1, maxDepth)
+ }
+ for _, arg := range c.Args() {
+ visit(arg, visitor, order, depth+1, maxDepth)
+ }
+ case ComprehensionKind:
+ c := expr.AsComprehension()
+ visit(c.IterRange(), visitor, order, depth+1, maxDepth)
+ visit(c.AccuInit(), visitor, order, depth+1, maxDepth)
+ visit(c.LoopCondition(), visitor, order, depth+1, maxDepth)
+ visit(c.LoopStep(), visitor, order, depth+1, maxDepth)
+ visit(c.Result(), visitor, order, depth+1, maxDepth)
+ case ListKind:
+ l := expr.AsList()
+ for _, elem := range l.Elements() {
+ visit(elem, visitor, order, depth+1, maxDepth)
+ }
+ case MapKind:
+ m := expr.AsMap()
+ for _, e := range m.Entries() {
+ if order == preOrder {
+ visitor.VisitEntryExpr(e)
+ }
+ entry := e.AsMapEntry()
+ visit(entry.Key(), visitor, order, depth+1, maxDepth)
+ visit(entry.Value(), visitor, order, depth+1, maxDepth)
+ if order == postOrder {
+ visitor.VisitEntryExpr(e)
+ }
+ }
+ case SelectKind:
+ visit(expr.AsSelect().Operand(), visitor, order, depth+1, maxDepth)
+ case StructKind:
+ s := expr.AsStruct()
+ for _, f := range s.Fields() {
+ visitor.VisitEntryExpr(f)
+ visit(f.AsStructField().Value(), visitor, order, depth+1, maxDepth)
+ }
+ }
+ if order == postOrder {
+ visitor.VisitExpr(expr)
+ }
+}
+
+func matchIsConstantValue(e NavigableExpr) bool {
+ if e.Kind() == LiteralKind {
+ return true
+ }
+ if e.Kind() == StructKind || e.Kind() == MapKind || e.Kind() == ListKind {
+ for _, child := range e.Children() {
+ if !matchIsConstantValue(child) {
+ return false
+ }
+ }
+ return true
+ }
+ return false
+}
+
+func newNavigableExpr(ast *AST, parent NavigableExpr, expr Expr, depth int) NavigableExpr {
+ // Reduce navigable expression nesting by unwrapping the embedded Expr value.
+ if nav, ok := expr.(*navigableExprImpl); ok {
+ expr = nav.Expr
+ }
+ nav := &navigableExprImpl{
+ Expr: expr,
+ depth: depth,
+ ast: ast,
+ parent: parent,
+ createChildren: getChildFactory(expr),
+ }
+ return nav
+}
+
+type navigableExprImpl struct {
+ Expr
+ depth int
+ ast *AST
+ parent NavigableExpr
+ createChildren childFactory
+}
+
+func (nav *navigableExprImpl) Parent() (NavigableExpr, bool) {
+ if nav.parent != nil {
+ return nav.parent, true
+ }
+ return nil, false
+}
+
+func (nav *navigableExprImpl) ID() int64 {
+ return nav.Expr.ID()
+}
+
+func (nav *navigableExprImpl) Kind() ExprKind {
+ return nav.Expr.Kind()
+}
+
+func (nav *navigableExprImpl) Type() *types.Type {
+ return nav.ast.GetType(nav.ID())
+}
+
+func (nav *navigableExprImpl) Children() []NavigableExpr {
+ return nav.createChildren(nav)
+}
+
+func (nav *navigableExprImpl) Depth() int {
+ return nav.depth
+}
+
+func (nav *navigableExprImpl) AsCall() CallExpr {
+ return navigableCallImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) AsComprehension() ComprehensionExpr {
+ return navigableComprehensionImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) AsIdent() string {
+ return nav.Expr.AsIdent()
+}
+
+func (nav *navigableExprImpl) AsList() ListExpr {
+ return navigableListImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) AsLiteral() ref.Val {
+ return nav.Expr.AsLiteral()
+}
+
+func (nav *navigableExprImpl) AsMap() MapExpr {
+ return navigableMapImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) AsSelect() SelectExpr {
+ return navigableSelectImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) AsStruct() StructExpr {
+ return navigableStructImpl{navigableExprImpl: nav}
+}
+
+func (nav *navigableExprImpl) createChild(e Expr) NavigableExpr {
+ return newNavigableExpr(nav.ast, nav, e, nav.depth+1)
+}
+
+func (nav *navigableExprImpl) isExpr() {}
+
+type navigableCallImpl struct {
+ *navigableExprImpl
+}
+
+func (call navigableCallImpl) FunctionName() string {
+ return call.Expr.AsCall().FunctionName()
+}
+
+func (call navigableCallImpl) IsMemberFunction() bool {
+ return call.Expr.AsCall().IsMemberFunction()
+}
+
+func (call navigableCallImpl) Target() Expr {
+ t := call.Expr.AsCall().Target()
+ if t != nil {
+ return call.createChild(t)
+ }
+ return nil
+}
+
+func (call navigableCallImpl) Args() []Expr {
+ args := call.Expr.AsCall().Args()
+ navArgs := make([]Expr, len(args))
+ for i, a := range args {
+ navArgs[i] = call.createChild(a)
+ }
+ return navArgs
+}
+
+type navigableComprehensionImpl struct {
+ *navigableExprImpl
+}
+
+func (comp navigableComprehensionImpl) IterRange() Expr {
+ return comp.createChild(comp.Expr.AsComprehension().IterRange())
+}
+
+func (comp navigableComprehensionImpl) IterVar() string {
+ return comp.Expr.AsComprehension().IterVar()
+}
+
+func (comp navigableComprehensionImpl) AccuVar() string {
+ return comp.Expr.AsComprehension().AccuVar()
+}
+
+func (comp navigableComprehensionImpl) AccuInit() Expr {
+ return comp.createChild(comp.Expr.AsComprehension().AccuInit())
+}
+
+func (comp navigableComprehensionImpl) LoopCondition() Expr {
+ return comp.createChild(comp.Expr.AsComprehension().LoopCondition())
+}
+
+func (comp navigableComprehensionImpl) LoopStep() Expr {
+ return comp.createChild(comp.Expr.AsComprehension().LoopStep())
+}
+
+func (comp navigableComprehensionImpl) Result() Expr {
+ return comp.createChild(comp.Expr.AsComprehension().Result())
+}
+
+type navigableListImpl struct {
+ *navigableExprImpl
+}
+
+func (l navigableListImpl) Elements() []Expr {
+ pbElems := l.Expr.AsList().Elements()
+ elems := make([]Expr, len(pbElems))
+ for i := 0; i < len(pbElems); i++ {
+ elems[i] = l.createChild(pbElems[i])
+ }
+ return elems
+}
+
+func (l navigableListImpl) IsOptional(index int32) bool {
+ return l.Expr.AsList().IsOptional(index)
+}
+
+func (l navigableListImpl) OptionalIndices() []int32 {
+ return l.Expr.AsList().OptionalIndices()
+}
+
+func (l navigableListImpl) Size() int {
+ return l.Expr.AsList().Size()
+}
+
+type navigableMapImpl struct {
+ *navigableExprImpl
+}
+
+func (m navigableMapImpl) Entries() []EntryExpr {
+ mapExpr := m.Expr.AsMap()
+ entries := make([]EntryExpr, len(mapExpr.Entries()))
+ for i, e := range mapExpr.Entries() {
+ entry := e.AsMapEntry()
+ entries[i] = &entryExpr{
+ id: e.ID(),
+ entryExprKindCase: navigableEntryImpl{
+ key: m.createChild(entry.Key()),
+ val: m.createChild(entry.Value()),
+ isOpt: entry.IsOptional(),
+ },
+ }
+ }
+ return entries
+}
+
+func (m navigableMapImpl) Size() int {
+ return m.Expr.AsMap().Size()
+}
+
+type navigableEntryImpl struct {
+ key NavigableExpr
+ val NavigableExpr
+ isOpt bool
+}
+
+func (e navigableEntryImpl) Kind() EntryExprKind {
+ return MapEntryKind
+}
+
+func (e navigableEntryImpl) Key() Expr {
+ return e.key
+}
+
+func (e navigableEntryImpl) Value() Expr {
+ return e.val
+}
+
+func (e navigableEntryImpl) IsOptional() bool {
+ return e.isOpt
+}
+
+func (e navigableEntryImpl) renumberIDs(IDGenerator) {}
+
+func (e navigableEntryImpl) isEntryExpr() {}
+
+type navigableSelectImpl struct {
+ *navigableExprImpl
+}
+
+func (sel navigableSelectImpl) FieldName() string {
+ return sel.Expr.AsSelect().FieldName()
+}
+
+func (sel navigableSelectImpl) IsTestOnly() bool {
+ return sel.Expr.AsSelect().IsTestOnly()
+}
+
+func (sel navigableSelectImpl) Operand() Expr {
+ return sel.createChild(sel.Expr.AsSelect().Operand())
+}
+
+type navigableStructImpl struct {
+ *navigableExprImpl
+}
+
+func (s navigableStructImpl) TypeName() string {
+ return s.Expr.AsStruct().TypeName()
+}
+
+func (s navigableStructImpl) Fields() []EntryExpr {
+ fieldInits := s.Expr.AsStruct().Fields()
+ fields := make([]EntryExpr, len(fieldInits))
+ for i, f := range fieldInits {
+ field := f.AsStructField()
+ fields[i] = &entryExpr{
+ id: f.ID(),
+ entryExprKindCase: navigableFieldImpl{
+ name: field.Name(),
+ val: s.createChild(field.Value()),
+ isOpt: field.IsOptional(),
+ },
+ }
+ }
+ return fields
+}
+
+type navigableFieldImpl struct {
+ name string
+ val NavigableExpr
+ isOpt bool
+}
+
+func (f navigableFieldImpl) Kind() EntryExprKind {
+ return StructFieldKind
+}
+
+func (f navigableFieldImpl) Name() string {
+ return f.name
+}
+
+func (f navigableFieldImpl) Value() Expr {
+ return f.val
+}
+
+func (f navigableFieldImpl) IsOptional() bool {
+ return f.isOpt
+}
+
+func (f navigableFieldImpl) renumberIDs(IDGenerator) {}
+
+func (f navigableFieldImpl) isEntryExpr() {}
+
+func getChildFactory(expr Expr) childFactory {
+ if expr == nil {
+ return noopFactory
+ }
+ switch expr.Kind() {
+ case LiteralKind:
+ return noopFactory
+ case IdentKind:
+ return noopFactory
+ case SelectKind:
+ return selectFactory
+ case CallKind:
+ return callArgFactory
+ case ListKind:
+ return listElemFactory
+ case MapKind:
+ return mapEntryFactory
+ case StructKind:
+ return structEntryFactory
+ case ComprehensionKind:
+ return comprehensionFactory
+ default:
+ return noopFactory
+ }
+}
+
+type childFactory func(*navigableExprImpl) []NavigableExpr
+
+func noopFactory(*navigableExprImpl) []NavigableExpr {
+ return nil
+}
+
+func selectFactory(nav *navigableExprImpl) []NavigableExpr {
+ return []NavigableExpr{nav.createChild(nav.AsSelect().Operand())}
+}
+
+func callArgFactory(nav *navigableExprImpl) []NavigableExpr {
+ call := nav.Expr.AsCall()
+ argCount := len(call.Args())
+ if call.IsMemberFunction() {
+ argCount++
+ }
+ navExprs := make([]NavigableExpr, argCount)
+ i := 0
+ if call.IsMemberFunction() {
+ navExprs[i] = nav.createChild(call.Target())
+ i++
+ }
+ for _, arg := range call.Args() {
+ navExprs[i] = nav.createChild(arg)
+ i++
+ }
+ return navExprs
+}
+
+func listElemFactory(nav *navigableExprImpl) []NavigableExpr {
+ l := nav.Expr.AsList()
+ navExprs := make([]NavigableExpr, len(l.Elements()))
+ for i, e := range l.Elements() {
+ navExprs[i] = nav.createChild(e)
+ }
+ return navExprs
+}
+
+func structEntryFactory(nav *navigableExprImpl) []NavigableExpr {
+ s := nav.Expr.AsStruct()
+ entries := make([]NavigableExpr, len(s.Fields()))
+ for i, e := range s.Fields() {
+ f := e.AsStructField()
+ entries[i] = nav.createChild(f.Value())
+ }
+ return entries
+}
+
+func mapEntryFactory(nav *navigableExprImpl) []NavigableExpr {
+ m := nav.Expr.AsMap()
+ entries := make([]NavigableExpr, len(m.Entries())*2)
+ j := 0
+ for _, e := range m.Entries() {
+ mapEntry := e.AsMapEntry()
+ entries[j] = nav.createChild(mapEntry.Key())
+ entries[j+1] = nav.createChild(mapEntry.Value())
+ j += 2
+ }
+ return entries
+}
+
+func comprehensionFactory(nav *navigableExprImpl) []NavigableExpr {
+ compre := nav.Expr.AsComprehension()
+ return []NavigableExpr{
+ nav.createChild(compre.IterRange()),
+ nav.createChild(compre.AccuInit()),
+ nav.createChild(compre.LoopCondition()),
+ nav.createChild(compre.LoopStep()),
+ nav.createChild(compre.Result()),
+ }
+}
diff --git a/vendor/github.com/google/cel-go/common/containers/BUILD.bazel b/vendor/github.com/google/cel-go/common/containers/BUILD.bazel
index 3f3f078871..81197f0641 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 d46698d3cd..52153d4cd1 100644
--- a/vendor/github.com/google/cel-go/common/containers/container.go
+++ b/vendor/github.com/google/cel-go/common/containers/container.go
@@ -20,7 +20,7 @@ import (
"fmt"
"strings"
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
)
var (
@@ -297,19 +297,19 @@ func Name(name string) ContainerOption {
// ToQualifiedName converts an expression AST into a qualified name if possible, with a boolean
// 'found' value that indicates if the conversion is successful.
-func ToQualifiedName(e *exprpb.Expr) (string, bool) {
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- id := e.GetIdentExpr()
- return id.GetName(), true
- case *exprpb.Expr_SelectExpr:
- sel := e.GetSelectExpr()
+func ToQualifiedName(e ast.Expr) (string, bool) {
+ switch e.Kind() {
+ case ast.IdentKind:
+ id := e.AsIdent()
+ return id, true
+ case ast.SelectKind:
+ sel := e.AsSelect()
// Test only expressions are not valid as qualified names.
- if sel.GetTestOnly() {
+ if sel.IsTestOnly() {
return "", false
}
- if qual, found := ToQualifiedName(sel.GetOperand()); found {
- return qual + "." + sel.GetField(), true
+ if qual, found := ToQualifiedName(sel.Operand()); found {
+ return qual + "." + sel.FieldName(), true
}
}
return "", false
diff --git a/vendor/github.com/google/cel-go/common/debug/BUILD.bazel b/vendor/github.com/google/cel-go/common/debug/BUILD.bazel
index 1f029839c7..724ed34045 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 5dab156ef3..e4c01ac6ed 100644
--- a/vendor/github.com/google/cel-go/common/debug/debug.go
+++ b/vendor/github.com/google/cel-go/common/debug/debug.go
@@ -22,7 +22,9 @@ import (
"strconv"
"strings"
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
)
// Adorner returns debug metadata that will be tacked on to the string
@@ -38,7 +40,7 @@ type Writer interface {
// Buffer pushes an expression into an internal queue of expressions to
// write to a string.
- Buffer(e *exprpb.Expr)
+ Buffer(e ast.Expr)
}
type emptyDebugAdorner struct {
@@ -51,12 +53,12 @@ func (a *emptyDebugAdorner) GetMetadata(e any) string {
}
// ToDebugString gives the unadorned string representation of the Expr.
-func ToDebugString(e *exprpb.Expr) string {
+func ToDebugString(e ast.Expr) string {
return ToAdornedDebugString(e, emptyAdorner)
}
// ToAdornedDebugString gives the adorned string representation of the Expr.
-func ToAdornedDebugString(e *exprpb.Expr, adorner Adorner) string {
+func ToAdornedDebugString(e ast.Expr, adorner Adorner) string {
w := newDebugWriter(adorner)
w.Buffer(e)
return w.String()
@@ -78,49 +80,51 @@ func newDebugWriter(a Adorner) *debugWriter {
}
}
-func (w *debugWriter) Buffer(e *exprpb.Expr) {
+func (w *debugWriter) Buffer(e ast.Expr) {
if e == nil {
return
}
- switch e.ExprKind.(type) {
- case *exprpb.Expr_ConstExpr:
- w.append(formatLiteral(e.GetConstExpr()))
- case *exprpb.Expr_IdentExpr:
- w.append(e.GetIdentExpr().Name)
- case *exprpb.Expr_SelectExpr:
- w.appendSelect(e.GetSelectExpr())
- case *exprpb.Expr_CallExpr:
- w.appendCall(e.GetCallExpr())
- case *exprpb.Expr_ListExpr:
- w.appendList(e.GetListExpr())
- case *exprpb.Expr_StructExpr:
- w.appendStruct(e.GetStructExpr())
- case *exprpb.Expr_ComprehensionExpr:
- w.appendComprehension(e.GetComprehensionExpr())
+ switch e.Kind() {
+ case ast.LiteralKind:
+ w.append(formatLiteral(e.AsLiteral()))
+ case ast.IdentKind:
+ w.append(e.AsIdent())
+ case ast.SelectKind:
+ w.appendSelect(e.AsSelect())
+ case ast.CallKind:
+ w.appendCall(e.AsCall())
+ case ast.ListKind:
+ w.appendList(e.AsList())
+ case ast.MapKind:
+ w.appendMap(e.AsMap())
+ case ast.StructKind:
+ w.appendStruct(e.AsStruct())
+ case ast.ComprehensionKind:
+ w.appendComprehension(e.AsComprehension())
}
w.adorn(e)
}
-func (w *debugWriter) appendSelect(sel *exprpb.Expr_Select) {
- w.Buffer(sel.GetOperand())
+func (w *debugWriter) appendSelect(sel ast.SelectExpr) {
+ w.Buffer(sel.Operand())
w.append(".")
- w.append(sel.GetField())
- if sel.TestOnly {
+ w.append(sel.FieldName())
+ if sel.IsTestOnly() {
w.append("~test-only~")
}
}
-func (w *debugWriter) appendCall(call *exprpb.Expr_Call) {
- if call.Target != nil {
- w.Buffer(call.GetTarget())
+func (w *debugWriter) appendCall(call ast.CallExpr) {
+ if call.IsMemberFunction() {
+ w.Buffer(call.Target())
w.append(".")
}
- w.append(call.GetFunction())
+ w.append(call.FunctionName())
w.append("(")
- if len(call.GetArgs()) > 0 {
+ if len(call.Args()) > 0 {
w.addIndent()
w.appendLine()
- for i, arg := range call.GetArgs() {
+ for i, arg := range call.Args() {
if i > 0 {
w.append(",")
w.appendLine()
@@ -133,12 +137,12 @@ func (w *debugWriter) appendCall(call *exprpb.Expr_Call) {
w.append(")")
}
-func (w *debugWriter) appendList(list *exprpb.Expr_CreateList) {
+func (w *debugWriter) appendList(list ast.ListExpr) {
w.append("[")
- if len(list.GetElements()) > 0 {
+ if len(list.Elements()) > 0 {
w.appendLine()
w.addIndent()
- for i, elem := range list.GetElements() {
+ for i, elem := range list.Elements() {
if i > 0 {
w.append(",")
w.appendLine()
@@ -151,32 +155,25 @@ func (w *debugWriter) appendList(list *exprpb.Expr_CreateList) {
w.append("]")
}
-func (w *debugWriter) appendStruct(obj *exprpb.Expr_CreateStruct) {
- if obj.MessageName != "" {
- w.appendObject(obj)
- } else {
- w.appendMap(obj)
- }
-}
-
-func (w *debugWriter) appendObject(obj *exprpb.Expr_CreateStruct) {
- w.append(obj.GetMessageName())
+func (w *debugWriter) appendStruct(obj ast.StructExpr) {
+ w.append(obj.TypeName())
w.append("{")
- if len(obj.GetEntries()) > 0 {
+ if len(obj.Fields()) > 0 {
w.appendLine()
w.addIndent()
- for i, entry := range obj.GetEntries() {
+ for i, f := range obj.Fields() {
+ field := f.AsStructField()
if i > 0 {
w.append(",")
w.appendLine()
}
- if entry.GetOptionalEntry() {
+ if field.IsOptional() {
w.append("?")
}
- w.append(entry.GetFieldKey())
+ w.append(field.Name())
w.append(":")
- w.Buffer(entry.GetValue())
- w.adorn(entry)
+ w.Buffer(field.Value())
+ w.adorn(f)
}
w.removeIndent()
w.appendLine()
@@ -184,23 +181,24 @@ func (w *debugWriter) appendObject(obj *exprpb.Expr_CreateStruct) {
w.append("}")
}
-func (w *debugWriter) appendMap(obj *exprpb.Expr_CreateStruct) {
+func (w *debugWriter) appendMap(m ast.MapExpr) {
w.append("{")
- if len(obj.GetEntries()) > 0 {
+ if m.Size() > 0 {
w.appendLine()
w.addIndent()
- for i, entry := range obj.GetEntries() {
+ for i, e := range m.Entries() {
+ entry := e.AsMapEntry()
if i > 0 {
w.append(",")
w.appendLine()
}
- if entry.GetOptionalEntry() {
+ if entry.IsOptional() {
w.append("?")
}
- w.Buffer(entry.GetMapKey())
+ w.Buffer(entry.Key())
w.append(":")
- w.Buffer(entry.GetValue())
- w.adorn(entry)
+ w.Buffer(entry.Value())
+ w.adorn(e)
}
w.removeIndent()
w.appendLine()
@@ -208,62 +206,62 @@ func (w *debugWriter) appendMap(obj *exprpb.Expr_CreateStruct) {
w.append("}")
}
-func (w *debugWriter) appendComprehension(comprehension *exprpb.Expr_Comprehension) {
+func (w *debugWriter) appendComprehension(comprehension ast.ComprehensionExpr) {
w.append("__comprehension__(")
w.addIndent()
w.appendLine()
w.append("// Variable")
w.appendLine()
- w.append(comprehension.GetIterVar())
+ w.append(comprehension.IterVar())
w.append(",")
w.appendLine()
w.append("// Target")
w.appendLine()
- w.Buffer(comprehension.GetIterRange())
+ w.Buffer(comprehension.IterRange())
w.append(",")
w.appendLine()
w.append("// Accumulator")
w.appendLine()
- w.append(comprehension.GetAccuVar())
+ w.append(comprehension.AccuVar())
w.append(",")
w.appendLine()
w.append("// Init")
w.appendLine()
- w.Buffer(comprehension.GetAccuInit())
+ w.Buffer(comprehension.AccuInit())
w.append(",")
w.appendLine()
w.append("// LoopCondition")
w.appendLine()
- w.Buffer(comprehension.GetLoopCondition())
+ w.Buffer(comprehension.LoopCondition())
w.append(",")
w.appendLine()
w.append("// LoopStep")
w.appendLine()
- w.Buffer(comprehension.GetLoopStep())
+ w.Buffer(comprehension.LoopStep())
w.append(",")
w.appendLine()
w.append("// Result")
w.appendLine()
- w.Buffer(comprehension.GetResult())
+ w.Buffer(comprehension.Result())
w.append(")")
w.removeIndent()
}
-func formatLiteral(c *exprpb.Constant) string {
- switch c.GetConstantKind().(type) {
- case *exprpb.Constant_BoolValue:
- return fmt.Sprintf("%t", c.GetBoolValue())
- case *exprpb.Constant_BytesValue:
- return fmt.Sprintf("b\"%s\"", string(c.GetBytesValue()))
- case *exprpb.Constant_DoubleValue:
- return fmt.Sprintf("%v", c.GetDoubleValue())
- case *exprpb.Constant_Int64Value:
- return fmt.Sprintf("%d", c.GetInt64Value())
- case *exprpb.Constant_StringValue:
- return strconv.Quote(c.GetStringValue())
- case *exprpb.Constant_Uint64Value:
- return fmt.Sprintf("%du", c.GetUint64Value())
- case *exprpb.Constant_NullValue:
+func formatLiteral(c ref.Val) string {
+ switch v := c.(type) {
+ case types.Bool:
+ return fmt.Sprintf("%t", v)
+ case types.Bytes:
+ return fmt.Sprintf("b\"%s\"", string(v))
+ case types.Double:
+ return fmt.Sprintf("%v", float64(v))
+ case types.Int:
+ return fmt.Sprintf("%d", int64(v))
+ case types.String:
+ return strconv.Quote(string(v))
+ case types.Uint:
+ return fmt.Sprintf("%du", uint64(v))
+ case types.Null:
return "null"
default:
panic("Unknown constant type")
diff --git a/vendor/github.com/google/cel-go/common/errors.go b/vendor/github.com/google/cel-go/common/errors.go
index 63919714ea..25adc73d8e 100644
--- a/vendor/github.com/google/cel-go/common/errors.go
+++ b/vendor/github.com/google/cel-go/common/errors.go
@@ -64,7 +64,7 @@ func (e *Errors) GetErrors() []*Error {
// Append creates a new Errors object with the current and input errors.
func (e *Errors) Append(errs []*Error) *Errors {
return &Errors{
- errors: append(e.errors, errs...),
+ errors: append(e.errors[:], errs...),
source: e.source,
numErrors: e.numErrors + len(errs),
maxErrorsToReport: e.maxErrorsToReport,
diff --git a/vendor/github.com/google/cel-go/common/types/err.go b/vendor/github.com/google/cel-go/common/types/err.go
index aa8f94b4f8..9c9d9e21ef 100644
--- a/vendor/github.com/google/cel-go/common/types/err.go
+++ b/vendor/github.com/google/cel-go/common/types/err.go
@@ -31,6 +31,7 @@ type Error interface {
// Err type which extends the built-in go error and implements ref.Val.
type Err struct {
error
+ id int64
}
var (
@@ -58,7 +59,24 @@ var (
// NewErr creates a new Err described by the format string and args.
// TODO: Audit the use of this function and standardize the error messages and codes.
func NewErr(format string, args ...any) ref.Val {
- return &Err{fmt.Errorf(format, args...)}
+ return &Err{error: fmt.Errorf(format, args...)}
+}
+
+// NewErrWithNodeID creates a new Err described by the format string and args.
+// TODO: Audit the use of this function and standardize the error messages and codes.
+func NewErrWithNodeID(id int64, format string, args ...any) ref.Val {
+ return &Err{error: fmt.Errorf(format, args...), id: id}
+}
+
+// LabelErrNode returns val unaltered it is not an Err or if the error has a non-zero
+// AST node ID already present. Otherwise the id is added to the error for
+// recovery with the Err.NodeID method.
+func LabelErrNode(id int64, val ref.Val) ref.Val {
+ if err, ok := val.(*Err); ok && err.id == 0 {
+ err.id = id
+ return err
+ }
+ return val
}
// NoSuchOverloadErr returns a new types.Err instance with a no such overload message.
@@ -124,6 +142,11 @@ func (e *Err) Value() any {
return e.error
}
+// NodeID returns the AST node ID of the expression that returned the error.
+func (e *Err) NodeID() int64 {
+ return e.id
+}
+
// Is implements errors.Is.
func (e *Err) Is(target error) bool {
return e.error.Error() == target.Error()
diff --git a/vendor/github.com/google/cel-go/common/types/int.go b/vendor/github.com/google/cel-go/common/types/int.go
index 940772aed1..0ae9507c39 100644
--- a/vendor/github.com/google/cel-go/common/types/int.go
+++ b/vendor/github.com/google/cel-go/common/types/int.go
@@ -90,6 +90,18 @@ func (i Int) ConvertToNative(typeDesc reflect.Type) (any, error) {
return nil, err
}
return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
+ case reflect.Int8:
+ v, err := int64ToInt8Checked(int64(i))
+ if err != nil {
+ return nil, err
+ }
+ return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
+ case reflect.Int16:
+ v, err := int64ToInt16Checked(int64(i))
+ if err != nil {
+ return nil, err
+ }
+ return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
case reflect.Int64:
return reflect.ValueOf(i).Convert(typeDesc).Interface(), nil
case reflect.Ptr:
diff --git a/vendor/github.com/google/cel-go/common/types/list.go b/vendor/github.com/google/cel-go/common/types/list.go
index d4932b4a90..06f48dde75 100644
--- a/vendor/github.com/google/cel-go/common/types/list.go
+++ b/vendor/github.com/google/cel-go/common/types/list.go
@@ -190,7 +190,13 @@ func (l *baseList) ConvertToNative(typeDesc reflect.Type) (any, error) {
// Allow the element ConvertToNative() function to determine whether conversion is possible.
otherElemType := typeDesc.Elem()
elemCount := l.size
- nativeList := reflect.MakeSlice(typeDesc, elemCount, elemCount)
+ var nativeList reflect.Value
+ if typeDesc.Kind() == reflect.Array {
+ nativeList = reflect.New(reflect.ArrayOf(elemCount, typeDesc)).Elem().Index(0)
+ } else {
+ nativeList = reflect.MakeSlice(typeDesc, elemCount, elemCount)
+
+ }
for i := 0; i < elemCount; i++ {
elem := l.NativeToValue(l.get(i))
nativeElemVal, err := elem.ConvertToNative(otherElemType)
diff --git a/vendor/github.com/google/cel-go/common/types/optional.go b/vendor/github.com/google/cel-go/common/types/optional.go
index a9f30aed01..97845a740c 100644
--- a/vendor/github.com/google/cel-go/common/types/optional.go
+++ b/vendor/github.com/google/cel-go/common/types/optional.go
@@ -24,7 +24,7 @@ import (
var (
// OptionalType indicates the runtime type of an optional value.
- OptionalType = NewOpaqueType("optional")
+ OptionalType = NewOpaqueType("optional_type")
// OptionalNone is a sentinel value which is used to indicate an empty optional value.
OptionalNone = &Optional{}
diff --git a/vendor/github.com/google/cel-go/common/types/overflow.go b/vendor/github.com/google/cel-go/common/types/overflow.go
index c68a921826..dcb66ef596 100644
--- a/vendor/github.com/google/cel-go/common/types/overflow.go
+++ b/vendor/github.com/google/cel-go/common/types/overflow.go
@@ -326,6 +326,26 @@ func int64ToUint64Checked(v int64) (uint64, error) {
return uint64(v), nil
}
+// int64ToInt8Checked converts an int64 to an int8 value.
+//
+// If the conversion fails due to overflow the error return value will be non-nil.
+func int64ToInt8Checked(v int64) (int8, error) {
+ if v < math.MinInt8 || v > math.MaxInt8 {
+ return 0, errIntOverflow
+ }
+ return int8(v), nil
+}
+
+// int64ToInt16Checked converts an int64 to an int16 value.
+//
+// If the conversion fails due to overflow the error return value will be non-nil.
+func int64ToInt16Checked(v int64) (int16, error) {
+ if v < math.MinInt16 || v > math.MaxInt16 {
+ return 0, errIntOverflow
+ }
+ return int16(v), nil
+}
+
// int64ToInt32Checked converts an int64 to an int32 value.
//
// If the conversion fails due to overflow the error return value will be non-nil.
@@ -336,6 +356,26 @@ func int64ToInt32Checked(v int64) (int32, error) {
return int32(v), nil
}
+// uint64ToUint8Checked converts a uint64 to a uint8 value.
+//
+// If the conversion fails due to overflow the error return value will be non-nil.
+func uint64ToUint8Checked(v uint64) (uint8, error) {
+ if v > math.MaxUint8 {
+ return 0, errUintOverflow
+ }
+ return uint8(v), nil
+}
+
+// uint64ToUint16Checked converts a uint64 to a uint16 value.
+//
+// If the conversion fails due to overflow the error return value will be non-nil.
+func uint64ToUint16Checked(v uint64) (uint16, error) {
+ if v > math.MaxUint16 {
+ return 0, errUintOverflow
+ }
+ return uint16(v), nil
+}
+
// uint64ToUint32Checked converts a uint64 to a uint32 value.
//
// If the conversion fails due to overflow the error return value will be non-nil.
diff --git a/vendor/github.com/google/cel-go/common/types/provider.go b/vendor/github.com/google/cel-go/common/types/provider.go
index e80b4622e2..c5ff05fdb9 100644
--- a/vendor/github.com/google/cel-go/common/types/provider.go
+++ b/vendor/github.com/google/cel-go/common/types/provider.go
@@ -54,6 +54,10 @@ type Provider interface {
// Returns false if not found.
FindStructType(structType string) (*Type, bool)
+ // FindStructFieldNames returns thet field names associated with the type, if the type
+ // is found.
+ FindStructFieldNames(structType string) ([]string, bool)
+
// FieldStructFieldType returns the field type for a checked type value. Returns
// false if the field could not be found.
FindStructFieldType(structType, fieldName string) (*FieldType, bool)
@@ -154,7 +158,7 @@ func (p *Registry) EnumValue(enumName string) ref.Val {
return Int(enumVal.Value())
}
-// FieldFieldType returns the field type for a checked type value. Returns false if
+// FindFieldType returns the field type for a checked type value. Returns false if
// the field could not be found.
//
// Deprecated: use FindStructFieldType
@@ -173,7 +177,24 @@ func (p *Registry) FindFieldType(structType, fieldName string) (*ref.FieldType,
GetFrom: field.GetFrom}, true
}
-// FieldStructFieldType returns the field type for a checked type value. Returns
+// FindStructFieldNames returns the set of field names for the given struct type,
+// if the type exists in the registry.
+func (p *Registry) FindStructFieldNames(structType string) ([]string, bool) {
+ msgType, found := p.pbdb.DescribeType(structType)
+ if !found {
+ return []string{}, false
+ }
+ fieldMap := msgType.FieldMap()
+ fields := make([]string, len(fieldMap))
+ idx := 0
+ for f := range fieldMap {
+ fields[idx] = f
+ idx++
+ }
+ return fields, true
+}
+
+// FindStructFieldType returns the field type for a checked type value. Returns
// false if the field could not be found.
func (p *Registry) FindStructFieldType(structType, fieldName string) (*FieldType, bool) {
msgType, found := p.pbdb.DescribeType(structType)
@@ -255,7 +276,7 @@ func (p *Registry) NewValue(structType string, fields map[string]ref.Val) ref.Va
}
err := msgSetField(msg, field, value)
if err != nil {
- return &Err{err}
+ return &Err{error: err}
}
}
return p.NativeToValue(msg.Interface())
@@ -569,12 +590,33 @@ func nativeToValue(a Adapter, value any) (ref.Val, bool) {
return NewDynamicMap(a, v), true
// type aliases of primitive types cannot be asserted as that type, but rather need
// to be downcast to int32 before being converted to a CEL representation.
+ case reflect.Bool:
+ boolTupe := reflect.TypeOf(false)
+ return Bool(refValue.Convert(boolTupe).Interface().(bool)), true
+ case reflect.Int:
+ intType := reflect.TypeOf(int(0))
+ return Int(refValue.Convert(intType).Interface().(int)), true
+ case reflect.Int8:
+ intType := reflect.TypeOf(int8(0))
+ return Int(refValue.Convert(intType).Interface().(int8)), true
+ case reflect.Int16:
+ intType := reflect.TypeOf(int16(0))
+ return Int(refValue.Convert(intType).Interface().(int16)), true
case reflect.Int32:
intType := reflect.TypeOf(int32(0))
return Int(refValue.Convert(intType).Interface().(int32)), true
case reflect.Int64:
intType := reflect.TypeOf(int64(0))
return Int(refValue.Convert(intType).Interface().(int64)), true
+ case reflect.Uint:
+ uintType := reflect.TypeOf(uint(0))
+ return Uint(refValue.Convert(uintType).Interface().(uint)), true
+ case reflect.Uint8:
+ uintType := reflect.TypeOf(uint8(0))
+ return Uint(refValue.Convert(uintType).Interface().(uint8)), true
+ case reflect.Uint16:
+ uintType := reflect.TypeOf(uint16(0))
+ return Uint(refValue.Convert(uintType).Interface().(uint16)), true
case reflect.Uint32:
uintType := reflect.TypeOf(uint32(0))
return Uint(refValue.Convert(uintType).Interface().(uint32)), true
@@ -587,6 +629,9 @@ func nativeToValue(a Adapter, value any) (ref.Val, bool) {
case reflect.Float64:
doubleType := reflect.TypeOf(float64(0))
return Double(refValue.Convert(doubleType).Interface().(float64)), true
+ case reflect.String:
+ stringType := reflect.TypeOf("")
+ return String(refValue.Convert(stringType).Interface().(string)), true
}
}
return nil, false
diff --git a/vendor/github.com/google/cel-go/common/types/string.go b/vendor/github.com/google/cel-go/common/types/string.go
index 028e6824d2..3a93743f24 100644
--- a/vendor/github.com/google/cel-go/common/types/string.go
+++ b/vendor/github.com/google/cel-go/common/types/string.go
@@ -66,10 +66,7 @@ func (s String) Compare(other ref.Val) ref.Val {
func (s String) ConvertToNative(typeDesc reflect.Type) (any, error) {
switch typeDesc.Kind() {
case reflect.String:
- if reflect.TypeOf(s).AssignableTo(typeDesc) {
- return s, nil
- }
- return s.Value(), nil
+ return reflect.ValueOf(s).Convert(typeDesc).Interface(), nil
case reflect.Ptr:
switch typeDesc {
case anyValueType:
@@ -158,7 +155,7 @@ func (s String) Match(pattern ref.Val) ref.Val {
}
matched, err := regexp.MatchString(pat.Value().(string), s.Value().(string))
if err != nil {
- return &Err{err}
+ return &Err{error: err}
}
return Bool(matched)
}
diff --git a/vendor/github.com/google/cel-go/common/types/types.go b/vendor/github.com/google/cel-go/common/types/types.go
index 76624eefde..6c3d5f719b 100644
--- a/vendor/github.com/google/cel-go/common/types/types.go
+++ b/vendor/github.com/google/cel-go/common/types/types.go
@@ -373,6 +373,23 @@ func (t *Type) TypeName() string {
return t.runtimeTypeName
}
+// WithTraits creates a copy of the current Type and sets the trait mask to the traits parameter.
+//
+// This method should be used with Opaque types where the type acts like a container, e.g. vector.
+func (t *Type) WithTraits(traits int) *Type {
+ if t == nil {
+ return nil
+ }
+ return &Type{
+ kind: t.kind,
+ parameters: t.parameters,
+ runtimeTypeName: t.runtimeTypeName,
+ isAssignableType: t.isAssignableType,
+ isAssignableRuntimeType: t.isAssignableRuntimeType,
+ traitMask: traits,
+ }
+}
+
// String returns a human-readable definition of the type name.
func (t *Type) String() string {
if len(t.Parameters()) == 0 {
@@ -496,7 +513,7 @@ func NewNullableType(wrapped *Type) *Type {
// NewOptionalType creates an abstract parameterized type instance corresponding to CEL's notion of optional.
func NewOptionalType(param *Type) *Type {
- return NewOpaqueType("optional", param)
+ return NewOpaqueType("optional_type", param)
}
// NewOpaqueType creates an abstract parameterized type with a given name.
diff --git a/vendor/github.com/google/cel-go/common/types/uint.go b/vendor/github.com/google/cel-go/common/types/uint.go
index 3257f9ade9..6d74f30d88 100644
--- a/vendor/github.com/google/cel-go/common/types/uint.go
+++ b/vendor/github.com/google/cel-go/common/types/uint.go
@@ -80,6 +80,18 @@ func (i Uint) ConvertToNative(typeDesc reflect.Type) (any, error) {
return 0, err
}
return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
+ case reflect.Uint8:
+ v, err := uint64ToUint8Checked(uint64(i))
+ if err != nil {
+ return 0, err
+ }
+ return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
+ case reflect.Uint16:
+ v, err := uint64ToUint16Checked(uint64(i))
+ if err != nil {
+ return 0, err
+ }
+ return reflect.ValueOf(v).Convert(typeDesc).Interface(), nil
case reflect.Uint64:
return reflect.ValueOf(i).Convert(typeDesc).Interface(), nil
case reflect.Ptr:
diff --git a/vendor/github.com/google/cel-go/ext/BUILD.bazel b/vendor/github.com/google/cel-go/ext/BUILD.bazel
index 6fdcc60c65..db223da2f7 100644
--- a/vendor/github.com/google/cel-go/ext/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/ext/BUILD.bazel
@@ -7,7 +7,9 @@ package(
go_library(
name = "go_default_library",
srcs = [
+ "bindings.go",
"encoders.go",
+ "formatting.go",
"guards.go",
"lists.go",
"math.go",
@@ -21,14 +23,14 @@ go_library(
deps = [
"//cel:go_default_library",
"//checker:go_default_library",
- "//checker/decls:go_default_library",
+ "//common/ast:go_default_library",
"//common/overloads:go_default_library",
+ "//common/operators:go_default_library",
"//common/types:go_default_library",
"//common/types/pb:go_default_library",
"//common/types/ref:go_default_library",
"//common/types/traits:go_default_library",
"//interpreter:go_default_library",
- "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//types/known/structpb",
@@ -61,7 +63,6 @@ go_test(
"//test:go_default_library",
"//test/proto2pb:go_default_library",
"//test/proto3pb:go_default_library",
- "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//types/known/wrapperspb:go_default_library",
"@org_golang_google_protobuf//encoding/protojson:go_default_library",
diff --git a/vendor/github.com/google/cel-go/ext/README.md b/vendor/github.com/google/cel-go/ext/README.md
index 6f621ac4af..2fac0cb22b 100644
--- a/vendor/github.com/google/cel-go/ext/README.md
+++ b/vendor/github.com/google/cel-go/ext/README.md
@@ -414,3 +414,17 @@ Examples:
'TacoCat'.upperAscii() // returns 'TACOCAT'
'TacoCÆt Xii'.upperAscii() // returns 'TACOCÆT XII'
+
+### Reverse
+
+Returns a new string whose characters are the same as the target string, only formatted in
+reverse order.
+This function relies on converting strings to rune arrays in order to reverse.
+It can be located in Version 3 of strings.
+
+ .reverse() ->
+
+Examples:
+
+ 'gums'.reverse() // returns 'smug'
+ 'John Smith'.reverse() // returns 'htimS nhoJ'
\ No newline at end of file
diff --git a/vendor/github.com/google/cel-go/ext/bindings.go b/vendor/github.com/google/cel-go/ext/bindings.go
index 4ac9a7f07f..2c6cc627fa 100644
--- a/vendor/github.com/google/cel-go/ext/bindings.go
+++ b/vendor/github.com/google/cel-go/ext/bindings.go
@@ -16,8 +16,8 @@ package ext
import (
"github.com/google/cel-go/cel"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
)
// Bindings returns a cel.EnvOption to configure support for local variable
@@ -61,7 +61,7 @@ func (celBindings) CompileOptions() []cel.EnvOption {
return []cel.EnvOption{
cel.Macros(
// cel.bind(var, , )
- cel.NewReceiverMacro(bindMacro, 3, celBind),
+ cel.ReceiverMacro(bindMacro, 3, celBind),
),
}
}
@@ -70,27 +70,27 @@ func (celBindings) ProgramOptions() []cel.ProgramOption {
return []cel.ProgramOption{}
}
-func celBind(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) {
+func celBind(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
if !macroTargetMatchesNamespace(celNamespace, target) {
return nil, nil
}
varIdent := args[0]
varName := ""
- switch varIdent.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- varName = varIdent.GetIdentExpr().GetName()
+ switch varIdent.Kind() {
+ case ast.IdentKind:
+ varName = varIdent.AsIdent()
default:
- return nil, meh.NewError(varIdent.GetId(), "cel.bind() variable names must be simple identifiers")
+ return nil, mef.NewError(varIdent.ID(), "cel.bind() variable names must be simple identifiers")
}
varInit := args[1]
resultExpr := args[2]
- return meh.Fold(
+ return mef.NewComprehension(
+ mef.NewList(),
unusedIterVar,
- meh.NewList(),
varName,
varInit,
- meh.LiteralBool(false),
- meh.Ident(varName),
+ mef.NewLiteral(types.False),
+ mef.NewIdent(varName),
resultExpr,
), nil
}
diff --git a/vendor/github.com/google/cel-go/ext/formatting.go b/vendor/github.com/google/cel-go/ext/formatting.go
new file mode 100644
index 0000000000..2f35b996cb
--- /dev/null
+++ b/vendor/github.com/google/cel-go/ext/formatting.go
@@ -0,0 +1,904 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ext
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "sort"
+ "strconv"
+ "strings"
+ "unicode"
+
+ "golang.org/x/text/language"
+ "golang.org/x/text/message"
+
+ "github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/overloads"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+ "github.com/google/cel-go/common/types/traits"
+)
+
+type clauseImpl func(ref.Val, string) (string, error)
+
+func clauseForType(argType ref.Type) (clauseImpl, error) {
+ switch argType {
+ case types.IntType, types.UintType:
+ return formatDecimal, nil
+ case types.StringType, types.BytesType, types.BoolType, types.NullType, types.TypeType:
+ return FormatString, nil
+ case types.TimestampType, types.DurationType:
+ // special case to ensure timestamps/durations get printed as CEL literals
+ return func(arg ref.Val, locale string) (string, error) {
+ argStrVal := arg.ConvertToType(types.StringType)
+ argStr := argStrVal.Value().(string)
+ if arg.Type() == types.TimestampType {
+ return fmt.Sprintf("timestamp(%q)", argStr), nil
+ }
+ if arg.Type() == types.DurationType {
+ return fmt.Sprintf("duration(%q)", argStr), nil
+ }
+ return "", fmt.Errorf("cannot convert argument of type %s to timestamp/duration", arg.Type().TypeName())
+ }, nil
+ case types.ListType:
+ return formatList, nil
+ case types.MapType:
+ return formatMap, nil
+ case types.DoubleType:
+ // avoid formatFixed so we can output a period as the decimal separator in order
+ // to always be a valid CEL literal
+ return func(arg ref.Val, locale string) (string, error) {
+ argDouble, ok := arg.Value().(float64)
+ if !ok {
+ return "", fmt.Errorf("couldn't convert %s to float64", arg.Type().TypeName())
+ }
+ fmtStr := fmt.Sprintf("%%.%df", defaultPrecision)
+ return fmt.Sprintf(fmtStr, argDouble), nil
+ }, nil
+ case types.TypeType:
+ return func(arg ref.Val, locale string) (string, error) {
+ return fmt.Sprintf("type(%s)", arg.Value().(string)), nil
+ }, nil
+ default:
+ return nil, fmt.Errorf("no formatting function for %s", argType.TypeName())
+ }
+}
+
+func formatList(arg ref.Val, locale string) (string, error) {
+ argList := arg.(traits.Lister)
+ argIterator := argList.Iterator()
+ var listStrBuilder strings.Builder
+ _, err := listStrBuilder.WriteRune('[')
+ if err != nil {
+ return "", fmt.Errorf("error writing to list string: %w", err)
+ }
+ for argIterator.HasNext() == types.True {
+ member := argIterator.Next()
+ memberFormat, err := clauseForType(member.Type())
+ if err != nil {
+ return "", err
+ }
+ unquotedStr, err := memberFormat(member, locale)
+ if err != nil {
+ return "", err
+ }
+ str := quoteForCEL(member, unquotedStr)
+ _, err = listStrBuilder.WriteString(str)
+ if err != nil {
+ return "", fmt.Errorf("error writing to list string: %w", err)
+ }
+ if argIterator.HasNext() == types.True {
+ _, err = listStrBuilder.WriteString(", ")
+ if err != nil {
+ return "", fmt.Errorf("error writing to list string: %w", err)
+ }
+ }
+ }
+ _, err = listStrBuilder.WriteRune(']')
+ if err != nil {
+ return "", fmt.Errorf("error writing to list string: %w", err)
+ }
+ return listStrBuilder.String(), nil
+}
+
+func formatMap(arg ref.Val, locale string) (string, error) {
+ argMap := arg.(traits.Mapper)
+ argIterator := argMap.Iterator()
+ type mapPair struct {
+ key string
+ value string
+ }
+ argPairs := make([]mapPair, argMap.Size().Value().(int64))
+ i := 0
+ for argIterator.HasNext() == types.True {
+ key := argIterator.Next()
+ var keyFormat clauseImpl
+ switch key.Type() {
+ case types.StringType, types.BoolType:
+ keyFormat = FormatString
+ case types.IntType, types.UintType:
+ keyFormat = formatDecimal
+ default:
+ return "", fmt.Errorf("no formatting function for map key of type %s", key.Type().TypeName())
+ }
+ unquotedKeyStr, err := keyFormat(key, locale)
+ if err != nil {
+ return "", err
+ }
+ keyStr := quoteForCEL(key, unquotedKeyStr)
+ value, found := argMap.Find(key)
+ if !found {
+ return "", fmt.Errorf("could not find key: %q", key)
+ }
+ valueFormat, err := clauseForType(value.Type())
+ if err != nil {
+ return "", err
+ }
+ unquotedValueStr, err := valueFormat(value, locale)
+ if err != nil {
+ return "", err
+ }
+ valueStr := quoteForCEL(value, unquotedValueStr)
+ argPairs[i] = mapPair{keyStr, valueStr}
+ i++
+ }
+ sort.SliceStable(argPairs, func(x, y int) bool {
+ return argPairs[x].key < argPairs[y].key
+ })
+ var mapStrBuilder strings.Builder
+ _, err := mapStrBuilder.WriteRune('{')
+ if err != nil {
+ return "", fmt.Errorf("error writing to map string: %w", err)
+ }
+ for i, entry := range argPairs {
+ _, err = mapStrBuilder.WriteString(fmt.Sprintf("%s:%s", entry.key, entry.value))
+ if err != nil {
+ return "", fmt.Errorf("error writing to map string: %w", err)
+ }
+ if i < len(argPairs)-1 {
+ _, err = mapStrBuilder.WriteString(", ")
+ if err != nil {
+ return "", fmt.Errorf("error writing to map string: %w", err)
+ }
+ }
+ }
+ _, err = mapStrBuilder.WriteRune('}')
+ if err != nil {
+ return "", fmt.Errorf("error writing to map string: %w", err)
+ }
+ return mapStrBuilder.String(), nil
+}
+
+// quoteForCEL takes a formatted, unquoted value and quotes it in a manner suitable
+// for embedding directly in CEL.
+func quoteForCEL(refVal ref.Val, unquotedValue string) string {
+ switch refVal.Type() {
+ case types.StringType:
+ return fmt.Sprintf("%q", unquotedValue)
+ case types.BytesType:
+ return fmt.Sprintf("b%q", unquotedValue)
+ case types.DoubleType:
+ // special case to handle infinity/NaN
+ num := refVal.Value().(float64)
+ if math.IsInf(num, 1) || math.IsInf(num, -1) || math.IsNaN(num) {
+ return fmt.Sprintf("%q", unquotedValue)
+ }
+ return unquotedValue
+ default:
+ return unquotedValue
+ }
+}
+
+// FormatString returns the string representation of a CEL value.
+//
+// It is used to implement the %s specifier in the (string).format() extension function.
+func FormatString(arg ref.Val, locale string) (string, error) {
+ switch arg.Type() {
+ case types.ListType:
+ return formatList(arg, locale)
+ case types.MapType:
+ return formatMap(arg, locale)
+ case types.IntType, types.UintType, types.DoubleType,
+ types.BoolType, types.StringType, types.TimestampType, types.BytesType, types.DurationType, types.TypeType:
+ argStrVal := arg.ConvertToType(types.StringType)
+ argStr, ok := argStrVal.Value().(string)
+ if !ok {
+ return "", fmt.Errorf("could not convert argument %q to string", argStrVal)
+ }
+ return argStr, nil
+ case types.NullType:
+ return "null", nil
+ default:
+ return "", stringFormatError(runtimeID, arg.Type().TypeName())
+ }
+}
+
+func formatDecimal(arg ref.Val, locale string) (string, error) {
+ switch arg.Type() {
+ case types.IntType:
+ argInt, ok := arg.ConvertToType(types.IntType).Value().(int64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value())
+ }
+ return fmt.Sprintf("%d", argInt), nil
+ case types.UintType:
+ argInt, ok := arg.ConvertToType(types.UintType).Value().(uint64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value())
+ }
+ return fmt.Sprintf("%d", argInt), nil
+ default:
+ return "", decimalFormatError(runtimeID, arg.Type().TypeName())
+ }
+}
+
+func matchLanguage(locale string) (language.Tag, error) {
+ matcher, err := makeMatcher(locale)
+ if err != nil {
+ return language.Und, err
+ }
+ tag, _ := language.MatchStrings(matcher, locale)
+ return tag, nil
+}
+
+func makeMatcher(locale string) (language.Matcher, error) {
+ tags := make([]language.Tag, 0)
+ tag, err := language.Parse(locale)
+ if err != nil {
+ return nil, err
+ }
+ tags = append(tags, tag)
+ return language.NewMatcher(tags), nil
+}
+
+type stringFormatter struct{}
+
+func (c *stringFormatter) String(arg ref.Val, locale string) (string, error) {
+ return FormatString(arg, locale)
+}
+
+func (c *stringFormatter) Decimal(arg ref.Val, locale string) (string, error) {
+ return formatDecimal(arg, locale)
+}
+
+func (c *stringFormatter) Fixed(precision *int) func(ref.Val, string) (string, error) {
+ if precision == nil {
+ precision = new(int)
+ *precision = defaultPrecision
+ }
+ return func(arg ref.Val, locale string) (string, error) {
+ strException := false
+ if arg.Type() == types.StringType {
+ argStr := arg.Value().(string)
+ if argStr == "NaN" || argStr == "Infinity" || argStr == "-Infinity" {
+ strException = true
+ }
+ }
+ if arg.Type() != types.DoubleType && !strException {
+ return "", fixedPointFormatError(runtimeID, arg.Type().TypeName())
+ }
+ argFloatVal := arg.ConvertToType(types.DoubleType)
+ argFloat, ok := argFloatVal.Value().(float64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%s\" to float64", argFloatVal.Value())
+ }
+ fmtStr := fmt.Sprintf("%%.%df", *precision)
+
+ matchedLocale, err := matchLanguage(locale)
+ if err != nil {
+ return "", fmt.Errorf("error matching locale: %w", err)
+ }
+ return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil
+ }
+}
+
+func (c *stringFormatter) Scientific(precision *int) func(ref.Val, string) (string, error) {
+ if precision == nil {
+ precision = new(int)
+ *precision = defaultPrecision
+ }
+ return func(arg ref.Val, locale string) (string, error) {
+ strException := false
+ if arg.Type() == types.StringType {
+ argStr := arg.Value().(string)
+ if argStr == "NaN" || argStr == "Infinity" || argStr == "-Infinity" {
+ strException = true
+ }
+ }
+ if arg.Type() != types.DoubleType && !strException {
+ return "", scientificFormatError(runtimeID, arg.Type().TypeName())
+ }
+ argFloatVal := arg.ConvertToType(types.DoubleType)
+ argFloat, ok := argFloatVal.Value().(float64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%v\" to float64", argFloatVal.Value())
+ }
+ matchedLocale, err := matchLanguage(locale)
+ if err != nil {
+ return "", fmt.Errorf("error matching locale: %w", err)
+ }
+ fmtStr := fmt.Sprintf("%%%de", *precision)
+ return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil
+ }
+}
+
+func (c *stringFormatter) Binary(arg ref.Val, locale string) (string, error) {
+ switch arg.Type() {
+ case types.IntType:
+ argInt := arg.Value().(int64)
+ // locale is intentionally unused as integers formatted as binary
+ // strings are locale-independent
+ return fmt.Sprintf("%b", argInt), nil
+ case types.UintType:
+ argInt := arg.Value().(uint64)
+ return fmt.Sprintf("%b", argInt), nil
+ case types.BoolType:
+ argBool := arg.Value().(bool)
+ if argBool {
+ return "1", nil
+ }
+ return "0", nil
+ default:
+ return "", binaryFormatError(runtimeID, arg.Type().TypeName())
+ }
+}
+
+func (c *stringFormatter) Hex(useUpper bool) func(ref.Val, string) (string, error) {
+ return func(arg ref.Val, locale string) (string, error) {
+ fmtStr := "%x"
+ if useUpper {
+ fmtStr = "%X"
+ }
+ switch arg.Type() {
+ case types.StringType, types.BytesType:
+ if arg.Type() == types.BytesType {
+ return fmt.Sprintf(fmtStr, arg.Value().([]byte)), nil
+ }
+ return fmt.Sprintf(fmtStr, arg.Value().(string)), nil
+ case types.IntType:
+ argInt, ok := arg.Value().(int64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value())
+ }
+ return fmt.Sprintf(fmtStr, argInt), nil
+ case types.UintType:
+ argInt, ok := arg.Value().(uint64)
+ if !ok {
+ return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value())
+ }
+ return fmt.Sprintf(fmtStr, argInt), nil
+ default:
+ return "", hexFormatError(runtimeID, arg.Type().TypeName())
+ }
+ }
+}
+
+func (c *stringFormatter) Octal(arg ref.Val, locale string) (string, error) {
+ switch arg.Type() {
+ case types.IntType:
+ argInt := arg.Value().(int64)
+ return fmt.Sprintf("%o", argInt), nil
+ case types.UintType:
+ argInt := arg.Value().(uint64)
+ return fmt.Sprintf("%o", argInt), nil
+ default:
+ return "", octalFormatError(runtimeID, arg.Type().TypeName())
+ }
+}
+
+// stringFormatValidator implements the cel.ASTValidator interface allowing for static validation
+// of string.format calls.
+type stringFormatValidator struct{}
+
+// Name returns the name of the validator.
+func (stringFormatValidator) Name() string {
+ return "cel.lib.ext.validate.functions.string.format"
+}
+
+// Configure implements the ASTValidatorConfigurer interface and augments the list of functions to skip
+// during homogeneous aggregate literal type-checks.
+func (stringFormatValidator) Configure(config cel.MutableValidatorConfig) error {
+ functions := config.GetOrDefault(cel.HomogeneousAggregateLiteralExemptFunctions, []string{}).([]string)
+ functions = append(functions, "format")
+ return config.Set(cel.HomogeneousAggregateLiteralExemptFunctions, functions)
+}
+
+// Validate parses all literal format strings and type checks the format clause against the argument
+// at the corresponding ordinal within the list literal argument to the function, if one is specified.
+func (stringFormatValidator) Validate(env *cel.Env, _ cel.ValidatorConfig, a *ast.AST, iss *cel.Issues) {
+ root := ast.NavigateAST(a)
+ formatCallExprs := ast.MatchDescendants(root, matchConstantFormatStringWithListLiteralArgs(a))
+ for _, e := range formatCallExprs {
+ call := e.AsCall()
+ formatStr := call.Target().AsLiteral().Value().(string)
+ args := call.Args()[0].AsList().Elements()
+ formatCheck := &stringFormatChecker{
+ args: args,
+ ast: a,
+ }
+ // use a placeholder locale, since locale doesn't affect syntax
+ _, err := parseFormatString(formatStr, formatCheck, formatCheck, "en_US")
+ if err != nil {
+ iss.ReportErrorAtID(getErrorExprID(e.ID(), err), err.Error())
+ continue
+ }
+ seenArgs := formatCheck.argsRequested
+ if len(args) > seenArgs {
+ iss.ReportErrorAtID(e.ID(),
+ "too many arguments supplied to string.format (expected %d, got %d)", seenArgs, len(args))
+ }
+ }
+}
+
+// getErrorExprID determines which list literal argument triggered a type-disagreement for the
+// purposes of more accurate error message reports.
+func getErrorExprID(id int64, err error) int64 {
+ fmtErr, ok := err.(formatError)
+ if ok {
+ return fmtErr.id
+ }
+ wrapped := errors.Unwrap(err)
+ if wrapped != nil {
+ return getErrorExprID(id, wrapped)
+ }
+ return id
+}
+
+// matchConstantFormatStringWithListLiteralArgs matches all valid expression nodes for string
+// format checking.
+func matchConstantFormatStringWithListLiteralArgs(a *ast.AST) ast.ExprMatcher {
+ return func(e ast.NavigableExpr) bool {
+ if e.Kind() != ast.CallKind {
+ return false
+ }
+ call := e.AsCall()
+ if !call.IsMemberFunction() || call.FunctionName() != "format" {
+ return false
+ }
+ overloadIDs := a.GetOverloadIDs(e.ID())
+ if len(overloadIDs) != 0 {
+ found := false
+ for _, overload := range overloadIDs {
+ if overload == overloads.ExtFormatString {
+ found = true
+ break
+ }
+ }
+ if !found {
+ return false
+ }
+ }
+ formatString := call.Target()
+ if formatString.Kind() != ast.LiteralKind && formatString.AsLiteral().Type() != cel.StringType {
+ return false
+ }
+ args := call.Args()
+ if len(args) != 1 {
+ return false
+ }
+ formatArgs := args[0]
+ return formatArgs.Kind() == ast.ListKind
+ }
+}
+
+// stringFormatChecker implements the formatStringInterpolater interface
+type stringFormatChecker struct {
+ args []ast.Expr
+ argsRequested int
+ currArgIndex int64
+ ast *ast.AST
+}
+
+func (c *stringFormatChecker) String(arg ref.Val, locale string) (string, error) {
+ formatArg := c.args[c.currArgIndex]
+ valid, badID := c.verifyString(formatArg)
+ if !valid {
+ return "", stringFormatError(badID, c.typeOf(badID).TypeName())
+ }
+ return "", nil
+}
+
+func (c *stringFormatChecker) Decimal(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType)
+ if !valid {
+ return "", decimalFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+}
+
+func (c *stringFormatChecker) Fixed(precision *int) func(ref.Val, string) (string, error) {
+ return func(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ // we allow StringType since "NaN", "Infinity", and "-Infinity" are also valid values
+ valid := c.verifyTypeOneOf(id, types.DoubleType, types.StringType)
+ if !valid {
+ return "", fixedPointFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+ }
+}
+
+func (c *stringFormatChecker) Scientific(precision *int) func(ref.Val, string) (string, error) {
+ return func(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.DoubleType, types.StringType)
+ if !valid {
+ return "", scientificFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+ }
+}
+
+func (c *stringFormatChecker) Binary(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.BoolType)
+ if !valid {
+ return "", binaryFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+}
+
+func (c *stringFormatChecker) Hex(useUpper bool) func(ref.Val, string) (string, error) {
+ return func(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.StringType, types.BytesType)
+ if !valid {
+ return "", hexFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+ }
+}
+
+func (c *stringFormatChecker) Octal(arg ref.Val, locale string) (string, error) {
+ id := c.args[c.currArgIndex].ID()
+ valid := c.verifyTypeOneOf(id, types.IntType, types.UintType)
+ if !valid {
+ return "", octalFormatError(id, c.typeOf(id).TypeName())
+ }
+ return "", nil
+}
+
+func (c *stringFormatChecker) Arg(index int64) (ref.Val, error) {
+ c.argsRequested++
+ c.currArgIndex = index
+ // return a dummy value - this is immediately passed to back to us
+ // through one of the FormatCallback functions, so anything will do
+ return types.Int(0), nil
+}
+
+func (c *stringFormatChecker) Size() int64 {
+ return int64(len(c.args))
+}
+
+func (c *stringFormatChecker) typeOf(id int64) *cel.Type {
+ return c.ast.GetType(id)
+}
+
+func (c *stringFormatChecker) verifyTypeOneOf(id int64, validTypes ...*cel.Type) bool {
+ t := c.typeOf(id)
+ if t == cel.DynType {
+ return true
+ }
+ for _, vt := range validTypes {
+ // Only check runtime type compatibility without delving deeper into parameterized types
+ if t.Kind() == vt.Kind() {
+ return true
+ }
+ }
+ return false
+}
+
+func (c *stringFormatChecker) verifyString(sub ast.Expr) (bool, int64) {
+ paramA := cel.TypeParamType("A")
+ paramB := cel.TypeParamType("B")
+ subVerified := c.verifyTypeOneOf(sub.ID(),
+ cel.ListType(paramA), cel.MapType(paramA, paramB),
+ cel.IntType, cel.UintType, cel.DoubleType, cel.BoolType, cel.StringType,
+ cel.TimestampType, cel.BytesType, cel.DurationType, cel.TypeType, cel.NullType)
+ if !subVerified {
+ return false, sub.ID()
+ }
+ switch sub.Kind() {
+ case ast.ListKind:
+ for _, e := range sub.AsList().Elements() {
+ // recursively verify if we're dealing with a list/map
+ verified, id := c.verifyString(e)
+ if !verified {
+ return false, id
+ }
+ }
+ return true, sub.ID()
+ case ast.MapKind:
+ for _, e := range sub.AsMap().Entries() {
+ // recursively verify if we're dealing with a list/map
+ entry := e.AsMapEntry()
+ verified, id := c.verifyString(entry.Key())
+ if !verified {
+ return false, id
+ }
+ verified, id = c.verifyString(entry.Value())
+ if !verified {
+ return false, id
+ }
+ }
+ return true, sub.ID()
+ default:
+ return true, sub.ID()
+ }
+}
+
+// helper routines for reporting common errors during string formatting static validation and
+// runtime execution.
+
+func binaryFormatError(id int64, badType string) error {
+ return newFormatError(id, "only integers and bools can be formatted as binary, was given %s", badType)
+}
+
+func decimalFormatError(id int64, badType string) error {
+ return newFormatError(id, "decimal clause can only be used on integers, was given %s", badType)
+}
+
+func fixedPointFormatError(id int64, badType string) error {
+ return newFormatError(id, "fixed-point clause can only be used on doubles, was given %s", badType)
+}
+
+func hexFormatError(id int64, badType string) error {
+ return newFormatError(id, "only integers, byte buffers, and strings can be formatted as hex, was given %s", badType)
+}
+
+func octalFormatError(id int64, badType string) error {
+ return newFormatError(id, "octal clause can only be used on integers, was given %s", badType)
+}
+
+func scientificFormatError(id int64, badType string) error {
+ return newFormatError(id, "scientific clause can only be used on doubles, was given %s", badType)
+}
+
+func stringFormatError(id int64, badType string) error {
+ return newFormatError(id, "string clause can only be used on strings, bools, bytes, ints, doubles, maps, lists, types, durations, and timestamps, was given %s", badType)
+}
+
+type formatError struct {
+ id int64
+ msg string
+}
+
+func newFormatError(id int64, msg string, args ...any) error {
+ return formatError{
+ id: id,
+ msg: fmt.Sprintf(msg, args...),
+ }
+}
+
+func (e formatError) Error() string {
+ return e.msg
+}
+
+func (e formatError) Is(target error) bool {
+ return e.msg == target.Error()
+}
+
+// stringArgList implements the formatListArgs interface.
+type stringArgList struct {
+ args traits.Lister
+}
+
+func (c *stringArgList) Arg(index int64) (ref.Val, error) {
+ if index >= c.args.Size().Value().(int64) {
+ return nil, fmt.Errorf("index %d out of range", index)
+ }
+ return c.args.Get(types.Int(index)), nil
+}
+
+func (c *stringArgList) Size() int64 {
+ return c.args.Size().Value().(int64)
+}
+
+// formatStringInterpolator is an interface that allows user-defined behavior
+// for formatting clause implementations, as well as argument retrieval.
+// Each function is expected to support the appropriate types as laid out in
+// the string.format documentation, and to return an error if given an inappropriate type.
+type formatStringInterpolator interface {
+ // String takes a ref.Val and a string representing the current locale identifier
+ // and returns the Val formatted as a string, or an error if one occurred.
+ String(ref.Val, string) (string, error)
+
+ // Decimal takes a ref.Val and a string representing the current locale identifier
+ // and returns the Val formatted as a decimal integer, or an error if one occurred.
+ Decimal(ref.Val, string) (string, error)
+
+ // Fixed takes an int pointer representing precision (or nil if none was given) and
+ // returns a function operating in a similar manner to String and Decimal, taking a
+ // ref.Val and locale and returning the appropriate string. A closure is returned
+ // so precision can be set without needing an additional function call/configuration.
+ Fixed(*int) func(ref.Val, string) (string, error)
+
+ // Scientific functions identically to Fixed, except the string returned from the closure
+ // is expected to be in scientific notation.
+ Scientific(*int) func(ref.Val, string) (string, error)
+
+ // Binary takes a ref.Val and a string representing the current locale identifier
+ // and returns the Val formatted as a binary integer, or an error if one occurred.
+ Binary(ref.Val, string) (string, error)
+
+ // Hex takes a boolean that, if true, indicates the hex string output by the returned
+ // closure should use uppercase letters for A-F.
+ Hex(bool) func(ref.Val, string) (string, error)
+
+ // Octal takes a ref.Val and a string representing the current locale identifier and
+ // returns the Val formatted in octal, or an error if one occurred.
+ Octal(ref.Val, string) (string, error)
+}
+
+// formatListArgs is an interface that allows user-defined list-like datatypes to be used
+// for formatting clause implementations.
+type formatListArgs interface {
+ // Arg returns the ref.Val at the given index, or an error if one occurred.
+ Arg(int64) (ref.Val, error)
+
+ // Size returns the length of the argument list.
+ Size() int64
+}
+
+// parseFormatString formats a string according to the string.format syntax, taking the clause implementations
+// from the provided FormatCallback and the args from the given FormatList.
+func parseFormatString(formatStr string, callback formatStringInterpolator, list formatListArgs, locale string) (string, error) {
+ i := 0
+ argIndex := 0
+ var builtStr strings.Builder
+ for i < len(formatStr) {
+ if formatStr[i] == '%' {
+ if i+1 < len(formatStr) && formatStr[i+1] == '%' {
+ err := builtStr.WriteByte('%')
+ if err != nil {
+ return "", fmt.Errorf("error writing format string: %w", err)
+ }
+ i += 2
+ continue
+ } else {
+ argAny, err := list.Arg(int64(argIndex))
+ if err != nil {
+ return "", err
+ }
+ if i+1 >= len(formatStr) {
+ return "", errors.New("unexpected end of string")
+ }
+ if int64(argIndex) >= list.Size() {
+ return "", fmt.Errorf("index %d out of range", argIndex)
+ }
+ numRead, val, refErr := parseAndFormatClause(formatStr[i:], argAny, callback, list, locale)
+ if refErr != nil {
+ return "", refErr
+ }
+ _, err = builtStr.WriteString(val)
+ if err != nil {
+ return "", fmt.Errorf("error writing format string: %w", err)
+ }
+ i += numRead
+ argIndex++
+ }
+ } else {
+ err := builtStr.WriteByte(formatStr[i])
+ if err != nil {
+ return "", fmt.Errorf("error writing format string: %w", err)
+ }
+ i++
+ }
+ }
+ return builtStr.String(), nil
+}
+
+// parseAndFormatClause parses the format clause at the start of the given string with val, and returns
+// how many characters were consumed and the substituted string form of val, or an error if one occurred.
+func parseAndFormatClause(formatStr string, val ref.Val, callback formatStringInterpolator, list formatListArgs, locale string) (int, string, error) {
+ i := 1
+ read, formatter, err := parseFormattingClause(formatStr[i:], callback)
+ i += read
+ if err != nil {
+ return -1, "", newParseFormatError("could not parse formatting clause", err)
+ }
+
+ valStr, err := formatter(val, locale)
+ if err != nil {
+ return -1, "", newParseFormatError("error during formatting", err)
+ }
+ return i, valStr, nil
+}
+
+func parseFormattingClause(formatStr string, callback formatStringInterpolator) (int, clauseImpl, error) {
+ i := 0
+ read, precision, err := parsePrecision(formatStr[i:])
+ i += read
+ if err != nil {
+ return -1, nil, fmt.Errorf("error while parsing precision: %w", err)
+ }
+ r := rune(formatStr[i])
+ i++
+ switch r {
+ case 's':
+ return i, callback.String, nil
+ case 'd':
+ return i, callback.Decimal, nil
+ case 'f':
+ return i, callback.Fixed(precision), nil
+ case 'e':
+ return i, callback.Scientific(precision), nil
+ case 'b':
+ return i, callback.Binary, nil
+ case 'x', 'X':
+ return i, callback.Hex(unicode.IsUpper(r)), nil
+ case 'o':
+ return i, callback.Octal, nil
+ default:
+ return -1, nil, fmt.Errorf("unrecognized formatting clause \"%c\"", r)
+ }
+}
+
+func parsePrecision(formatStr string) (int, *int, error) {
+ i := 0
+ if formatStr[i] != '.' {
+ return i, nil, nil
+ }
+ i++
+ var buffer strings.Builder
+ for {
+ if i >= len(formatStr) {
+ return -1, nil, errors.New("could not find end of precision specifier")
+ }
+ if !isASCIIDigit(rune(formatStr[i])) {
+ break
+ }
+ buffer.WriteByte(formatStr[i])
+ i++
+ }
+ precision, err := strconv.Atoi(buffer.String())
+ if err != nil {
+ return -1, nil, fmt.Errorf("error while converting precision to integer: %w", err)
+ }
+ return i, &precision, nil
+}
+
+func isASCIIDigit(r rune) bool {
+ return r <= unicode.MaxASCII && unicode.IsDigit(r)
+}
+
+type parseFormatError struct {
+ msg string
+ wrapped error
+}
+
+func newParseFormatError(msg string, wrapped error) error {
+ return parseFormatError{msg: msg, wrapped: wrapped}
+}
+
+func (e parseFormatError) Error() string {
+ return fmt.Sprintf("%s: %s", e.msg, e.wrapped.Error())
+}
+
+func (e parseFormatError) Is(target error) bool {
+ return e.Error() == target.Error()
+}
+
+func (e parseFormatError) Unwrap() error {
+ return e.wrapped
+}
+
+const (
+ runtimeID = int64(-1)
+)
diff --git a/vendor/github.com/google/cel-go/ext/guards.go b/vendor/github.com/google/cel-go/ext/guards.go
index 785c8675bb..2c00bfe3a8 100644
--- a/vendor/github.com/google/cel-go/ext/guards.go
+++ b/vendor/github.com/google/cel-go/ext/guards.go
@@ -15,10 +15,9 @@
package ext
import (
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// function invocation guards for common call signatures within extension functions.
@@ -51,10 +50,10 @@ func listStringOrError(strs []string, err error) ref.Val {
return types.DefaultTypeAdapter.NativeToValue(strs)
}
-func macroTargetMatchesNamespace(ns string, target *exprpb.Expr) bool {
- switch target.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- if target.GetIdentExpr().GetName() != ns {
+func macroTargetMatchesNamespace(ns string, target ast.Expr) bool {
+ switch target.Kind() {
+ case ast.IdentKind:
+ if target.AsIdent() != ns {
return false
}
return true
diff --git a/vendor/github.com/google/cel-go/ext/math.go b/vendor/github.com/google/cel-go/ext/math.go
index 0b9a361031..65d7e2eb07 100644
--- a/vendor/github.com/google/cel-go/ext/math.go
+++ b/vendor/github.com/google/cel-go/ext/math.go
@@ -19,11 +19,10 @@ import (
"strings"
"github.com/google/cel-go/cel"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// Math returns a cel.EnvOption to configure namespaced math helper macros and
@@ -111,9 +110,9 @@ func (mathLib) CompileOptions() []cel.EnvOption {
return []cel.EnvOption{
cel.Macros(
// math.least(num, ...)
- cel.NewReceiverVarArgMacro(leastMacro, mathLeast),
+ cel.ReceiverVarArgMacro(leastMacro, mathLeast),
// math.greatest(num, ...)
- cel.NewReceiverVarArgMacro(greatestMacro, mathGreatest),
+ cel.ReceiverVarArgMacro(greatestMacro, mathGreatest),
),
cel.Function(minFunc,
cel.Overload("math_@min_double", []*cel.Type{cel.DoubleType}, cel.DoubleType,
@@ -187,57 +186,57 @@ func (mathLib) ProgramOptions() []cel.ProgramOption {
return []cel.ProgramOption{}
}
-func mathLeast(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) {
+func mathLeast(meh cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
if !macroTargetMatchesNamespace(mathNamespace, target) {
return nil, nil
}
switch len(args) {
case 0:
- return nil, meh.NewError(target.GetId(), "math.least() requires at least one argument")
+ return nil, meh.NewError(target.ID(), "math.least() requires at least one argument")
case 1:
if isListLiteralWithValidArgs(args[0]) || isValidArgType(args[0]) {
- return meh.GlobalCall(minFunc, args[0]), nil
+ return meh.NewCall(minFunc, args[0]), nil
}
- return nil, meh.NewError(args[0].GetId(), "math.least() invalid single argument value")
+ return nil, meh.NewError(args[0].ID(), "math.least() invalid single argument value")
case 2:
err := checkInvalidArgs(meh, "math.least()", args)
if err != nil {
return nil, err
}
- return meh.GlobalCall(minFunc, args...), nil
+ return meh.NewCall(minFunc, args...), nil
default:
err := checkInvalidArgs(meh, "math.least()", args)
if err != nil {
return nil, err
}
- return meh.GlobalCall(minFunc, meh.NewList(args...)), nil
+ return meh.NewCall(minFunc, meh.NewList(args...)), nil
}
}
-func mathGreatest(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) {
+func mathGreatest(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
if !macroTargetMatchesNamespace(mathNamespace, target) {
return nil, nil
}
switch len(args) {
case 0:
- return nil, meh.NewError(target.GetId(), "math.greatest() requires at least one argument")
+ return nil, mef.NewError(target.ID(), "math.greatest() requires at least one argument")
case 1:
if isListLiteralWithValidArgs(args[0]) || isValidArgType(args[0]) {
- return meh.GlobalCall(maxFunc, args[0]), nil
+ return mef.NewCall(maxFunc, args[0]), nil
}
- return nil, meh.NewError(args[0].GetId(), "math.greatest() invalid single argument value")
+ return nil, mef.NewError(args[0].ID(), "math.greatest() invalid single argument value")
case 2:
- err := checkInvalidArgs(meh, "math.greatest()", args)
+ err := checkInvalidArgs(mef, "math.greatest()", args)
if err != nil {
return nil, err
}
- return meh.GlobalCall(maxFunc, args...), nil
+ return mef.NewCall(maxFunc, args...), nil
default:
- err := checkInvalidArgs(meh, "math.greatest()", args)
+ err := checkInvalidArgs(mef, "math.greatest()", args)
if err != nil {
return nil, err
}
- return meh.GlobalCall(maxFunc, meh.NewList(args...)), nil
+ return mef.NewCall(maxFunc, mef.NewList(args...)), nil
}
}
@@ -311,48 +310,48 @@ func maxList(numList ref.Val) ref.Val {
}
}
-func checkInvalidArgs(meh cel.MacroExprHelper, funcName string, args []*exprpb.Expr) *cel.Error {
+func checkInvalidArgs(meh cel.MacroExprFactory, funcName string, args []ast.Expr) *cel.Error {
for _, arg := range args {
err := checkInvalidArgLiteral(funcName, arg)
if err != nil {
- return meh.NewError(arg.GetId(), err.Error())
+ return meh.NewError(arg.ID(), err.Error())
}
}
return nil
}
-func checkInvalidArgLiteral(funcName string, arg *exprpb.Expr) error {
+func checkInvalidArgLiteral(funcName string, arg ast.Expr) error {
if !isValidArgType(arg) {
return fmt.Errorf("%s simple literal arguments must be numeric", funcName)
}
return nil
}
-func isValidArgType(arg *exprpb.Expr) bool {
- switch arg.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- c := arg.GetConstExpr()
- switch c.GetConstantKind().(type) {
- case *exprpb.Constant_DoubleValue, *exprpb.Constant_Int64Value, *exprpb.Constant_Uint64Value:
+func isValidArgType(arg ast.Expr) bool {
+ switch arg.Kind() {
+ case ast.LiteralKind:
+ c := ref.Val(arg.AsLiteral())
+ switch c.(type) {
+ case types.Double, types.Int, types.Uint:
return true
default:
return false
}
- case *exprpb.Expr_ListExpr, *exprpb.Expr_StructExpr:
+ case ast.ListKind, ast.MapKind, ast.StructKind:
return false
default:
return true
}
}
-func isListLiteralWithValidArgs(arg *exprpb.Expr) bool {
- switch arg.GetExprKind().(type) {
- case *exprpb.Expr_ListExpr:
- list := arg.GetListExpr()
- if len(list.GetElements()) == 0 {
+func isListLiteralWithValidArgs(arg ast.Expr) bool {
+ switch arg.Kind() {
+ case ast.ListKind:
+ list := arg.AsList()
+ if list.Size() == 0 {
return false
}
- for _, e := range list.GetElements() {
+ for _, e := range list.Elements() {
if !isValidArgType(e) {
return false
}
diff --git a/vendor/github.com/google/cel-go/ext/native.go b/vendor/github.com/google/cel-go/ext/native.go
index 0b5fc38ca9..d1b7877758 100644
--- a/vendor/github.com/google/cel-go/ext/native.go
+++ b/vendor/github.com/google/cel-go/ext/native.go
@@ -96,17 +96,21 @@ func newNativeTypeProvider(adapter types.Adapter, provider types.Provider, refTy
for _, refType := range refTypes {
switch rt := refType.(type) {
case reflect.Type:
- t, err := newNativeType(rt)
+ result, err := newNativeTypes(rt)
if err != nil {
return nil, err
}
- nativeTypes[t.TypeName()] = t
+ for idx := range result {
+ nativeTypes[result[idx].TypeName()] = result[idx]
+ }
case reflect.Value:
- t, err := newNativeType(rt.Type())
+ result, err := newNativeTypes(rt.Type())
if err != nil {
return nil, err
}
- nativeTypes[t.TypeName()] = t
+ for idx := range result {
+ nativeTypes[result[idx].TypeName()] = result[idx]
+ }
default:
return nil, fmt.Errorf("unsupported native type: %v (%T) must be reflect.Type or reflect.Value", rt, rt)
}
@@ -151,6 +155,24 @@ func (tp *nativeTypeProvider) FindStructType(typeName string) (*types.Type, bool
return tp.baseProvider.FindStructType(typeName)
}
+// FindStructFieldNames looks up the type definition first from the native types, then from
+// the backing provider type set. If found, a set of field names corresponding to the type
+// will be returned.
+func (tp *nativeTypeProvider) FindStructFieldNames(typeName string) ([]string, bool) {
+ if t, found := tp.nativeTypes[typeName]; found {
+ fieldCount := t.refType.NumField()
+ fields := make([]string, fieldCount)
+ for i := 0; i < fieldCount; i++ {
+ fields[i] = t.refType.Field(i).Name
+ }
+ return fields, true
+ }
+ if celTypeFields, found := tp.baseProvider.FindStructFieldNames(typeName); found {
+ return celTypeFields, true
+ }
+ return tp.baseProvider.FindStructFieldNames(typeName)
+}
+
// FindStructFieldType looks up a native type's field definition, and if the type name is not a native
// type then proxies to the composed types.Provider
func (tp *nativeTypeProvider) FindStructFieldType(typeName, fieldName string) (*types.FieldType, bool) {
@@ -447,6 +469,42 @@ func (o *nativeObj) Value() any {
return o.val
}
+func newNativeTypes(rawType reflect.Type) ([]*nativeType, error) {
+ nt, err := newNativeType(rawType)
+ if err != nil {
+ return nil, err
+ }
+ result := []*nativeType{nt}
+
+ alreadySeen := make(map[string]struct{})
+ var iterateStructMembers func(reflect.Type)
+ iterateStructMembers = func(t reflect.Type) {
+ if k := t.Kind(); k == reflect.Pointer || k == reflect.Slice || k == reflect.Array || k == reflect.Map {
+ t = t.Elem()
+ }
+ if t.Kind() != reflect.Struct {
+ return
+ }
+ if _, seen := alreadySeen[t.String()]; seen {
+ return
+ }
+ alreadySeen[t.String()] = struct{}{}
+ nt, ntErr := newNativeType(t)
+ if ntErr != nil {
+ err = ntErr
+ return
+ }
+ result = append(result, nt)
+
+ for idx := 0; idx < t.NumField(); idx++ {
+ iterateStructMembers(t.Field(idx).Type)
+ }
+ }
+ iterateStructMembers(rawType)
+
+ return result, err
+}
+
func newNativeType(rawType reflect.Type) (*nativeType, error) {
refType := rawType
if refType.Kind() == reflect.Pointer {
diff --git a/vendor/github.com/google/cel-go/ext/protos.go b/vendor/github.com/google/cel-go/ext/protos.go
index a7ca27a6a2..68796f60ad 100644
--- a/vendor/github.com/google/cel-go/ext/protos.go
+++ b/vendor/github.com/google/cel-go/ext/protos.go
@@ -16,8 +16,7 @@ package ext
import (
"github.com/google/cel-go/cel"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
)
// Protos returns a cel.EnvOption to configure extended macros and functions for
@@ -72,9 +71,9 @@ func (protoLib) CompileOptions() []cel.EnvOption {
return []cel.EnvOption{
cel.Macros(
// proto.getExt(msg, select_expression)
- cel.NewReceiverMacro(getExtension, 2, getProtoExt),
+ cel.ReceiverMacro(getExtension, 2, getProtoExt),
// proto.hasExt(msg, select_expression)
- cel.NewReceiverMacro(hasExtension, 2, hasProtoExt),
+ cel.ReceiverMacro(hasExtension, 2, hasProtoExt),
),
}
}
@@ -85,56 +84,56 @@ func (protoLib) ProgramOptions() []cel.ProgramOption {
}
// hasProtoExt generates a test-only select expression for a fully-qualified extension name on a protobuf message.
-func hasProtoExt(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) {
+func hasProtoExt(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
if !macroTargetMatchesNamespace(protoNamespace, target) {
return nil, nil
}
- extensionField, err := getExtFieldName(meh, args[1])
+ extensionField, err := getExtFieldName(mef, args[1])
if err != nil {
return nil, err
}
- return meh.PresenceTest(args[0], extensionField), nil
+ return mef.NewPresenceTest(args[0], extensionField), nil
}
// getProtoExt generates a select expression for a fully-qualified extension name on a protobuf message.
-func getProtoExt(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) {
+func getProtoExt(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
if !macroTargetMatchesNamespace(protoNamespace, target) {
return nil, nil
}
- extFieldName, err := getExtFieldName(meh, args[1])
+ extFieldName, err := getExtFieldName(mef, args[1])
if err != nil {
return nil, err
}
- return meh.Select(args[0], extFieldName), nil
+ return mef.NewSelect(args[0], extFieldName), nil
}
-func getExtFieldName(meh cel.MacroExprHelper, expr *exprpb.Expr) (string, *cel.Error) {
+func getExtFieldName(mef cel.MacroExprFactory, expr ast.Expr) (string, *cel.Error) {
isValid := false
extensionField := ""
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_SelectExpr:
+ switch expr.Kind() {
+ case ast.SelectKind:
extensionField, isValid = validateIdentifier(expr)
}
if !isValid {
- return "", meh.NewError(expr.GetId(), "invalid extension field")
+ return "", mef.NewError(expr.ID(), "invalid extension field")
}
return extensionField, nil
}
-func validateIdentifier(expr *exprpb.Expr) (string, bool) {
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_IdentExpr:
- return expr.GetIdentExpr().GetName(), true
- case *exprpb.Expr_SelectExpr:
- sel := expr.GetSelectExpr()
- if sel.GetTestOnly() {
+func validateIdentifier(expr ast.Expr) (string, bool) {
+ switch expr.Kind() {
+ case ast.IdentKind:
+ return expr.AsIdent(), true
+ case ast.SelectKind:
+ sel := expr.AsSelect()
+ if sel.IsTestOnly() {
return "", false
}
- opStr, isIdent := validateIdentifier(sel.GetOperand())
+ opStr, isIdent := validateIdentifier(sel.Operand())
if !isIdent {
return "", false
}
- return opStr + "." + sel.GetField(), true
+ return opStr + "." + sel.FieldName(), true
default:
return "", false
}
diff --git a/vendor/github.com/google/cel-go/ext/sets.go b/vendor/github.com/google/cel-go/ext/sets.go
index 833c15f616..7e94166552 100644
--- a/vendor/github.com/google/cel-go/ext/sets.go
+++ b/vendor/github.com/google/cel-go/ext/sets.go
@@ -19,6 +19,8 @@ import (
"github.com/google/cel-go/cel"
"github.com/google/cel-go/checker"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
@@ -119,6 +121,68 @@ func (setsLib) ProgramOptions() []cel.ProgramOption {
}
}
+// NewSetMembershipOptimizer rewrites set membership tests using the `in` operator against a list
+// of constant values of enum, int, uint, string, or boolean type into a set membership test against
+// a map where the map keys are the elements of the list.
+func NewSetMembershipOptimizer() (cel.ASTOptimizer, error) {
+ return setsLib{}, nil
+}
+
+func (setsLib) Optimize(ctx *cel.OptimizerContext, a *ast.AST) *ast.AST {
+ root := ast.NavigateAST(a)
+ matches := ast.MatchDescendants(root, matchInConstantList(a))
+ for _, match := range matches {
+ call := match.AsCall()
+ listArg := call.Args()[1]
+ entries := make([]ast.EntryExpr, len(listArg.AsList().Elements()))
+ for i, elem := range listArg.AsList().Elements() {
+ var entry ast.EntryExpr
+ if r, found := a.ReferenceMap()[elem.ID()]; found && r.Value != nil {
+ entry = ctx.NewMapEntry(ctx.NewLiteral(r.Value), ctx.NewLiteral(types.True), false)
+ } else {
+ entry = ctx.NewMapEntry(elem, ctx.NewLiteral(types.True), false)
+ }
+ entries[i] = entry
+ }
+ mapArg := ctx.NewMap(entries)
+ ctx.UpdateExpr(listArg, mapArg)
+ }
+ return a
+}
+
+func matchInConstantList(a *ast.AST) ast.ExprMatcher {
+ return func(e ast.NavigableExpr) bool {
+ if e.Kind() != ast.CallKind {
+ return false
+ }
+ call := e.AsCall()
+ if call.FunctionName() != operators.In {
+ return false
+ }
+ aggregateVal := call.Args()[1]
+ if aggregateVal.Kind() != ast.ListKind {
+ return false
+ }
+ listVal := aggregateVal.AsList()
+ for _, elem := range listVal.Elements() {
+ if r, found := a.ReferenceMap()[elem.ID()]; found {
+ if r.Value != nil {
+ continue
+ }
+ }
+ if elem.Kind() != ast.LiteralKind {
+ return false
+ }
+ lit := elem.AsLiteral()
+ if !(lit.Type() == cel.StringType || lit.Type() == cel.IntType ||
+ lit.Type() == cel.UintType || lit.Type() == cel.BoolType) {
+ return false
+ }
+ }
+ return true
+ }
+}
+
func setsIntersects(listA, listB ref.Val) ref.Val {
lA := listA.(traits.Lister)
lB := listB.(traits.Lister)
diff --git a/vendor/github.com/google/cel-go/ext/strings.go b/vendor/github.com/google/cel-go/ext/strings.go
index 88c119f2b0..2e20f1e4c4 100644
--- a/vendor/github.com/google/cel-go/ext/strings.go
+++ b/vendor/github.com/google/cel-go/ext/strings.go
@@ -21,19 +21,16 @@ import (
"fmt"
"math"
"reflect"
- "sort"
"strings"
"unicode"
"unicode/utf8"
"golang.org/x/text/language"
- "golang.org/x/text/message"
"github.com/google/cel-go/cel"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
- "github.com/google/cel-go/interpreter"
)
const (
@@ -99,7 +96,7 @@ const (
// "a map inside a list: %s".format([[1, 2, 3, {"a": "x", "b": "y", "c": "z"}]]) // returns "a map inside a list: [1, 2, 3, {"a":"x", "b":"y", "c":"d"}]"
// "true bool: %s - false bool: %s\nbinary bool: %b".format([true, false, true]) // returns "true bool: true - false bool: false\nbinary bool: 1"
//
-// Passing an incorrect type (an integer to `%s`) is considered an error, as well as attempting
+// Passing an incorrect type (a string to `%b`) is considered an error, as well as attempting
// to use more formatting clauses than there are arguments (`%d %d %d` while passing two ints, for instance).
// If compile-time checking is enabled, and the formatting string is a constant, and the argument list is a literal,
// then letting any arguments go unused/unformatted is also considered an error.
@@ -205,6 +202,8 @@ const (
// 'hello hello'.replace('he', 'we', -1) // returns 'wello wello'
// 'hello hello'.replace('he', 'we', 1) // returns 'wello hello'
// 'hello hello'.replace('he', 'we', 0) // returns 'hello hello'
+// 'hello hello'.replace('', '_') // returns '_h_e_l_l_o_ _h_e_l_l_o_'
+// 'hello hello'.replace('h', '') // returns 'ello ello'
//
// # Split
//
@@ -270,8 +269,26 @@ const (
//
// 'TacoCat'.upperAscii() // returns 'TACOCAT'
// 'TacoCÆt Xii'.upperAscii() // returns 'TACOCÆT XII'
+//
+// # Reverse
+//
+// Introduced at version: 3
+//
+// Returns a new string whose characters are the same as the target string, only formatted in
+// reverse order.
+// This function relies on converting strings to rune arrays in order to reverse
+//
+// .reverse() ->
+//
+// Examples:
+//
+// 'gums'.reverse() // returns 'smug'
+// 'John Smith'.reverse() // returns 'htimS nhoJ'
func Strings(options ...StringsOption) cel.EnvOption {
- s := &stringLib{version: math.MaxUint32}
+ s := &stringLib{
+ version: math.MaxUint32,
+ validateFormat: true,
+ }
for _, o := range options {
s = o(s)
}
@@ -279,8 +296,9 @@ func Strings(options ...StringsOption) cel.EnvOption {
}
type stringLib struct {
- locale string
- version uint32
+ locale string
+ version uint32
+ validateFormat bool
}
// LibraryName implements the SingletonLibrary interface method.
@@ -317,6 +335,17 @@ func StringsVersion(version uint32) StringsOption {
}
}
+// StringsValidateFormatCalls validates type-checked ASTs to ensure that string.format() calls have
+// valid formatting clauses and valid argument types for each clause.
+//
+// Enabled by default.
+func StringsValidateFormatCalls(value bool) StringsOption {
+ return func(s *stringLib) *stringLib {
+ s.validateFormat = value
+ return s
+ }
+}
+
// CompileOptions implements the Library interface method.
func (lib *stringLib) CompileOptions() []cel.EnvOption {
formatLocale := "en_US"
@@ -440,13 +469,15 @@ func (lib *stringLib) CompileOptions() []cel.EnvOption {
cel.FunctionBinding(func(args ...ref.Val) ref.Val {
s := string(args[0].(types.String))
formatArgs := args[1].(traits.Lister)
- return stringOrError(interpreter.ParseFormatString(s, &stringFormatter{}, &stringArgList{formatArgs}, formatLocale))
+ return stringOrError(parseFormatString(s, &stringFormatter{}, &stringArgList{formatArgs}, formatLocale))
}))),
cel.Function("strings.quote", cel.Overload("strings_quote", []*cel.Type{cel.StringType}, cel.StringType,
cel.UnaryBinding(func(str ref.Val) ref.Val {
s := str.(types.String)
return stringOrError(quote(string(s)))
- }))))
+ }))),
+
+ cel.ASTValidators(stringFormatValidator{}))
}
if lib.version >= 2 {
@@ -471,7 +502,7 @@ func (lib *stringLib) CompileOptions() []cel.EnvOption {
cel.UnaryBinding(func(list ref.Val) ref.Val {
l, err := list.ConvertToNative(stringListType)
if err != nil {
- return types.NewErr(err.Error())
+ return types.WrapErr(err)
}
return stringOrError(join(l.([]string)))
})),
@@ -479,13 +510,26 @@ func (lib *stringLib) CompileOptions() []cel.EnvOption {
cel.BinaryBinding(func(list, delim ref.Val) ref.Val {
l, err := list.ConvertToNative(stringListType)
if err != nil {
- return types.NewErr(err.Error())
+ return types.WrapErr(err)
}
d := delim.(types.String)
return stringOrError(joinSeparator(l.([]string), string(d)))
}))),
)
}
+ if lib.version >= 3 {
+ opts = append(opts,
+ cel.Function("reverse",
+ cel.MemberOverload("reverse", []*cel.Type{cel.StringType}, cel.StringType,
+ cel.UnaryBinding(func(str ref.Val) ref.Val {
+ s := str.(types.String)
+ return stringOrError(reverse(string(s)))
+ }))),
+ )
+ }
+ if lib.validateFormat {
+ opts = append(opts, cel.ASTValidators(stringFormatValidator{}))
+ }
return opts
}
@@ -636,6 +680,14 @@ func upperASCII(str string) (string, error) {
return string(runes), nil
}
+func reverse(str string) (string, error) {
+ chars := []rune(str)
+ for i, j := 0, len(chars)-1; i < j; i, j = i+1, j-1 {
+ chars[i], chars[j] = chars[j], chars[i]
+ }
+ return string(chars), nil
+}
+
func joinSeparator(strs []string, separator string) (string, error) {
return strings.Join(strs, separator), nil
}
@@ -661,238 +713,6 @@ func joinValSeparator(strs traits.Lister, separator string) (string, error) {
return sb.String(), nil
}
-type clauseImpl func(ref.Val, string) (string, error)
-
-func clauseForType(argType ref.Type) (clauseImpl, error) {
- switch argType {
- case types.IntType, types.UintType:
- return formatDecimal, nil
- case types.StringType, types.BytesType, types.BoolType, types.NullType, types.TypeType:
- return FormatString, nil
- case types.TimestampType, types.DurationType:
- // special case to ensure timestamps/durations get printed as CEL literals
- return func(arg ref.Val, locale string) (string, error) {
- argStrVal := arg.ConvertToType(types.StringType)
- argStr := argStrVal.Value().(string)
- if arg.Type() == types.TimestampType {
- return fmt.Sprintf("timestamp(%q)", argStr), nil
- }
- if arg.Type() == types.DurationType {
- return fmt.Sprintf("duration(%q)", argStr), nil
- }
- return "", fmt.Errorf("cannot convert argument of type %s to timestamp/duration", arg.Type().TypeName())
- }, nil
- case types.ListType:
- return formatList, nil
- case types.MapType:
- return formatMap, nil
- case types.DoubleType:
- // avoid formatFixed so we can output a period as the decimal separator in order
- // to always be a valid CEL literal
- return func(arg ref.Val, locale string) (string, error) {
- argDouble, ok := arg.Value().(float64)
- if !ok {
- return "", fmt.Errorf("couldn't convert %s to float64", arg.Type().TypeName())
- }
- fmtStr := fmt.Sprintf("%%.%df", defaultPrecision)
- return fmt.Sprintf(fmtStr, argDouble), nil
- }, nil
- case types.TypeType:
- return func(arg ref.Val, locale string) (string, error) {
- return fmt.Sprintf("type(%s)", arg.Value().(string)), nil
- }, nil
- default:
- return nil, fmt.Errorf("no formatting function for %s", argType.TypeName())
- }
-}
-
-func formatList(arg ref.Val, locale string) (string, error) {
- argList := arg.(traits.Lister)
- argIterator := argList.Iterator()
- var listStrBuilder strings.Builder
- _, err := listStrBuilder.WriteRune('[')
- if err != nil {
- return "", fmt.Errorf("error writing to list string: %w", err)
- }
- for argIterator.HasNext() == types.True {
- member := argIterator.Next()
- memberFormat, err := clauseForType(member.Type())
- if err != nil {
- return "", err
- }
- unquotedStr, err := memberFormat(member, locale)
- if err != nil {
- return "", err
- }
- str := quoteForCEL(member, unquotedStr)
- _, err = listStrBuilder.WriteString(str)
- if err != nil {
- return "", fmt.Errorf("error writing to list string: %w", err)
- }
- if argIterator.HasNext() == types.True {
- _, err = listStrBuilder.WriteString(", ")
- if err != nil {
- return "", fmt.Errorf("error writing to list string: %w", err)
- }
- }
- }
- _, err = listStrBuilder.WriteRune(']')
- if err != nil {
- return "", fmt.Errorf("error writing to list string: %w", err)
- }
- return listStrBuilder.String(), nil
-}
-
-func formatMap(arg ref.Val, locale string) (string, error) {
- argMap := arg.(traits.Mapper)
- argIterator := argMap.Iterator()
- type mapPair struct {
- key string
- value string
- }
- argPairs := make([]mapPair, argMap.Size().Value().(int64))
- i := 0
- for argIterator.HasNext() == types.True {
- key := argIterator.Next()
- var keyFormat clauseImpl
- switch key.Type() {
- case types.StringType, types.BoolType:
- keyFormat = FormatString
- case types.IntType, types.UintType:
- keyFormat = formatDecimal
- default:
- return "", fmt.Errorf("no formatting function for map key of type %s", key.Type().TypeName())
- }
- unquotedKeyStr, err := keyFormat(key, locale)
- if err != nil {
- return "", err
- }
- keyStr := quoteForCEL(key, unquotedKeyStr)
- value, found := argMap.Find(key)
- if !found {
- return "", fmt.Errorf("could not find key: %q", key)
- }
- valueFormat, err := clauseForType(value.Type())
- if err != nil {
- return "", err
- }
- unquotedValueStr, err := valueFormat(value, locale)
- if err != nil {
- return "", err
- }
- valueStr := quoteForCEL(value, unquotedValueStr)
- argPairs[i] = mapPair{keyStr, valueStr}
- i++
- }
- sort.SliceStable(argPairs, func(x, y int) bool {
- return argPairs[x].key < argPairs[y].key
- })
- var mapStrBuilder strings.Builder
- _, err := mapStrBuilder.WriteRune('{')
- if err != nil {
- return "", fmt.Errorf("error writing to map string: %w", err)
- }
- for i, entry := range argPairs {
- _, err = mapStrBuilder.WriteString(fmt.Sprintf("%s:%s", entry.key, entry.value))
- if err != nil {
- return "", fmt.Errorf("error writing to map string: %w", err)
- }
- if i < len(argPairs)-1 {
- _, err = mapStrBuilder.WriteString(", ")
- if err != nil {
- return "", fmt.Errorf("error writing to map string: %w", err)
- }
- }
- }
- _, err = mapStrBuilder.WriteRune('}')
- if err != nil {
- return "", fmt.Errorf("error writing to map string: %w", err)
- }
- return mapStrBuilder.String(), nil
-}
-
-// quoteForCEL takes a formatted, unquoted value and quotes it in a manner
-// suitable for embedding directly in CEL.
-func quoteForCEL(refVal ref.Val, unquotedValue string) string {
- switch refVal.Type() {
- case types.StringType:
- return fmt.Sprintf("%q", unquotedValue)
- case types.BytesType:
- return fmt.Sprintf("b%q", unquotedValue)
- case types.DoubleType:
- // special case to handle infinity/NaN
- num := refVal.Value().(float64)
- if math.IsInf(num, 1) || math.IsInf(num, -1) || math.IsNaN(num) {
- return fmt.Sprintf("%q", unquotedValue)
- }
- return unquotedValue
- default:
- return unquotedValue
- }
-}
-
-// FormatString returns the string representation of a CEL value.
-// It is used to implement the %s specifier in the (string).format() extension
-// function.
-func FormatString(arg ref.Val, locale string) (string, error) {
- switch arg.Type() {
- case types.ListType:
- return formatList(arg, locale)
- case types.MapType:
- return formatMap(arg, locale)
- case types.IntType, types.UintType, types.DoubleType,
- types.BoolType, types.StringType, types.TimestampType, types.BytesType, types.DurationType, types.TypeType:
- argStrVal := arg.ConvertToType(types.StringType)
- argStr, ok := argStrVal.Value().(string)
- if !ok {
- return "", fmt.Errorf("could not convert argument %q to string", argStrVal)
- }
- return argStr, nil
- case types.NullType:
- return "null", nil
- default:
- return "", fmt.Errorf("string clause can only be used on strings, bools, bytes, ints, doubles, maps, lists, types, durations, and timestamps, was given %s", arg.Type().TypeName())
- }
-}
-
-func formatDecimal(arg ref.Val, locale string) (string, error) {
- switch arg.Type() {
- case types.IntType:
- argInt, ok := arg.ConvertToType(types.IntType).Value().(int64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value())
- }
- return fmt.Sprintf("%d", argInt), nil
- case types.UintType:
- argInt, ok := arg.ConvertToType(types.UintType).Value().(uint64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value())
- }
- return fmt.Sprintf("%d", argInt), nil
- default:
- return "", fmt.Errorf("decimal clause can only be used on integers, was given %s", arg.Type().TypeName())
- }
-}
-
-func matchLanguage(locale string) (language.Tag, error) {
- matcher, err := makeMatcher(locale)
- if err != nil {
- return language.Und, err
- }
- tag, _ := language.MatchStrings(matcher, locale)
- return tag, nil
-}
-
-func makeMatcher(locale string) (language.Matcher, error) {
- tags := make([]language.Tag, 0)
- tag, err := language.Parse(locale)
- if err != nil {
- return nil, err
- }
- tags = append(tags, tag)
- return language.NewMatcher(tags), nil
-}
-
// quote implements a string quoting function. The string will be wrapped in
// double quotes, and all valid CEL escape sequences will be escaped to show up
// literally if printed. If the input contains any invalid UTF-8, the invalid runes
@@ -940,156 +760,6 @@ func sanitize(s string) string {
return sanitizedStringBuilder.String()
}
-type stringFormatter struct{}
-
-func (c *stringFormatter) String(arg ref.Val, locale string) (string, error) {
- return FormatString(arg, locale)
-}
-
-func (c *stringFormatter) Decimal(arg ref.Val, locale string) (string, error) {
- return formatDecimal(arg, locale)
-}
-
-func (c *stringFormatter) Fixed(precision *int) func(ref.Val, string) (string, error) {
- if precision == nil {
- precision = new(int)
- *precision = defaultPrecision
- }
- return func(arg ref.Val, locale string) (string, error) {
- strException := false
- if arg.Type() == types.StringType {
- argStr := arg.Value().(string)
- if argStr == "NaN" || argStr == "Infinity" || argStr == "-Infinity" {
- strException = true
- }
- }
- if arg.Type() != types.DoubleType && !strException {
- return "", fmt.Errorf("fixed-point clause can only be used on doubles, was given %s", arg.Type().TypeName())
- }
- argFloatVal := arg.ConvertToType(types.DoubleType)
- argFloat, ok := argFloatVal.Value().(float64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to float64", argFloatVal.Value())
- }
- fmtStr := fmt.Sprintf("%%.%df", *precision)
-
- matchedLocale, err := matchLanguage(locale)
- if err != nil {
- return "", fmt.Errorf("error matching locale: %w", err)
- }
- return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil
- }
-}
-
-func (c *stringFormatter) Scientific(precision *int) func(ref.Val, string) (string, error) {
- if precision == nil {
- precision = new(int)
- *precision = defaultPrecision
- }
- return func(arg ref.Val, locale string) (string, error) {
- strException := false
- if arg.Type() == types.StringType {
- argStr := arg.Value().(string)
- if argStr == "NaN" || argStr == "Infinity" || argStr == "-Infinity" {
- strException = true
- }
- }
- if arg.Type() != types.DoubleType && !strException {
- return "", fmt.Errorf("scientific clause can only be used on doubles, was given %s", arg.Type().TypeName())
- }
- argFloatVal := arg.ConvertToType(types.DoubleType)
- argFloat, ok := argFloatVal.Value().(float64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to float64", argFloatVal.Value())
- }
- matchedLocale, err := matchLanguage(locale)
- if err != nil {
- return "", fmt.Errorf("error matching locale: %w", err)
- }
- fmtStr := fmt.Sprintf("%%%de", *precision)
- return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil
- }
-}
-
-func (c *stringFormatter) Binary(arg ref.Val, locale string) (string, error) {
- switch arg.Type() {
- case types.IntType:
- argInt := arg.Value().(int64)
- // locale is intentionally unused as integers formatted as binary
- // strings are locale-independent
- return fmt.Sprintf("%b", argInt), nil
- case types.UintType:
- argInt := arg.Value().(uint64)
- return fmt.Sprintf("%b", argInt), nil
- case types.BoolType:
- argBool := arg.Value().(bool)
- if argBool {
- return "1", nil
- }
- return "0", nil
- default:
- return "", fmt.Errorf("only integers and bools can be formatted as binary, was given %s", arg.Type().TypeName())
- }
-}
-
-func (c *stringFormatter) Hex(useUpper bool) func(ref.Val, string) (string, error) {
- return func(arg ref.Val, locale string) (string, error) {
- fmtStr := "%x"
- if useUpper {
- fmtStr = "%X"
- }
- switch arg.Type() {
- case types.StringType, types.BytesType:
- if arg.Type() == types.BytesType {
- return fmt.Sprintf(fmtStr, arg.Value().([]byte)), nil
- }
- return fmt.Sprintf(fmtStr, arg.Value().(string)), nil
- case types.IntType:
- argInt, ok := arg.Value().(int64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to int64", arg.Value())
- }
- return fmt.Sprintf(fmtStr, argInt), nil
- case types.UintType:
- argInt, ok := arg.Value().(uint64)
- if !ok {
- return "", fmt.Errorf("could not convert \"%s\" to uint64", arg.Value())
- }
- return fmt.Sprintf(fmtStr, argInt), nil
- default:
- return "", fmt.Errorf("only integers, byte buffers, and strings can be formatted as hex, was given %s", arg.Type().TypeName())
- }
- }
-}
-
-func (c *stringFormatter) Octal(arg ref.Val, locale string) (string, error) {
- switch arg.Type() {
- case types.IntType:
- argInt := arg.Value().(int64)
- return fmt.Sprintf("%o", argInt), nil
- case types.UintType:
- argInt := arg.Value().(uint64)
- return fmt.Sprintf("%o", argInt), nil
- default:
- return "", fmt.Errorf("octal clause can only be used on integers, was given %s", arg.Type().TypeName())
- }
-}
-
-type stringArgList struct {
- args traits.Lister
-}
-
-func (c *stringArgList) Arg(index int64) (ref.Val, error) {
- if index >= c.args.Size().Value().(int64) {
- return nil, fmt.Errorf("index %d out of range", index)
- }
- return c.args.Get(types.Int(index)), nil
-}
-
-func (c *stringArgList) ArgSize() int64 {
- return c.args.Size().Value().(int64)
-}
-
var (
stringListType = reflect.TypeOf([]string{})
)
diff --git a/vendor/github.com/google/cel-go/interpreter/BUILD.bazel b/vendor/github.com/google/cel-go/interpreter/BUILD.bazel
index 3a5219eb5f..220e23d475 100644
--- a/vendor/github.com/google/cel-go/interpreter/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/interpreter/BUILD.bazel
@@ -14,7 +14,6 @@ go_library(
"decorators.go",
"dispatcher.go",
"evalstate.go",
- "formatting.go",
"interpretable.go",
"interpreter.go",
"optimizations.go",
diff --git a/vendor/github.com/google/cel-go/interpreter/attributes.go b/vendor/github.com/google/cel-go/interpreter/attributes.go
index ca97bdfcf1..0098750dd7 100644
--- a/vendor/github.com/google/cel-go/interpreter/attributes.go
+++ b/vendor/github.com/google/cel-go/interpreter/attributes.go
@@ -287,6 +287,9 @@ func (a *absoluteAttribute) Resolve(vars Activation) (any, error) {
// determine whether the type is unknown before returning.
obj, found := vars.ResolveName(nm)
if found {
+ if celErr, ok := obj.(*types.Err); ok {
+ return nil, celErr.Unwrap()
+ }
obj, isOpt, err := applyQualifiers(vars, obj, a.qualifiers)
if err != nil {
return nil, err
diff --git a/vendor/github.com/google/cel-go/interpreter/formatting.go b/vendor/github.com/google/cel-go/interpreter/formatting.go
deleted file mode 100644
index e3f7533745..0000000000
--- a/vendor/github.com/google/cel-go/interpreter/formatting.go
+++ /dev/null
@@ -1,383 +0,0 @@
-// Copyright 2023 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package interpreter
-
-import (
- "errors"
- "fmt"
- "strconv"
- "strings"
- "unicode"
-
- "github.com/google/cel-go/common/types"
- "github.com/google/cel-go/common/types/ref"
-)
-
-type typeVerifier func(int64, ...ref.Type) (bool, error)
-
-// InterpolateFormattedString checks the syntax and cardinality of any string.format calls present in the expression and reports
-// any errors at compile time.
-func InterpolateFormattedString(verifier typeVerifier) InterpretableDecorator {
- return func(inter Interpretable) (Interpretable, error) {
- call, ok := inter.(InterpretableCall)
- if !ok {
- return inter, nil
- }
- if call.OverloadID() != "string_format" {
- return inter, nil
- }
- args := call.Args()
- if len(args) != 2 {
- return nil, fmt.Errorf("wrong number of arguments to string.format (expected 2, got %d)", len(args))
- }
- fmtStrInter, ok := args[0].(InterpretableConst)
- if !ok {
- return inter, nil
- }
- var fmtArgsInter InterpretableConstructor
- fmtArgsInter, ok = args[1].(InterpretableConstructor)
- if !ok {
- return inter, nil
- }
- if fmtArgsInter.Type() != types.ListType {
- // don't necessarily return an error since the list may be DynType
- return inter, nil
- }
- formatStr := fmtStrInter.Value().Value().(string)
- initVals := fmtArgsInter.InitVals()
-
- formatCheck := &formatCheck{
- args: initVals,
- verifier: verifier,
- }
- // use a placeholder locale, since locale doesn't affect syntax
- _, err := ParseFormatString(formatStr, formatCheck, formatCheck, "en_US")
- if err != nil {
- return nil, err
- }
- seenArgs := formatCheck.argsRequested
- if len(initVals) > seenArgs {
- return nil, fmt.Errorf("too many arguments supplied to string.format (expected %d, got %d)", seenArgs, len(initVals))
- }
- return inter, nil
- }
-}
-
-type formatCheck struct {
- args []Interpretable
- argsRequested int
- curArgIndex int64
- enableCheckArgTypes bool
- verifier typeVerifier
-}
-
-func (c *formatCheck) String(arg ref.Val, locale string) (string, error) {
- valid, err := verifyString(c.args[c.curArgIndex], c.verifier)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("string clause can only be used on strings, bools, bytes, ints, doubles, maps, lists, types, durations, and timestamps")
- }
- return "", nil
-}
-
-func (c *formatCheck) Decimal(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- valid, err := c.verifier(id, types.IntType, types.UintType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("integer clause can only be used on integers")
- }
- return "", nil
-}
-
-func (c *formatCheck) Fixed(precision *int) func(ref.Val, string) (string, error) {
- return func(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- // we allow StringType since "NaN", "Infinity", and "-Infinity" are also valid values
- valid, err := c.verifier(id, types.DoubleType, types.StringType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("fixed-point clause can only be used on doubles")
- }
- return "", nil
- }
-}
-
-func (c *formatCheck) Scientific(precision *int) func(ref.Val, string) (string, error) {
- return func(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- valid, err := c.verifier(id, types.DoubleType, types.StringType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("scientific clause can only be used on doubles")
- }
- return "", nil
- }
-}
-
-func (c *formatCheck) Binary(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- valid, err := c.verifier(id, types.IntType, types.UintType, types.BoolType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("only integers and bools can be formatted as binary")
- }
- return "", nil
-}
-
-func (c *formatCheck) Hex(useUpper bool) func(ref.Val, string) (string, error) {
- return func(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- valid, err := c.verifier(id, types.IntType, types.UintType, types.StringType, types.BytesType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("only integers, byte buffers, and strings can be formatted as hex")
- }
- return "", nil
- }
-}
-
-func (c *formatCheck) Octal(arg ref.Val, locale string) (string, error) {
- id := c.args[c.curArgIndex].ID()
- valid, err := c.verifier(id, types.IntType, types.UintType)
- if err != nil {
- return "", err
- }
- if !valid {
- return "", errors.New("octal clause can only be used on integers")
- }
- return "", nil
-}
-
-func (c *formatCheck) Arg(index int64) (ref.Val, error) {
- c.argsRequested++
- c.curArgIndex = index
- // return a dummy value - this is immediately passed to back to us
- // through one of the FormatCallback functions, so anything will do
- return types.Int(0), nil
-}
-
-func (c *formatCheck) ArgSize() int64 {
- return int64(len(c.args))
-}
-
-func verifyString(sub Interpretable, verifier typeVerifier) (bool, error) {
- subVerified, err := verifier(sub.ID(),
- types.ListType, types.MapType, types.IntType, types.UintType, types.DoubleType,
- types.BoolType, types.StringType, types.TimestampType, types.BytesType, types.DurationType, types.TypeType, types.NullType)
- if err != nil {
- return false, err
- }
- if !subVerified {
- return false, nil
- }
- con, ok := sub.(InterpretableConstructor)
- if ok {
- members := con.InitVals()
- for _, m := range members {
- // recursively verify if we're dealing with a list/map
- verified, err := verifyString(m, verifier)
- if err != nil {
- return false, err
- }
- if !verified {
- return false, nil
- }
- }
- }
- return true, nil
-
-}
-
-// FormatStringInterpolator is an interface that allows user-defined behavior
-// for formatting clause implementations, as well as argument retrieval.
-// Each function is expected to support the appropriate types as laid out in
-// the string.format documentation, and to return an error if given an inappropriate type.
-type FormatStringInterpolator interface {
- // String takes a ref.Val and a string representing the current locale identifier
- // and returns the Val formatted as a string, or an error if one occurred.
- String(ref.Val, string) (string, error)
-
- // Decimal takes a ref.Val and a string representing the current locale identifier
- // and returns the Val formatted as a decimal integer, or an error if one occurred.
- Decimal(ref.Val, string) (string, error)
-
- // Fixed takes an int pointer representing precision (or nil if none was given) and
- // returns a function operating in a similar manner to String and Decimal, taking a
- // ref.Val and locale and returning the appropriate string. A closure is returned
- // so precision can be set without needing an additional function call/configuration.
- Fixed(*int) func(ref.Val, string) (string, error)
-
- // Scientific functions identically to Fixed, except the string returned from the closure
- // is expected to be in scientific notation.
- Scientific(*int) func(ref.Val, string) (string, error)
-
- // Binary takes a ref.Val and a string representing the current locale identifier
- // and returns the Val formatted as a binary integer, or an error if one occurred.
- Binary(ref.Val, string) (string, error)
-
- // Hex takes a boolean that, if true, indicates the hex string output by the returned
- // closure should use uppercase letters for A-F.
- Hex(bool) func(ref.Val, string) (string, error)
-
- // Octal takes a ref.Val and a string representing the current locale identifier and
- // returns the Val formatted in octal, or an error if one occurred.
- Octal(ref.Val, string) (string, error)
-}
-
-// FormatList is an interface that allows user-defined list-like datatypes to be used
-// for formatting clause implementations.
-type FormatList interface {
- // Arg returns the ref.Val at the given index, or an error if one occurred.
- Arg(int64) (ref.Val, error)
- // ArgSize returns the length of the argument list.
- ArgSize() int64
-}
-
-type clauseImpl func(ref.Val, string) (string, error)
-
-// ParseFormatString formats a string according to the string.format syntax, taking the clause implementations
-// from the provided FormatCallback and the args from the given FormatList.
-func ParseFormatString(formatStr string, callback FormatStringInterpolator, list FormatList, locale string) (string, error) {
- i := 0
- argIndex := 0
- var builtStr strings.Builder
- for i < len(formatStr) {
- if formatStr[i] == '%' {
- if i+1 < len(formatStr) && formatStr[i+1] == '%' {
- err := builtStr.WriteByte('%')
- if err != nil {
- return "", fmt.Errorf("error writing format string: %w", err)
- }
- i += 2
- continue
- } else {
- argAny, err := list.Arg(int64(argIndex))
- if err != nil {
- return "", err
- }
- if i+1 >= len(formatStr) {
- return "", errors.New("unexpected end of string")
- }
- if int64(argIndex) >= list.ArgSize() {
- return "", fmt.Errorf("index %d out of range", argIndex)
- }
- numRead, val, refErr := parseAndFormatClause(formatStr[i:], argAny, callback, list, locale)
- if refErr != nil {
- return "", refErr
- }
- _, err = builtStr.WriteString(val)
- if err != nil {
- return "", fmt.Errorf("error writing format string: %w", err)
- }
- i += numRead
- argIndex++
- }
- } else {
- err := builtStr.WriteByte(formatStr[i])
- if err != nil {
- return "", fmt.Errorf("error writing format string: %w", err)
- }
- i++
- }
- }
- return builtStr.String(), nil
-}
-
-// parseAndFormatClause parses the format clause at the start of the given string with val, and returns
-// how many characters were consumed and the substituted string form of val, or an error if one occurred.
-func parseAndFormatClause(formatStr string, val ref.Val, callback FormatStringInterpolator, list FormatList, locale string) (int, string, error) {
- i := 1
- read, formatter, err := parseFormattingClause(formatStr[i:], callback)
- i += read
- if err != nil {
- return -1, "", fmt.Errorf("could not parse formatting clause: %s", err)
- }
-
- valStr, err := formatter(val, locale)
- if err != nil {
- return -1, "", fmt.Errorf("error during formatting: %s", err)
- }
- return i, valStr, nil
-}
-
-func parseFormattingClause(formatStr string, callback FormatStringInterpolator) (int, clauseImpl, error) {
- i := 0
- read, precision, err := parsePrecision(formatStr[i:])
- i += read
- if err != nil {
- return -1, nil, fmt.Errorf("error while parsing precision: %w", err)
- }
- r := rune(formatStr[i])
- i++
- switch r {
- case 's':
- return i, callback.String, nil
- case 'd':
- return i, callback.Decimal, nil
- case 'f':
- return i, callback.Fixed(precision), nil
- case 'e':
- return i, callback.Scientific(precision), nil
- case 'b':
- return i, callback.Binary, nil
- case 'x', 'X':
- return i, callback.Hex(unicode.IsUpper(r)), nil
- case 'o':
- return i, callback.Octal, nil
- default:
- return -1, nil, fmt.Errorf("unrecognized formatting clause \"%c\"", r)
- }
-}
-
-func parsePrecision(formatStr string) (int, *int, error) {
- i := 0
- if formatStr[i] != '.' {
- return i, nil, nil
- }
- i++
- var buffer strings.Builder
- for {
- if i >= len(formatStr) {
- return -1, nil, errors.New("could not find end of precision specifier")
- }
- if !isASCIIDigit(rune(formatStr[i])) {
- break
- }
- buffer.WriteByte(formatStr[i])
- i++
- }
- precision, err := strconv.Atoi(buffer.String())
- if err != nil {
- return -1, nil, fmt.Errorf("error while converting precision to integer: %w", err)
- }
- return i, &precision, nil
-}
-
-func isASCIIDigit(r rune) bool {
- return r <= unicode.MaxASCII && unicode.IsDigit(r)
-}
diff --git a/vendor/github.com/google/cel-go/interpreter/interpretable.go b/vendor/github.com/google/cel-go/interpreter/interpretable.go
index c4598dfa73..5612384074 100644
--- a/vendor/github.com/google/cel-go/interpreter/interpretable.go
+++ b/vendor/github.com/google/cel-go/interpreter/interpretable.go
@@ -125,7 +125,7 @@ func (test *evalTestOnly) Eval(ctx Activation) ref.Val {
val, err := test.Resolve(ctx)
// Return an error if the resolve step fails
if err != nil {
- return types.WrapErr(err)
+ return types.LabelErrNode(test.id, types.WrapErr(err))
}
if optVal, isOpt := val.(*types.Optional); isOpt {
return types.Bool(optVal.HasValue())
@@ -231,6 +231,7 @@ func (or *evalOr) Eval(ctx Activation) ref.Val {
} else {
err = types.MaybeNoSuchOverloadErr(val)
}
+ err = types.LabelErrNode(or.id, err)
}
}
}
@@ -273,6 +274,7 @@ func (and *evalAnd) Eval(ctx Activation) ref.Val {
} else {
err = types.MaybeNoSuchOverloadErr(val)
}
+ err = types.LabelErrNode(and.id, err)
}
}
}
@@ -377,7 +379,7 @@ func (zero *evalZeroArity) ID() int64 {
// Eval implements the Interpretable interface method.
func (zero *evalZeroArity) Eval(ctx Activation) ref.Val {
- return zero.impl()
+ return types.LabelErrNode(zero.id, zero.impl())
}
// Function implements the InterpretableCall interface method.
@@ -421,14 +423,14 @@ func (un *evalUnary) Eval(ctx Activation) ref.Val {
// If the implementation is bound and the argument value has the right traits required to
// invoke it, then call the implementation.
if un.impl != nil && (un.trait == 0 || (!strict && types.IsUnknownOrError(argVal)) || argVal.Type().HasTrait(un.trait)) {
- return un.impl(argVal)
+ return types.LabelErrNode(un.id, un.impl(argVal))
}
// Otherwise, if the argument is a ReceiverType attempt to invoke the receiver method on the
// operand (arg0).
if argVal.Type().HasTrait(traits.ReceiverType) {
- return argVal.(traits.Receiver).Receive(un.function, un.overload, []ref.Val{})
+ return types.LabelErrNode(un.id, argVal.(traits.Receiver).Receive(un.function, un.overload, []ref.Val{}))
}
- return types.NewErr("no such overload: %s", un.function)
+ return types.NewErrWithNodeID(un.id, "no such overload: %s", un.function)
}
// Function implements the InterpretableCall interface method.
@@ -479,14 +481,14 @@ func (bin *evalBinary) Eval(ctx Activation) ref.Val {
// If the implementation is bound and the argument value has the right traits required to
// invoke it, then call the implementation.
if bin.impl != nil && (bin.trait == 0 || (!strict && types.IsUnknownOrError(lVal)) || lVal.Type().HasTrait(bin.trait)) {
- return bin.impl(lVal, rVal)
+ return types.LabelErrNode(bin.id, bin.impl(lVal, rVal))
}
// Otherwise, if the argument is a ReceiverType attempt to invoke the receiver method on the
// operand (arg0).
if lVal.Type().HasTrait(traits.ReceiverType) {
- return lVal.(traits.Receiver).Receive(bin.function, bin.overload, []ref.Val{rVal})
+ return types.LabelErrNode(bin.id, lVal.(traits.Receiver).Receive(bin.function, bin.overload, []ref.Val{rVal}))
}
- return types.NewErr("no such overload: %s", bin.function)
+ return types.NewErrWithNodeID(bin.id, "no such overload: %s", bin.function)
}
// Function implements the InterpretableCall interface method.
@@ -545,14 +547,14 @@ func (fn *evalVarArgs) Eval(ctx Activation) ref.Val {
// invoke it, then call the implementation.
arg0 := argVals[0]
if fn.impl != nil && (fn.trait == 0 || (!strict && types.IsUnknownOrError(arg0)) || arg0.Type().HasTrait(fn.trait)) {
- return fn.impl(argVals...)
+ return types.LabelErrNode(fn.id, fn.impl(argVals...))
}
// Otherwise, if the argument is a ReceiverType attempt to invoke the receiver method on the
// operand (arg0).
if arg0.Type().HasTrait(traits.ReceiverType) {
- return arg0.(traits.Receiver).Receive(fn.function, fn.overload, argVals[1:])
+ return types.LabelErrNode(fn.id, arg0.(traits.Receiver).Receive(fn.function, fn.overload, argVals[1:]))
}
- return types.NewErr("no such overload: %s", fn.function)
+ return types.NewErrWithNodeID(fn.id, "no such overload: %s %d", fn.function, fn.id)
}
// Function implements the InterpretableCall interface method.
@@ -595,7 +597,7 @@ func (l *evalList) Eval(ctx Activation) ref.Val {
if l.hasOptionals && l.optionals[i] {
optVal, ok := elemVal.(*types.Optional)
if !ok {
- return invalidOptionalElementInit(elemVal)
+ return types.LabelErrNode(l.id, invalidOptionalElementInit(elemVal))
}
if !optVal.HasValue() {
continue
@@ -645,7 +647,7 @@ func (m *evalMap) Eval(ctx Activation) ref.Val {
if m.hasOptionals && m.optionals[i] {
optVal, ok := valVal.(*types.Optional)
if !ok {
- return invalidOptionalEntryInit(keyVal, valVal)
+ return types.LabelErrNode(m.id, invalidOptionalEntryInit(keyVal, valVal))
}
if !optVal.HasValue() {
delete(entries, keyVal)
@@ -705,7 +707,7 @@ func (o *evalObj) Eval(ctx Activation) ref.Val {
if o.hasOptionals && o.optionals[i] {
optVal, ok := val.(*types.Optional)
if !ok {
- return invalidOptionalEntryInit(field, val)
+ return types.LabelErrNode(o.id, invalidOptionalEntryInit(field, val))
}
if !optVal.HasValue() {
delete(fieldVals, field)
@@ -715,7 +717,7 @@ func (o *evalObj) Eval(ctx Activation) ref.Val {
}
fieldVals[field] = val
}
- return o.provider.NewValue(o.typeName, fieldVals)
+ return types.LabelErrNode(o.id, o.provider.NewValue(o.typeName, fieldVals))
}
func (o *evalObj) InitVals() []Interpretable {
@@ -921,7 +923,7 @@ func (e *evalWatchConstQual) Qualify(vars Activation, obj any) (any, error) {
out, err := e.ConstantQualifier.Qualify(vars, obj)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else {
val = e.adapter.NativeToValue(out)
}
@@ -934,7 +936,7 @@ func (e *evalWatchConstQual) QualifyIfPresent(vars Activation, obj any, presence
out, present, err := e.ConstantQualifier.QualifyIfPresent(vars, obj, presenceOnly)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else if out != nil {
val = e.adapter.NativeToValue(out)
} else if presenceOnly {
@@ -964,7 +966,7 @@ func (e *evalWatchAttrQual) Qualify(vars Activation, obj any) (any, error) {
out, err := e.Attribute.Qualify(vars, obj)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else {
val = e.adapter.NativeToValue(out)
}
@@ -977,7 +979,7 @@ func (e *evalWatchAttrQual) QualifyIfPresent(vars Activation, obj any, presenceO
out, present, err := e.Attribute.QualifyIfPresent(vars, obj, presenceOnly)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else if out != nil {
val = e.adapter.NativeToValue(out)
} else if presenceOnly {
@@ -1001,7 +1003,7 @@ func (e *evalWatchQual) Qualify(vars Activation, obj any) (any, error) {
out, err := e.Qualifier.Qualify(vars, obj)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else {
val = e.adapter.NativeToValue(out)
}
@@ -1014,7 +1016,7 @@ func (e *evalWatchQual) QualifyIfPresent(vars Activation, obj any, presenceOnly
out, present, err := e.Qualifier.QualifyIfPresent(vars, obj, presenceOnly)
var val ref.Val
if err != nil {
- val = types.WrapErr(err)
+ val = types.LabelErrNode(e.ID(), types.WrapErr(err))
} else if out != nil {
val = e.adapter.NativeToValue(out)
} else if presenceOnly {
@@ -1157,12 +1159,12 @@ func (cond *evalExhaustiveConditional) Eval(ctx Activation) ref.Val {
}
if cBool {
if tErr != nil {
- return types.WrapErr(tErr)
+ return types.LabelErrNode(cond.id, types.WrapErr(tErr))
}
return cond.adapter.NativeToValue(tVal)
}
if fErr != nil {
- return types.WrapErr(fErr)
+ return types.LabelErrNode(cond.id, types.WrapErr(fErr))
}
return cond.adapter.NativeToValue(fVal)
}
@@ -1202,7 +1204,7 @@ func (a *evalAttr) Adapter() types.Adapter {
func (a *evalAttr) Eval(ctx Activation) ref.Val {
v, err := a.attr.Resolve(ctx)
if err != nil {
- return types.WrapErr(err)
+ return types.LabelErrNode(a.ID(), types.WrapErr(err))
}
return a.adapter.NativeToValue(v)
}
diff --git a/vendor/github.com/google/cel-go/interpreter/interpreter.go b/vendor/github.com/google/cel-go/interpreter/interpreter.go
index 00fc74732c..0aca74d88b 100644
--- a/vendor/github.com/google/cel-go/interpreter/interpreter.go
+++ b/vendor/github.com/google/cel-go/interpreter/interpreter.go
@@ -22,19 +22,13 @@ import (
"github.com/google/cel-go/common/containers"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// Interpreter generates a new Interpretable from a checked or unchecked expression.
type Interpreter interface {
// NewInterpretable creates an Interpretable from a checked expression and an
// optional list of InterpretableDecorator values.
- NewInterpretable(checked *ast.CheckedAST, decorators ...InterpretableDecorator) (Interpretable, error)
-
- // NewUncheckedInterpretable returns an Interpretable from a parsed expression
- // and an optional list of InterpretableDecorator values.
- NewUncheckedInterpretable(expr *exprpb.Expr, decorators ...InterpretableDecorator) (Interpretable, error)
+ NewInterpretable(exprAST *ast.AST, decorators ...InterpretableDecorator) (Interpretable, error)
}
// EvalObserver is a functional interface that accepts an expression id and an observed value.
@@ -177,7 +171,7 @@ func NewInterpreter(dispatcher Dispatcher,
// NewIntepretable implements the Interpreter interface method.
func (i *exprInterpreter) NewInterpretable(
- checked *ast.CheckedAST,
+ checked *ast.AST,
decorators ...InterpretableDecorator) (Interpretable, error) {
p := newPlanner(
i.dispatcher,
@@ -187,19 +181,5 @@ func (i *exprInterpreter) NewInterpretable(
i.container,
checked,
decorators...)
- return p.Plan(checked.Expr)
-}
-
-// NewUncheckedIntepretable implements the Interpreter interface method.
-func (i *exprInterpreter) NewUncheckedInterpretable(
- expr *exprpb.Expr,
- decorators ...InterpretableDecorator) (Interpretable, error) {
- p := newUncheckedPlanner(
- i.dispatcher,
- i.provider,
- i.adapter,
- i.attrFactory,
- i.container,
- decorators...)
- return p.Plan(expr)
+ return p.Plan(checked.Expr())
}
diff --git a/vendor/github.com/google/cel-go/interpreter/planner.go b/vendor/github.com/google/cel-go/interpreter/planner.go
index 757cd080e5..cf371f95d5 100644
--- a/vendor/github.com/google/cel-go/interpreter/planner.go
+++ b/vendor/github.com/google/cel-go/interpreter/planner.go
@@ -23,15 +23,12 @@ import (
"github.com/google/cel-go/common/functions"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/types"
- "github.com/google/cel-go/common/types/ref"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// interpretablePlanner creates an Interpretable evaluation plan from a proto Expr value.
type interpretablePlanner interface {
// Plan generates an Interpretable value (or error) from the input proto Expr.
- Plan(expr *exprpb.Expr) (Interpretable, error)
+ Plan(expr ast.Expr) (Interpretable, error)
}
// newPlanner creates an interpretablePlanner which references a Dispatcher, TypeProvider,
@@ -43,28 +40,7 @@ func newPlanner(disp Dispatcher,
adapter types.Adapter,
attrFactory AttributeFactory,
cont *containers.Container,
- checked *ast.CheckedAST,
- decorators ...InterpretableDecorator) interpretablePlanner {
- return &planner{
- disp: disp,
- provider: provider,
- adapter: adapter,
- attrFactory: attrFactory,
- container: cont,
- refMap: checked.ReferenceMap,
- typeMap: checked.TypeMap,
- decorators: decorators,
- }
-}
-
-// newUncheckedPlanner creates an interpretablePlanner which references a Dispatcher, TypeProvider,
-// TypeAdapter, and Container to resolve functions and types at plan time. Namespaces present in
-// Select expressions are resolved lazily at evaluation time.
-func newUncheckedPlanner(disp Dispatcher,
- provider types.Provider,
- adapter types.Adapter,
- attrFactory AttributeFactory,
- cont *containers.Container,
+ exprAST *ast.AST,
decorators ...InterpretableDecorator) interpretablePlanner {
return &planner{
disp: disp,
@@ -72,8 +48,8 @@ func newUncheckedPlanner(disp Dispatcher,
adapter: adapter,
attrFactory: attrFactory,
container: cont,
- refMap: make(map[int64]*ast.ReferenceInfo),
- typeMap: make(map[int64]*types.Type),
+ refMap: exprAST.ReferenceMap(),
+ typeMap: exprAST.TypeMap(),
decorators: decorators,
}
}
@@ -95,22 +71,24 @@ type planner struct {
// useful for layering functionality into the evaluation that is not natively understood by CEL,
// such as state-tracking, expression re-write, and possibly efficient thread-safe memoization of
// repeated expressions.
-func (p *planner) Plan(expr *exprpb.Expr) (Interpretable, error) {
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_CallExpr:
+func (p *planner) Plan(expr ast.Expr) (Interpretable, error) {
+ switch expr.Kind() {
+ case ast.CallKind:
return p.decorate(p.planCall(expr))
- case *exprpb.Expr_IdentExpr:
+ case ast.IdentKind:
return p.decorate(p.planIdent(expr))
- case *exprpb.Expr_SelectExpr:
+ case ast.LiteralKind:
+ return p.decorate(p.planConst(expr))
+ case ast.SelectKind:
return p.decorate(p.planSelect(expr))
- case *exprpb.Expr_ListExpr:
+ case ast.ListKind:
return p.decorate(p.planCreateList(expr))
- case *exprpb.Expr_StructExpr:
+ case ast.MapKind:
+ return p.decorate(p.planCreateMap(expr))
+ case ast.StructKind:
return p.decorate(p.planCreateStruct(expr))
- case *exprpb.Expr_ComprehensionExpr:
+ case ast.ComprehensionKind:
return p.decorate(p.planComprehension(expr))
- case *exprpb.Expr_ConstExpr:
- return p.decorate(p.planConst(expr))
}
return nil, fmt.Errorf("unsupported expr: %v", expr)
}
@@ -132,16 +110,16 @@ func (p *planner) decorate(i Interpretable, err error) (Interpretable, error) {
}
// planIdent creates an Interpretable that resolves an identifier from an Activation.
-func (p *planner) planIdent(expr *exprpb.Expr) (Interpretable, error) {
+func (p *planner) planIdent(expr ast.Expr) (Interpretable, error) {
// Establish whether the identifier is in the reference map.
- if identRef, found := p.refMap[expr.GetId()]; found {
- return p.planCheckedIdent(expr.GetId(), identRef)
+ if identRef, found := p.refMap[expr.ID()]; found {
+ return p.planCheckedIdent(expr.ID(), identRef)
}
// Create the possible attribute list for the unresolved reference.
- ident := expr.GetIdentExpr()
+ ident := expr.AsIdent()
return &evalAttr{
adapter: p.adapter,
- attr: p.attrFactory.MaybeAttribute(expr.GetId(), ident.Name),
+ attr: p.attrFactory.MaybeAttribute(expr.ID(), ident),
}, nil
}
@@ -174,20 +152,20 @@ func (p *planner) planCheckedIdent(id int64, identRef *ast.ReferenceInfo) (Inter
// a) selects a field from a map or proto.
// b) creates a field presence test for a select within a has() macro.
// c) resolves the select expression to a namespaced identifier.
-func (p *planner) planSelect(expr *exprpb.Expr) (Interpretable, error) {
+func (p *planner) planSelect(expr ast.Expr) (Interpretable, error) {
// If the Select id appears in the reference map from the CheckedExpr proto then it is either
// a namespaced identifier or enum value.
- if identRef, found := p.refMap[expr.GetId()]; found {
- return p.planCheckedIdent(expr.GetId(), identRef)
+ if identRef, found := p.refMap[expr.ID()]; found {
+ return p.planCheckedIdent(expr.ID(), identRef)
}
- sel := expr.GetSelectExpr()
+ sel := expr.AsSelect()
// Plan the operand evaluation.
- op, err := p.Plan(sel.GetOperand())
+ op, err := p.Plan(sel.Operand())
if err != nil {
return nil, err
}
- opType := p.typeMap[sel.GetOperand().GetId()]
+ opType := p.typeMap[sel.Operand().ID()]
// If the Select was marked TestOnly, this is a presence test.
//
@@ -211,14 +189,14 @@ func (p *planner) planSelect(expr *exprpb.Expr) (Interpretable, error) {
}
// Build a qualifier for the attribute.
- qual, err := p.attrFactory.NewQualifier(opType, expr.GetId(), sel.GetField(), false)
+ qual, err := p.attrFactory.NewQualifier(opType, expr.ID(), sel.FieldName(), false)
if err != nil {
return nil, err
}
// Modify the attribute to be test-only.
- if sel.GetTestOnly() {
+ if sel.IsTestOnly() {
attr = &evalTestOnly{
- id: expr.GetId(),
+ id: expr.ID(),
InterpretableAttribute: attr,
}
}
@@ -230,10 +208,10 @@ func (p *planner) planSelect(expr *exprpb.Expr) (Interpretable, error) {
// planCall creates a callable Interpretable while specializing for common functions and invocation
// patterns. Specifically, conditional operators &&, ||, ?:, and (in)equality functions result in
// optimized Interpretable values.
-func (p *planner) planCall(expr *exprpb.Expr) (Interpretable, error) {
- call := expr.GetCallExpr()
+func (p *planner) planCall(expr ast.Expr) (Interpretable, error) {
+ call := expr.AsCall()
target, fnName, oName := p.resolveFunction(expr)
- argCount := len(call.GetArgs())
+ argCount := len(call.Args())
var offset int
if target != nil {
argCount++
@@ -248,7 +226,7 @@ func (p *planner) planCall(expr *exprpb.Expr) (Interpretable, error) {
}
args[0] = arg
}
- for i, argExpr := range call.GetArgs() {
+ for i, argExpr := range call.Args() {
arg, err := p.Plan(argExpr)
if err != nil {
return nil, err
@@ -307,7 +285,7 @@ func (p *planner) planCall(expr *exprpb.Expr) (Interpretable, error) {
}
// planCallZero generates a zero-arity callable Interpretable.
-func (p *planner) planCallZero(expr *exprpb.Expr,
+func (p *planner) planCallZero(expr ast.Expr,
function string,
overload string,
impl *functions.Overload) (Interpretable, error) {
@@ -315,7 +293,7 @@ func (p *planner) planCallZero(expr *exprpb.Expr,
return nil, fmt.Errorf("no such overload: %s()", function)
}
return &evalZeroArity{
- id: expr.GetId(),
+ id: expr.ID(),
function: function,
overload: overload,
impl: impl.Function,
@@ -323,7 +301,7 @@ func (p *planner) planCallZero(expr *exprpb.Expr,
}
// planCallUnary generates a unary callable Interpretable.
-func (p *planner) planCallUnary(expr *exprpb.Expr,
+func (p *planner) planCallUnary(expr ast.Expr,
function string,
overload string,
impl *functions.Overload,
@@ -340,7 +318,7 @@ func (p *planner) planCallUnary(expr *exprpb.Expr,
nonStrict = impl.NonStrict
}
return &evalUnary{
- id: expr.GetId(),
+ id: expr.ID(),
function: function,
overload: overload,
arg: args[0],
@@ -351,7 +329,7 @@ func (p *planner) planCallUnary(expr *exprpb.Expr,
}
// planCallBinary generates a binary callable Interpretable.
-func (p *planner) planCallBinary(expr *exprpb.Expr,
+func (p *planner) planCallBinary(expr ast.Expr,
function string,
overload string,
impl *functions.Overload,
@@ -368,7 +346,7 @@ func (p *planner) planCallBinary(expr *exprpb.Expr,
nonStrict = impl.NonStrict
}
return &evalBinary{
- id: expr.GetId(),
+ id: expr.ID(),
function: function,
overload: overload,
lhs: args[0],
@@ -380,7 +358,7 @@ func (p *planner) planCallBinary(expr *exprpb.Expr,
}
// planCallVarArgs generates a variable argument callable Interpretable.
-func (p *planner) planCallVarArgs(expr *exprpb.Expr,
+func (p *planner) planCallVarArgs(expr ast.Expr,
function string,
overload string,
impl *functions.Overload,
@@ -397,7 +375,7 @@ func (p *planner) planCallVarArgs(expr *exprpb.Expr,
nonStrict = impl.NonStrict
}
return &evalVarArgs{
- id: expr.GetId(),
+ id: expr.ID(),
function: function,
overload: overload,
args: args,
@@ -408,41 +386,41 @@ func (p *planner) planCallVarArgs(expr *exprpb.Expr,
}
// planCallEqual generates an equals (==) Interpretable.
-func (p *planner) planCallEqual(expr *exprpb.Expr, args []Interpretable) (Interpretable, error) {
+func (p *planner) planCallEqual(expr ast.Expr, args []Interpretable) (Interpretable, error) {
return &evalEq{
- id: expr.GetId(),
+ id: expr.ID(),
lhs: args[0],
rhs: args[1],
}, nil
}
// planCallNotEqual generates a not equals (!=) Interpretable.
-func (p *planner) planCallNotEqual(expr *exprpb.Expr, args []Interpretable) (Interpretable, error) {
+func (p *planner) planCallNotEqual(expr ast.Expr, args []Interpretable) (Interpretable, error) {
return &evalNe{
- id: expr.GetId(),
+ id: expr.ID(),
lhs: args[0],
rhs: args[1],
}, nil
}
// planCallLogicalAnd generates a logical and (&&) Interpretable.
-func (p *planner) planCallLogicalAnd(expr *exprpb.Expr, args []Interpretable) (Interpretable, error) {
+func (p *planner) planCallLogicalAnd(expr ast.Expr, args []Interpretable) (Interpretable, error) {
return &evalAnd{
- id: expr.GetId(),
+ id: expr.ID(),
terms: args,
}, nil
}
// planCallLogicalOr generates a logical or (||) Interpretable.
-func (p *planner) planCallLogicalOr(expr *exprpb.Expr, args []Interpretable) (Interpretable, error) {
+func (p *planner) planCallLogicalOr(expr ast.Expr, args []Interpretable) (Interpretable, error) {
return &evalOr{
- id: expr.GetId(),
+ id: expr.ID(),
terms: args,
}, nil
}
// planCallConditional generates a conditional / ternary (c ? t : f) Interpretable.
-func (p *planner) planCallConditional(expr *exprpb.Expr, args []Interpretable) (Interpretable, error) {
+func (p *planner) planCallConditional(expr ast.Expr, args []Interpretable) (Interpretable, error) {
cond := args[0]
t := args[1]
var tAttr Attribute
@@ -464,13 +442,13 @@ func (p *planner) planCallConditional(expr *exprpb.Expr, args []Interpretable) (
return &evalAttr{
adapter: p.adapter,
- attr: p.attrFactory.ConditionalAttribute(expr.GetId(), cond, tAttr, fAttr),
+ attr: p.attrFactory.ConditionalAttribute(expr.ID(), cond, tAttr, fAttr),
}, nil
}
// planCallIndex either extends an attribute with the argument to the index operation, or creates
// a relative attribute based on the return of a function call or operation.
-func (p *planner) planCallIndex(expr *exprpb.Expr, args []Interpretable, optional bool) (Interpretable, error) {
+func (p *planner) planCallIndex(expr ast.Expr, args []Interpretable, optional bool) (Interpretable, error) {
op := args[0]
ind := args[1]
opType := p.typeMap[op.ID()]
@@ -489,11 +467,11 @@ func (p *planner) planCallIndex(expr *exprpb.Expr, args []Interpretable, optiona
var qual Qualifier
switch ind := ind.(type) {
case InterpretableConst:
- qual, err = p.attrFactory.NewQualifier(opType, expr.GetId(), ind.Value(), optional)
+ qual, err = p.attrFactory.NewQualifier(opType, expr.ID(), ind.Value(), optional)
case InterpretableAttribute:
- qual, err = p.attrFactory.NewQualifier(opType, expr.GetId(), ind, optional)
+ qual, err = p.attrFactory.NewQualifier(opType, expr.ID(), ind, optional)
default:
- qual, err = p.relativeAttr(expr.GetId(), ind, optional)
+ qual, err = p.relativeAttr(expr.ID(), ind, optional)
}
if err != nil {
return nil, err
@@ -505,10 +483,10 @@ func (p *planner) planCallIndex(expr *exprpb.Expr, args []Interpretable, optiona
}
// planCreateList generates a list construction Interpretable.
-func (p *planner) planCreateList(expr *exprpb.Expr) (Interpretable, error) {
- list := expr.GetListExpr()
- optionalIndices := list.GetOptionalIndices()
- elements := list.GetElements()
+func (p *planner) planCreateList(expr ast.Expr) (Interpretable, error) {
+ list := expr.AsList()
+ optionalIndices := list.OptionalIndices()
+ elements := list.Elements()
optionals := make([]bool, len(elements))
for _, index := range optionalIndices {
if index < 0 || index >= int32(len(elements)) {
@@ -525,7 +503,7 @@ func (p *planner) planCreateList(expr *exprpb.Expr) (Interpretable, error) {
elems[i] = elemVal
}
return &evalList{
- id: expr.GetId(),
+ id: expr.ID(),
elems: elems,
optionals: optionals,
hasOptionals: len(optionals) != 0,
@@ -534,31 +512,29 @@ func (p *planner) planCreateList(expr *exprpb.Expr) (Interpretable, error) {
}
// planCreateStruct generates a map or object construction Interpretable.
-func (p *planner) planCreateStruct(expr *exprpb.Expr) (Interpretable, error) {
- str := expr.GetStructExpr()
- if len(str.MessageName) != 0 {
- return p.planCreateObj(expr)
- }
- entries := str.GetEntries()
+func (p *planner) planCreateMap(expr ast.Expr) (Interpretable, error) {
+ m := expr.AsMap()
+ entries := m.Entries()
optionals := make([]bool, len(entries))
keys := make([]Interpretable, len(entries))
vals := make([]Interpretable, len(entries))
- for i, entry := range entries {
- keyVal, err := p.Plan(entry.GetMapKey())
+ for i, e := range entries {
+ entry := e.AsMapEntry()
+ keyVal, err := p.Plan(entry.Key())
if err != nil {
return nil, err
}
keys[i] = keyVal
- valVal, err := p.Plan(entry.GetValue())
+ valVal, err := p.Plan(entry.Value())
if err != nil {
return nil, err
}
vals[i] = valVal
- optionals[i] = entry.GetOptionalEntry()
+ optionals[i] = entry.IsOptional()
}
return &evalMap{
- id: expr.GetId(),
+ id: expr.ID(),
keys: keys,
vals: vals,
optionals: optionals,
@@ -568,27 +544,28 @@ func (p *planner) planCreateStruct(expr *exprpb.Expr) (Interpretable, error) {
}
// planCreateObj generates an object construction Interpretable.
-func (p *planner) planCreateObj(expr *exprpb.Expr) (Interpretable, error) {
- obj := expr.GetStructExpr()
- typeName, defined := p.resolveTypeName(obj.GetMessageName())
+func (p *planner) planCreateStruct(expr ast.Expr) (Interpretable, error) {
+ obj := expr.AsStruct()
+ typeName, defined := p.resolveTypeName(obj.TypeName())
if !defined {
- return nil, fmt.Errorf("unknown type: %s", obj.GetMessageName())
- }
- entries := obj.GetEntries()
- optionals := make([]bool, len(entries))
- fields := make([]string, len(entries))
- vals := make([]Interpretable, len(entries))
- for i, entry := range entries {
- fields[i] = entry.GetFieldKey()
- val, err := p.Plan(entry.GetValue())
+ return nil, fmt.Errorf("unknown type: %s", obj.TypeName())
+ }
+ objFields := obj.Fields()
+ optionals := make([]bool, len(objFields))
+ fields := make([]string, len(objFields))
+ vals := make([]Interpretable, len(objFields))
+ for i, f := range objFields {
+ field := f.AsStructField()
+ fields[i] = field.Name()
+ val, err := p.Plan(field.Value())
if err != nil {
return nil, err
}
vals[i] = val
- optionals[i] = entry.GetOptionalEntry()
+ optionals[i] = field.IsOptional()
}
return &evalObj{
- id: expr.GetId(),
+ id: expr.ID(),
typeName: typeName,
fields: fields,
vals: vals,
@@ -599,33 +576,33 @@ func (p *planner) planCreateObj(expr *exprpb.Expr) (Interpretable, error) {
}
// planComprehension generates an Interpretable fold operation.
-func (p *planner) planComprehension(expr *exprpb.Expr) (Interpretable, error) {
- fold := expr.GetComprehensionExpr()
- accu, err := p.Plan(fold.GetAccuInit())
+func (p *planner) planComprehension(expr ast.Expr) (Interpretable, error) {
+ fold := expr.AsComprehension()
+ accu, err := p.Plan(fold.AccuInit())
if err != nil {
return nil, err
}
- iterRange, err := p.Plan(fold.GetIterRange())
+ iterRange, err := p.Plan(fold.IterRange())
if err != nil {
return nil, err
}
- cond, err := p.Plan(fold.GetLoopCondition())
+ cond, err := p.Plan(fold.LoopCondition())
if err != nil {
return nil, err
}
- step, err := p.Plan(fold.GetLoopStep())
+ step, err := p.Plan(fold.LoopStep())
if err != nil {
return nil, err
}
- result, err := p.Plan(fold.GetResult())
+ result, err := p.Plan(fold.Result())
if err != nil {
return nil, err
}
return &evalFold{
- id: expr.GetId(),
- accuVar: fold.AccuVar,
+ id: expr.ID(),
+ accuVar: fold.AccuVar(),
accu: accu,
- iterVar: fold.IterVar,
+ iterVar: fold.IterVar(),
iterRange: iterRange,
cond: cond,
step: step,
@@ -635,37 +612,8 @@ func (p *planner) planComprehension(expr *exprpb.Expr) (Interpretable, error) {
}
// planConst generates a constant valued Interpretable.
-func (p *planner) planConst(expr *exprpb.Expr) (Interpretable, error) {
- val, err := p.constValue(expr.GetConstExpr())
- if err != nil {
- return nil, err
- }
- return NewConstValue(expr.GetId(), val), nil
-}
-
-// constValue converts a proto Constant value to a ref.Val.
-func (p *planner) constValue(c *exprpb.Constant) (ref.Val, error) {
- switch c.GetConstantKind().(type) {
- case *exprpb.Constant_BoolValue:
- return p.adapter.NativeToValue(c.GetBoolValue()), nil
- case *exprpb.Constant_BytesValue:
- return p.adapter.NativeToValue(c.GetBytesValue()), nil
- case *exprpb.Constant_DoubleValue:
- return p.adapter.NativeToValue(c.GetDoubleValue()), nil
- case *exprpb.Constant_DurationValue:
- return p.adapter.NativeToValue(c.GetDurationValue().AsDuration()), nil
- case *exprpb.Constant_Int64Value:
- return p.adapter.NativeToValue(c.GetInt64Value()), nil
- case *exprpb.Constant_NullValue:
- return p.adapter.NativeToValue(c.GetNullValue()), nil
- case *exprpb.Constant_StringValue:
- return p.adapter.NativeToValue(c.GetStringValue()), nil
- case *exprpb.Constant_TimestampValue:
- return p.adapter.NativeToValue(c.GetTimestampValue().AsTime()), nil
- case *exprpb.Constant_Uint64Value:
- return p.adapter.NativeToValue(c.GetUint64Value()), nil
- }
- return nil, fmt.Errorf("unknown constant type: %v", c)
+func (p *planner) planConst(expr ast.Expr) (Interpretable, error) {
+ return NewConstValue(expr.ID(), expr.AsLiteral()), nil
}
// resolveTypeName takes a qualified string constructed at parse time, applies the proto
@@ -687,17 +635,20 @@ func (p *planner) resolveTypeName(typeName string) (string, bool) {
// - The target expression may only consist of ident and select expressions.
// - The function is declared in the environment using its fully-qualified name.
// - The fully-qualified function name matches the string serialized target value.
-func (p *planner) resolveFunction(expr *exprpb.Expr) (*exprpb.Expr, string, string) {
+func (p *planner) resolveFunction(expr ast.Expr) (ast.Expr, string, string) {
// Note: similar logic exists within the `checker/checker.go`. If making changes here
// please consider the impact on checker.go and consolidate implementations or mirror code
// as appropriate.
- call := expr.GetCallExpr()
- target := call.GetTarget()
- fnName := call.GetFunction()
+ call := expr.AsCall()
+ var target ast.Expr = nil
+ if call.IsMemberFunction() {
+ target = call.Target()
+ }
+ fnName := call.FunctionName()
// Checked expressions always have a reference map entry, and _should_ have the fully qualified
// function name as the fnName value.
- oRef, hasOverload := p.refMap[expr.GetId()]
+ oRef, hasOverload := p.refMap[expr.ID()]
if hasOverload {
if len(oRef.OverloadIDs) == 1 {
return target, fnName, oRef.OverloadIDs[0]
@@ -771,16 +722,30 @@ func (p *planner) relativeAttr(id int64, eval Interpretable, opt bool) (Interpre
// toQualifiedName converts an expression AST into a qualified name if possible, with a boolean
// 'found' value that indicates if the conversion is successful.
-func (p *planner) toQualifiedName(operand *exprpb.Expr) (string, bool) {
+func (p *planner) toQualifiedName(operand ast.Expr) (string, bool) {
// If the checker identified the expression as an attribute by the type-checker, then it can't
// possibly be part of qualified name in a namespace.
- _, isAttr := p.refMap[operand.GetId()]
+ _, isAttr := p.refMap[operand.ID()]
if isAttr {
return "", false
}
// Since functions cannot be both namespaced and receiver functions, if the operand is not an
// qualified variable name, return the (possibly) qualified name given the expressions.
- return containers.ToQualifiedName(operand)
+ switch operand.Kind() {
+ case ast.IdentKind:
+ id := operand.AsIdent()
+ return id, true
+ case ast.SelectKind:
+ sel := operand.AsSelect()
+ // Test only expressions are not valid as qualified names.
+ if sel.IsTestOnly() {
+ return "", false
+ }
+ if qual, found := p.toQualifiedName(sel.Operand()); found {
+ return qual + "." + sel.FieldName(), true
+ }
+ }
+ return "", false
}
func stripLeadingDot(name string) string {
diff --git a/vendor/github.com/google/cel-go/interpreter/prune.go b/vendor/github.com/google/cel-go/interpreter/prune.go
index b8834b1cb8..410d80dc43 100644
--- a/vendor/github.com/google/cel-go/interpreter/prune.go
+++ b/vendor/github.com/google/cel-go/interpreter/prune.go
@@ -15,19 +15,18 @@
package interpreter
import (
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/overloads"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
- structpb "google.golang.org/protobuf/types/known/structpb"
)
type astPruner struct {
- expr *exprpb.Expr
- macroCalls map[int64]*exprpb.Expr
+ ast.ExprFactory
+ expr ast.Expr
+ macroCalls map[int64]ast.Expr
state EvalState
nextExprID int64
}
@@ -67,84 +66,44 @@ type astPruner struct {
// compiled and constant folded expressions, but is not willing to constant
// fold(and thus cache results of) some external calls, then they can prepare
// the overloads accordingly.
-func PruneAst(expr *exprpb.Expr, macroCalls map[int64]*exprpb.Expr, state EvalState) *exprpb.ParsedExpr {
+func PruneAst(expr ast.Expr, macroCalls map[int64]ast.Expr, state EvalState) *ast.AST {
pruneState := NewEvalState()
for _, id := range state.IDs() {
v, _ := state.Value(id)
pruneState.SetValue(id, v)
}
pruner := &astPruner{
- expr: expr,
- macroCalls: macroCalls,
- state: pruneState,
- nextExprID: getMaxID(expr)}
+ ExprFactory: ast.NewExprFactory(),
+ expr: expr,
+ macroCalls: macroCalls,
+ state: pruneState,
+ nextExprID: getMaxID(expr)}
newExpr, _ := pruner.maybePrune(expr)
- return &exprpb.ParsedExpr{
- Expr: newExpr,
- SourceInfo: &exprpb.SourceInfo{MacroCalls: pruner.macroCalls},
- }
-}
-
-func (p *astPruner) createLiteral(id int64, val *exprpb.Constant) *exprpb.Expr {
- return &exprpb.Expr{
- Id: id,
- ExprKind: &exprpb.Expr_ConstExpr{
- ConstExpr: val,
- },
+ newInfo := ast.NewSourceInfo(nil)
+ for id, call := range pruner.macroCalls {
+ newInfo.SetMacroCall(id, call)
}
+ return ast.NewAST(newExpr, newInfo)
}
-func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (*exprpb.Expr, bool) {
+func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (ast.Expr, bool) {
switch v := val.(type) {
- case types.Bool:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_BoolValue{BoolValue: bool(v)}}), true
- case types.Bytes:
+ case types.Bool, types.Bytes, types.Double, types.Int, types.Null, types.String, types.Uint:
p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_BytesValue{BytesValue: []byte(v)}}), true
- case types.Double:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_DoubleValue{DoubleValue: float64(v)}}), true
+ return p.NewLiteral(id, val), true
case types.Duration:
p.state.SetValue(id, val)
- durationString := string(v.ConvertToType(types.StringType).(types.String))
- return &exprpb.Expr{
- Id: id,
- ExprKind: &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{
- Function: overloads.TypeConvertDuration,
- Args: []*exprpb.Expr{
- p.createLiteral(p.nextID(),
- &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: durationString}}),
- },
- },
- },
- }, true
- case types.Int:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_Int64Value{Int64Value: int64(v)}}), true
- case types.Uint:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_Uint64Value{Uint64Value: uint64(v)}}), true
- case types.String:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: string(v)}}), true
- case types.Null:
- p.state.SetValue(id, val)
- return p.createLiteral(id,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_NullValue{NullValue: v.Value().(structpb.NullValue)}}), true
+ durationString := v.ConvertToType(types.StringType).(types.String)
+ return p.NewCall(id, overloads.TypeConvertDuration, p.NewLiteral(p.nextID(), durationString)), true
+ case types.Timestamp:
+ timestampString := v.ConvertToType(types.StringType).(types.String)
+ return p.NewCall(id, overloads.TypeConvertTimestamp, p.NewLiteral(p.nextID(), timestampString)), true
}
// Attempt to build a list literal.
if list, isList := val.(traits.Lister); isList {
sz := list.Size().(types.Int)
- elemExprs := make([]*exprpb.Expr, sz)
+ elemExprs := make([]ast.Expr, sz)
for i := types.Int(0); i < sz; i++ {
elem := list.Get(i)
if types.IsUnknownOrError(elem) {
@@ -157,20 +116,13 @@ func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (*exprpb.Expr, boo
elemExprs[i] = elemExpr
}
p.state.SetValue(id, val)
- return &exprpb.Expr{
- Id: id,
- ExprKind: &exprpb.Expr_ListExpr{
- ListExpr: &exprpb.Expr_CreateList{
- Elements: elemExprs,
- },
- },
- }, true
+ return p.NewList(id, elemExprs, []int32{}), true
}
// Create a map literal if possible.
if mp, isMap := val.(traits.Mapper); isMap {
it := mp.Iterator()
- entries := make([]*exprpb.Expr_CreateStruct_Entry, mp.Size().(types.Int))
+ entries := make([]ast.EntryExpr, mp.Size().(types.Int))
i := 0
for it.HasNext() != types.False {
key := it.Next()
@@ -186,25 +138,12 @@ func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (*exprpb.Expr, boo
if !ok {
return nil, false
}
- entry := &exprpb.Expr_CreateStruct_Entry{
- Id: p.nextID(),
- KeyKind: &exprpb.Expr_CreateStruct_Entry_MapKey{
- MapKey: keyExpr,
- },
- Value: valExpr,
- }
+ entry := p.NewMapEntry(p.nextID(), keyExpr, valExpr, false)
entries[i] = entry
i++
}
p.state.SetValue(id, val)
- return &exprpb.Expr{
- Id: id,
- ExprKind: &exprpb.Expr_StructExpr{
- StructExpr: &exprpb.Expr_CreateStruct{
- Entries: entries,
- },
- },
- }, true
+ return p.NewMap(id, entries), true
}
// TODO(issues/377) To construct message literals, the type provider will need to support
@@ -212,215 +151,206 @@ func (p *astPruner) maybeCreateLiteral(id int64, val ref.Val) (*exprpb.Expr, boo
return nil, false
}
-func (p *astPruner) maybePruneOptional(elem *exprpb.Expr) (*exprpb.Expr, bool) {
- elemVal, found := p.value(elem.GetId())
+func (p *astPruner) maybePruneOptional(elem ast.Expr) (ast.Expr, bool) {
+ elemVal, found := p.value(elem.ID())
if found && elemVal.Type() == types.OptionalType {
opt := elemVal.(*types.Optional)
if !opt.HasValue() {
return nil, true
}
- if newElem, pruned := p.maybeCreateLiteral(elem.GetId(), opt.GetValue()); pruned {
+ if newElem, pruned := p.maybeCreateLiteral(elem.ID(), opt.GetValue()); pruned {
return newElem, true
}
}
return elem, false
}
-func (p *astPruner) maybePruneIn(node *exprpb.Expr) (*exprpb.Expr, bool) {
+func (p *astPruner) maybePruneIn(node ast.Expr) (ast.Expr, bool) {
// elem in list
- call := node.GetCallExpr()
- val, exists := p.maybeValue(call.GetArgs()[1].GetId())
+ call := node.AsCall()
+ val, exists := p.maybeValue(call.Args()[1].ID())
if !exists {
return nil, false
}
if sz, ok := val.(traits.Sizer); ok && sz.Size() == types.IntZero {
- return p.maybeCreateLiteral(node.GetId(), types.False)
+ return p.maybeCreateLiteral(node.ID(), types.False)
}
return nil, false
}
-func (p *astPruner) maybePruneLogicalNot(node *exprpb.Expr) (*exprpb.Expr, bool) {
- call := node.GetCallExpr()
- arg := call.GetArgs()[0]
- val, exists := p.maybeValue(arg.GetId())
+func (p *astPruner) maybePruneLogicalNot(node ast.Expr) (ast.Expr, bool) {
+ call := node.AsCall()
+ arg := call.Args()[0]
+ val, exists := p.maybeValue(arg.ID())
if !exists {
return nil, false
}
if b, ok := val.(types.Bool); ok {
- return p.maybeCreateLiteral(node.GetId(), !b)
+ return p.maybeCreateLiteral(node.ID(), !b)
}
return nil, false
}
-func (p *astPruner) maybePruneOr(node *exprpb.Expr) (*exprpb.Expr, bool) {
- call := node.GetCallExpr()
+func (p *astPruner) maybePruneOr(node ast.Expr) (ast.Expr, bool) {
+ call := node.AsCall()
// We know result is unknown, so we have at least one unknown arg
// and if one side is a known value, we know we can ignore it.
- if v, exists := p.maybeValue(call.GetArgs()[0].GetId()); exists {
+ if v, exists := p.maybeValue(call.Args()[0].ID()); exists {
if v == types.True {
- return p.maybeCreateLiteral(node.GetId(), types.True)
+ return p.maybeCreateLiteral(node.ID(), types.True)
}
- return call.GetArgs()[1], true
+ return call.Args()[1], true
}
- if v, exists := p.maybeValue(call.GetArgs()[1].GetId()); exists {
+ if v, exists := p.maybeValue(call.Args()[1].ID()); exists {
if v == types.True {
- return p.maybeCreateLiteral(node.GetId(), types.True)
+ return p.maybeCreateLiteral(node.ID(), types.True)
}
- return call.GetArgs()[0], true
+ return call.Args()[0], true
}
return nil, false
}
-func (p *astPruner) maybePruneAnd(node *exprpb.Expr) (*exprpb.Expr, bool) {
- call := node.GetCallExpr()
+func (p *astPruner) maybePruneAnd(node ast.Expr) (ast.Expr, bool) {
+ call := node.AsCall()
// We know result is unknown, so we have at least one unknown arg
// and if one side is a known value, we know we can ignore it.
- if v, exists := p.maybeValue(call.GetArgs()[0].GetId()); exists {
+ if v, exists := p.maybeValue(call.Args()[0].ID()); exists {
if v == types.False {
- return p.maybeCreateLiteral(node.GetId(), types.False)
+ return p.maybeCreateLiteral(node.ID(), types.False)
}
- return call.GetArgs()[1], true
+ return call.Args()[1], true
}
- if v, exists := p.maybeValue(call.GetArgs()[1].GetId()); exists {
+ if v, exists := p.maybeValue(call.Args()[1].ID()); exists {
if v == types.False {
- return p.maybeCreateLiteral(node.GetId(), types.False)
+ return p.maybeCreateLiteral(node.ID(), types.False)
}
- return call.GetArgs()[0], true
+ return call.Args()[0], true
}
return nil, false
}
-func (p *astPruner) maybePruneConditional(node *exprpb.Expr) (*exprpb.Expr, bool) {
- call := node.GetCallExpr()
- cond, exists := p.maybeValue(call.GetArgs()[0].GetId())
+func (p *astPruner) maybePruneConditional(node ast.Expr) (ast.Expr, bool) {
+ call := node.AsCall()
+ cond, exists := p.maybeValue(call.Args()[0].ID())
if !exists {
return nil, false
}
if cond.Value().(bool) {
- return call.GetArgs()[1], true
+ return call.Args()[1], true
}
- return call.GetArgs()[2], true
+ return call.Args()[2], true
}
-func (p *astPruner) maybePruneFunction(node *exprpb.Expr) (*exprpb.Expr, bool) {
- if _, exists := p.value(node.GetId()); !exists {
+func (p *astPruner) maybePruneFunction(node ast.Expr) (ast.Expr, bool) {
+ if _, exists := p.value(node.ID()); !exists {
return nil, false
}
- call := node.GetCallExpr()
- if call.Function == operators.LogicalOr {
+ call := node.AsCall()
+ if call.FunctionName() == operators.LogicalOr {
return p.maybePruneOr(node)
}
- if call.Function == operators.LogicalAnd {
+ if call.FunctionName() == operators.LogicalAnd {
return p.maybePruneAnd(node)
}
- if call.Function == operators.Conditional {
+ if call.FunctionName() == operators.Conditional {
return p.maybePruneConditional(node)
}
- if call.Function == operators.In {
+ if call.FunctionName() == operators.In {
return p.maybePruneIn(node)
}
- if call.Function == operators.LogicalNot {
+ if call.FunctionName() == operators.LogicalNot {
return p.maybePruneLogicalNot(node)
}
return nil, false
}
-func (p *astPruner) maybePrune(node *exprpb.Expr) (*exprpb.Expr, bool) {
+func (p *astPruner) maybePrune(node ast.Expr) (ast.Expr, bool) {
return p.prune(node)
}
-func (p *astPruner) prune(node *exprpb.Expr) (*exprpb.Expr, bool) {
+func (p *astPruner) prune(node ast.Expr) (ast.Expr, bool) {
if node == nil {
return node, false
}
- val, valueExists := p.maybeValue(node.GetId())
+ val, valueExists := p.maybeValue(node.ID())
if valueExists {
- if newNode, ok := p.maybeCreateLiteral(node.GetId(), val); ok {
- delete(p.macroCalls, node.GetId())
+ if newNode, ok := p.maybeCreateLiteral(node.ID(), val); ok {
+ delete(p.macroCalls, node.ID())
return newNode, true
}
}
- if macro, found := p.macroCalls[node.GetId()]; found {
+ if macro, found := p.macroCalls[node.ID()]; found {
// Ensure that intermediate values for the comprehension are cleared during pruning
- compre := node.GetComprehensionExpr()
- if compre != nil {
- visit(macro, clearIterVarVisitor(compre.IterVar, p.state))
+ if node.Kind() == ast.ComprehensionKind {
+ compre := node.AsComprehension()
+ visit(macro, clearIterVarVisitor(compre.IterVar(), p.state))
}
// prune the expression in terms of the macro call instead of the expanded form.
if newMacro, pruned := p.prune(macro); pruned {
- p.macroCalls[node.GetId()] = newMacro
+ p.macroCalls[node.ID()] = newMacro
}
}
// We have either an unknown/error value, or something we don't want to
// transform, or expression was not evaluated. If possible, drill down
// more.
- switch node.GetExprKind().(type) {
- case *exprpb.Expr_SelectExpr:
- if operand, pruned := p.maybePrune(node.GetSelectExpr().GetOperand()); pruned {
- return &exprpb.Expr{
- Id: node.GetId(),
- ExprKind: &exprpb.Expr_SelectExpr{
- SelectExpr: &exprpb.Expr_Select{
- Operand: operand,
- Field: node.GetSelectExpr().GetField(),
- TestOnly: node.GetSelectExpr().GetTestOnly(),
- },
- },
- }, true
- }
- case *exprpb.Expr_CallExpr:
- var prunedCall bool
- call := node.GetCallExpr()
- args := call.GetArgs()
- newArgs := make([]*exprpb.Expr, len(args))
- newCall := &exprpb.Expr_Call{
- Function: call.GetFunction(),
- Target: call.GetTarget(),
- Args: newArgs,
- }
- for i, arg := range args {
- newArgs[i] = arg
- if newArg, prunedArg := p.maybePrune(arg); prunedArg {
- prunedCall = true
- newArgs[i] = newArg
+ switch node.Kind() {
+ case ast.SelectKind:
+ sel := node.AsSelect()
+ if operand, isPruned := p.maybePrune(sel.Operand()); isPruned {
+ if sel.IsTestOnly() {
+ return p.NewPresenceTest(node.ID(), operand, sel.FieldName()), true
}
+ return p.NewSelect(node.ID(), operand, sel.FieldName()), true
}
- if newTarget, prunedTarget := p.maybePrune(call.GetTarget()); prunedTarget {
- prunedCall = true
- newCall.Target = newTarget
+ case ast.CallKind:
+ argsPruned := false
+ call := node.AsCall()
+ args := call.Args()
+ newArgs := make([]ast.Expr, len(args))
+ for i, a := range args {
+ newArgs[i] = a
+ if arg, isPruned := p.maybePrune(a); isPruned {
+ argsPruned = true
+ newArgs[i] = arg
+ }
}
- newNode := &exprpb.Expr{
- Id: node.GetId(),
- ExprKind: &exprpb.Expr_CallExpr{
- CallExpr: newCall,
- },
+ if !call.IsMemberFunction() {
+ newCall := p.NewCall(node.ID(), call.FunctionName(), newArgs...)
+ if prunedCall, isPruned := p.maybePruneFunction(newCall); isPruned {
+ return prunedCall, true
+ }
+ return newCall, argsPruned
}
- if newExpr, pruned := p.maybePruneFunction(newNode); pruned {
- newExpr, _ = p.maybePrune(newExpr)
- return newExpr, true
+ newTarget := call.Target()
+ targetPruned := false
+ if prunedTarget, isPruned := p.maybePrune(call.Target()); isPruned {
+ targetPruned = true
+ newTarget = prunedTarget
}
- if prunedCall {
- return newNode, true
+ newCall := p.NewMemberCall(node.ID(), call.FunctionName(), newTarget, newArgs...)
+ if prunedCall, isPruned := p.maybePruneFunction(newCall); isPruned {
+ return prunedCall, true
}
- case *exprpb.Expr_ListExpr:
- elems := node.GetListExpr().GetElements()
- optIndices := node.GetListExpr().GetOptionalIndices()
+ return newCall, targetPruned || argsPruned
+ case ast.ListKind:
+ l := node.AsList()
+ elems := l.Elements()
+ optIndices := l.OptionalIndices()
optIndexMap := map[int32]bool{}
for _, i := range optIndices {
optIndexMap[i] = true
}
newOptIndexMap := make(map[int32]bool, len(optIndexMap))
- newElems := make([]*exprpb.Expr, 0, len(elems))
- var prunedList bool
-
+ newElems := make([]ast.Expr, 0, len(elems))
+ var listPruned bool
prunedIdx := 0
for i, elem := range elems {
_, isOpt := optIndexMap[int32(i)]
if isOpt {
newElem, pruned := p.maybePruneOptional(elem)
if pruned {
- prunedList = true
+ listPruned = true
if newElem != nil {
newElems = append(newElems, newElem)
prunedIdx++
@@ -431,7 +361,7 @@ func (p *astPruner) prune(node *exprpb.Expr) (*exprpb.Expr, bool) {
}
if newElem, prunedElem := p.maybePrune(elem); prunedElem {
newElems = append(newElems, newElem)
- prunedList = true
+ listPruned = true
} else {
newElems = append(newElems, elem)
}
@@ -443,76 +373,64 @@ func (p *astPruner) prune(node *exprpb.Expr) (*exprpb.Expr, bool) {
optIndices[idx] = i
idx++
}
- if prunedList {
- return &exprpb.Expr{
- Id: node.GetId(),
- ExprKind: &exprpb.Expr_ListExpr{
- ListExpr: &exprpb.Expr_CreateList{
- Elements: newElems,
- OptionalIndices: optIndices,
- },
- },
- }, true
+ if listPruned {
+ return p.NewList(node.ID(), newElems, optIndices), true
}
- case *exprpb.Expr_StructExpr:
- var prunedStruct bool
- entries := node.GetStructExpr().GetEntries()
- messageType := node.GetStructExpr().GetMessageName()
- newEntries := make([]*exprpb.Expr_CreateStruct_Entry, len(entries))
+ case ast.MapKind:
+ var mapPruned bool
+ m := node.AsMap()
+ entries := m.Entries()
+ newEntries := make([]ast.EntryExpr, len(entries))
for i, entry := range entries {
newEntries[i] = entry
- newKey, prunedKey := p.maybePrune(entry.GetMapKey())
- newValue, prunedValue := p.maybePrune(entry.GetValue())
- if !prunedKey && !prunedValue {
+ e := entry.AsMapEntry()
+ newKey, keyPruned := p.maybePrune(e.Key())
+ newValue, valuePruned := p.maybePrune(e.Value())
+ if !keyPruned && !valuePruned {
continue
}
- prunedStruct = true
- newEntry := &exprpb.Expr_CreateStruct_Entry{
- Value: newValue,
- }
- if messageType != "" {
- newEntry.KeyKind = &exprpb.Expr_CreateStruct_Entry_FieldKey{
- FieldKey: entry.GetFieldKey(),
- }
- } else {
- newEntry.KeyKind = &exprpb.Expr_CreateStruct_Entry_MapKey{
- MapKey: newKey,
- }
- }
- newEntry.OptionalEntry = entry.GetOptionalEntry()
+ mapPruned = true
+ newEntry := p.NewMapEntry(entry.ID(), newKey, newValue, e.IsOptional())
newEntries[i] = newEntry
}
- if prunedStruct {
- return &exprpb.Expr{
- Id: node.GetId(),
- ExprKind: &exprpb.Expr_StructExpr{
- StructExpr: &exprpb.Expr_CreateStruct{
- MessageName: messageType,
- Entries: newEntries,
- },
- },
- }, true
+ if mapPruned {
+ return p.NewMap(node.ID(), newEntries), true
}
- case *exprpb.Expr_ComprehensionExpr:
- compre := node.GetComprehensionExpr()
+ case ast.StructKind:
+ var structPruned bool
+ obj := node.AsStruct()
+ fields := obj.Fields()
+ newFields := make([]ast.EntryExpr, len(fields))
+ for i, field := range fields {
+ newFields[i] = field
+ f := field.AsStructField()
+ newValue, prunedValue := p.maybePrune(f.Value())
+ if !prunedValue {
+ continue
+ }
+ structPruned = true
+ newEntry := p.NewStructField(field.ID(), f.Name(), newValue, f.IsOptional())
+ newFields[i] = newEntry
+ }
+ if structPruned {
+ return p.NewStruct(node.ID(), obj.TypeName(), newFields), true
+ }
+ case ast.ComprehensionKind:
+ compre := node.AsComprehension()
// Only the range of the comprehension is pruned since the state tracking only records
// the last iteration of the comprehension and not each step in the evaluation which
// means that the any residuals computed in between might be inaccurate.
- if newRange, pruned := p.maybePrune(compre.GetIterRange()); pruned {
- return &exprpb.Expr{
- Id: node.GetId(),
- ExprKind: &exprpb.Expr_ComprehensionExpr{
- ComprehensionExpr: &exprpb.Expr_Comprehension{
- IterVar: compre.GetIterVar(),
- IterRange: newRange,
- AccuVar: compre.GetAccuVar(),
- AccuInit: compre.GetAccuInit(),
- LoopCondition: compre.GetLoopCondition(),
- LoopStep: compre.GetLoopStep(),
- Result: compre.GetResult(),
- },
- },
- }, true
+ if newRange, pruned := p.maybePrune(compre.IterRange()); pruned {
+ return p.NewComprehension(
+ node.ID(),
+ newRange,
+ compre.IterVar(),
+ compre.AccuVar(),
+ compre.AccuInit(),
+ compre.LoopCondition(),
+ compre.LoopStep(),
+ compre.Result(),
+ ), true
}
}
return node, false
@@ -539,12 +457,12 @@ func (p *astPruner) nextID() int64 {
type astVisitor struct {
// visitEntry is called on every expr node, including those within a map/struct entry.
- visitExpr func(expr *exprpb.Expr)
+ visitExpr func(expr ast.Expr)
// visitEntry is called before entering the key, value of a map/struct entry.
- visitEntry func(entry *exprpb.Expr_CreateStruct_Entry)
+ visitEntry func(entry ast.EntryExpr)
}
-func getMaxID(expr *exprpb.Expr) int64 {
+func getMaxID(expr ast.Expr) int64 {
maxID := int64(1)
visit(expr, maxIDVisitor(&maxID))
return maxID
@@ -552,10 +470,9 @@ func getMaxID(expr *exprpb.Expr) int64 {
func clearIterVarVisitor(varName string, state EvalState) astVisitor {
return astVisitor{
- visitExpr: func(e *exprpb.Expr) {
- ident := e.GetIdentExpr()
- if ident != nil && ident.GetName() == varName {
- state.SetValue(e.GetId(), nil)
+ visitExpr: func(e ast.Expr) {
+ if e.Kind() == ast.IdentKind && e.AsIdent() == varName {
+ state.SetValue(e.ID(), nil)
}
},
}
@@ -563,56 +480,63 @@ func clearIterVarVisitor(varName string, state EvalState) astVisitor {
func maxIDVisitor(maxID *int64) astVisitor {
return astVisitor{
- visitExpr: func(e *exprpb.Expr) {
- if e.GetId() >= *maxID {
- *maxID = e.GetId() + 1
+ visitExpr: func(e ast.Expr) {
+ if e.ID() >= *maxID {
+ *maxID = e.ID() + 1
}
},
- visitEntry: func(e *exprpb.Expr_CreateStruct_Entry) {
- if e.GetId() >= *maxID {
- *maxID = e.GetId() + 1
+ visitEntry: func(e ast.EntryExpr) {
+ if e.ID() >= *maxID {
+ *maxID = e.ID() + 1
}
},
}
}
-func visit(expr *exprpb.Expr, visitor astVisitor) {
- exprs := []*exprpb.Expr{expr}
+func visit(expr ast.Expr, visitor astVisitor) {
+ exprs := []ast.Expr{expr}
for len(exprs) != 0 {
e := exprs[0]
if visitor.visitExpr != nil {
visitor.visitExpr(e)
}
exprs = exprs[1:]
- switch e.GetExprKind().(type) {
- case *exprpb.Expr_SelectExpr:
- exprs = append(exprs, e.GetSelectExpr().GetOperand())
- case *exprpb.Expr_CallExpr:
- call := e.GetCallExpr()
- if call.GetTarget() != nil {
- exprs = append(exprs, call.GetTarget())
+ switch e.Kind() {
+ case ast.SelectKind:
+ exprs = append(exprs, e.AsSelect().Operand())
+ case ast.CallKind:
+ call := e.AsCall()
+ if call.Target() != nil {
+ exprs = append(exprs, call.Target())
}
- exprs = append(exprs, call.GetArgs()...)
- case *exprpb.Expr_ComprehensionExpr:
- compre := e.GetComprehensionExpr()
+ exprs = append(exprs, call.Args()...)
+ case ast.ComprehensionKind:
+ compre := e.AsComprehension()
exprs = append(exprs,
- compre.GetIterRange(),
- compre.GetAccuInit(),
- compre.GetLoopCondition(),
- compre.GetLoopStep(),
- compre.GetResult())
- case *exprpb.Expr_ListExpr:
- list := e.GetListExpr()
- exprs = append(exprs, list.GetElements()...)
- case *exprpb.Expr_StructExpr:
- for _, entry := range e.GetStructExpr().GetEntries() {
+ compre.IterRange(),
+ compre.AccuInit(),
+ compre.LoopCondition(),
+ compre.LoopStep(),
+ compre.Result())
+ case ast.ListKind:
+ list := e.AsList()
+ exprs = append(exprs, list.Elements()...)
+ case ast.MapKind:
+ for _, entry := range e.AsMap().Entries() {
+ e := entry.AsMapEntry()
if visitor.visitEntry != nil {
visitor.visitEntry(entry)
}
- if entry.GetMapKey() != nil {
- exprs = append(exprs, entry.GetMapKey())
+ exprs = append(exprs, e.Key())
+ exprs = append(exprs, e.Value())
+ }
+ case ast.StructKind:
+ for _, entry := range e.AsStruct().Fields() {
+ f := entry.AsStructField()
+ if visitor.visitEntry != nil {
+ visitor.visitEntry(entry)
}
- exprs = append(exprs, entry.GetValue())
+ exprs = append(exprs, f.Value())
}
}
}
diff --git a/vendor/github.com/google/cel-go/parser/BUILD.bazel b/vendor/github.com/google/cel-go/parser/BUILD.bazel
index 67ecc95543..97bc9bd434 100644
--- a/vendor/github.com/google/cel-go/parser/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/parser/BUILD.bazel
@@ -20,10 +20,13 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//common:go_default_library",
+ "//common/ast:go_default_library",
"//common/operators:go_default_library",
"//common/runes:go_default_library",
+ "//common/types:go_default_library",
+ "//common/types/ref:go_default_library",
"//parser/gen:go_default_library",
- "@com_github_antlr_antlr4_runtime_go_antlr_v4//:go_default_library",
+ "@com_github_antlr4_go_antlr_v4//:go_default_library",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//types/known/structpb:go_default_library",
@@ -43,10 +46,12 @@ go_test(
":go_default_library",
],
deps = [
+ "//common/ast:go_default_library",
"//common/debug:go_default_library",
+ "//common/types:go_default_library",
"//parser/gen:go_default_library",
"//test:go_default_library",
- "@com_github_antlr_antlr4_runtime_go_antlr_v4//:go_default_library",
+ "@com_github_antlr4_go_antlr_v4//:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//testing/protocmp:go_default_library",
],
diff --git a/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel b/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel
index 654d1de7aa..e704334834 100644
--- a/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/parser/gen/BUILD.bazel
@@ -21,6 +21,6 @@ go_library(
],
importpath = "github.com/google/cel-go/parser/gen",
deps = [
- "@com_github_antlr_antlr4_runtime_go_antlr_v4//:go_default_library",
+ "@com_github_antlr4_go_antlr_v4//:go_default_library",
],
)
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go b/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go
index 0247f470a7..c49d038676 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go
@@ -1,7 +1,7 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
-import "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+import "github.com/antlr4-go/antlr/v4"
// BaseCELListener is a complete listener for a parse tree produced by CELParser.
type BaseCELListener struct{}
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go b/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go
index 52a7f4dc57..b2c0783d39 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go
@@ -1,7 +1,8 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
-import "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+import "github.com/antlr4-go/antlr/v4"
+
type BaseCELVisitor struct {
*antlr.BaseParseTreeVisitor
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go b/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go
index 98ddc06d0b..e026cc46f0 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_lexer.go
@@ -1,280 +1,278 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen
-
import (
"fmt"
- "sync"
+ "sync"
"unicode"
-
- "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+ "github.com/antlr4-go/antlr/v4"
)
-
// Suppress unused import error
var _ = fmt.Printf
var _ = sync.Once{}
var _ = unicode.IsLetter
+
type CELLexer struct {
*antlr.BaseLexer
channelNames []string
- modeNames []string
+ modeNames []string
// TODO: EOF string
}
-var cellexerLexerStaticData struct {
- once sync.Once
- serializedATN []int32
- channelNames []string
- modeNames []string
- literalNames []string
- symbolicNames []string
- ruleNames []string
- predictionContextCache *antlr.PredictionContextCache
- atn *antlr.ATN
- decisionToDFA []*antlr.DFA
+var CELLexerLexerStaticData struct {
+ once sync.Once
+ serializedATN []int32
+ ChannelNames []string
+ ModeNames []string
+ LiteralNames []string
+ SymbolicNames []string
+ RuleNames []string
+ PredictionContextCache *antlr.PredictionContextCache
+ atn *antlr.ATN
+ decisionToDFA []*antlr.DFA
}
func cellexerLexerInit() {
- staticData := &cellexerLexerStaticData
- staticData.channelNames = []string{
- "DEFAULT_TOKEN_CHANNEL", "HIDDEN",
- }
- staticData.modeNames = []string{
- "DEFAULT_MODE",
- }
- staticData.literalNames = []string{
- "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
- "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
- "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
- }
- staticData.symbolicNames = []string{
- "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
- "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
- "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
- "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
- "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
- "STRING", "BYTES", "IDENTIFIER",
- }
- staticData.ruleNames = []string{
- "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
- "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
- "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
- "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
- "NUL", "BACKSLASH", "LETTER", "DIGIT", "EXPONENT", "HEXDIGIT", "RAW",
- "ESC_SEQ", "ESC_CHAR_SEQ", "ESC_OCT_SEQ", "ESC_BYTE_SEQ", "ESC_UNI_SEQ",
- "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT", "STRING",
- "BYTES", "IDENTIFIER",
- }
- staticData.predictionContextCache = antlr.NewPredictionContextCache()
- staticData.serializedATN = []int32{
- 4, 0, 36, 423, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2,
- 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2,
- 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15,
- 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7,
- 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25,
- 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2,
- 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36,
- 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7,
- 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46,
- 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4,
- 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8,
- 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13,
- 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1,
- 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24,
- 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1,
- 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29,
- 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 177, 8, 31, 1, 31, 4, 31, 180, 8, 31,
- 11, 31, 12, 31, 181, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1,
- 34, 3, 34, 192, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36,
- 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1,
- 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38,
- 1, 38, 1, 38, 1, 38, 3, 38, 225, 8, 38, 1, 39, 4, 39, 228, 8, 39, 11, 39,
- 12, 39, 229, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 238, 8, 40,
- 10, 40, 12, 40, 241, 9, 40, 1, 40, 1, 40, 1, 41, 4, 41, 246, 8, 41, 11,
- 41, 12, 41, 247, 1, 41, 1, 41, 4, 41, 252, 8, 41, 11, 41, 12, 41, 253,
- 1, 41, 3, 41, 257, 8, 41, 1, 41, 4, 41, 260, 8, 41, 11, 41, 12, 41, 261,
- 1, 41, 1, 41, 1, 41, 1, 41, 4, 41, 268, 8, 41, 11, 41, 12, 41, 269, 1,
- 41, 3, 41, 273, 8, 41, 3, 41, 275, 8, 41, 1, 42, 4, 42, 278, 8, 42, 11,
- 42, 12, 42, 279, 1, 42, 1, 42, 1, 42, 1, 42, 4, 42, 286, 8, 42, 11, 42,
- 12, 42, 287, 3, 42, 290, 8, 42, 1, 43, 4, 43, 293, 8, 43, 11, 43, 12, 43,
- 294, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 303, 8, 43, 11, 43,
- 12, 43, 304, 1, 43, 1, 43, 3, 43, 309, 8, 43, 1, 44, 1, 44, 1, 44, 5, 44,
- 314, 8, 44, 10, 44, 12, 44, 317, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5,
- 44, 323, 8, 44, 10, 44, 12, 44, 326, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44,
- 1, 44, 1, 44, 1, 44, 5, 44, 335, 8, 44, 10, 44, 12, 44, 338, 9, 44, 1,
- 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 349,
- 8, 44, 10, 44, 12, 44, 352, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
- 44, 5, 44, 360, 8, 44, 10, 44, 12, 44, 363, 9, 44, 1, 44, 1, 44, 1, 44,
- 1, 44, 1, 44, 5, 44, 370, 8, 44, 10, 44, 12, 44, 373, 9, 44, 1, 44, 1,
- 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 383, 8, 44, 10, 44,
- 12, 44, 386, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
- 44, 1, 44, 1, 44, 5, 44, 398, 8, 44, 10, 44, 12, 44, 401, 9, 44, 1, 44,
- 1, 44, 1, 44, 1, 44, 3, 44, 407, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1,
- 46, 3, 46, 414, 8, 46, 1, 46, 1, 46, 1, 46, 5, 46, 419, 8, 46, 10, 46,
- 12, 46, 422, 9, 46, 4, 336, 350, 384, 399, 0, 47, 1, 1, 3, 2, 5, 3, 7,
- 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27,
- 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45,
- 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 0, 59, 0, 61, 0, 63, 0,
- 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, 0, 79, 29, 81, 30, 83, 31,
- 85, 32, 87, 33, 89, 34, 91, 35, 93, 36, 1, 0, 16, 2, 0, 65, 90, 97, 122,
- 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, 65, 70, 97,
- 102, 2, 0, 82, 82, 114, 114, 10, 0, 34, 34, 39, 39, 63, 63, 92, 92, 96,
- 98, 102, 102, 110, 110, 114, 114, 116, 116, 118, 118, 2, 0, 88, 88, 120,
- 120, 3, 0, 9, 10, 12, 13, 32, 32, 1, 0, 10, 10, 2, 0, 85, 85, 117, 117,
- 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 39, 39, 92,
- 92, 1, 0, 92, 92, 3, 0, 10, 10, 13, 13, 34, 34, 3, 0, 10, 10, 13, 13, 39,
- 39, 2, 0, 66, 66, 98, 98, 456, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5,
- 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13,
- 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0,
- 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0,
- 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0,
- 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0,
- 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1,
- 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81,
- 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0,
- 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0,
- 3, 98, 1, 0, 0, 0, 5, 101, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 9, 106, 1, 0,
- 0, 0, 11, 109, 1, 0, 0, 0, 13, 112, 1, 0, 0, 0, 15, 114, 1, 0, 0, 0, 17,
- 117, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 122, 1, 0, 0, 0, 23, 124, 1,
- 0, 0, 0, 25, 126, 1, 0, 0, 0, 27, 128, 1, 0, 0, 0, 29, 130, 1, 0, 0, 0,
- 31, 132, 1, 0, 0, 0, 33, 134, 1, 0, 0, 0, 35, 136, 1, 0, 0, 0, 37, 138,
- 1, 0, 0, 0, 39, 140, 1, 0, 0, 0, 41, 142, 1, 0, 0, 0, 43, 144, 1, 0, 0,
- 0, 45, 146, 1, 0, 0, 0, 47, 148, 1, 0, 0, 0, 49, 150, 1, 0, 0, 0, 51, 152,
- 1, 0, 0, 0, 53, 157, 1, 0, 0, 0, 55, 163, 1, 0, 0, 0, 57, 168, 1, 0, 0,
- 0, 59, 170, 1, 0, 0, 0, 61, 172, 1, 0, 0, 0, 63, 174, 1, 0, 0, 0, 65, 183,
- 1, 0, 0, 0, 67, 185, 1, 0, 0, 0, 69, 191, 1, 0, 0, 0, 71, 193, 1, 0, 0,
- 0, 73, 196, 1, 0, 0, 0, 75, 201, 1, 0, 0, 0, 77, 224, 1, 0, 0, 0, 79, 227,
- 1, 0, 0, 0, 81, 233, 1, 0, 0, 0, 83, 274, 1, 0, 0, 0, 85, 289, 1, 0, 0,
- 0, 87, 308, 1, 0, 0, 0, 89, 406, 1, 0, 0, 0, 91, 408, 1, 0, 0, 0, 93, 413,
- 1, 0, 0, 0, 95, 96, 5, 61, 0, 0, 96, 97, 5, 61, 0, 0, 97, 2, 1, 0, 0, 0,
- 98, 99, 5, 33, 0, 0, 99, 100, 5, 61, 0, 0, 100, 4, 1, 0, 0, 0, 101, 102,
- 5, 105, 0, 0, 102, 103, 5, 110, 0, 0, 103, 6, 1, 0, 0, 0, 104, 105, 5,
- 60, 0, 0, 105, 8, 1, 0, 0, 0, 106, 107, 5, 60, 0, 0, 107, 108, 5, 61, 0,
- 0, 108, 10, 1, 0, 0, 0, 109, 110, 5, 62, 0, 0, 110, 111, 5, 61, 0, 0, 111,
- 12, 1, 0, 0, 0, 112, 113, 5, 62, 0, 0, 113, 14, 1, 0, 0, 0, 114, 115, 5,
- 38, 0, 0, 115, 116, 5, 38, 0, 0, 116, 16, 1, 0, 0, 0, 117, 118, 5, 124,
- 0, 0, 118, 119, 5, 124, 0, 0, 119, 18, 1, 0, 0, 0, 120, 121, 5, 91, 0,
- 0, 121, 20, 1, 0, 0, 0, 122, 123, 5, 93, 0, 0, 123, 22, 1, 0, 0, 0, 124,
- 125, 5, 123, 0, 0, 125, 24, 1, 0, 0, 0, 126, 127, 5, 125, 0, 0, 127, 26,
- 1, 0, 0, 0, 128, 129, 5, 40, 0, 0, 129, 28, 1, 0, 0, 0, 130, 131, 5, 41,
- 0, 0, 131, 30, 1, 0, 0, 0, 132, 133, 5, 46, 0, 0, 133, 32, 1, 0, 0, 0,
- 134, 135, 5, 44, 0, 0, 135, 34, 1, 0, 0, 0, 136, 137, 5, 45, 0, 0, 137,
- 36, 1, 0, 0, 0, 138, 139, 5, 33, 0, 0, 139, 38, 1, 0, 0, 0, 140, 141, 5,
- 63, 0, 0, 141, 40, 1, 0, 0, 0, 142, 143, 5, 58, 0, 0, 143, 42, 1, 0, 0,
- 0, 144, 145, 5, 43, 0, 0, 145, 44, 1, 0, 0, 0, 146, 147, 5, 42, 0, 0, 147,
- 46, 1, 0, 0, 0, 148, 149, 5, 47, 0, 0, 149, 48, 1, 0, 0, 0, 150, 151, 5,
- 37, 0, 0, 151, 50, 1, 0, 0, 0, 152, 153, 5, 116, 0, 0, 153, 154, 5, 114,
- 0, 0, 154, 155, 5, 117, 0, 0, 155, 156, 5, 101, 0, 0, 156, 52, 1, 0, 0,
- 0, 157, 158, 5, 102, 0, 0, 158, 159, 5, 97, 0, 0, 159, 160, 5, 108, 0,
- 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 54, 1, 0, 0, 0,
- 163, 164, 5, 110, 0, 0, 164, 165, 5, 117, 0, 0, 165, 166, 5, 108, 0, 0,
- 166, 167, 5, 108, 0, 0, 167, 56, 1, 0, 0, 0, 168, 169, 5, 92, 0, 0, 169,
- 58, 1, 0, 0, 0, 170, 171, 7, 0, 0, 0, 171, 60, 1, 0, 0, 0, 172, 173, 2,
- 48, 57, 0, 173, 62, 1, 0, 0, 0, 174, 176, 7, 1, 0, 0, 175, 177, 7, 2, 0,
- 0, 176, 175, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 1, 0, 0, 0, 178,
- 180, 3, 61, 30, 0, 179, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 179,
- 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 64, 1, 0, 0, 0, 183, 184, 7, 3,
- 0, 0, 184, 66, 1, 0, 0, 0, 185, 186, 7, 4, 0, 0, 186, 68, 1, 0, 0, 0, 187,
- 192, 3, 71, 35, 0, 188, 192, 3, 75, 37, 0, 189, 192, 3, 77, 38, 0, 190,
- 192, 3, 73, 36, 0, 191, 187, 1, 0, 0, 0, 191, 188, 1, 0, 0, 0, 191, 189,
- 1, 0, 0, 0, 191, 190, 1, 0, 0, 0, 192, 70, 1, 0, 0, 0, 193, 194, 3, 57,
- 28, 0, 194, 195, 7, 5, 0, 0, 195, 72, 1, 0, 0, 0, 196, 197, 3, 57, 28,
- 0, 197, 198, 2, 48, 51, 0, 198, 199, 2, 48, 55, 0, 199, 200, 2, 48, 55,
- 0, 200, 74, 1, 0, 0, 0, 201, 202, 3, 57, 28, 0, 202, 203, 7, 6, 0, 0, 203,
- 204, 3, 65, 32, 0, 204, 205, 3, 65, 32, 0, 205, 76, 1, 0, 0, 0, 206, 207,
- 3, 57, 28, 0, 207, 208, 5, 117, 0, 0, 208, 209, 3, 65, 32, 0, 209, 210,
- 3, 65, 32, 0, 210, 211, 3, 65, 32, 0, 211, 212, 3, 65, 32, 0, 212, 225,
- 1, 0, 0, 0, 213, 214, 3, 57, 28, 0, 214, 215, 5, 85, 0, 0, 215, 216, 3,
- 65, 32, 0, 216, 217, 3, 65, 32, 0, 217, 218, 3, 65, 32, 0, 218, 219, 3,
- 65, 32, 0, 219, 220, 3, 65, 32, 0, 220, 221, 3, 65, 32, 0, 221, 222, 3,
- 65, 32, 0, 222, 223, 3, 65, 32, 0, 223, 225, 1, 0, 0, 0, 224, 206, 1, 0,
- 0, 0, 224, 213, 1, 0, 0, 0, 225, 78, 1, 0, 0, 0, 226, 228, 7, 7, 0, 0,
- 227, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 229,
- 230, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 6, 39, 0, 0, 232, 80,
- 1, 0, 0, 0, 233, 234, 5, 47, 0, 0, 234, 235, 5, 47, 0, 0, 235, 239, 1,
- 0, 0, 0, 236, 238, 8, 8, 0, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0,
- 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241,
- 239, 1, 0, 0, 0, 242, 243, 6, 40, 0, 0, 243, 82, 1, 0, 0, 0, 244, 246,
- 3, 61, 30, 0, 245, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 245, 1,
- 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 5, 46, 0,
- 0, 250, 252, 3, 61, 30, 0, 251, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0,
- 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 1, 0, 0, 0, 255,
- 257, 3, 63, 31, 0, 256, 255, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 275,
- 1, 0, 0, 0, 258, 260, 3, 61, 30, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1,
- 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 263, 1, 0, 0,
- 0, 263, 264, 3, 63, 31, 0, 264, 275, 1, 0, 0, 0, 265, 267, 5, 46, 0, 0,
- 266, 268, 3, 61, 30, 0, 267, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269,
- 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 272, 1, 0, 0, 0, 271, 273,
- 3, 63, 31, 0, 272, 271, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1,
- 0, 0, 0, 274, 245, 1, 0, 0, 0, 274, 259, 1, 0, 0, 0, 274, 265, 1, 0, 0,
- 0, 275, 84, 1, 0, 0, 0, 276, 278, 3, 61, 30, 0, 277, 276, 1, 0, 0, 0, 278,
- 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 290,
- 1, 0, 0, 0, 281, 282, 5, 48, 0, 0, 282, 283, 5, 120, 0, 0, 283, 285, 1,
- 0, 0, 0, 284, 286, 3, 65, 32, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0,
- 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 1, 0, 0, 0,
- 289, 277, 1, 0, 0, 0, 289, 281, 1, 0, 0, 0, 290, 86, 1, 0, 0, 0, 291, 293,
- 3, 61, 30, 0, 292, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 292, 1,
- 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 7, 9, 0,
- 0, 297, 309, 1, 0, 0, 0, 298, 299, 5, 48, 0, 0, 299, 300, 5, 120, 0, 0,
- 300, 302, 1, 0, 0, 0, 301, 303, 3, 65, 32, 0, 302, 301, 1, 0, 0, 0, 303,
- 304, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 306,
- 1, 0, 0, 0, 306, 307, 7, 9, 0, 0, 307, 309, 1, 0, 0, 0, 308, 292, 1, 0,
- 0, 0, 308, 298, 1, 0, 0, 0, 309, 88, 1, 0, 0, 0, 310, 315, 5, 34, 0, 0,
- 311, 314, 3, 69, 34, 0, 312, 314, 8, 10, 0, 0, 313, 311, 1, 0, 0, 0, 313,
- 312, 1, 0, 0, 0, 314, 317, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 315, 316,
- 1, 0, 0, 0, 316, 318, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 407, 5, 34,
- 0, 0, 319, 324, 5, 39, 0, 0, 320, 323, 3, 69, 34, 0, 321, 323, 8, 11, 0,
- 0, 322, 320, 1, 0, 0, 0, 322, 321, 1, 0, 0, 0, 323, 326, 1, 0, 0, 0, 324,
- 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 327, 1, 0, 0, 0, 326, 324,
- 1, 0, 0, 0, 327, 407, 5, 39, 0, 0, 328, 329, 5, 34, 0, 0, 329, 330, 5,
- 34, 0, 0, 330, 331, 5, 34, 0, 0, 331, 336, 1, 0, 0, 0, 332, 335, 3, 69,
- 34, 0, 333, 335, 8, 12, 0, 0, 334, 332, 1, 0, 0, 0, 334, 333, 1, 0, 0,
- 0, 335, 338, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337,
- 339, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 340, 5, 34, 0, 0, 340, 341,
- 5, 34, 0, 0, 341, 407, 5, 34, 0, 0, 342, 343, 5, 39, 0, 0, 343, 344, 5,
- 39, 0, 0, 344, 345, 5, 39, 0, 0, 345, 350, 1, 0, 0, 0, 346, 349, 3, 69,
- 34, 0, 347, 349, 8, 12, 0, 0, 348, 346, 1, 0, 0, 0, 348, 347, 1, 0, 0,
- 0, 349, 352, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 351,
- 353, 1, 0, 0, 0, 352, 350, 1, 0, 0, 0, 353, 354, 5, 39, 0, 0, 354, 355,
- 5, 39, 0, 0, 355, 407, 5, 39, 0, 0, 356, 357, 3, 67, 33, 0, 357, 361, 5,
- 34, 0, 0, 358, 360, 8, 13, 0, 0, 359, 358, 1, 0, 0, 0, 360, 363, 1, 0,
- 0, 0, 361, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 364, 1, 0, 0, 0,
- 363, 361, 1, 0, 0, 0, 364, 365, 5, 34, 0, 0, 365, 407, 1, 0, 0, 0, 366,
- 367, 3, 67, 33, 0, 367, 371, 5, 39, 0, 0, 368, 370, 8, 14, 0, 0, 369, 368,
- 1, 0, 0, 0, 370, 373, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 371, 372, 1, 0,
- 0, 0, 372, 374, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 374, 375, 5, 39, 0, 0,
- 375, 407, 1, 0, 0, 0, 376, 377, 3, 67, 33, 0, 377, 378, 5, 34, 0, 0, 378,
- 379, 5, 34, 0, 0, 379, 380, 5, 34, 0, 0, 380, 384, 1, 0, 0, 0, 381, 383,
- 9, 0, 0, 0, 382, 381, 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 385, 1, 0,
- 0, 0, 384, 382, 1, 0, 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0,
- 387, 388, 5, 34, 0, 0, 388, 389, 5, 34, 0, 0, 389, 390, 5, 34, 0, 0, 390,
- 407, 1, 0, 0, 0, 391, 392, 3, 67, 33, 0, 392, 393, 5, 39, 0, 0, 393, 394,
- 5, 39, 0, 0, 394, 395, 5, 39, 0, 0, 395, 399, 1, 0, 0, 0, 396, 398, 9,
- 0, 0, 0, 397, 396, 1, 0, 0, 0, 398, 401, 1, 0, 0, 0, 399, 400, 1, 0, 0,
- 0, 399, 397, 1, 0, 0, 0, 400, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402,
- 403, 5, 39, 0, 0, 403, 404, 5, 39, 0, 0, 404, 405, 5, 39, 0, 0, 405, 407,
- 1, 0, 0, 0, 406, 310, 1, 0, 0, 0, 406, 319, 1, 0, 0, 0, 406, 328, 1, 0,
- 0, 0, 406, 342, 1, 0, 0, 0, 406, 356, 1, 0, 0, 0, 406, 366, 1, 0, 0, 0,
- 406, 376, 1, 0, 0, 0, 406, 391, 1, 0, 0, 0, 407, 90, 1, 0, 0, 0, 408, 409,
- 7, 15, 0, 0, 409, 410, 3, 89, 44, 0, 410, 92, 1, 0, 0, 0, 411, 414, 3,
- 59, 29, 0, 412, 414, 5, 95, 0, 0, 413, 411, 1, 0, 0, 0, 413, 412, 1, 0,
- 0, 0, 414, 420, 1, 0, 0, 0, 415, 419, 3, 59, 29, 0, 416, 419, 3, 61, 30,
- 0, 417, 419, 5, 95, 0, 0, 418, 415, 1, 0, 0, 0, 418, 416, 1, 0, 0, 0, 418,
- 417, 1, 0, 0, 0, 419, 422, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 420, 421,
- 1, 0, 0, 0, 421, 94, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 36, 0, 176, 181,
- 191, 224, 229, 239, 247, 253, 256, 261, 269, 272, 274, 279, 287, 289, 294,
- 304, 308, 313, 315, 322, 324, 334, 336, 348, 350, 361, 371, 384, 399, 406,
- 413, 418, 420, 1, 0, 1, 0,
- }
- deserializer := antlr.NewATNDeserializer(nil)
- staticData.atn = deserializer.Deserialize(staticData.serializedATN)
- atn := staticData.atn
- staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
- decisionToDFA := staticData.decisionToDFA
- for index, state := range atn.DecisionToState {
- decisionToDFA[index] = antlr.NewDFA(state, index)
- }
+ staticData := &CELLexerLexerStaticData
+ staticData.ChannelNames = []string{
+ "DEFAULT_TOKEN_CHANNEL", "HIDDEN",
+ }
+ staticData.ModeNames = []string{
+ "DEFAULT_MODE",
+ }
+ staticData.LiteralNames = []string{
+ "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
+ "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
+ "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
+ }
+ staticData.SymbolicNames = []string{
+ "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
+ "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
+ "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
+ "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
+ "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
+ "STRING", "BYTES", "IDENTIFIER",
+ }
+ staticData.RuleNames = []string{
+ "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
+ "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
+ "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
+ "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
+ "NUL", "BACKSLASH", "LETTER", "DIGIT", "EXPONENT", "HEXDIGIT", "RAW",
+ "ESC_SEQ", "ESC_CHAR_SEQ", "ESC_OCT_SEQ", "ESC_BYTE_SEQ", "ESC_UNI_SEQ",
+ "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT", "STRING",
+ "BYTES", "IDENTIFIER",
+ }
+ staticData.PredictionContextCache = antlr.NewPredictionContextCache()
+ staticData.serializedATN = []int32{
+ 4, 0, 36, 423, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2,
+ 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2,
+ 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15,
+ 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7,
+ 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25,
+ 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2,
+ 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36,
+ 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7,
+ 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46,
+ 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4,
+ 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8,
+ 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13,
+ 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1,
+ 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24,
+ 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1,
+ 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29,
+ 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 177, 8, 31, 1, 31, 4, 31, 180, 8, 31,
+ 11, 31, 12, 31, 181, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1,
+ 34, 3, 34, 192, 8, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36,
+ 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1,
+ 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38,
+ 1, 38, 1, 38, 1, 38, 3, 38, 225, 8, 38, 1, 39, 4, 39, 228, 8, 39, 11, 39,
+ 12, 39, 229, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 238, 8, 40,
+ 10, 40, 12, 40, 241, 9, 40, 1, 40, 1, 40, 1, 41, 4, 41, 246, 8, 41, 11,
+ 41, 12, 41, 247, 1, 41, 1, 41, 4, 41, 252, 8, 41, 11, 41, 12, 41, 253,
+ 1, 41, 3, 41, 257, 8, 41, 1, 41, 4, 41, 260, 8, 41, 11, 41, 12, 41, 261,
+ 1, 41, 1, 41, 1, 41, 1, 41, 4, 41, 268, 8, 41, 11, 41, 12, 41, 269, 1,
+ 41, 3, 41, 273, 8, 41, 3, 41, 275, 8, 41, 1, 42, 4, 42, 278, 8, 42, 11,
+ 42, 12, 42, 279, 1, 42, 1, 42, 1, 42, 1, 42, 4, 42, 286, 8, 42, 11, 42,
+ 12, 42, 287, 3, 42, 290, 8, 42, 1, 43, 4, 43, 293, 8, 43, 11, 43, 12, 43,
+ 294, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 4, 43, 303, 8, 43, 11, 43,
+ 12, 43, 304, 1, 43, 1, 43, 3, 43, 309, 8, 43, 1, 44, 1, 44, 1, 44, 5, 44,
+ 314, 8, 44, 10, 44, 12, 44, 317, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5,
+ 44, 323, 8, 44, 10, 44, 12, 44, 326, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44,
+ 1, 44, 1, 44, 1, 44, 5, 44, 335, 8, 44, 10, 44, 12, 44, 338, 9, 44, 1,
+ 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 349,
+ 8, 44, 10, 44, 12, 44, 352, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
+ 44, 5, 44, 360, 8, 44, 10, 44, 12, 44, 363, 9, 44, 1, 44, 1, 44, 1, 44,
+ 1, 44, 1, 44, 5, 44, 370, 8, 44, 10, 44, 12, 44, 373, 9, 44, 1, 44, 1,
+ 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 5, 44, 383, 8, 44, 10, 44,
+ 12, 44, 386, 9, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1,
+ 44, 1, 44, 1, 44, 5, 44, 398, 8, 44, 10, 44, 12, 44, 401, 9, 44, 1, 44,
+ 1, 44, 1, 44, 1, 44, 3, 44, 407, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1,
+ 46, 3, 46, 414, 8, 46, 1, 46, 1, 46, 1, 46, 5, 46, 419, 8, 46, 10, 46,
+ 12, 46, 422, 9, 46, 4, 336, 350, 384, 399, 0, 47, 1, 1, 3, 2, 5, 3, 7,
+ 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27,
+ 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45,
+ 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 0, 59, 0, 61, 0, 63, 0,
+ 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75, 0, 77, 0, 79, 29, 81, 30, 83, 31,
+ 85, 32, 87, 33, 89, 34, 91, 35, 93, 36, 1, 0, 16, 2, 0, 65, 90, 97, 122,
+ 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 3, 0, 48, 57, 65, 70, 97,
+ 102, 2, 0, 82, 82, 114, 114, 10, 0, 34, 34, 39, 39, 63, 63, 92, 92, 96,
+ 98, 102, 102, 110, 110, 114, 114, 116, 116, 118, 118, 2, 0, 88, 88, 120,
+ 120, 3, 0, 9, 10, 12, 13, 32, 32, 1, 0, 10, 10, 2, 0, 85, 85, 117, 117,
+ 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 39, 39, 92,
+ 92, 1, 0, 92, 92, 3, 0, 10, 10, 13, 13, 34, 34, 3, 0, 10, 10, 13, 13, 39,
+ 39, 2, 0, 66, 66, 98, 98, 456, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5,
+ 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13,
+ 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0,
+ 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0,
+ 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0,
+ 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0,
+ 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1,
+ 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81,
+ 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0,
+ 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 1, 95, 1, 0, 0, 0,
+ 3, 98, 1, 0, 0, 0, 5, 101, 1, 0, 0, 0, 7, 104, 1, 0, 0, 0, 9, 106, 1, 0,
+ 0, 0, 11, 109, 1, 0, 0, 0, 13, 112, 1, 0, 0, 0, 15, 114, 1, 0, 0, 0, 17,
+ 117, 1, 0, 0, 0, 19, 120, 1, 0, 0, 0, 21, 122, 1, 0, 0, 0, 23, 124, 1,
+ 0, 0, 0, 25, 126, 1, 0, 0, 0, 27, 128, 1, 0, 0, 0, 29, 130, 1, 0, 0, 0,
+ 31, 132, 1, 0, 0, 0, 33, 134, 1, 0, 0, 0, 35, 136, 1, 0, 0, 0, 37, 138,
+ 1, 0, 0, 0, 39, 140, 1, 0, 0, 0, 41, 142, 1, 0, 0, 0, 43, 144, 1, 0, 0,
+ 0, 45, 146, 1, 0, 0, 0, 47, 148, 1, 0, 0, 0, 49, 150, 1, 0, 0, 0, 51, 152,
+ 1, 0, 0, 0, 53, 157, 1, 0, 0, 0, 55, 163, 1, 0, 0, 0, 57, 168, 1, 0, 0,
+ 0, 59, 170, 1, 0, 0, 0, 61, 172, 1, 0, 0, 0, 63, 174, 1, 0, 0, 0, 65, 183,
+ 1, 0, 0, 0, 67, 185, 1, 0, 0, 0, 69, 191, 1, 0, 0, 0, 71, 193, 1, 0, 0,
+ 0, 73, 196, 1, 0, 0, 0, 75, 201, 1, 0, 0, 0, 77, 224, 1, 0, 0, 0, 79, 227,
+ 1, 0, 0, 0, 81, 233, 1, 0, 0, 0, 83, 274, 1, 0, 0, 0, 85, 289, 1, 0, 0,
+ 0, 87, 308, 1, 0, 0, 0, 89, 406, 1, 0, 0, 0, 91, 408, 1, 0, 0, 0, 93, 413,
+ 1, 0, 0, 0, 95, 96, 5, 61, 0, 0, 96, 97, 5, 61, 0, 0, 97, 2, 1, 0, 0, 0,
+ 98, 99, 5, 33, 0, 0, 99, 100, 5, 61, 0, 0, 100, 4, 1, 0, 0, 0, 101, 102,
+ 5, 105, 0, 0, 102, 103, 5, 110, 0, 0, 103, 6, 1, 0, 0, 0, 104, 105, 5,
+ 60, 0, 0, 105, 8, 1, 0, 0, 0, 106, 107, 5, 60, 0, 0, 107, 108, 5, 61, 0,
+ 0, 108, 10, 1, 0, 0, 0, 109, 110, 5, 62, 0, 0, 110, 111, 5, 61, 0, 0, 111,
+ 12, 1, 0, 0, 0, 112, 113, 5, 62, 0, 0, 113, 14, 1, 0, 0, 0, 114, 115, 5,
+ 38, 0, 0, 115, 116, 5, 38, 0, 0, 116, 16, 1, 0, 0, 0, 117, 118, 5, 124,
+ 0, 0, 118, 119, 5, 124, 0, 0, 119, 18, 1, 0, 0, 0, 120, 121, 5, 91, 0,
+ 0, 121, 20, 1, 0, 0, 0, 122, 123, 5, 93, 0, 0, 123, 22, 1, 0, 0, 0, 124,
+ 125, 5, 123, 0, 0, 125, 24, 1, 0, 0, 0, 126, 127, 5, 125, 0, 0, 127, 26,
+ 1, 0, 0, 0, 128, 129, 5, 40, 0, 0, 129, 28, 1, 0, 0, 0, 130, 131, 5, 41,
+ 0, 0, 131, 30, 1, 0, 0, 0, 132, 133, 5, 46, 0, 0, 133, 32, 1, 0, 0, 0,
+ 134, 135, 5, 44, 0, 0, 135, 34, 1, 0, 0, 0, 136, 137, 5, 45, 0, 0, 137,
+ 36, 1, 0, 0, 0, 138, 139, 5, 33, 0, 0, 139, 38, 1, 0, 0, 0, 140, 141, 5,
+ 63, 0, 0, 141, 40, 1, 0, 0, 0, 142, 143, 5, 58, 0, 0, 143, 42, 1, 0, 0,
+ 0, 144, 145, 5, 43, 0, 0, 145, 44, 1, 0, 0, 0, 146, 147, 5, 42, 0, 0, 147,
+ 46, 1, 0, 0, 0, 148, 149, 5, 47, 0, 0, 149, 48, 1, 0, 0, 0, 150, 151, 5,
+ 37, 0, 0, 151, 50, 1, 0, 0, 0, 152, 153, 5, 116, 0, 0, 153, 154, 5, 114,
+ 0, 0, 154, 155, 5, 117, 0, 0, 155, 156, 5, 101, 0, 0, 156, 52, 1, 0, 0,
+ 0, 157, 158, 5, 102, 0, 0, 158, 159, 5, 97, 0, 0, 159, 160, 5, 108, 0,
+ 0, 160, 161, 5, 115, 0, 0, 161, 162, 5, 101, 0, 0, 162, 54, 1, 0, 0, 0,
+ 163, 164, 5, 110, 0, 0, 164, 165, 5, 117, 0, 0, 165, 166, 5, 108, 0, 0,
+ 166, 167, 5, 108, 0, 0, 167, 56, 1, 0, 0, 0, 168, 169, 5, 92, 0, 0, 169,
+ 58, 1, 0, 0, 0, 170, 171, 7, 0, 0, 0, 171, 60, 1, 0, 0, 0, 172, 173, 2,
+ 48, 57, 0, 173, 62, 1, 0, 0, 0, 174, 176, 7, 1, 0, 0, 175, 177, 7, 2, 0,
+ 0, 176, 175, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 179, 1, 0, 0, 0, 178,
+ 180, 3, 61, 30, 0, 179, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 179,
+ 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 64, 1, 0, 0, 0, 183, 184, 7, 3,
+ 0, 0, 184, 66, 1, 0, 0, 0, 185, 186, 7, 4, 0, 0, 186, 68, 1, 0, 0, 0, 187,
+ 192, 3, 71, 35, 0, 188, 192, 3, 75, 37, 0, 189, 192, 3, 77, 38, 0, 190,
+ 192, 3, 73, 36, 0, 191, 187, 1, 0, 0, 0, 191, 188, 1, 0, 0, 0, 191, 189,
+ 1, 0, 0, 0, 191, 190, 1, 0, 0, 0, 192, 70, 1, 0, 0, 0, 193, 194, 3, 57,
+ 28, 0, 194, 195, 7, 5, 0, 0, 195, 72, 1, 0, 0, 0, 196, 197, 3, 57, 28,
+ 0, 197, 198, 2, 48, 51, 0, 198, 199, 2, 48, 55, 0, 199, 200, 2, 48, 55,
+ 0, 200, 74, 1, 0, 0, 0, 201, 202, 3, 57, 28, 0, 202, 203, 7, 6, 0, 0, 203,
+ 204, 3, 65, 32, 0, 204, 205, 3, 65, 32, 0, 205, 76, 1, 0, 0, 0, 206, 207,
+ 3, 57, 28, 0, 207, 208, 5, 117, 0, 0, 208, 209, 3, 65, 32, 0, 209, 210,
+ 3, 65, 32, 0, 210, 211, 3, 65, 32, 0, 211, 212, 3, 65, 32, 0, 212, 225,
+ 1, 0, 0, 0, 213, 214, 3, 57, 28, 0, 214, 215, 5, 85, 0, 0, 215, 216, 3,
+ 65, 32, 0, 216, 217, 3, 65, 32, 0, 217, 218, 3, 65, 32, 0, 218, 219, 3,
+ 65, 32, 0, 219, 220, 3, 65, 32, 0, 220, 221, 3, 65, 32, 0, 221, 222, 3,
+ 65, 32, 0, 222, 223, 3, 65, 32, 0, 223, 225, 1, 0, 0, 0, 224, 206, 1, 0,
+ 0, 0, 224, 213, 1, 0, 0, 0, 225, 78, 1, 0, 0, 0, 226, 228, 7, 7, 0, 0,
+ 227, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 229,
+ 230, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 6, 39, 0, 0, 232, 80,
+ 1, 0, 0, 0, 233, 234, 5, 47, 0, 0, 234, 235, 5, 47, 0, 0, 235, 239, 1,
+ 0, 0, 0, 236, 238, 8, 8, 0, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0,
+ 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241,
+ 239, 1, 0, 0, 0, 242, 243, 6, 40, 0, 0, 243, 82, 1, 0, 0, 0, 244, 246,
+ 3, 61, 30, 0, 245, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 245, 1,
+ 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 251, 5, 46, 0,
+ 0, 250, 252, 3, 61, 30, 0, 251, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0,
+ 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 1, 0, 0, 0, 255,
+ 257, 3, 63, 31, 0, 256, 255, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 275,
+ 1, 0, 0, 0, 258, 260, 3, 61, 30, 0, 259, 258, 1, 0, 0, 0, 260, 261, 1,
+ 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 263, 1, 0, 0,
+ 0, 263, 264, 3, 63, 31, 0, 264, 275, 1, 0, 0, 0, 265, 267, 5, 46, 0, 0,
+ 266, 268, 3, 61, 30, 0, 267, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269,
+ 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 272, 1, 0, 0, 0, 271, 273,
+ 3, 63, 31, 0, 272, 271, 1, 0, 0, 0, 272, 273, 1, 0, 0, 0, 273, 275, 1,
+ 0, 0, 0, 274, 245, 1, 0, 0, 0, 274, 259, 1, 0, 0, 0, 274, 265, 1, 0, 0,
+ 0, 275, 84, 1, 0, 0, 0, 276, 278, 3, 61, 30, 0, 277, 276, 1, 0, 0, 0, 278,
+ 279, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 290,
+ 1, 0, 0, 0, 281, 282, 5, 48, 0, 0, 282, 283, 5, 120, 0, 0, 283, 285, 1,
+ 0, 0, 0, 284, 286, 3, 65, 32, 0, 285, 284, 1, 0, 0, 0, 286, 287, 1, 0,
+ 0, 0, 287, 285, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 290, 1, 0, 0, 0,
+ 289, 277, 1, 0, 0, 0, 289, 281, 1, 0, 0, 0, 290, 86, 1, 0, 0, 0, 291, 293,
+ 3, 61, 30, 0, 292, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 292, 1,
+ 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 7, 9, 0,
+ 0, 297, 309, 1, 0, 0, 0, 298, 299, 5, 48, 0, 0, 299, 300, 5, 120, 0, 0,
+ 300, 302, 1, 0, 0, 0, 301, 303, 3, 65, 32, 0, 302, 301, 1, 0, 0, 0, 303,
+ 304, 1, 0, 0, 0, 304, 302, 1, 0, 0, 0, 304, 305, 1, 0, 0, 0, 305, 306,
+ 1, 0, 0, 0, 306, 307, 7, 9, 0, 0, 307, 309, 1, 0, 0, 0, 308, 292, 1, 0,
+ 0, 0, 308, 298, 1, 0, 0, 0, 309, 88, 1, 0, 0, 0, 310, 315, 5, 34, 0, 0,
+ 311, 314, 3, 69, 34, 0, 312, 314, 8, 10, 0, 0, 313, 311, 1, 0, 0, 0, 313,
+ 312, 1, 0, 0, 0, 314, 317, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 315, 316,
+ 1, 0, 0, 0, 316, 318, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 407, 5, 34,
+ 0, 0, 319, 324, 5, 39, 0, 0, 320, 323, 3, 69, 34, 0, 321, 323, 8, 11, 0,
+ 0, 322, 320, 1, 0, 0, 0, 322, 321, 1, 0, 0, 0, 323, 326, 1, 0, 0, 0, 324,
+ 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 327, 1, 0, 0, 0, 326, 324,
+ 1, 0, 0, 0, 327, 407, 5, 39, 0, 0, 328, 329, 5, 34, 0, 0, 329, 330, 5,
+ 34, 0, 0, 330, 331, 5, 34, 0, 0, 331, 336, 1, 0, 0, 0, 332, 335, 3, 69,
+ 34, 0, 333, 335, 8, 12, 0, 0, 334, 332, 1, 0, 0, 0, 334, 333, 1, 0, 0,
+ 0, 335, 338, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337,
+ 339, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 340, 5, 34, 0, 0, 340, 341,
+ 5, 34, 0, 0, 341, 407, 5, 34, 0, 0, 342, 343, 5, 39, 0, 0, 343, 344, 5,
+ 39, 0, 0, 344, 345, 5, 39, 0, 0, 345, 350, 1, 0, 0, 0, 346, 349, 3, 69,
+ 34, 0, 347, 349, 8, 12, 0, 0, 348, 346, 1, 0, 0, 0, 348, 347, 1, 0, 0,
+ 0, 349, 352, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 350, 348, 1, 0, 0, 0, 351,
+ 353, 1, 0, 0, 0, 352, 350, 1, 0, 0, 0, 353, 354, 5, 39, 0, 0, 354, 355,
+ 5, 39, 0, 0, 355, 407, 5, 39, 0, 0, 356, 357, 3, 67, 33, 0, 357, 361, 5,
+ 34, 0, 0, 358, 360, 8, 13, 0, 0, 359, 358, 1, 0, 0, 0, 360, 363, 1, 0,
+ 0, 0, 361, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 364, 1, 0, 0, 0,
+ 363, 361, 1, 0, 0, 0, 364, 365, 5, 34, 0, 0, 365, 407, 1, 0, 0, 0, 366,
+ 367, 3, 67, 33, 0, 367, 371, 5, 39, 0, 0, 368, 370, 8, 14, 0, 0, 369, 368,
+ 1, 0, 0, 0, 370, 373, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 371, 372, 1, 0,
+ 0, 0, 372, 374, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 374, 375, 5, 39, 0, 0,
+ 375, 407, 1, 0, 0, 0, 376, 377, 3, 67, 33, 0, 377, 378, 5, 34, 0, 0, 378,
+ 379, 5, 34, 0, 0, 379, 380, 5, 34, 0, 0, 380, 384, 1, 0, 0, 0, 381, 383,
+ 9, 0, 0, 0, 382, 381, 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 385, 1, 0,
+ 0, 0, 384, 382, 1, 0, 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0,
+ 387, 388, 5, 34, 0, 0, 388, 389, 5, 34, 0, 0, 389, 390, 5, 34, 0, 0, 390,
+ 407, 1, 0, 0, 0, 391, 392, 3, 67, 33, 0, 392, 393, 5, 39, 0, 0, 393, 394,
+ 5, 39, 0, 0, 394, 395, 5, 39, 0, 0, 395, 399, 1, 0, 0, 0, 396, 398, 9,
+ 0, 0, 0, 397, 396, 1, 0, 0, 0, 398, 401, 1, 0, 0, 0, 399, 400, 1, 0, 0,
+ 0, 399, 397, 1, 0, 0, 0, 400, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402,
+ 403, 5, 39, 0, 0, 403, 404, 5, 39, 0, 0, 404, 405, 5, 39, 0, 0, 405, 407,
+ 1, 0, 0, 0, 406, 310, 1, 0, 0, 0, 406, 319, 1, 0, 0, 0, 406, 328, 1, 0,
+ 0, 0, 406, 342, 1, 0, 0, 0, 406, 356, 1, 0, 0, 0, 406, 366, 1, 0, 0, 0,
+ 406, 376, 1, 0, 0, 0, 406, 391, 1, 0, 0, 0, 407, 90, 1, 0, 0, 0, 408, 409,
+ 7, 15, 0, 0, 409, 410, 3, 89, 44, 0, 410, 92, 1, 0, 0, 0, 411, 414, 3,
+ 59, 29, 0, 412, 414, 5, 95, 0, 0, 413, 411, 1, 0, 0, 0, 413, 412, 1, 0,
+ 0, 0, 414, 420, 1, 0, 0, 0, 415, 419, 3, 59, 29, 0, 416, 419, 3, 61, 30,
+ 0, 417, 419, 5, 95, 0, 0, 418, 415, 1, 0, 0, 0, 418, 416, 1, 0, 0, 0, 418,
+ 417, 1, 0, 0, 0, 419, 422, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 420, 421,
+ 1, 0, 0, 0, 421, 94, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 36, 0, 176, 181,
+ 191, 224, 229, 239, 247, 253, 256, 261, 269, 272, 274, 279, 287, 289, 294,
+ 304, 308, 313, 315, 322, 324, 334, 336, 348, 350, 361, 371, 384, 399, 406,
+ 413, 418, 420, 1, 0, 1, 0,
+}
+ deserializer := antlr.NewATNDeserializer(nil)
+ staticData.atn = deserializer.Deserialize(staticData.serializedATN)
+ atn := staticData.atn
+ staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
+ decisionToDFA := staticData.decisionToDFA
+ for index, state := range atn.DecisionToState {
+ decisionToDFA[index] = antlr.NewDFA(state, index)
+ }
}
// CELLexerInit initializes any static state used to implement CELLexer. By default the
@@ -282,22 +280,22 @@ func cellexerLexerInit() {
// NewCELLexer(). You can call this function if you wish to initialize the static state ahead
// of time.
func CELLexerInit() {
- staticData := &cellexerLexerStaticData
- staticData.once.Do(cellexerLexerInit)
+ staticData := &CELLexerLexerStaticData
+ staticData.once.Do(cellexerLexerInit)
}
// NewCELLexer produces a new lexer instance for the optional input antlr.CharStream.
func NewCELLexer(input antlr.CharStream) *CELLexer {
- CELLexerInit()
+ CELLexerInit()
l := new(CELLexer)
l.BaseLexer = antlr.NewBaseLexer(input)
- staticData := &cellexerLexerStaticData
- l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache)
- l.channelNames = staticData.channelNames
- l.modeNames = staticData.modeNames
- l.RuleNames = staticData.ruleNames
- l.LiteralNames = staticData.literalNames
- l.SymbolicNames = staticData.symbolicNames
+ staticData := &CELLexerLexerStaticData
+ l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache)
+ l.channelNames = staticData.ChannelNames
+ l.modeNames = staticData.ModeNames
+ l.RuleNames = staticData.RuleNames
+ l.LiteralNames = staticData.LiteralNames
+ l.SymbolicNames = staticData.SymbolicNames
l.GrammarFileName = "CEL.g4"
// TODO: l.EOF = antlr.TokenEOF
@@ -306,40 +304,41 @@ func NewCELLexer(input antlr.CharStream) *CELLexer {
// CELLexer tokens.
const (
- CELLexerEQUALS = 1
- CELLexerNOT_EQUALS = 2
- CELLexerIN = 3
- CELLexerLESS = 4
- CELLexerLESS_EQUALS = 5
+ CELLexerEQUALS = 1
+ CELLexerNOT_EQUALS = 2
+ CELLexerIN = 3
+ CELLexerLESS = 4
+ CELLexerLESS_EQUALS = 5
CELLexerGREATER_EQUALS = 6
- CELLexerGREATER = 7
- CELLexerLOGICAL_AND = 8
- CELLexerLOGICAL_OR = 9
- CELLexerLBRACKET = 10
- CELLexerRPRACKET = 11
- CELLexerLBRACE = 12
- CELLexerRBRACE = 13
- CELLexerLPAREN = 14
- CELLexerRPAREN = 15
- CELLexerDOT = 16
- CELLexerCOMMA = 17
- CELLexerMINUS = 18
- CELLexerEXCLAM = 19
- CELLexerQUESTIONMARK = 20
- CELLexerCOLON = 21
- CELLexerPLUS = 22
- CELLexerSTAR = 23
- CELLexerSLASH = 24
- CELLexerPERCENT = 25
- CELLexerCEL_TRUE = 26
- CELLexerCEL_FALSE = 27
- CELLexerNUL = 28
- CELLexerWHITESPACE = 29
- CELLexerCOMMENT = 30
- CELLexerNUM_FLOAT = 31
- CELLexerNUM_INT = 32
- CELLexerNUM_UINT = 33
- CELLexerSTRING = 34
- CELLexerBYTES = 35
- CELLexerIDENTIFIER = 36
+ CELLexerGREATER = 7
+ CELLexerLOGICAL_AND = 8
+ CELLexerLOGICAL_OR = 9
+ CELLexerLBRACKET = 10
+ CELLexerRPRACKET = 11
+ CELLexerLBRACE = 12
+ CELLexerRBRACE = 13
+ CELLexerLPAREN = 14
+ CELLexerRPAREN = 15
+ CELLexerDOT = 16
+ CELLexerCOMMA = 17
+ CELLexerMINUS = 18
+ CELLexerEXCLAM = 19
+ CELLexerQUESTIONMARK = 20
+ CELLexerCOLON = 21
+ CELLexerPLUS = 22
+ CELLexerSTAR = 23
+ CELLexerSLASH = 24
+ CELLexerPERCENT = 25
+ CELLexerCEL_TRUE = 26
+ CELLexerCEL_FALSE = 27
+ CELLexerNUL = 28
+ CELLexerWHITESPACE = 29
+ CELLexerCOMMENT = 30
+ CELLexerNUM_FLOAT = 31
+ CELLexerNUM_INT = 32
+ CELLexerNUM_UINT = 33
+ CELLexerSTRING = 34
+ CELLexerBYTES = 35
+ CELLexerIDENTIFIER = 36
)
+
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_listener.go b/vendor/github.com/google/cel-go/parser/gen/cel_listener.go
index 73b7f1d39f..22dc997898 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_listener.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_listener.go
@@ -1,7 +1,8 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
-import "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+import "github.com/antlr4-go/antlr/v4"
+
// CELListener is a complete listener for a parse tree produced by CELParser.
type CELListener interface {
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_parser.go b/vendor/github.com/google/cel-go/parser/gen/cel_parser.go
index 0cb6c8eae8..35334af615 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_parser.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_parser.go
@@ -1,12 +1,12 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
import (
"fmt"
"strconv"
- "sync"
+ "sync"
- "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+ "github.com/antlr4-go/antlr/v4"
)
// Suppress unused import errors
@@ -14,166 +14,167 @@ var _ = fmt.Printf
var _ = strconv.Itoa
var _ = sync.Once{}
+
type CELParser struct {
*antlr.BaseParser
}
-var celParserStaticData struct {
- once sync.Once
- serializedATN []int32
- literalNames []string
- symbolicNames []string
- ruleNames []string
- predictionContextCache *antlr.PredictionContextCache
- atn *antlr.ATN
- decisionToDFA []*antlr.DFA
+var CELParserStaticData struct {
+ once sync.Once
+ serializedATN []int32
+ LiteralNames []string
+ SymbolicNames []string
+ RuleNames []string
+ PredictionContextCache *antlr.PredictionContextCache
+ atn *antlr.ATN
+ decisionToDFA []*antlr.DFA
}
func celParserInit() {
- staticData := &celParserStaticData
- staticData.literalNames = []string{
- "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
- "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
- "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
- }
- staticData.symbolicNames = []string{
- "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
- "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
- "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
- "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
- "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
- "STRING", "BYTES", "IDENTIFIER",
- }
- staticData.ruleNames = []string{
- "start", "expr", "conditionalOr", "conditionalAnd", "relation", "calc",
- "unary", "member", "primary", "exprList", "listInit", "fieldInitializerList",
- "optField", "mapInitializerList", "optExpr", "literal",
- }
- staticData.predictionContextCache = antlr.NewPredictionContextCache()
- staticData.serializedATN = []int32{
- 4, 1, 36, 251, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7,
- 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7,
- 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15,
- 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 42, 8, 1, 1,
- 2, 1, 2, 1, 2, 5, 2, 47, 8, 2, 10, 2, 12, 2, 50, 9, 2, 1, 3, 1, 3, 1, 3,
- 5, 3, 55, 8, 3, 10, 3, 12, 3, 58, 9, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1,
- 4, 5, 4, 66, 8, 4, 10, 4, 12, 4, 69, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5,
- 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 80, 8, 5, 10, 5, 12, 5, 83, 9, 5, 1, 6, 1,
- 6, 4, 6, 87, 8, 6, 11, 6, 12, 6, 88, 1, 6, 1, 6, 4, 6, 93, 8, 6, 11, 6,
- 12, 6, 94, 1, 6, 3, 6, 98, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3,
- 7, 106, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 114, 8, 7, 1, 7,
- 1, 7, 1, 7, 1, 7, 3, 7, 120, 8, 7, 1, 7, 1, 7, 1, 7, 5, 7, 125, 8, 7, 10,
- 7, 12, 7, 128, 9, 7, 1, 8, 3, 8, 131, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 136,
- 8, 8, 1, 8, 3, 8, 139, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8,
- 147, 8, 8, 1, 8, 3, 8, 150, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 155, 8, 8, 1,
- 8, 3, 8, 158, 8, 8, 1, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8,
- 167, 8, 8, 10, 8, 12, 8, 170, 9, 8, 1, 8, 1, 8, 3, 8, 174, 8, 8, 1, 8,
- 3, 8, 177, 8, 8, 1, 8, 1, 8, 3, 8, 181, 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 186,
- 8, 9, 10, 9, 12, 9, 189, 9, 9, 1, 10, 1, 10, 1, 10, 5, 10, 194, 8, 10,
- 10, 10, 12, 10, 197, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1,
- 11, 1, 11, 5, 11, 207, 8, 11, 10, 11, 12, 11, 210, 9, 11, 1, 12, 3, 12,
- 213, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1,
- 13, 1, 13, 5, 13, 225, 8, 13, 10, 13, 12, 13, 228, 9, 13, 1, 14, 3, 14,
- 231, 8, 14, 1, 14, 1, 14, 1, 15, 3, 15, 236, 8, 15, 1, 15, 1, 15, 1, 15,
- 3, 15, 241, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 249,
- 8, 15, 1, 15, 0, 3, 8, 10, 14, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
- 22, 24, 26, 28, 30, 0, 3, 1, 0, 1, 7, 1, 0, 23, 25, 2, 0, 18, 18, 22, 22,
- 281, 0, 32, 1, 0, 0, 0, 2, 35, 1, 0, 0, 0, 4, 43, 1, 0, 0, 0, 6, 51, 1,
- 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 70, 1, 0, 0, 0, 12, 97, 1, 0, 0, 0, 14,
- 99, 1, 0, 0, 0, 16, 180, 1, 0, 0, 0, 18, 182, 1, 0, 0, 0, 20, 190, 1, 0,
- 0, 0, 22, 198, 1, 0, 0, 0, 24, 212, 1, 0, 0, 0, 26, 216, 1, 0, 0, 0, 28,
- 230, 1, 0, 0, 0, 30, 248, 1, 0, 0, 0, 32, 33, 3, 2, 1, 0, 33, 34, 5, 0,
- 0, 1, 34, 1, 1, 0, 0, 0, 35, 41, 3, 4, 2, 0, 36, 37, 5, 20, 0, 0, 37, 38,
- 3, 4, 2, 0, 38, 39, 5, 21, 0, 0, 39, 40, 3, 2, 1, 0, 40, 42, 1, 0, 0, 0,
- 41, 36, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 3, 1, 0, 0, 0, 43, 48, 3, 6,
- 3, 0, 44, 45, 5, 9, 0, 0, 45, 47, 3, 6, 3, 0, 46, 44, 1, 0, 0, 0, 47, 50,
- 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 48, 49, 1, 0, 0, 0, 49, 5, 1, 0, 0, 0,
- 50, 48, 1, 0, 0, 0, 51, 56, 3, 8, 4, 0, 52, 53, 5, 8, 0, 0, 53, 55, 3,
- 8, 4, 0, 54, 52, 1, 0, 0, 0, 55, 58, 1, 0, 0, 0, 56, 54, 1, 0, 0, 0, 56,
- 57, 1, 0, 0, 0, 57, 7, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 59, 60, 6, 4, -1,
- 0, 60, 61, 3, 10, 5, 0, 61, 67, 1, 0, 0, 0, 62, 63, 10, 1, 0, 0, 63, 64,
- 7, 0, 0, 0, 64, 66, 3, 8, 4, 2, 65, 62, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0,
- 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 9, 1, 0, 0, 0, 69, 67, 1, 0,
- 0, 0, 70, 71, 6, 5, -1, 0, 71, 72, 3, 12, 6, 0, 72, 81, 1, 0, 0, 0, 73,
- 74, 10, 2, 0, 0, 74, 75, 7, 1, 0, 0, 75, 80, 3, 10, 5, 3, 76, 77, 10, 1,
- 0, 0, 77, 78, 7, 2, 0, 0, 78, 80, 3, 10, 5, 2, 79, 73, 1, 0, 0, 0, 79,
- 76, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0,
- 0, 82, 11, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 98, 3, 14, 7, 0, 85, 87,
- 5, 19, 0, 0, 86, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0,
- 88, 89, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 98, 3, 14, 7, 0, 91, 93, 5,
- 18, 0, 0, 92, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94,
- 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 3, 14, 7, 0, 97, 84, 1, 0,
- 0, 0, 97, 86, 1, 0, 0, 0, 97, 92, 1, 0, 0, 0, 98, 13, 1, 0, 0, 0, 99, 100,
- 6, 7, -1, 0, 100, 101, 3, 16, 8, 0, 101, 126, 1, 0, 0, 0, 102, 103, 10,
- 3, 0, 0, 103, 105, 5, 16, 0, 0, 104, 106, 5, 20, 0, 0, 105, 104, 1, 0,
- 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 125, 5, 36, 0, 0,
- 108, 109, 10, 2, 0, 0, 109, 110, 5, 16, 0, 0, 110, 111, 5, 36, 0, 0, 111,
- 113, 5, 14, 0, 0, 112, 114, 3, 18, 9, 0, 113, 112, 1, 0, 0, 0, 113, 114,
- 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 125, 5, 15, 0, 0, 116, 117, 10,
- 1, 0, 0, 117, 119, 5, 10, 0, 0, 118, 120, 5, 20, 0, 0, 119, 118, 1, 0,
- 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 122, 3, 2, 1, 0,
- 122, 123, 5, 11, 0, 0, 123, 125, 1, 0, 0, 0, 124, 102, 1, 0, 0, 0, 124,
- 108, 1, 0, 0, 0, 124, 116, 1, 0, 0, 0, 125, 128, 1, 0, 0, 0, 126, 124,
- 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 15, 1, 0, 0, 0, 128, 126, 1, 0,
- 0, 0, 129, 131, 5, 16, 0, 0, 130, 129, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0,
- 131, 132, 1, 0, 0, 0, 132, 138, 5, 36, 0, 0, 133, 135, 5, 14, 0, 0, 134,
- 136, 3, 18, 9, 0, 135, 134, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 137,
- 1, 0, 0, 0, 137, 139, 5, 15, 0, 0, 138, 133, 1, 0, 0, 0, 138, 139, 1, 0,
- 0, 0, 139, 181, 1, 0, 0, 0, 140, 141, 5, 14, 0, 0, 141, 142, 3, 2, 1, 0,
- 142, 143, 5, 15, 0, 0, 143, 181, 1, 0, 0, 0, 144, 146, 5, 10, 0, 0, 145,
- 147, 3, 20, 10, 0, 146, 145, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 149,
- 1, 0, 0, 0, 148, 150, 5, 17, 0, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0,
- 0, 0, 150, 151, 1, 0, 0, 0, 151, 181, 5, 11, 0, 0, 152, 154, 5, 12, 0,
- 0, 153, 155, 3, 26, 13, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0,
- 155, 157, 1, 0, 0, 0, 156, 158, 5, 17, 0, 0, 157, 156, 1, 0, 0, 0, 157,
- 158, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 181, 5, 13, 0, 0, 160, 162,
- 5, 16, 0, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0,
- 0, 0, 163, 168, 5, 36, 0, 0, 164, 165, 5, 16, 0, 0, 165, 167, 5, 36, 0,
- 0, 166, 164, 1, 0, 0, 0, 167, 170, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 168,
- 169, 1, 0, 0, 0, 169, 171, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 171, 173,
- 5, 12, 0, 0, 172, 174, 3, 22, 11, 0, 173, 172, 1, 0, 0, 0, 173, 174, 1,
- 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 177, 5, 17, 0, 0, 176, 175, 1, 0, 0,
- 0, 176, 177, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 181, 5, 13, 0, 0, 179,
- 181, 3, 30, 15, 0, 180, 130, 1, 0, 0, 0, 180, 140, 1, 0, 0, 0, 180, 144,
- 1, 0, 0, 0, 180, 152, 1, 0, 0, 0, 180, 161, 1, 0, 0, 0, 180, 179, 1, 0,
- 0, 0, 181, 17, 1, 0, 0, 0, 182, 187, 3, 2, 1, 0, 183, 184, 5, 17, 0, 0,
- 184, 186, 3, 2, 1, 0, 185, 183, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187,
- 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 19, 1, 0, 0, 0, 189, 187, 1,
- 0, 0, 0, 190, 195, 3, 28, 14, 0, 191, 192, 5, 17, 0, 0, 192, 194, 3, 28,
- 14, 0, 193, 191, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0,
- 195, 196, 1, 0, 0, 0, 196, 21, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 199,
- 3, 24, 12, 0, 199, 200, 5, 21, 0, 0, 200, 208, 3, 2, 1, 0, 201, 202, 5,
- 17, 0, 0, 202, 203, 3, 24, 12, 0, 203, 204, 5, 21, 0, 0, 204, 205, 3, 2,
- 1, 0, 205, 207, 1, 0, 0, 0, 206, 201, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0,
- 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 23, 1, 0, 0, 0, 210, 208,
- 1, 0, 0, 0, 211, 213, 5, 20, 0, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0,
- 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 36, 0, 0, 215, 25, 1, 0, 0, 0,
- 216, 217, 3, 28, 14, 0, 217, 218, 5, 21, 0, 0, 218, 226, 3, 2, 1, 0, 219,
- 220, 5, 17, 0, 0, 220, 221, 3, 28, 14, 0, 221, 222, 5, 21, 0, 0, 222, 223,
- 3, 2, 1, 0, 223, 225, 1, 0, 0, 0, 224, 219, 1, 0, 0, 0, 225, 228, 1, 0,
- 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 27, 1, 0, 0, 0,
- 228, 226, 1, 0, 0, 0, 229, 231, 5, 20, 0, 0, 230, 229, 1, 0, 0, 0, 230,
- 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 3, 2, 1, 0, 233, 29, 1,
- 0, 0, 0, 234, 236, 5, 18, 0, 0, 235, 234, 1, 0, 0, 0, 235, 236, 1, 0, 0,
- 0, 236, 237, 1, 0, 0, 0, 237, 249, 5, 32, 0, 0, 238, 249, 5, 33, 0, 0,
- 239, 241, 5, 18, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241,
- 242, 1, 0, 0, 0, 242, 249, 5, 31, 0, 0, 243, 249, 5, 34, 0, 0, 244, 249,
- 5, 35, 0, 0, 245, 249, 5, 26, 0, 0, 246, 249, 5, 27, 0, 0, 247, 249, 5,
- 28, 0, 0, 248, 235, 1, 0, 0, 0, 248, 238, 1, 0, 0, 0, 248, 240, 1, 0, 0,
- 0, 248, 243, 1, 0, 0, 0, 248, 244, 1, 0, 0, 0, 248, 245, 1, 0, 0, 0, 248,
- 246, 1, 0, 0, 0, 248, 247, 1, 0, 0, 0, 249, 31, 1, 0, 0, 0, 35, 41, 48,
- 56, 67, 79, 81, 88, 94, 97, 105, 113, 119, 124, 126, 130, 135, 138, 146,
- 149, 154, 157, 161, 168, 173, 176, 180, 187, 195, 208, 212, 226, 230, 235,
- 240, 248,
- }
- deserializer := antlr.NewATNDeserializer(nil)
- staticData.atn = deserializer.Deserialize(staticData.serializedATN)
- atn := staticData.atn
- staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
- decisionToDFA := staticData.decisionToDFA
- for index, state := range atn.DecisionToState {
- decisionToDFA[index] = antlr.NewDFA(state, index)
- }
+ staticData := &CELParserStaticData
+ staticData.LiteralNames = []string{
+ "", "'=='", "'!='", "'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'",
+ "'['", "']'", "'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'",
+ "'?'", "':'", "'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'",
+ }
+ staticData.SymbolicNames = []string{
+ "", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", "GREATER_EQUALS",
+ "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", "RPRACKET", "LBRACE",
+ "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", "MINUS", "EXCLAM", "QUESTIONMARK",
+ "COLON", "PLUS", "STAR", "SLASH", "PERCENT", "CEL_TRUE", "CEL_FALSE",
+ "NUL", "WHITESPACE", "COMMENT", "NUM_FLOAT", "NUM_INT", "NUM_UINT",
+ "STRING", "BYTES", "IDENTIFIER",
+ }
+ staticData.RuleNames = []string{
+ "start", "expr", "conditionalOr", "conditionalAnd", "relation", "calc",
+ "unary", "member", "primary", "exprList", "listInit", "fieldInitializerList",
+ "optField", "mapInitializerList", "optExpr", "literal",
+ }
+ staticData.PredictionContextCache = antlr.NewPredictionContextCache()
+ staticData.serializedATN = []int32{
+ 4, 1, 36, 251, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7,
+ 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7,
+ 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15,
+ 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 42, 8, 1, 1,
+ 2, 1, 2, 1, 2, 5, 2, 47, 8, 2, 10, 2, 12, 2, 50, 9, 2, 1, 3, 1, 3, 1, 3,
+ 5, 3, 55, 8, 3, 10, 3, 12, 3, 58, 9, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1,
+ 4, 5, 4, 66, 8, 4, 10, 4, 12, 4, 69, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5,
+ 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 80, 8, 5, 10, 5, 12, 5, 83, 9, 5, 1, 6, 1,
+ 6, 4, 6, 87, 8, 6, 11, 6, 12, 6, 88, 1, 6, 1, 6, 4, 6, 93, 8, 6, 11, 6,
+ 12, 6, 94, 1, 6, 3, 6, 98, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3,
+ 7, 106, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 114, 8, 7, 1, 7,
+ 1, 7, 1, 7, 1, 7, 3, 7, 120, 8, 7, 1, 7, 1, 7, 1, 7, 5, 7, 125, 8, 7, 10,
+ 7, 12, 7, 128, 9, 7, 1, 8, 3, 8, 131, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 136,
+ 8, 8, 1, 8, 3, 8, 139, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8,
+ 147, 8, 8, 1, 8, 3, 8, 150, 8, 8, 1, 8, 1, 8, 1, 8, 3, 8, 155, 8, 8, 1,
+ 8, 3, 8, 158, 8, 8, 1, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 1, 8, 5, 8,
+ 167, 8, 8, 10, 8, 12, 8, 170, 9, 8, 1, 8, 1, 8, 3, 8, 174, 8, 8, 1, 8,
+ 3, 8, 177, 8, 8, 1, 8, 1, 8, 3, 8, 181, 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 186,
+ 8, 9, 10, 9, 12, 9, 189, 9, 9, 1, 10, 1, 10, 1, 10, 5, 10, 194, 8, 10,
+ 10, 10, 12, 10, 197, 9, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1,
+ 11, 1, 11, 5, 11, 207, 8, 11, 10, 11, 12, 11, 210, 9, 11, 1, 12, 3, 12,
+ 213, 8, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1,
+ 13, 1, 13, 5, 13, 225, 8, 13, 10, 13, 12, 13, 228, 9, 13, 1, 14, 3, 14,
+ 231, 8, 14, 1, 14, 1, 14, 1, 15, 3, 15, 236, 8, 15, 1, 15, 1, 15, 1, 15,
+ 3, 15, 241, 8, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 249,
+ 8, 15, 1, 15, 0, 3, 8, 10, 14, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
+ 22, 24, 26, 28, 30, 0, 3, 1, 0, 1, 7, 1, 0, 23, 25, 2, 0, 18, 18, 22, 22,
+ 281, 0, 32, 1, 0, 0, 0, 2, 35, 1, 0, 0, 0, 4, 43, 1, 0, 0, 0, 6, 51, 1,
+ 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 70, 1, 0, 0, 0, 12, 97, 1, 0, 0, 0, 14,
+ 99, 1, 0, 0, 0, 16, 180, 1, 0, 0, 0, 18, 182, 1, 0, 0, 0, 20, 190, 1, 0,
+ 0, 0, 22, 198, 1, 0, 0, 0, 24, 212, 1, 0, 0, 0, 26, 216, 1, 0, 0, 0, 28,
+ 230, 1, 0, 0, 0, 30, 248, 1, 0, 0, 0, 32, 33, 3, 2, 1, 0, 33, 34, 5, 0,
+ 0, 1, 34, 1, 1, 0, 0, 0, 35, 41, 3, 4, 2, 0, 36, 37, 5, 20, 0, 0, 37, 38,
+ 3, 4, 2, 0, 38, 39, 5, 21, 0, 0, 39, 40, 3, 2, 1, 0, 40, 42, 1, 0, 0, 0,
+ 41, 36, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 3, 1, 0, 0, 0, 43, 48, 3, 6,
+ 3, 0, 44, 45, 5, 9, 0, 0, 45, 47, 3, 6, 3, 0, 46, 44, 1, 0, 0, 0, 47, 50,
+ 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 48, 49, 1, 0, 0, 0, 49, 5, 1, 0, 0, 0,
+ 50, 48, 1, 0, 0, 0, 51, 56, 3, 8, 4, 0, 52, 53, 5, 8, 0, 0, 53, 55, 3,
+ 8, 4, 0, 54, 52, 1, 0, 0, 0, 55, 58, 1, 0, 0, 0, 56, 54, 1, 0, 0, 0, 56,
+ 57, 1, 0, 0, 0, 57, 7, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 59, 60, 6, 4, -1,
+ 0, 60, 61, 3, 10, 5, 0, 61, 67, 1, 0, 0, 0, 62, 63, 10, 1, 0, 0, 63, 64,
+ 7, 0, 0, 0, 64, 66, 3, 8, 4, 2, 65, 62, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0,
+ 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 9, 1, 0, 0, 0, 69, 67, 1, 0,
+ 0, 0, 70, 71, 6, 5, -1, 0, 71, 72, 3, 12, 6, 0, 72, 81, 1, 0, 0, 0, 73,
+ 74, 10, 2, 0, 0, 74, 75, 7, 1, 0, 0, 75, 80, 3, 10, 5, 3, 76, 77, 10, 1,
+ 0, 0, 77, 78, 7, 2, 0, 0, 78, 80, 3, 10, 5, 2, 79, 73, 1, 0, 0, 0, 79,
+ 76, 1, 0, 0, 0, 80, 83, 1, 0, 0, 0, 81, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0,
+ 0, 82, 11, 1, 0, 0, 0, 83, 81, 1, 0, 0, 0, 84, 98, 3, 14, 7, 0, 85, 87,
+ 5, 19, 0, 0, 86, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0,
+ 88, 89, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 98, 3, 14, 7, 0, 91, 93, 5,
+ 18, 0, 0, 92, 91, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 92, 1, 0, 0, 0, 94,
+ 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 98, 3, 14, 7, 0, 97, 84, 1, 0,
+ 0, 0, 97, 86, 1, 0, 0, 0, 97, 92, 1, 0, 0, 0, 98, 13, 1, 0, 0, 0, 99, 100,
+ 6, 7, -1, 0, 100, 101, 3, 16, 8, 0, 101, 126, 1, 0, 0, 0, 102, 103, 10,
+ 3, 0, 0, 103, 105, 5, 16, 0, 0, 104, 106, 5, 20, 0, 0, 105, 104, 1, 0,
+ 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 125, 5, 36, 0, 0,
+ 108, 109, 10, 2, 0, 0, 109, 110, 5, 16, 0, 0, 110, 111, 5, 36, 0, 0, 111,
+ 113, 5, 14, 0, 0, 112, 114, 3, 18, 9, 0, 113, 112, 1, 0, 0, 0, 113, 114,
+ 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 125, 5, 15, 0, 0, 116, 117, 10,
+ 1, 0, 0, 117, 119, 5, 10, 0, 0, 118, 120, 5, 20, 0, 0, 119, 118, 1, 0,
+ 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 122, 3, 2, 1, 0,
+ 122, 123, 5, 11, 0, 0, 123, 125, 1, 0, 0, 0, 124, 102, 1, 0, 0, 0, 124,
+ 108, 1, 0, 0, 0, 124, 116, 1, 0, 0, 0, 125, 128, 1, 0, 0, 0, 126, 124,
+ 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 15, 1, 0, 0, 0, 128, 126, 1, 0,
+ 0, 0, 129, 131, 5, 16, 0, 0, 130, 129, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0,
+ 131, 132, 1, 0, 0, 0, 132, 138, 5, 36, 0, 0, 133, 135, 5, 14, 0, 0, 134,
+ 136, 3, 18, 9, 0, 135, 134, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 137,
+ 1, 0, 0, 0, 137, 139, 5, 15, 0, 0, 138, 133, 1, 0, 0, 0, 138, 139, 1, 0,
+ 0, 0, 139, 181, 1, 0, 0, 0, 140, 141, 5, 14, 0, 0, 141, 142, 3, 2, 1, 0,
+ 142, 143, 5, 15, 0, 0, 143, 181, 1, 0, 0, 0, 144, 146, 5, 10, 0, 0, 145,
+ 147, 3, 20, 10, 0, 146, 145, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 149,
+ 1, 0, 0, 0, 148, 150, 5, 17, 0, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0,
+ 0, 0, 150, 151, 1, 0, 0, 0, 151, 181, 5, 11, 0, 0, 152, 154, 5, 12, 0,
+ 0, 153, 155, 3, 26, 13, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0,
+ 155, 157, 1, 0, 0, 0, 156, 158, 5, 17, 0, 0, 157, 156, 1, 0, 0, 0, 157,
+ 158, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 181, 5, 13, 0, 0, 160, 162,
+ 5, 16, 0, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0,
+ 0, 0, 163, 168, 5, 36, 0, 0, 164, 165, 5, 16, 0, 0, 165, 167, 5, 36, 0,
+ 0, 166, 164, 1, 0, 0, 0, 167, 170, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 168,
+ 169, 1, 0, 0, 0, 169, 171, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 171, 173,
+ 5, 12, 0, 0, 172, 174, 3, 22, 11, 0, 173, 172, 1, 0, 0, 0, 173, 174, 1,
+ 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 177, 5, 17, 0, 0, 176, 175, 1, 0, 0,
+ 0, 176, 177, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 181, 5, 13, 0, 0, 179,
+ 181, 3, 30, 15, 0, 180, 130, 1, 0, 0, 0, 180, 140, 1, 0, 0, 0, 180, 144,
+ 1, 0, 0, 0, 180, 152, 1, 0, 0, 0, 180, 161, 1, 0, 0, 0, 180, 179, 1, 0,
+ 0, 0, 181, 17, 1, 0, 0, 0, 182, 187, 3, 2, 1, 0, 183, 184, 5, 17, 0, 0,
+ 184, 186, 3, 2, 1, 0, 185, 183, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187,
+ 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 19, 1, 0, 0, 0, 189, 187, 1,
+ 0, 0, 0, 190, 195, 3, 28, 14, 0, 191, 192, 5, 17, 0, 0, 192, 194, 3, 28,
+ 14, 0, 193, 191, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0,
+ 195, 196, 1, 0, 0, 0, 196, 21, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 199,
+ 3, 24, 12, 0, 199, 200, 5, 21, 0, 0, 200, 208, 3, 2, 1, 0, 201, 202, 5,
+ 17, 0, 0, 202, 203, 3, 24, 12, 0, 203, 204, 5, 21, 0, 0, 204, 205, 3, 2,
+ 1, 0, 205, 207, 1, 0, 0, 0, 206, 201, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0,
+ 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 23, 1, 0, 0, 0, 210, 208,
+ 1, 0, 0, 0, 211, 213, 5, 20, 0, 0, 212, 211, 1, 0, 0, 0, 212, 213, 1, 0,
+ 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 5, 36, 0, 0, 215, 25, 1, 0, 0, 0,
+ 216, 217, 3, 28, 14, 0, 217, 218, 5, 21, 0, 0, 218, 226, 3, 2, 1, 0, 219,
+ 220, 5, 17, 0, 0, 220, 221, 3, 28, 14, 0, 221, 222, 5, 21, 0, 0, 222, 223,
+ 3, 2, 1, 0, 223, 225, 1, 0, 0, 0, 224, 219, 1, 0, 0, 0, 225, 228, 1, 0,
+ 0, 0, 226, 224, 1, 0, 0, 0, 226, 227, 1, 0, 0, 0, 227, 27, 1, 0, 0, 0,
+ 228, 226, 1, 0, 0, 0, 229, 231, 5, 20, 0, 0, 230, 229, 1, 0, 0, 0, 230,
+ 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 233, 3, 2, 1, 0, 233, 29, 1,
+ 0, 0, 0, 234, 236, 5, 18, 0, 0, 235, 234, 1, 0, 0, 0, 235, 236, 1, 0, 0,
+ 0, 236, 237, 1, 0, 0, 0, 237, 249, 5, 32, 0, 0, 238, 249, 5, 33, 0, 0,
+ 239, 241, 5, 18, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241,
+ 242, 1, 0, 0, 0, 242, 249, 5, 31, 0, 0, 243, 249, 5, 34, 0, 0, 244, 249,
+ 5, 35, 0, 0, 245, 249, 5, 26, 0, 0, 246, 249, 5, 27, 0, 0, 247, 249, 5,
+ 28, 0, 0, 248, 235, 1, 0, 0, 0, 248, 238, 1, 0, 0, 0, 248, 240, 1, 0, 0,
+ 0, 248, 243, 1, 0, 0, 0, 248, 244, 1, 0, 0, 0, 248, 245, 1, 0, 0, 0, 248,
+ 246, 1, 0, 0, 0, 248, 247, 1, 0, 0, 0, 249, 31, 1, 0, 0, 0, 35, 41, 48,
+ 56, 67, 79, 81, 88, 94, 97, 105, 113, 119, 124, 126, 130, 135, 138, 146,
+ 149, 154, 157, 161, 168, 173, 176, 180, 187, 195, 208, 212, 226, 230, 235,
+ 240, 248,
+}
+ deserializer := antlr.NewATNDeserializer(nil)
+ staticData.atn = deserializer.Deserialize(staticData.serializedATN)
+ atn := staticData.atn
+ staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
+ decisionToDFA := staticData.decisionToDFA
+ for index, state := range atn.DecisionToState {
+ decisionToDFA[index] = antlr.NewDFA(state, index)
+ }
}
// CELParserInit initializes any static state used to implement CELParser. By default the
@@ -181,8 +182,8 @@ func celParserInit() {
// NewCELParser(). You can call this function if you wish to initialize the static state ahead
// of time.
func CELParserInit() {
- staticData := &celParserStaticData
- staticData.once.Do(celParserInit)
+ staticData := &CELParserStaticData
+ staticData.once.Do(celParserInit)
}
// NewCELParser produces a new parser instance for the optional input antlr.TokenStream.
@@ -190,75 +191,76 @@ func NewCELParser(input antlr.TokenStream) *CELParser {
CELParserInit()
this := new(CELParser)
this.BaseParser = antlr.NewBaseParser(input)
- staticData := &celParserStaticData
- this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache)
- this.RuleNames = staticData.ruleNames
- this.LiteralNames = staticData.literalNames
- this.SymbolicNames = staticData.symbolicNames
+ staticData := &CELParserStaticData
+ this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache)
+ this.RuleNames = staticData.RuleNames
+ this.LiteralNames = staticData.LiteralNames
+ this.SymbolicNames = staticData.SymbolicNames
this.GrammarFileName = "CEL.g4"
return this
}
+
// CELParser tokens.
const (
- CELParserEOF = antlr.TokenEOF
- CELParserEQUALS = 1
- CELParserNOT_EQUALS = 2
- CELParserIN = 3
- CELParserLESS = 4
- CELParserLESS_EQUALS = 5
+ CELParserEOF = antlr.TokenEOF
+ CELParserEQUALS = 1
+ CELParserNOT_EQUALS = 2
+ CELParserIN = 3
+ CELParserLESS = 4
+ CELParserLESS_EQUALS = 5
CELParserGREATER_EQUALS = 6
- CELParserGREATER = 7
- CELParserLOGICAL_AND = 8
- CELParserLOGICAL_OR = 9
- CELParserLBRACKET = 10
- CELParserRPRACKET = 11
- CELParserLBRACE = 12
- CELParserRBRACE = 13
- CELParserLPAREN = 14
- CELParserRPAREN = 15
- CELParserDOT = 16
- CELParserCOMMA = 17
- CELParserMINUS = 18
- CELParserEXCLAM = 19
- CELParserQUESTIONMARK = 20
- CELParserCOLON = 21
- CELParserPLUS = 22
- CELParserSTAR = 23
- CELParserSLASH = 24
- CELParserPERCENT = 25
- CELParserCEL_TRUE = 26
- CELParserCEL_FALSE = 27
- CELParserNUL = 28
- CELParserWHITESPACE = 29
- CELParserCOMMENT = 30
- CELParserNUM_FLOAT = 31
- CELParserNUM_INT = 32
- CELParserNUM_UINT = 33
- CELParserSTRING = 34
- CELParserBYTES = 35
- CELParserIDENTIFIER = 36
+ CELParserGREATER = 7
+ CELParserLOGICAL_AND = 8
+ CELParserLOGICAL_OR = 9
+ CELParserLBRACKET = 10
+ CELParserRPRACKET = 11
+ CELParserLBRACE = 12
+ CELParserRBRACE = 13
+ CELParserLPAREN = 14
+ CELParserRPAREN = 15
+ CELParserDOT = 16
+ CELParserCOMMA = 17
+ CELParserMINUS = 18
+ CELParserEXCLAM = 19
+ CELParserQUESTIONMARK = 20
+ CELParserCOLON = 21
+ CELParserPLUS = 22
+ CELParserSTAR = 23
+ CELParserSLASH = 24
+ CELParserPERCENT = 25
+ CELParserCEL_TRUE = 26
+ CELParserCEL_FALSE = 27
+ CELParserNUL = 28
+ CELParserWHITESPACE = 29
+ CELParserCOMMENT = 30
+ CELParserNUM_FLOAT = 31
+ CELParserNUM_INT = 32
+ CELParserNUM_UINT = 33
+ CELParserSTRING = 34
+ CELParserBYTES = 35
+ CELParserIDENTIFIER = 36
)
// CELParser rules.
const (
- CELParserRULE_start = 0
- CELParserRULE_expr = 1
- CELParserRULE_conditionalOr = 2
- CELParserRULE_conditionalAnd = 3
- CELParserRULE_relation = 4
- CELParserRULE_calc = 5
- CELParserRULE_unary = 6
- CELParserRULE_member = 7
- CELParserRULE_primary = 8
- CELParserRULE_exprList = 9
- CELParserRULE_listInit = 10
+ CELParserRULE_start = 0
+ CELParserRULE_expr = 1
+ CELParserRULE_conditionalOr = 2
+ CELParserRULE_conditionalAnd = 3
+ CELParserRULE_relation = 4
+ CELParserRULE_calc = 5
+ CELParserRULE_unary = 6
+ CELParserRULE_member = 7
+ CELParserRULE_primary = 8
+ CELParserRULE_exprList = 9
+ CELParserRULE_listInit = 10
CELParserRULE_fieldInitializerList = 11
- CELParserRULE_optField = 12
- CELParserRULE_mapInitializerList = 13
- CELParserRULE_optExpr = 14
- CELParserRULE_literal = 15
+ CELParserRULE_optField = 12
+ CELParserRULE_mapInitializerList = 13
+ CELParserRULE_optExpr = 14
+ CELParserRULE_literal = 15
)
// IStartContext is an interface to support dynamic dispatch.
@@ -271,9 +273,11 @@ type IStartContext interface {
// GetE returns the e rule contexts.
GetE() IExprContext
+
// SetE sets the e rule contexts.
SetE(IExprContext)
+
// Getter signatures
EOF() antlr.TerminalNode
Expr() IExprContext
@@ -283,24 +287,29 @@ type IStartContext interface {
}
type StartContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- e IExprContext
+ e IExprContext
}
func NewEmptyStartContext() *StartContext {
var p = new(StartContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_start
return p
}
+func InitEmptyStartContext(p *StartContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_start
+}
+
func (*StartContext) IsStartContext() {}
func NewStartContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StartContext {
var p = new(StartContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_start
@@ -312,17 +321,19 @@ func (s *StartContext) GetParser() antlr.Parser { return s.parser }
func (s *StartContext) GetE() IExprContext { return s.e }
+
func (s *StartContext) SetE(v IExprContext) { s.e = v }
+
func (s *StartContext) EOF() antlr.TerminalNode {
return s.GetToken(CELParserEOF, 0)
}
func (s *StartContext) Expr() IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -342,6 +353,7 @@ func (s *StartContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *StartContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterStart(s)
@@ -364,45 +376,46 @@ func (s *StartContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) Start() (localctx IStartContext) {
- this := p
- _ = this
- localctx = NewStartContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 0, CELParserRULE_start)
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
+func (p *CELParser) Start_() (localctx IStartContext) {
+ localctx = NewStartContext(p, p.GetParserRuleContext(), p.GetState())
+ p.EnterRule(localctx, 0, CELParserRULE_start)
p.EnterOuterAlt(localctx, 1)
{
p.SetState(32)
var _x = p.Expr()
+
localctx.(*StartContext).e = _x
}
{
p.SetState(33)
p.Match(CELParserEOF)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IExprContext is an interface to support dynamic dispatch.
type IExprContext interface {
antlr.ParserRuleContext
@@ -411,10 +424,12 @@ type IExprContext interface {
GetParser() antlr.Parser
// GetOp returns the op token.
- GetOp() antlr.Token
+ GetOp() antlr.Token
+
// SetOp sets the op token.
- SetOp(antlr.Token)
+ SetOp(antlr.Token)
+
// GetE returns the e rule contexts.
GetE() IConditionalOrContext
@@ -425,6 +440,7 @@ type IExprContext interface {
// GetE2 returns the e2 rule contexts.
GetE2() IExprContext
+
// SetE sets the e rule contexts.
SetE(IConditionalOrContext)
@@ -434,6 +450,7 @@ type IExprContext interface {
// SetE2 sets the e2 rule contexts.
SetE2(IExprContext)
+
// Getter signatures
AllConditionalOr() []IConditionalOrContext
ConditionalOr(i int) IConditionalOrContext
@@ -446,27 +463,32 @@ type IExprContext interface {
}
type ExprContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- e IConditionalOrContext
- op antlr.Token
- e1 IConditionalOrContext
- e2 IExprContext
+ e IConditionalOrContext
+ op antlr.Token
+ e1 IConditionalOrContext
+ e2 IExprContext
}
func NewEmptyExprContext() *ExprContext {
var p = new(ExprContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_expr
return p
}
+func InitEmptyExprContext(p *ExprContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_expr
+}
+
func (*ExprContext) IsExprContext() {}
func NewExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprContext {
var p = new(ExprContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_expr
@@ -478,20 +500,24 @@ func (s *ExprContext) GetParser() antlr.Parser { return s.parser }
func (s *ExprContext) GetOp() antlr.Token { return s.op }
+
func (s *ExprContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *ExprContext) GetE() IConditionalOrContext { return s.e }
func (s *ExprContext) GetE1() IConditionalOrContext { return s.e1 }
func (s *ExprContext) GetE2() IExprContext { return s.e2 }
+
func (s *ExprContext) SetE(v IConditionalOrContext) { s.e = v }
func (s *ExprContext) SetE1(v IConditionalOrContext) { s.e1 = v }
func (s *ExprContext) SetE2(v IExprContext) { s.e2 = v }
+
func (s *ExprContext) AllConditionalOr() []IConditionalOrContext {
children := s.GetChildren()
len := 0
@@ -514,12 +540,12 @@ func (s *ExprContext) AllConditionalOr() []IConditionalOrContext {
}
func (s *ExprContext) ConditionalOr(i int) IConditionalOrContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IConditionalOrContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -542,10 +568,10 @@ func (s *ExprContext) QUESTIONMARK() antlr.TerminalNode {
}
func (s *ExprContext) Expr() IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -565,6 +591,7 @@ func (s *ExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *ExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterExpr(s)
@@ -587,42 +614,31 @@ func (s *ExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) Expr() (localctx IExprContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) Expr() (localctx IExprContext) {
localctx = NewExprContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 2, CELParserRULE_expr)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
{
p.SetState(35)
var _x = p.ConditionalOr()
+
localctx.(*ExprContext).e = _x
}
p.SetState(41)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK {
{
p.SetState(36)
@@ -630,31 +646,54 @@ func (p *CELParser) Expr() (localctx IExprContext) {
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*ExprContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(37)
var _x = p.ConditionalOr()
+
localctx.(*ExprContext).e1 = _x
}
{
p.SetState(38)
p.Match(CELParserCOLON)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(39)
var _x = p.Expr()
+
localctx.(*ExprContext).e2 = _x
}
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IConditionalOrContext is an interface to support dynamic dispatch.
type IConditionalOrContext interface {
antlr.ParserRuleContext
@@ -663,34 +702,42 @@ type IConditionalOrContext interface {
GetParser() antlr.Parser
// GetS9 returns the s9 token.
- GetS9() antlr.Token
+ GetS9() antlr.Token
+
// SetS9 sets the s9 token.
- SetS9(antlr.Token)
+ SetS9(antlr.Token)
+
// GetOps returns the ops token list.
GetOps() []antlr.Token
+
// SetOps sets the ops token list.
SetOps([]antlr.Token)
+
// GetE returns the e rule contexts.
GetE() IConditionalAndContext
// Get_conditionalAnd returns the _conditionalAnd rule contexts.
Get_conditionalAnd() IConditionalAndContext
+
// SetE sets the e rule contexts.
SetE(IConditionalAndContext)
// Set_conditionalAnd sets the _conditionalAnd rule contexts.
Set_conditionalAnd(IConditionalAndContext)
+
// GetE1 returns the e1 rule context list.
GetE1() []IConditionalAndContext
+
// SetE1 sets the e1 rule context list.
- SetE1([]IConditionalAndContext)
+ SetE1([]IConditionalAndContext)
+
// Getter signatures
AllConditionalAnd() []IConditionalAndContext
@@ -703,28 +750,33 @@ type IConditionalOrContext interface {
}
type ConditionalOrContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- e IConditionalAndContext
- s9 antlr.Token
- ops []antlr.Token
- _conditionalAnd IConditionalAndContext
- e1 []IConditionalAndContext
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+ e IConditionalAndContext
+ s9 antlr.Token
+ ops []antlr.Token
+ _conditionalAnd IConditionalAndContext
+ e1 []IConditionalAndContext
}
func NewEmptyConditionalOrContext() *ConditionalOrContext {
var p = new(ConditionalOrContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_conditionalOr
return p
}
+func InitEmptyConditionalOrContext(p *ConditionalOrContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_conditionalOr
+}
+
func (*ConditionalOrContext) IsConditionalOrContext() {}
func NewConditionalOrContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConditionalOrContext {
var p = new(ConditionalOrContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_conditionalOr
@@ -736,24 +788,32 @@ func (s *ConditionalOrContext) GetParser() antlr.Parser { return s.parser }
func (s *ConditionalOrContext) GetS9() antlr.Token { return s.s9 }
+
func (s *ConditionalOrContext) SetS9(v antlr.Token) { s.s9 = v }
+
func (s *ConditionalOrContext) GetOps() []antlr.Token { return s.ops }
+
func (s *ConditionalOrContext) SetOps(v []antlr.Token) { s.ops = v }
+
func (s *ConditionalOrContext) GetE() IConditionalAndContext { return s.e }
func (s *ConditionalOrContext) Get_conditionalAnd() IConditionalAndContext { return s._conditionalAnd }
+
func (s *ConditionalOrContext) SetE(v IConditionalAndContext) { s.e = v }
func (s *ConditionalOrContext) Set_conditionalAnd(v IConditionalAndContext) { s._conditionalAnd = v }
+
func (s *ConditionalOrContext) GetE1() []IConditionalAndContext { return s.e1 }
+
func (s *ConditionalOrContext) SetE1(v []IConditionalAndContext) { s.e1 = v }
+
func (s *ConditionalOrContext) AllConditionalAnd() []IConditionalAndContext {
children := s.GetChildren()
len := 0
@@ -776,12 +836,12 @@ func (s *ConditionalOrContext) AllConditionalAnd() []IConditionalAndContext {
}
func (s *ConditionalOrContext) ConditionalAnd(i int) IConditionalAndContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IConditionalAndContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -811,6 +871,7 @@ func (s *ConditionalOrContext) ToStringTree(ruleNames []string, recog antlr.Reco
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *ConditionalOrContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterConditionalOr(s)
@@ -833,42 +894,31 @@ func (s *ConditionalOrContext) Accept(visitor antlr.ParseTreeVisitor) interface{
}
}
-func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) {
localctx = NewConditionalOrContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 4, CELParserRULE_conditionalOr)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
{
p.SetState(43)
var _x = p.ConditionalAnd()
+
localctx.(*ConditionalOrContext).e = _x
}
p.SetState(48)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
for _la == CELParserLOGICAL_OR {
{
p.SetState(44)
@@ -876,6 +926,10 @@ func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) {
var _m = p.Match(CELParserLOGICAL_OR)
localctx.(*ConditionalOrContext).s9 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*ConditionalOrContext).ops = append(localctx.(*ConditionalOrContext).ops, localctx.(*ConditionalOrContext).s9)
{
@@ -883,18 +937,36 @@ func (p *CELParser) ConditionalOr() (localctx IConditionalOrContext) {
var _x = p.ConditionalAnd()
+
localctx.(*ConditionalOrContext)._conditionalAnd = _x
}
localctx.(*ConditionalOrContext).e1 = append(localctx.(*ConditionalOrContext).e1, localctx.(*ConditionalOrContext)._conditionalAnd)
+
p.SetState(50)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IConditionalAndContext is an interface to support dynamic dispatch.
type IConditionalAndContext interface {
antlr.ParserRuleContext
@@ -903,34 +975,42 @@ type IConditionalAndContext interface {
GetParser() antlr.Parser
// GetS8 returns the s8 token.
- GetS8() antlr.Token
+ GetS8() antlr.Token
+
// SetS8 sets the s8 token.
- SetS8(antlr.Token)
+ SetS8(antlr.Token)
+
// GetOps returns the ops token list.
GetOps() []antlr.Token
+
// SetOps sets the ops token list.
SetOps([]antlr.Token)
+
// GetE returns the e rule contexts.
GetE() IRelationContext
// Get_relation returns the _relation rule contexts.
Get_relation() IRelationContext
+
// SetE sets the e rule contexts.
SetE(IRelationContext)
// Set_relation sets the _relation rule contexts.
Set_relation(IRelationContext)
+
// GetE1 returns the e1 rule context list.
GetE1() []IRelationContext
+
// SetE1 sets the e1 rule context list.
- SetE1([]IRelationContext)
+ SetE1([]IRelationContext)
+
// Getter signatures
AllRelation() []IRelationContext
@@ -943,28 +1023,33 @@ type IConditionalAndContext interface {
}
type ConditionalAndContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- e IRelationContext
- s8 antlr.Token
- ops []antlr.Token
- _relation IRelationContext
- e1 []IRelationContext
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+ e IRelationContext
+ s8 antlr.Token
+ ops []antlr.Token
+ _relation IRelationContext
+ e1 []IRelationContext
}
func NewEmptyConditionalAndContext() *ConditionalAndContext {
var p = new(ConditionalAndContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_conditionalAnd
return p
}
+func InitEmptyConditionalAndContext(p *ConditionalAndContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_conditionalAnd
+}
+
func (*ConditionalAndContext) IsConditionalAndContext() {}
func NewConditionalAndContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConditionalAndContext {
var p = new(ConditionalAndContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_conditionalAnd
@@ -976,24 +1061,32 @@ func (s *ConditionalAndContext) GetParser() antlr.Parser { return s.parser }
func (s *ConditionalAndContext) GetS8() antlr.Token { return s.s8 }
+
func (s *ConditionalAndContext) SetS8(v antlr.Token) { s.s8 = v }
+
func (s *ConditionalAndContext) GetOps() []antlr.Token { return s.ops }
+
func (s *ConditionalAndContext) SetOps(v []antlr.Token) { s.ops = v }
+
func (s *ConditionalAndContext) GetE() IRelationContext { return s.e }
func (s *ConditionalAndContext) Get_relation() IRelationContext { return s._relation }
+
func (s *ConditionalAndContext) SetE(v IRelationContext) { s.e = v }
func (s *ConditionalAndContext) Set_relation(v IRelationContext) { s._relation = v }
+
func (s *ConditionalAndContext) GetE1() []IRelationContext { return s.e1 }
+
func (s *ConditionalAndContext) SetE1(v []IRelationContext) { s.e1 = v }
+
func (s *ConditionalAndContext) AllRelation() []IRelationContext {
children := s.GetChildren()
len := 0
@@ -1016,12 +1109,12 @@ func (s *ConditionalAndContext) AllRelation() []IRelationContext {
}
func (s *ConditionalAndContext) Relation(i int) IRelationContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IRelationContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -1051,6 +1144,7 @@ func (s *ConditionalAndContext) ToStringTree(ruleNames []string, recog antlr.Rec
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *ConditionalAndContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterConditionalAnd(s)
@@ -1073,30 +1167,14 @@ func (s *ConditionalAndContext) Accept(visitor antlr.ParseTreeVisitor) interface
}
}
-func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
localctx = NewConditionalAndContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 6, CELParserRULE_conditionalAnd)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
{
p.SetState(51)
@@ -1107,8 +1185,12 @@ func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
}
p.SetState(56)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
for _la == CELParserLOGICAL_AND {
{
p.SetState(52)
@@ -1116,6 +1198,10 @@ func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
var _m = p.Match(CELParserLOGICAL_AND)
localctx.(*ConditionalAndContext).s8 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*ConditionalAndContext).ops = append(localctx.(*ConditionalAndContext).ops, localctx.(*ConditionalAndContext).s8)
{
@@ -1127,14 +1213,31 @@ func (p *CELParser) ConditionalAnd() (localctx IConditionalAndContext) {
}
localctx.(*ConditionalAndContext).e1 = append(localctx.(*ConditionalAndContext).e1, localctx.(*ConditionalAndContext)._relation)
+
p.SetState(58)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IRelationContext is an interface to support dynamic dispatch.
type IRelationContext interface {
antlr.ParserRuleContext
@@ -1143,10 +1246,12 @@ type IRelationContext interface {
GetParser() antlr.Parser
// GetOp returns the op token.
- GetOp() antlr.Token
+ GetOp() antlr.Token
+
// SetOp sets the op token.
- SetOp(antlr.Token)
+ SetOp(antlr.Token)
+
// Getter signatures
Calc() ICalcContext
@@ -1165,24 +1270,29 @@ type IRelationContext interface {
}
type RelationContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- op antlr.Token
+ op antlr.Token
}
func NewEmptyRelationContext() *RelationContext {
var p = new(RelationContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_relation
return p
}
+func InitEmptyRelationContext(p *RelationContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_relation
+}
+
func (*RelationContext) IsRelationContext() {}
func NewRelationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RelationContext {
var p = new(RelationContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_relation
@@ -1194,13 +1304,15 @@ func (s *RelationContext) GetParser() antlr.Parser { return s.parser }
func (s *RelationContext) GetOp() antlr.Token { return s.op }
+
func (s *RelationContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *RelationContext) Calc() ICalcContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(ICalcContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -1234,12 +1346,12 @@ func (s *RelationContext) AllRelation() []IRelationContext {
}
func (s *RelationContext) Relation(i int) IRelationContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IRelationContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -1289,6 +1401,7 @@ func (s *RelationContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *RelationContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterRelation(s)
@@ -1311,15 +1424,17 @@ func (s *RelationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
+
+
+
func (p *CELParser) Relation() (localctx IRelationContext) {
return p.relation(0)
}
func (p *CELParser) relation(_p int) (localctx IRelationContext) {
- this := p
- _ = this
-
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext()
+
_parentState := p.GetState()
localctx = NewRelationContext(p, p.GetParserRuleContext(), _parentState)
var _prevctx IRelationContext = localctx
@@ -1328,22 +1443,6 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
p.EnterRecursionRule(localctx, 8, CELParserRULE_relation, _p)
var _la int
- defer func() {
- p.UnrollRecursionContexts(_parentctx)
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -1355,8 +1454,13 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
p.SetState(67)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
if p.GetParseListeners() != nil {
@@ -1368,7 +1472,8 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
p.SetState(62)
if !(p.Precpred(p.GetParserRuleContext(), 1)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ goto errorExit
}
{
p.SetState(63)
@@ -1379,7 +1484,7 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
_la = p.GetTokenStream().LA(1)
- if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&254) != 0) {
+ if !(((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 254) != 0)) {
var _ri = p.GetErrorHandler().RecoverInline(p)
localctx.(*RelationContext).op = _ri
@@ -1393,15 +1498,35 @@ func (p *CELParser) relation(_p int) (localctx IRelationContext) {
p.relation(2)
}
+
}
p.SetState(69)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+ errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.UnrollRecursionContexts(_parentctx)
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// ICalcContext is an interface to support dynamic dispatch.
type ICalcContext interface {
antlr.ParserRuleContext
@@ -1410,10 +1535,12 @@ type ICalcContext interface {
GetParser() antlr.Parser
// GetOp returns the op token.
- GetOp() antlr.Token
+ GetOp() antlr.Token
+
// SetOp sets the op token.
- SetOp(antlr.Token)
+ SetOp(antlr.Token)
+
// Getter signatures
Unary() IUnaryContext
@@ -1430,24 +1557,29 @@ type ICalcContext interface {
}
type CalcContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- op antlr.Token
+ op antlr.Token
}
func NewEmptyCalcContext() *CalcContext {
var p = new(CalcContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_calc
return p
}
+func InitEmptyCalcContext(p *CalcContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_calc
+}
+
func (*CalcContext) IsCalcContext() {}
func NewCalcContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CalcContext {
var p = new(CalcContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_calc
@@ -1459,13 +1591,15 @@ func (s *CalcContext) GetParser() antlr.Parser { return s.parser }
func (s *CalcContext) GetOp() antlr.Token { return s.op }
+
func (s *CalcContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *CalcContext) Unary() IUnaryContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IUnaryContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -1499,12 +1633,12 @@ func (s *CalcContext) AllCalc() []ICalcContext {
}
func (s *CalcContext) Calc(i int) ICalcContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(ICalcContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -1546,6 +1680,7 @@ func (s *CalcContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *CalcContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCalc(s)
@@ -1568,15 +1703,17 @@ func (s *CalcContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
+
+
+
func (p *CELParser) Calc() (localctx ICalcContext) {
return p.calc(0)
}
func (p *CELParser) calc(_p int) (localctx ICalcContext) {
- this := p
- _ = this
-
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext()
+
_parentState := p.GetState()
localctx = NewCalcContext(p, p.GetParserRuleContext(), _parentState)
var _prevctx ICalcContext = localctx
@@ -1585,22 +1722,6 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
p.EnterRecursionRule(localctx, 10, CELParserRULE_calc, _p)
var _la int
- defer func() {
- p.UnrollRecursionContexts(_parentctx)
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -1612,8 +1733,13 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
p.SetState(81)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 5, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
if p.GetParseListeners() != nil {
@@ -1622,14 +1748,19 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
_prevctx = localctx
p.SetState(79)
p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 4, p.GetParserRuleContext()) {
+ if p.HasError() {
+ goto errorExit
+ }
+
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 4, p.GetParserRuleContext()) {
case 1:
localctx = NewCalcContext(p, _parentctx, _parentState)
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_calc)
p.SetState(73)
if !(p.Precpred(p.GetParserRuleContext(), 2)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
+ goto errorExit
}
{
p.SetState(74)
@@ -1640,7 +1771,7 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
_la = p.GetTokenStream().LA(1)
- if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&58720256) != 0) {
+ if !(((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 58720256) != 0)) {
var _ri = p.GetErrorHandler().RecoverInline(p)
localctx.(*CalcContext).op = _ri
@@ -1654,13 +1785,15 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
p.calc(3)
}
+
case 2:
localctx = NewCalcContext(p, _parentctx, _parentState)
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_calc)
p.SetState(76)
if !(p.Precpred(p.GetParserRuleContext(), 1)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ goto errorExit
}
{
p.SetState(77)
@@ -1685,17 +1818,38 @@ func (p *CELParser) calc(_p int) (localctx ICalcContext) {
p.calc(2)
}
+ case antlr.ATNInvalidAltNumber:
+ goto errorExit
}
}
p.SetState(83)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 5, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+ errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.UnrollRecursionContexts(_parentctx)
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IUnaryContext is an interface to support dynamic dispatch.
type IUnaryContext interface {
antlr.ParserRuleContext
@@ -1707,23 +1861,28 @@ type IUnaryContext interface {
}
type UnaryContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
}
func NewEmptyUnaryContext() *UnaryContext {
var p = new(UnaryContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_unary
return p
}
+func InitEmptyUnaryContext(p *UnaryContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_unary
+}
+
func (*UnaryContext) IsUnaryContext() {}
func NewUnaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UnaryContext {
var p = new(UnaryContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_unary
@@ -1733,8 +1892,8 @@ func NewUnaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invoki
func (s *UnaryContext) GetParser() antlr.Parser { return s.parser }
-func (s *UnaryContext) CopyFrom(ctx *UnaryContext) {
- s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext)
+func (s *UnaryContext) CopyAll(ctx *UnaryContext) {
+ s.CopyFrom(&ctx.BaseParserRuleContext)
}
func (s *UnaryContext) GetRuleContext() antlr.RuleContext {
@@ -1745,8 +1904,11 @@ func (s *UnaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
+
+
type LogicalNotContext struct {
- *UnaryContext
+ UnaryContext
s19 antlr.Token
ops []antlr.Token
}
@@ -1754,19 +1916,23 @@ type LogicalNotContext struct {
func NewLogicalNotContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LogicalNotContext {
var p = new(LogicalNotContext)
- p.UnaryContext = NewEmptyUnaryContext()
+ InitEmptyUnaryContext(&p.UnaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*UnaryContext))
+ p.CopyAll(ctx.(*UnaryContext))
return p
}
+
func (s *LogicalNotContext) GetS19() antlr.Token { return s.s19 }
+
func (s *LogicalNotContext) SetS19(v antlr.Token) { s.s19 = v }
+
func (s *LogicalNotContext) GetOps() []antlr.Token { return s.ops }
+
func (s *LogicalNotContext) SetOps(v []antlr.Token) { s.ops = v }
func (s *LogicalNotContext) GetRuleContext() antlr.RuleContext {
@@ -1774,10 +1940,10 @@ func (s *LogicalNotContext) GetRuleContext() antlr.RuleContext {
}
func (s *LogicalNotContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -1797,6 +1963,7 @@ func (s *LogicalNotContext) EXCLAM(i int) antlr.TerminalNode {
return s.GetToken(CELParserEXCLAM, i)
}
+
func (s *LogicalNotContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterLogicalNot(s)
@@ -1819,16 +1986,17 @@ func (s *LogicalNotContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type MemberExprContext struct {
- *UnaryContext
+ UnaryContext
}
func NewMemberExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MemberExprContext {
var p = new(MemberExprContext)
- p.UnaryContext = NewEmptyUnaryContext()
+ InitEmptyUnaryContext(&p.UnaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*UnaryContext))
+ p.CopyAll(ctx.(*UnaryContext))
return p
}
@@ -1838,10 +2006,10 @@ func (s *MemberExprContext) GetRuleContext() antlr.RuleContext {
}
func (s *MemberExprContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -1853,6 +2021,7 @@ func (s *MemberExprContext) Member() IMemberContext {
return t.(IMemberContext)
}
+
func (s *MemberExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterMemberExpr(s)
@@ -1875,8 +2044,9 @@ func (s *MemberExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type NegateContext struct {
- *UnaryContext
+ UnaryContext
s18 antlr.Token
ops []antlr.Token
}
@@ -1884,19 +2054,23 @@ type NegateContext struct {
func NewNegateContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NegateContext {
var p = new(NegateContext)
- p.UnaryContext = NewEmptyUnaryContext()
+ InitEmptyUnaryContext(&p.UnaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*UnaryContext))
+ p.CopyAll(ctx.(*UnaryContext))
return p
}
+
func (s *NegateContext) GetS18() antlr.Token { return s.s18 }
+
func (s *NegateContext) SetS18(v antlr.Token) { s.s18 = v }
+
func (s *NegateContext) GetOps() []antlr.Token { return s.ops }
+
func (s *NegateContext) SetOps(v []antlr.Token) { s.ops = v }
func (s *NegateContext) GetRuleContext() antlr.RuleContext {
@@ -1904,10 +2078,10 @@ func (s *NegateContext) GetRuleContext() antlr.RuleContext {
}
func (s *NegateContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -1927,6 +2101,7 @@ func (s *NegateContext) MINUS(i int) antlr.TerminalNode {
return s.GetToken(CELParserMINUS, i)
}
+
func (s *NegateContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterNegate(s)
@@ -1949,35 +2124,22 @@ func (s *NegateContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) Unary() (localctx IUnaryContext) {
- this := p
- _ = this
+
+func (p *CELParser) Unary() (localctx IUnaryContext) {
localctx = NewUnaryContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 12, CELParserRULE_unary)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
var _alt int
p.SetState(97)
p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 8, p.GetParserRuleContext()) {
+ if p.HasError() {
+ goto errorExit
+ }
+
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) {
case 1:
localctx = NewMemberExprContext(p, localctx)
p.EnterOuterAlt(localctx, 1)
@@ -1986,13 +2148,18 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
p.member(0)
}
+
case 2:
localctx = NewLogicalNotContext(p, localctx)
p.EnterOuterAlt(localctx, 2)
p.SetState(86)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
for ok := true; ok; ok = _la == CELParserEXCLAM {
{
p.SetState(85)
@@ -2000,11 +2167,19 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
var _m = p.Match(CELParserEXCLAM)
localctx.(*LogicalNotContext).s19 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*LogicalNotContext).ops = append(localctx.(*LogicalNotContext).ops, localctx.(*LogicalNotContext).s19)
+
p.SetState(88)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
{
@@ -2012,42 +2187,71 @@ func (p *CELParser) Unary() (localctx IUnaryContext) {
p.member(0)
}
+
case 3:
localctx = NewNegateContext(p, localctx)
p.EnterOuterAlt(localctx, 3)
p.SetState(92)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_alt = 1
for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
switch _alt {
case 1:
- {
- p.SetState(91)
+ {
+ p.SetState(91)
+
+ var _m = p.Match(CELParserMINUS)
+
+ localctx.(*NegateContext).s18 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
+ }
+ localctx.(*NegateContext).ops = append(localctx.(*NegateContext).ops, localctx.(*NegateContext).s18)
+
- var _m = p.Match(CELParserMINUS)
- localctx.(*NegateContext).s18 = _m
- }
- localctx.(*NegateContext).ops = append(localctx.(*NegateContext).ops, localctx.(*NegateContext).s18)
default:
- panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
+ p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
+ goto errorExit
}
p.SetState(94)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 7, p.GetParserRuleContext())
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 7, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
{
p.SetState(96)
p.member(0)
}
+ case antlr.ATNInvalidAltNumber:
+ goto errorExit
}
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IMemberContext is an interface to support dynamic dispatch.
type IMemberContext interface {
antlr.ParserRuleContext
@@ -2059,23 +2263,28 @@ type IMemberContext interface {
}
type MemberContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
}
func NewEmptyMemberContext() *MemberContext {
var p = new(MemberContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_member
return p
}
+func InitEmptyMemberContext(p *MemberContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_member
+}
+
func (*MemberContext) IsMemberContext() {}
func NewMemberContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MemberContext {
var p = new(MemberContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_member
@@ -2085,8 +2294,8 @@ func NewMemberContext(parser antlr.Parser, parent antlr.ParserRuleContext, invok
func (s *MemberContext) GetParser() antlr.Parser { return s.parser }
-func (s *MemberContext) CopyFrom(ctx *MemberContext) {
- s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext)
+func (s *MemberContext) CopyAll(ctx *MemberContext) {
+ s.CopyFrom(&ctx.BaseParserRuleContext)
}
func (s *MemberContext) GetRuleContext() antlr.RuleContext {
@@ -2097,38 +2306,46 @@ func (s *MemberContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
+
+
+
type MemberCallContext struct {
- *MemberContext
- op antlr.Token
- id antlr.Token
+ MemberContext
+ op antlr.Token
+ id antlr.Token
open antlr.Token
- args IExprListContext
+ args IExprListContext
}
func NewMemberCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MemberCallContext {
var p = new(MemberCallContext)
- p.MemberContext = NewEmptyMemberContext()
+ InitEmptyMemberContext(&p.MemberContext)
p.parser = parser
- p.CopyFrom(ctx.(*MemberContext))
+ p.CopyAll(ctx.(*MemberContext))
return p
}
+
func (s *MemberCallContext) GetOp() antlr.Token { return s.op }
func (s *MemberCallContext) GetId() antlr.Token { return s.id }
func (s *MemberCallContext) GetOpen() antlr.Token { return s.open }
+
func (s *MemberCallContext) SetOp(v antlr.Token) { s.op = v }
func (s *MemberCallContext) SetId(v antlr.Token) { s.id = v }
func (s *MemberCallContext) SetOpen(v antlr.Token) { s.open = v }
+
func (s *MemberCallContext) GetArgs() IExprListContext { return s.args }
+
func (s *MemberCallContext) SetArgs(v IExprListContext) { s.args = v }
func (s *MemberCallContext) GetRuleContext() antlr.RuleContext {
@@ -2136,10 +2353,10 @@ func (s *MemberCallContext) GetRuleContext() antlr.RuleContext {
}
func (s *MemberCallContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2168,10 +2385,10 @@ func (s *MemberCallContext) LPAREN() antlr.TerminalNode {
}
func (s *MemberCallContext) ExprList() IExprListContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprListContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2183,6 +2400,7 @@ func (s *MemberCallContext) ExprList() IExprListContext {
return t.(IExprListContext)
}
+
func (s *MemberCallContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterMemberCall(s)
@@ -2205,29 +2423,32 @@ func (s *MemberCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type SelectContext struct {
- *MemberContext
- op antlr.Token
+ MemberContext
+ op antlr.Token
opt antlr.Token
- id antlr.Token
+ id antlr.Token
}
func NewSelectContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectContext {
var p = new(SelectContext)
- p.MemberContext = NewEmptyMemberContext()
+ InitEmptyMemberContext(&p.MemberContext)
p.parser = parser
- p.CopyFrom(ctx.(*MemberContext))
+ p.CopyAll(ctx.(*MemberContext))
return p
}
+
func (s *SelectContext) GetOp() antlr.Token { return s.op }
func (s *SelectContext) GetOpt() antlr.Token { return s.opt }
func (s *SelectContext) GetId() antlr.Token { return s.id }
+
func (s *SelectContext) SetOp(v antlr.Token) { s.op = v }
func (s *SelectContext) SetOpt(v antlr.Token) { s.opt = v }
@@ -2239,10 +2460,10 @@ func (s *SelectContext) GetRuleContext() antlr.RuleContext {
}
func (s *SelectContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2266,6 +2487,7 @@ func (s *SelectContext) QUESTIONMARK() antlr.TerminalNode {
return s.GetToken(CELParserQUESTIONMARK, 0)
}
+
func (s *SelectContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterSelect(s)
@@ -2288,16 +2510,17 @@ func (s *SelectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type PrimaryExprContext struct {
- *MemberContext
+ MemberContext
}
func NewPrimaryExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PrimaryExprContext {
var p = new(PrimaryExprContext)
- p.MemberContext = NewEmptyMemberContext()
+ InitEmptyMemberContext(&p.MemberContext)
p.parser = parser
- p.CopyFrom(ctx.(*MemberContext))
+ p.CopyAll(ctx.(*MemberContext))
return p
}
@@ -2307,10 +2530,10 @@ func (s *PrimaryExprContext) GetRuleContext() antlr.RuleContext {
}
func (s *PrimaryExprContext) Primary() IPrimaryContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IPrimaryContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2322,6 +2545,7 @@ func (s *PrimaryExprContext) Primary() IPrimaryContext {
return t.(IPrimaryContext)
}
+
func (s *PrimaryExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterPrimaryExpr(s)
@@ -2344,33 +2568,38 @@ func (s *PrimaryExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
}
}
+
type IndexContext struct {
- *MemberContext
- op antlr.Token
- opt antlr.Token
- index IExprContext
+ MemberContext
+ op antlr.Token
+ opt antlr.Token
+ index IExprContext
}
func NewIndexContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IndexContext {
var p = new(IndexContext)
- p.MemberContext = NewEmptyMemberContext()
+ InitEmptyMemberContext(&p.MemberContext)
p.parser = parser
- p.CopyFrom(ctx.(*MemberContext))
+ p.CopyAll(ctx.(*MemberContext))
return p
}
+
func (s *IndexContext) GetOp() antlr.Token { return s.op }
func (s *IndexContext) GetOpt() antlr.Token { return s.opt }
+
func (s *IndexContext) SetOp(v antlr.Token) { s.op = v }
func (s *IndexContext) SetOpt(v antlr.Token) { s.opt = v }
+
func (s *IndexContext) GetIndex() IExprContext { return s.index }
+
func (s *IndexContext) SetIndex(v IExprContext) { s.index = v }
func (s *IndexContext) GetRuleContext() antlr.RuleContext {
@@ -2378,10 +2607,10 @@ func (s *IndexContext) GetRuleContext() antlr.RuleContext {
}
func (s *IndexContext) Member() IMemberContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMemberContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2402,10 +2631,10 @@ func (s *IndexContext) LBRACKET() antlr.TerminalNode {
}
func (s *IndexContext) Expr() IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2421,6 +2650,7 @@ func (s *IndexContext) QUESTIONMARK() antlr.TerminalNode {
return s.GetToken(CELParserQUESTIONMARK, 0)
}
+
func (s *IndexContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterIndex(s)
@@ -2443,15 +2673,15 @@ func (s *IndexContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
+
func (p *CELParser) Member() (localctx IMemberContext) {
return p.member(0)
}
func (p *CELParser) member(_p int) (localctx IMemberContext) {
- this := p
- _ = this
-
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext()
+
_parentState := p.GetState()
localctx = NewMemberContext(p, p.GetParserRuleContext(), _parentState)
var _prevctx IMemberContext = localctx
@@ -2460,22 +2690,6 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
p.EnterRecursionRule(localctx, 14, CELParserRULE_member, _p)
var _la int
- defer func() {
- p.UnrollRecursionContexts(_parentctx)
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -2491,8 +2705,13 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1))
p.SetState(126)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 13, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
if p.GetParseListeners() != nil {
@@ -2501,14 +2720,19 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
_prevctx = localctx
p.SetState(124)
p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 12, p.GetParserRuleContext()) {
+ if p.HasError() {
+ goto errorExit
+ }
+
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 12, p.GetParserRuleContext()) {
case 1:
localctx = NewSelectContext(p, NewMemberContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member)
p.SetState(102)
if !(p.Precpred(p.GetParserRuleContext(), 3)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", ""))
+ goto errorExit
}
{
p.SetState(103)
@@ -2516,11 +2740,19 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserDOT)
localctx.(*SelectContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(105)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK {
{
p.SetState(104)
@@ -2528,6 +2760,10 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*SelectContext).opt = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -2537,15 +2773,21 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*SelectContext).id = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 2:
localctx = NewMemberCallContext(p, NewMemberContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member)
p.SetState(108)
if !(p.Precpred(p.GetParserRuleContext(), 2)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", ""))
+ goto errorExit
}
{
p.SetState(109)
@@ -2553,6 +2795,10 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserDOT)
localctx.(*MemberCallContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(110)
@@ -2560,6 +2806,10 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*MemberCallContext).id = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(111)
@@ -2567,17 +2817,26 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserLPAREN)
localctx.(*MemberCallContext).open = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(113)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
- if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135762105344) != 0 {
+
+ if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135762105344) != 0) {
{
p.SetState(112)
var _x = p.ExprList()
+
localctx.(*MemberCallContext).args = _x
}
@@ -2585,15 +2844,21 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
{
p.SetState(115)
p.Match(CELParserRPAREN)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 3:
localctx = NewIndexContext(p, NewMemberContext(p, _parentctx, _parentState))
p.PushNewRecursionContext(localctx, _startState, CELParserRULE_member)
p.SetState(116)
if !(p.Precpred(p.GetParserRuleContext(), 1)) {
- panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", ""))
+ goto errorExit
}
{
p.SetState(117)
@@ -2601,11 +2866,19 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserLBRACKET)
localctx.(*IndexContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(119)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK {
{
p.SetState(118)
@@ -2613,6 +2886,10 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*IndexContext).opt = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -2621,24 +2898,50 @@ func (p *CELParser) member(_p int) (localctx IMemberContext) {
var _x = p.Expr()
+
localctx.(*IndexContext).index = _x
}
{
p.SetState(122)
p.Match(CELParserRPRACKET)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+ case antlr.ATNInvalidAltNumber:
+ goto errorExit
}
}
p.SetState(128)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 13, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 13, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+ errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.UnrollRecursionContexts(_parentctx)
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IPrimaryContext is an interface to support dynamic dispatch.
type IPrimaryContext interface {
antlr.ParserRuleContext
@@ -2650,23 +2953,28 @@ type IPrimaryContext interface {
}
type PrimaryContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
}
func NewEmptyPrimaryContext() *PrimaryContext {
var p = new(PrimaryContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_primary
return p
}
+func InitEmptyPrimaryContext(p *PrimaryContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_primary
+}
+
func (*PrimaryContext) IsPrimaryContext() {}
func NewPrimaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PrimaryContext {
var p = new(PrimaryContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_primary
@@ -2676,8 +2984,8 @@ func NewPrimaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invo
func (s *PrimaryContext) GetParser() antlr.Parser { return s.parser }
-func (s *PrimaryContext) CopyFrom(ctx *PrimaryContext) {
- s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext)
+func (s *PrimaryContext) CopyAll(ctx *PrimaryContext) {
+ s.CopyFrom(&ctx.BaseParserRuleContext)
}
func (s *PrimaryContext) GetRuleContext() antlr.RuleContext {
@@ -2688,28 +2996,35 @@ func (s *PrimaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
+
+
type CreateListContext struct {
- *PrimaryContext
- op antlr.Token
- elems IListInitContext
+ PrimaryContext
+ op antlr.Token
+ elems IListInitContext
}
func NewCreateListContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateListContext {
var p = new(CreateListContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
+
func (s *CreateListContext) GetOp() antlr.Token { return s.op }
+
func (s *CreateListContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *CreateListContext) GetElems() IListInitContext { return s.elems }
+
func (s *CreateListContext) SetElems(v IListInitContext) { s.elems = v }
func (s *CreateListContext) GetRuleContext() antlr.RuleContext {
@@ -2729,10 +3044,10 @@ func (s *CreateListContext) COMMA() antlr.TerminalNode {
}
func (s *CreateListContext) ListInit() IListInitContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IListInitContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2744,6 +3059,7 @@ func (s *CreateListContext) ListInit() IListInitContext {
return t.(IListInitContext)
}
+
func (s *CreateListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCreateList(s)
@@ -2766,28 +3082,33 @@ func (s *CreateListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type CreateStructContext struct {
- *PrimaryContext
- op antlr.Token
- entries IMapInitializerListContext
+ PrimaryContext
+ op antlr.Token
+ entries IMapInitializerListContext
}
func NewCreateStructContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateStructContext {
var p = new(CreateStructContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
+
func (s *CreateStructContext) GetOp() antlr.Token { return s.op }
+
func (s *CreateStructContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *CreateStructContext) GetEntries() IMapInitializerListContext { return s.entries }
+
func (s *CreateStructContext) SetEntries(v IMapInitializerListContext) { s.entries = v }
func (s *CreateStructContext) GetRuleContext() antlr.RuleContext {
@@ -2807,10 +3128,10 @@ func (s *CreateStructContext) COMMA() antlr.TerminalNode {
}
func (s *CreateStructContext) MapInitializerList() IMapInitializerListContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IMapInitializerListContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2822,6 +3143,7 @@ func (s *CreateStructContext) MapInitializerList() IMapInitializerListContext {
return t.(IMapInitializerListContext)
}
+
func (s *CreateStructContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCreateStruct(s)
@@ -2844,16 +3166,17 @@ func (s *CreateStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
}
}
+
type ConstantLiteralContext struct {
- *PrimaryContext
+ PrimaryContext
}
func NewConstantLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConstantLiteralContext {
var p = new(ConstantLiteralContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
@@ -2863,10 +3186,10 @@ func (s *ConstantLiteralContext) GetRuleContext() antlr.RuleContext {
}
func (s *ConstantLiteralContext) Literal() ILiteralContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(ILiteralContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2878,6 +3201,7 @@ func (s *ConstantLiteralContext) Literal() ILiteralContext {
return t.(ILiteralContext)
}
+
func (s *ConstantLiteralContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterConstantLiteral(s)
@@ -2900,23 +3224,26 @@ func (s *ConstantLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interfac
}
}
+
type NestedContext struct {
- *PrimaryContext
- e IExprContext
+ PrimaryContext
+ e IExprContext
}
func NewNestedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NestedContext {
var p = new(NestedContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
+
func (s *NestedContext) GetE() IExprContext { return s.e }
+
func (s *NestedContext) SetE(v IExprContext) { s.e = v }
func (s *NestedContext) GetRuleContext() antlr.RuleContext {
@@ -2932,10 +3259,10 @@ func (s *NestedContext) RPAREN() antlr.TerminalNode {
}
func (s *NestedContext) Expr() IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -2947,6 +3274,7 @@ func (s *NestedContext) Expr() IExprContext {
return t.(IExprContext)
}
+
func (s *NestedContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterNested(s)
@@ -2969,27 +3297,29 @@ func (s *NestedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type CreateMessageContext struct {
- *PrimaryContext
- leadingDot antlr.Token
+ PrimaryContext
+ leadingDot antlr.Token
_IDENTIFIER antlr.Token
- ids []antlr.Token
- s16 antlr.Token
- ops []antlr.Token
- op antlr.Token
- entries IFieldInitializerListContext
+ ids []antlr.Token
+ s16 antlr.Token
+ ops []antlr.Token
+ op antlr.Token
+ entries IFieldInitializerListContext
}
func NewCreateMessageContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateMessageContext {
var p = new(CreateMessageContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
+
func (s *CreateMessageContext) GetLeadingDot() antlr.Token { return s.leadingDot }
func (s *CreateMessageContext) Get_IDENTIFIER() antlr.Token { return s._IDENTIFIER }
@@ -2998,6 +3328,7 @@ func (s *CreateMessageContext) GetS16() antlr.Token { return s.s16 }
func (s *CreateMessageContext) GetOp() antlr.Token { return s.op }
+
func (s *CreateMessageContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v }
func (s *CreateMessageContext) Set_IDENTIFIER(v antlr.Token) { s._IDENTIFIER = v }
@@ -3006,16 +3337,20 @@ func (s *CreateMessageContext) SetS16(v antlr.Token) { s.s16 = v }
func (s *CreateMessageContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *CreateMessageContext) GetIds() []antlr.Token { return s.ids }
func (s *CreateMessageContext) GetOps() []antlr.Token { return s.ops }
+
func (s *CreateMessageContext) SetIds(v []antlr.Token) { s.ids = v }
func (s *CreateMessageContext) SetOps(v []antlr.Token) { s.ops = v }
+
func (s *CreateMessageContext) GetEntries() IFieldInitializerListContext { return s.entries }
+
func (s *CreateMessageContext) SetEntries(v IFieldInitializerListContext) { s.entries = v }
func (s *CreateMessageContext) GetRuleContext() antlr.RuleContext {
@@ -3051,10 +3386,10 @@ func (s *CreateMessageContext) DOT(i int) antlr.TerminalNode {
}
func (s *CreateMessageContext) FieldInitializerList() IFieldInitializerListContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IFieldInitializerListContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -3066,6 +3401,7 @@ func (s *CreateMessageContext) FieldInitializerList() IFieldInitializerListConte
return t.(IFieldInitializerListContext)
}
+
func (s *CreateMessageContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterCreateMessage(s)
@@ -3088,38 +3424,43 @@ func (s *CreateMessageContext) Accept(visitor antlr.ParseTreeVisitor) interface{
}
}
+
type IdentOrGlobalCallContext struct {
- *PrimaryContext
+ PrimaryContext
leadingDot antlr.Token
- id antlr.Token
- op antlr.Token
- args IExprListContext
+ id antlr.Token
+ op antlr.Token
+ args IExprListContext
}
func NewIdentOrGlobalCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IdentOrGlobalCallContext {
var p = new(IdentOrGlobalCallContext)
- p.PrimaryContext = NewEmptyPrimaryContext()
+ InitEmptyPrimaryContext(&p.PrimaryContext)
p.parser = parser
- p.CopyFrom(ctx.(*PrimaryContext))
+ p.CopyAll(ctx.(*PrimaryContext))
return p
}
+
func (s *IdentOrGlobalCallContext) GetLeadingDot() antlr.Token { return s.leadingDot }
func (s *IdentOrGlobalCallContext) GetId() antlr.Token { return s.id }
func (s *IdentOrGlobalCallContext) GetOp() antlr.Token { return s.op }
+
func (s *IdentOrGlobalCallContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v }
func (s *IdentOrGlobalCallContext) SetId(v antlr.Token) { s.id = v }
func (s *IdentOrGlobalCallContext) SetOp(v antlr.Token) { s.op = v }
+
func (s *IdentOrGlobalCallContext) GetArgs() IExprListContext { return s.args }
+
func (s *IdentOrGlobalCallContext) SetArgs(v IExprListContext) { s.args = v }
func (s *IdentOrGlobalCallContext) GetRuleContext() antlr.RuleContext {
@@ -3143,10 +3484,10 @@ func (s *IdentOrGlobalCallContext) LPAREN() antlr.TerminalNode {
}
func (s *IdentOrGlobalCallContext) ExprList() IExprListContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprListContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -3158,6 +3499,7 @@ func (s *IdentOrGlobalCallContext) ExprList() IExprListContext {
return t.(IExprListContext)
}
+
func (s *IdentOrGlobalCallContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterIdentOrGlobalCall(s)
@@ -3180,40 +3522,31 @@ func (s *IdentOrGlobalCallContext) Accept(visitor antlr.ParseTreeVisitor) interf
}
}
-func (p *CELParser) Primary() (localctx IPrimaryContext) {
- this := p
- _ = this
+
+func (p *CELParser) Primary() (localctx IPrimaryContext) {
localctx = NewPrimaryContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 16, CELParserRULE_primary)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.SetState(180)
p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 25, p.GetParserRuleContext()) {
+ if p.HasError() {
+ goto errorExit
+ }
+
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) {
case 1:
localctx = NewIdentOrGlobalCallContext(p, localctx)
p.EnterOuterAlt(localctx, 1)
p.SetState(130)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserDOT {
{
p.SetState(129)
@@ -3221,6 +3554,10 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserDOT)
localctx.(*IdentOrGlobalCallContext).leadingDot = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -3230,28 +3567,42 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*IdentOrGlobalCallContext).id = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(138)
p.GetErrorHandler().Sync(p)
- if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 {
+
+ if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 {
{
p.SetState(133)
var _m = p.Match(CELParserLPAREN)
localctx.(*IdentOrGlobalCallContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(135)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
- if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135762105344) != 0 {
+
+ if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135762105344) != 0) {
{
p.SetState(134)
var _x = p.ExprList()
+
localctx.(*IdentOrGlobalCallContext).args = _x
}
@@ -3259,29 +3610,46 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
{
p.SetState(137)
p.Match(CELParserRPAREN)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+ } else if p.HasError() { // JIM
+ goto errorExit
}
+
case 2:
localctx = NewNestedContext(p, localctx)
p.EnterOuterAlt(localctx, 2)
{
p.SetState(140)
p.Match(CELParserLPAREN)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(141)
var _x = p.Expr()
+
localctx.(*NestedContext).e = _x
}
{
p.SetState(142)
p.Match(CELParserRPAREN)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 3:
localctx = NewCreateListContext(p, localctx)
p.EnterOuterAlt(localctx, 3)
@@ -3291,37 +3659,59 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserLBRACKET)
localctx.(*CreateListContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(146)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
- if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135763153920) != 0 {
+
+ if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135763153920) != 0) {
{
p.SetState(145)
var _x = p.ListInit()
+
localctx.(*CreateListContext).elems = _x
}
}
p.SetState(149)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserCOMMA {
{
p.SetState(148)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
{
p.SetState(151)
p.Match(CELParserRPRACKET)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 4:
localctx = NewCreateStructContext(p, localctx)
p.EnterOuterAlt(localctx, 4)
@@ -3331,44 +3721,70 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserLBRACE)
localctx.(*CreateStructContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(154)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
- if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&135763153920) != 0 {
+
+ if ((int64(_la) & ^0x3f) == 0 && ((int64(1) << _la) & 135763153920) != 0) {
{
p.SetState(153)
var _x = p.MapInitializerList()
+
localctx.(*CreateStructContext).entries = _x
}
}
p.SetState(157)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserCOMMA {
{
p.SetState(156)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
{
p.SetState(159)
p.Match(CELParserRBRACE)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 5:
localctx = NewCreateMessageContext(p, localctx)
p.EnterOuterAlt(localctx, 5)
p.SetState(161)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserDOT {
{
p.SetState(160)
@@ -3376,6 +3792,10 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserDOT)
localctx.(*CreateMessageContext).leadingDot = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -3385,12 +3805,20 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*CreateMessageContext)._IDENTIFIER = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*CreateMessageContext).ids = append(localctx.(*CreateMessageContext).ids, localctx.(*CreateMessageContext)._IDENTIFIER)
p.SetState(168)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
for _la == CELParserDOT {
{
p.SetState(164)
@@ -3398,6 +3826,10 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserDOT)
localctx.(*CreateMessageContext).s16 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*CreateMessageContext).ops = append(localctx.(*CreateMessageContext).ops, localctx.(*CreateMessageContext).s16)
{
@@ -3406,11 +3838,19 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserIDENTIFIER)
localctx.(*CreateMessageContext)._IDENTIFIER = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*CreateMessageContext).ids = append(localctx.(*CreateMessageContext).ids, localctx.(*CreateMessageContext)._IDENTIFIER)
+
p.SetState(170)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
{
@@ -3419,37 +3859,59 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
var _m = p.Match(CELParserLBRACE)
localctx.(*CreateMessageContext).op = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
p.SetState(173)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK || _la == CELParserIDENTIFIER {
{
p.SetState(172)
var _x = p.FieldInitializerList()
+
localctx.(*CreateMessageContext).entries = _x
}
}
p.SetState(176)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserCOMMA {
{
p.SetState(175)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
{
p.SetState(178)
p.Match(CELParserRBRACE)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 6:
localctx = NewConstantLiteralContext(p, localctx)
p.EnterOuterAlt(localctx, 6)
@@ -3458,11 +3920,25 @@ func (p *CELParser) Primary() (localctx IPrimaryContext) {
p.Literal()
}
+ case antlr.ATNInvalidAltNumber:
+ goto errorExit
}
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IExprListContext is an interface to support dynamic dispatch.
type IExprListContext interface {
antlr.ParserRuleContext
@@ -3473,14 +3949,18 @@ type IExprListContext interface {
// Get_expr returns the _expr rule contexts.
Get_expr() IExprContext
+
// Set_expr sets the _expr rule contexts.
Set_expr(IExprContext)
+
// GetE returns the e rule context list.
GetE() []IExprContext
+
// SetE sets the e rule context list.
- SetE([]IExprContext)
+ SetE([]IExprContext)
+
// Getter signatures
AllExpr() []IExprContext
@@ -3493,25 +3973,30 @@ type IExprListContext interface {
}
type ExprListContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- _expr IExprContext
- e []IExprContext
+ _expr IExprContext
+ e []IExprContext
}
func NewEmptyExprListContext() *ExprListContext {
var p = new(ExprListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_exprList
return p
}
+func InitEmptyExprListContext(p *ExprListContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_exprList
+}
+
func (*ExprListContext) IsExprListContext() {}
func NewExprListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprListContext {
var p = new(ExprListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_exprList
@@ -3523,12 +4008,16 @@ func (s *ExprListContext) GetParser() antlr.Parser { return s.parser }
func (s *ExprListContext) Get_expr() IExprContext { return s._expr }
+
func (s *ExprListContext) Set_expr(v IExprContext) { s._expr = v }
+
func (s *ExprListContext) GetE() []IExprContext { return s.e }
+
func (s *ExprListContext) SetE(v []IExprContext) { s.e = v }
+
func (s *ExprListContext) AllExpr() []IExprContext {
children := s.GetChildren()
len := 0
@@ -3551,12 +4040,12 @@ func (s *ExprListContext) AllExpr() []IExprContext {
}
func (s *ExprListContext) Expr(i int) IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -3586,6 +4075,7 @@ func (s *ExprListContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *ExprListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterExprList(s)
@@ -3608,65 +4098,76 @@ func (s *ExprListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) ExprList() (localctx IExprListContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) ExprList() (localctx IExprListContext) {
localctx = NewExprListContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 18, CELParserRULE_exprList)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
{
p.SetState(182)
var _x = p.Expr()
+
localctx.(*ExprListContext)._expr = _x
}
localctx.(*ExprListContext).e = append(localctx.(*ExprListContext).e, localctx.(*ExprListContext)._expr)
p.SetState(187)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
for _la == CELParserCOMMA {
{
p.SetState(183)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(184)
var _x = p.Expr()
+
localctx.(*ExprListContext)._expr = _x
}
localctx.(*ExprListContext).e = append(localctx.(*ExprListContext).e, localctx.(*ExprListContext)._expr)
+
p.SetState(189)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IListInitContext is an interface to support dynamic dispatch.
type IListInitContext interface {
antlr.ParserRuleContext
@@ -3677,14 +4178,18 @@ type IListInitContext interface {
// Get_optExpr returns the _optExpr rule contexts.
Get_optExpr() IOptExprContext
+
// Set_optExpr sets the _optExpr rule contexts.
Set_optExpr(IOptExprContext)
+
// GetElems returns the elems rule context list.
GetElems() []IOptExprContext
+
// SetElems sets the elems rule context list.
- SetElems([]IOptExprContext)
+ SetElems([]IOptExprContext)
+
// Getter signatures
AllOptExpr() []IOptExprContext
@@ -3697,25 +4202,30 @@ type IListInitContext interface {
}
type ListInitContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- _optExpr IOptExprContext
- elems []IOptExprContext
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+ _optExpr IOptExprContext
+ elems []IOptExprContext
}
func NewEmptyListInitContext() *ListInitContext {
var p = new(ListInitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_listInit
return p
}
+func InitEmptyListInitContext(p *ListInitContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_listInit
+}
+
func (*ListInitContext) IsListInitContext() {}
func NewListInitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ListInitContext {
var p = new(ListInitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_listInit
@@ -3727,12 +4237,16 @@ func (s *ListInitContext) GetParser() antlr.Parser { return s.parser }
func (s *ListInitContext) Get_optExpr() IOptExprContext { return s._optExpr }
+
func (s *ListInitContext) Set_optExpr(v IOptExprContext) { s._optExpr = v }
+
func (s *ListInitContext) GetElems() []IOptExprContext { return s.elems }
+
func (s *ListInitContext) SetElems(v []IOptExprContext) { s.elems = v }
+
func (s *ListInitContext) AllOptExpr() []IOptExprContext {
children := s.GetChildren()
len := 0
@@ -3755,12 +4269,12 @@ func (s *ListInitContext) AllOptExpr() []IOptExprContext {
}
func (s *ListInitContext) OptExpr(i int) IOptExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IOptExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -3790,6 +4304,7 @@ func (s *ListInitContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *ListInitContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterListInit(s)
@@ -3812,29 +4327,12 @@ func (s *ListInitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) ListInit() (localctx IListInitContext) {
- this := p
- _ = this
- localctx = NewListInitContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 20, CELParserRULE_listInit)
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
+func (p *CELParser) ListInit() (localctx IListInitContext) {
+ localctx = NewListInitContext(p, p.GetParserRuleContext(), p.GetState())
+ p.EnterRule(localctx, 20, CELParserRULE_listInit)
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -3843,37 +4341,68 @@ func (p *CELParser) ListInit() (localctx IListInitContext) {
var _x = p.OptExpr()
+
localctx.(*ListInitContext)._optExpr = _x
}
localctx.(*ListInitContext).elems = append(localctx.(*ListInitContext).elems, localctx.(*ListInitContext)._optExpr)
p.SetState(195)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 27, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
{
p.SetState(191)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(192)
var _x = p.OptExpr()
+
localctx.(*ListInitContext)._optExpr = _x
}
localctx.(*ListInitContext).elems = append(localctx.(*ListInitContext).elems, localctx.(*ListInitContext)._optExpr)
+
}
p.SetState(197)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 27, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IFieldInitializerListContext is an interface to support dynamic dispatch.
type IFieldInitializerListContext interface {
antlr.ParserRuleContext
@@ -3882,40 +4411,48 @@ type IFieldInitializerListContext interface {
GetParser() antlr.Parser
// GetS21 returns the s21 token.
- GetS21() antlr.Token
+ GetS21() antlr.Token
+
// SetS21 sets the s21 token.
- SetS21(antlr.Token)
+ SetS21(antlr.Token)
+
// GetCols returns the cols token list.
GetCols() []antlr.Token
+
// SetCols sets the cols token list.
SetCols([]antlr.Token)
+
// Get_optField returns the _optField rule contexts.
Get_optField() IOptFieldContext
// Get_expr returns the _expr rule contexts.
Get_expr() IExprContext
+
// Set_optField sets the _optField rule contexts.
Set_optField(IOptFieldContext)
// Set_expr sets the _expr rule contexts.
Set_expr(IExprContext)
+
// GetFields returns the fields rule context list.
GetFields() []IOptFieldContext
// GetValues returns the values rule context list.
GetValues() []IExprContext
+
// SetFields sets the fields rule context list.
- SetFields([]IOptFieldContext)
+ SetFields([]IOptFieldContext)
// SetValues sets the values rule context list.
- SetValues([]IExprContext)
+ SetValues([]IExprContext)
+
// Getter signatures
AllOptField() []IOptFieldContext
@@ -3932,29 +4469,34 @@ type IFieldInitializerListContext interface {
}
type FieldInitializerListContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- _optField IOptFieldContext
- fields []IOptFieldContext
- s21 antlr.Token
- cols []antlr.Token
- _expr IExprContext
- values []IExprContext
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+ _optField IOptFieldContext
+ fields []IOptFieldContext
+ s21 antlr.Token
+ cols []antlr.Token
+ _expr IExprContext
+ values []IExprContext
}
func NewEmptyFieldInitializerListContext() *FieldInitializerListContext {
var p = new(FieldInitializerListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_fieldInitializerList
return p
}
+func InitEmptyFieldInitializerListContext(p *FieldInitializerListContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_fieldInitializerList
+}
+
func (*FieldInitializerListContext) IsFieldInitializerListContext() {}
func NewFieldInitializerListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FieldInitializerListContext {
var p = new(FieldInitializerListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_fieldInitializerList
@@ -3966,28 +4508,36 @@ func (s *FieldInitializerListContext) GetParser() antlr.Parser { return s.parser
func (s *FieldInitializerListContext) GetS21() antlr.Token { return s.s21 }
+
func (s *FieldInitializerListContext) SetS21(v antlr.Token) { s.s21 = v }
+
func (s *FieldInitializerListContext) GetCols() []antlr.Token { return s.cols }
+
func (s *FieldInitializerListContext) SetCols(v []antlr.Token) { s.cols = v }
+
func (s *FieldInitializerListContext) Get_optField() IOptFieldContext { return s._optField }
func (s *FieldInitializerListContext) Get_expr() IExprContext { return s._expr }
+
func (s *FieldInitializerListContext) Set_optField(v IOptFieldContext) { s._optField = v }
func (s *FieldInitializerListContext) Set_expr(v IExprContext) { s._expr = v }
+
func (s *FieldInitializerListContext) GetFields() []IOptFieldContext { return s.fields }
func (s *FieldInitializerListContext) GetValues() []IExprContext { return s.values }
+
func (s *FieldInitializerListContext) SetFields(v []IOptFieldContext) { s.fields = v }
func (s *FieldInitializerListContext) SetValues(v []IExprContext) { s.values = v }
+
func (s *FieldInitializerListContext) AllOptField() []IOptFieldContext {
children := s.GetChildren()
len := 0
@@ -4010,12 +4560,12 @@ func (s *FieldInitializerListContext) AllOptField() []IOptFieldContext {
}
func (s *FieldInitializerListContext) OptField(i int) IOptFieldContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IOptFieldContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -4059,12 +4609,12 @@ func (s *FieldInitializerListContext) AllExpr() []IExprContext {
}
func (s *FieldInitializerListContext) Expr(i int) IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -4094,6 +4644,7 @@ func (s *FieldInitializerListContext) ToStringTree(ruleNames []string, recog ant
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *FieldInitializerListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterFieldInitializerList(s)
@@ -4116,29 +4667,12 @@ func (s *FieldInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) int
}
}
-func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContext) {
- this := p
- _ = this
- localctx = NewFieldInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 22, CELParserRULE_fieldInitializerList)
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
+func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContext) {
+ localctx = NewFieldInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
+ p.EnterRule(localctx, 22, CELParserRULE_fieldInitializerList)
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -4147,6 +4681,7 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
var _x = p.OptField()
+
localctx.(*FieldInitializerListContext)._optField = _x
}
localctx.(*FieldInitializerListContext).fields = append(localctx.(*FieldInitializerListContext).fields, localctx.(*FieldInitializerListContext)._optField)
@@ -4156,6 +4691,10 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
var _m = p.Match(CELParserCOLON)
localctx.(*FieldInitializerListContext).s21 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*FieldInitializerListContext).cols = append(localctx.(*FieldInitializerListContext).cols, localctx.(*FieldInitializerListContext).s21)
{
@@ -4163,24 +4702,35 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
var _x = p.Expr()
+
localctx.(*FieldInitializerListContext)._expr = _x
}
localctx.(*FieldInitializerListContext).values = append(localctx.(*FieldInitializerListContext).values, localctx.(*FieldInitializerListContext)._expr)
p.SetState(208)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 28, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
{
p.SetState(201)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(202)
var _x = p.OptField()
+
localctx.(*FieldInitializerListContext)._optField = _x
}
localctx.(*FieldInitializerListContext).fields = append(localctx.(*FieldInitializerListContext).fields, localctx.(*FieldInitializerListContext)._optField)
@@ -4190,6 +4740,10 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
var _m = p.Match(CELParserCOLON)
localctx.(*FieldInitializerListContext).s21 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*FieldInitializerListContext).cols = append(localctx.(*FieldInitializerListContext).cols, localctx.(*FieldInitializerListContext).s21)
{
@@ -4197,19 +4751,40 @@ func (p *CELParser) FieldInitializerList() (localctx IFieldInitializerListContex
var _x = p.Expr()
+
localctx.(*FieldInitializerListContext)._expr = _x
}
localctx.(*FieldInitializerListContext).values = append(localctx.(*FieldInitializerListContext).values, localctx.(*FieldInitializerListContext)._expr)
+
}
p.SetState(210)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 28, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IOptFieldContext is an interface to support dynamic dispatch.
type IOptFieldContext interface {
antlr.ParserRuleContext
@@ -4218,10 +4793,12 @@ type IOptFieldContext interface {
GetParser() antlr.Parser
// GetOpt returns the opt token.
- GetOpt() antlr.Token
+ GetOpt() antlr.Token
+
// SetOpt sets the opt token.
- SetOpt(antlr.Token)
+ SetOpt(antlr.Token)
+
// Getter signatures
IDENTIFIER() antlr.TerminalNode
@@ -4232,24 +4809,29 @@ type IOptFieldContext interface {
}
type OptFieldContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- opt antlr.Token
+ opt antlr.Token
}
func NewEmptyOptFieldContext() *OptFieldContext {
var p = new(OptFieldContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_optField
return p
}
+func InitEmptyOptFieldContext(p *OptFieldContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_optField
+}
+
func (*OptFieldContext) IsOptFieldContext() {}
func NewOptFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OptFieldContext {
var p = new(OptFieldContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_optField
@@ -4261,8 +4843,10 @@ func (s *OptFieldContext) GetParser() antlr.Parser { return s.parser }
func (s *OptFieldContext) GetOpt() antlr.Token { return s.opt }
+
func (s *OptFieldContext) SetOpt(v antlr.Token) { s.opt = v }
+
func (s *OptFieldContext) IDENTIFIER() antlr.TerminalNode {
return s.GetToken(CELParserIDENTIFIER, 0)
}
@@ -4279,6 +4863,7 @@ func (s *OptFieldContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *OptFieldContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterOptField(s)
@@ -4301,35 +4886,23 @@ func (s *OptFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) OptField() (localctx IOptFieldContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) OptField() (localctx IOptFieldContext) {
localctx = NewOptFieldContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 24, CELParserRULE_optField)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
p.SetState(212)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK {
{
p.SetState(211)
@@ -4337,17 +4910,38 @@ func (p *CELParser) OptField() (localctx IOptFieldContext) {
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*OptFieldContext).opt = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
{
p.SetState(214)
p.Match(CELParserIDENTIFIER)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IMapInitializerListContext is an interface to support dynamic dispatch.
type IMapInitializerListContext interface {
antlr.ParserRuleContext
@@ -4356,40 +4950,48 @@ type IMapInitializerListContext interface {
GetParser() antlr.Parser
// GetS21 returns the s21 token.
- GetS21() antlr.Token
+ GetS21() antlr.Token
+
// SetS21 sets the s21 token.
- SetS21(antlr.Token)
+ SetS21(antlr.Token)
+
// GetCols returns the cols token list.
GetCols() []antlr.Token
+
// SetCols sets the cols token list.
SetCols([]antlr.Token)
+
// Get_optExpr returns the _optExpr rule contexts.
Get_optExpr() IOptExprContext
// Get_expr returns the _expr rule contexts.
Get_expr() IExprContext
+
// Set_optExpr sets the _optExpr rule contexts.
Set_optExpr(IOptExprContext)
// Set_expr sets the _expr rule contexts.
Set_expr(IExprContext)
+
// GetKeys returns the keys rule context list.
GetKeys() []IOptExprContext
// GetValues returns the values rule context list.
GetValues() []IExprContext
+
// SetKeys sets the keys rule context list.
- SetKeys([]IOptExprContext)
+ SetKeys([]IOptExprContext)
// SetValues sets the values rule context list.
- SetValues([]IExprContext)
+ SetValues([]IExprContext)
+
// Getter signatures
AllOptExpr() []IOptExprContext
@@ -4406,29 +5008,34 @@ type IMapInitializerListContext interface {
}
type MapInitializerListContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- _optExpr IOptExprContext
- keys []IOptExprContext
- s21 antlr.Token
- cols []antlr.Token
- _expr IExprContext
- values []IExprContext
+ antlr.BaseParserRuleContext
+ parser antlr.Parser
+ _optExpr IOptExprContext
+ keys []IOptExprContext
+ s21 antlr.Token
+ cols []antlr.Token
+ _expr IExprContext
+ values []IExprContext
}
func NewEmptyMapInitializerListContext() *MapInitializerListContext {
var p = new(MapInitializerListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_mapInitializerList
return p
}
+func InitEmptyMapInitializerListContext(p *MapInitializerListContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_mapInitializerList
+}
+
func (*MapInitializerListContext) IsMapInitializerListContext() {}
func NewMapInitializerListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MapInitializerListContext {
var p = new(MapInitializerListContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_mapInitializerList
@@ -4440,28 +5047,36 @@ func (s *MapInitializerListContext) GetParser() antlr.Parser { return s.parser }
func (s *MapInitializerListContext) GetS21() antlr.Token { return s.s21 }
+
func (s *MapInitializerListContext) SetS21(v antlr.Token) { s.s21 = v }
+
func (s *MapInitializerListContext) GetCols() []antlr.Token { return s.cols }
+
func (s *MapInitializerListContext) SetCols(v []antlr.Token) { s.cols = v }
+
func (s *MapInitializerListContext) Get_optExpr() IOptExprContext { return s._optExpr }
func (s *MapInitializerListContext) Get_expr() IExprContext { return s._expr }
+
func (s *MapInitializerListContext) Set_optExpr(v IOptExprContext) { s._optExpr = v }
func (s *MapInitializerListContext) Set_expr(v IExprContext) { s._expr = v }
+
func (s *MapInitializerListContext) GetKeys() []IOptExprContext { return s.keys }
func (s *MapInitializerListContext) GetValues() []IExprContext { return s.values }
+
func (s *MapInitializerListContext) SetKeys(v []IOptExprContext) { s.keys = v }
func (s *MapInitializerListContext) SetValues(v []IExprContext) { s.values = v }
+
func (s *MapInitializerListContext) AllOptExpr() []IOptExprContext {
children := s.GetChildren()
len := 0
@@ -4484,12 +5099,12 @@ func (s *MapInitializerListContext) AllOptExpr() []IOptExprContext {
}
func (s *MapInitializerListContext) OptExpr(i int) IOptExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IOptExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -4533,12 +5148,12 @@ func (s *MapInitializerListContext) AllExpr() []IExprContext {
}
func (s *MapInitializerListContext) Expr(i int) IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
j := 0
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
if j == i {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
j++
@@ -4568,6 +5183,7 @@ func (s *MapInitializerListContext) ToStringTree(ruleNames []string, recog antlr
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *MapInitializerListContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterMapInitializerList(s)
@@ -4590,29 +5206,12 @@ func (s *MapInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) inter
}
}
-func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
- this := p
- _ = this
- localctx = NewMapInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 26, CELParserRULE_mapInitializerList)
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
+func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
+ localctx = NewMapInitializerListContext(p, p.GetParserRuleContext(), p.GetState())
+ p.EnterRule(localctx, 26, CELParserRULE_mapInitializerList)
var _alt int
p.EnterOuterAlt(localctx, 1)
@@ -4621,6 +5220,7 @@ func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
var _x = p.OptExpr()
+
localctx.(*MapInitializerListContext)._optExpr = _x
}
localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr)
@@ -4630,6 +5230,10 @@ func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
var _m = p.Match(CELParserCOLON)
localctx.(*MapInitializerListContext).s21 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s21)
{
@@ -4637,24 +5241,35 @@ func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
var _x = p.Expr()
+
localctx.(*MapInitializerListContext)._expr = _x
}
localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr)
p.SetState(226)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 30, p.GetParserRuleContext())
-
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
if _alt == 1 {
{
p.SetState(219)
p.Match(CELParserCOMMA)
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
{
p.SetState(220)
var _x = p.OptExpr()
+
localctx.(*MapInitializerListContext)._optExpr = _x
}
localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr)
@@ -4664,6 +5279,10 @@ func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
var _m = p.Match(CELParserCOLON)
localctx.(*MapInitializerListContext).s21 = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s21)
{
@@ -4671,19 +5290,40 @@ func (p *CELParser) MapInitializerList() (localctx IMapInitializerListContext) {
var _x = p.Expr()
+
localctx.(*MapInitializerListContext)._expr = _x
}
localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr)
+
}
p.SetState(228)
p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 30, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
+ _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext())
+ if p.HasError() {
+ goto errorExit
+ }
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// IOptExprContext is an interface to support dynamic dispatch.
type IOptExprContext interface {
antlr.ParserRuleContext
@@ -4692,17 +5332,21 @@ type IOptExprContext interface {
GetParser() antlr.Parser
// GetOpt returns the opt token.
- GetOpt() antlr.Token
+ GetOpt() antlr.Token
+
// SetOpt sets the opt token.
- SetOpt(antlr.Token)
+ SetOpt(antlr.Token)
+
// GetE returns the e rule contexts.
GetE() IExprContext
+
// SetE sets the e rule contexts.
SetE(IExprContext)
+
// Getter signatures
Expr() IExprContext
QUESTIONMARK() antlr.TerminalNode
@@ -4712,25 +5356,30 @@ type IOptExprContext interface {
}
type OptExprContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
- opt antlr.Token
- e IExprContext
+ opt antlr.Token
+ e IExprContext
}
func NewEmptyOptExprContext() *OptExprContext {
var p = new(OptExprContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_optExpr
return p
}
+func InitEmptyOptExprContext(p *OptExprContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_optExpr
+}
+
func (*OptExprContext) IsOptExprContext() {}
func NewOptExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OptExprContext {
var p = new(OptExprContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_optExpr
@@ -4742,17 +5391,21 @@ func (s *OptExprContext) GetParser() antlr.Parser { return s.parser }
func (s *OptExprContext) GetOpt() antlr.Token { return s.opt }
+
func (s *OptExprContext) SetOpt(v antlr.Token) { s.opt = v }
+
func (s *OptExprContext) GetE() IExprContext { return s.e }
+
func (s *OptExprContext) SetE(v IExprContext) { s.e = v }
+
func (s *OptExprContext) Expr() IExprContext {
- var t antlr.RuleContext
+ var t antlr.RuleContext;
for _, ctx := range s.GetChildren() {
if _, ok := ctx.(IExprContext); ok {
- t = ctx.(antlr.RuleContext)
+ t = ctx.(antlr.RuleContext);
break
}
}
@@ -4776,6 +5429,7 @@ func (s *OptExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
func (s *OptExprContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterOptExpr(s)
@@ -4798,35 +5452,23 @@ func (s *OptExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) OptExpr() (localctx IOptExprContext) {
- this := p
- _ = this
+
+
+func (p *CELParser) OptExpr() (localctx IOptExprContext) {
localctx = NewOptExprContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 28, CELParserRULE_optExpr)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.EnterOuterAlt(localctx, 1)
p.SetState(230)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserQUESTIONMARK {
{
p.SetState(229)
@@ -4834,6 +5476,10 @@ func (p *CELParser) OptExpr() (localctx IOptExprContext) {
var _m = p.Match(CELParserQUESTIONMARK)
localctx.(*OptExprContext).opt = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -4842,12 +5488,26 @@ func (p *CELParser) OptExpr() (localctx IOptExprContext) {
var _x = p.Expr()
+
localctx.(*OptExprContext).e = _x
}
+
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
// ILiteralContext is an interface to support dynamic dispatch.
type ILiteralContext interface {
antlr.ParserRuleContext
@@ -4859,23 +5519,28 @@ type ILiteralContext interface {
}
type LiteralContext struct {
- *antlr.BaseParserRuleContext
+ antlr.BaseParserRuleContext
parser antlr.Parser
}
func NewEmptyLiteralContext() *LiteralContext {
var p = new(LiteralContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
p.RuleIndex = CELParserRULE_literal
return p
}
+func InitEmptyLiteralContext(p *LiteralContext) {
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
+ p.RuleIndex = CELParserRULE_literal
+}
+
func (*LiteralContext) IsLiteralContext() {}
func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext {
var p = new(LiteralContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
+ antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
p.parser = parser
p.RuleIndex = CELParserRULE_literal
@@ -4885,8 +5550,8 @@ func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invo
func (s *LiteralContext) GetParser() antlr.Parser { return s.parser }
-func (s *LiteralContext) CopyFrom(ctx *LiteralContext) {
- s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext)
+func (s *LiteralContext) CopyAll(ctx *LiteralContext) {
+ s.CopyFrom(&ctx.BaseParserRuleContext)
}
func (s *LiteralContext) GetRuleContext() antlr.RuleContext {
@@ -4897,23 +5562,28 @@ func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog)
}
+
+
+
type BytesContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewBytesContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BytesContext {
var p = new(BytesContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *BytesContext) GetTok() antlr.Token { return s.tok }
+
func (s *BytesContext) SetTok(v antlr.Token) { s.tok = v }
func (s *BytesContext) GetRuleContext() antlr.RuleContext {
@@ -4924,6 +5594,7 @@ func (s *BytesContext) BYTES() antlr.TerminalNode {
return s.GetToken(CELParserBYTES, 0)
}
+
func (s *BytesContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterBytes(s)
@@ -4946,23 +5617,26 @@ func (s *BytesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type UintContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewUintContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UintContext {
var p = new(UintContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *UintContext) GetTok() antlr.Token { return s.tok }
+
func (s *UintContext) SetTok(v antlr.Token) { s.tok = v }
func (s *UintContext) GetRuleContext() antlr.RuleContext {
@@ -4973,6 +5647,7 @@ func (s *UintContext) NUM_UINT() antlr.TerminalNode {
return s.GetToken(CELParserNUM_UINT, 0)
}
+
func (s *UintContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterUint(s)
@@ -4995,23 +5670,26 @@ func (s *UintContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type NullContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewNullContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NullContext {
var p = new(NullContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *NullContext) GetTok() antlr.Token { return s.tok }
+
func (s *NullContext) SetTok(v antlr.Token) { s.tok = v }
func (s *NullContext) GetRuleContext() antlr.RuleContext {
@@ -5022,6 +5700,7 @@ func (s *NullContext) NUL() antlr.TerminalNode {
return s.GetToken(CELParserNUL, 0)
}
+
func (s *NullContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterNull(s)
@@ -5044,23 +5723,26 @@ func (s *NullContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type BoolFalseContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewBoolFalseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolFalseContext {
var p = new(BoolFalseContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *BoolFalseContext) GetTok() antlr.Token { return s.tok }
+
func (s *BoolFalseContext) SetTok(v antlr.Token) { s.tok = v }
func (s *BoolFalseContext) GetRuleContext() antlr.RuleContext {
@@ -5071,6 +5753,7 @@ func (s *BoolFalseContext) CEL_FALSE() antlr.TerminalNode {
return s.GetToken(CELParserCEL_FALSE, 0)
}
+
func (s *BoolFalseContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterBoolFalse(s)
@@ -5093,23 +5776,26 @@ func (s *BoolFalseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type StringContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewStringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringContext {
var p = new(StringContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *StringContext) GetTok() antlr.Token { return s.tok }
+
func (s *StringContext) SetTok(v antlr.Token) { s.tok = v }
func (s *StringContext) GetRuleContext() antlr.RuleContext {
@@ -5120,6 +5806,7 @@ func (s *StringContext) STRING() antlr.TerminalNode {
return s.GetToken(CELParserSTRING, 0)
}
+
func (s *StringContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterString(s)
@@ -5142,26 +5829,29 @@ func (s *StringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type DoubleContext struct {
- *LiteralContext
+ LiteralContext
sign antlr.Token
- tok antlr.Token
+ tok antlr.Token
}
func NewDoubleContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DoubleContext {
var p = new(DoubleContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *DoubleContext) GetSign() antlr.Token { return s.sign }
func (s *DoubleContext) GetTok() antlr.Token { return s.tok }
+
func (s *DoubleContext) SetSign(v antlr.Token) { s.sign = v }
func (s *DoubleContext) SetTok(v antlr.Token) { s.tok = v }
@@ -5178,6 +5868,7 @@ func (s *DoubleContext) MINUS() antlr.TerminalNode {
return s.GetToken(CELParserMINUS, 0)
}
+
func (s *DoubleContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterDouble(s)
@@ -5200,23 +5891,26 @@ func (s *DoubleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type BoolTrueContext struct {
- *LiteralContext
+ LiteralContext
tok antlr.Token
}
func NewBoolTrueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolTrueContext {
var p = new(BoolTrueContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *BoolTrueContext) GetTok() antlr.Token { return s.tok }
+
func (s *BoolTrueContext) SetTok(v antlr.Token) { s.tok = v }
func (s *BoolTrueContext) GetRuleContext() antlr.RuleContext {
@@ -5227,6 +5921,7 @@ func (s *BoolTrueContext) CEL_TRUE() antlr.TerminalNode {
return s.GetToken(CELParserCEL_TRUE, 0)
}
+
func (s *BoolTrueContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterBoolTrue(s)
@@ -5249,26 +5944,29 @@ func (s *BoolTrueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
+
type IntContext struct {
- *LiteralContext
+ LiteralContext
sign antlr.Token
- tok antlr.Token
+ tok antlr.Token
}
func NewIntContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntContext {
var p = new(IntContext)
- p.LiteralContext = NewEmptyLiteralContext()
+ InitEmptyLiteralContext(&p.LiteralContext)
p.parser = parser
- p.CopyFrom(ctx.(*LiteralContext))
+ p.CopyAll(ctx.(*LiteralContext))
return p
}
+
func (s *IntContext) GetSign() antlr.Token { return s.sign }
func (s *IntContext) GetTok() antlr.Token { return s.tok }
+
func (s *IntContext) SetSign(v antlr.Token) { s.sign = v }
func (s *IntContext) SetTok(v antlr.Token) { s.tok = v }
@@ -5285,6 +5983,7 @@ func (s *IntContext) MINUS() antlr.TerminalNode {
return s.GetToken(CELParserMINUS, 0)
}
+
func (s *IntContext) EnterRule(listener antlr.ParseTreeListener) {
if listenerT, ok := listener.(CELListener); ok {
listenerT.EnterInt(s)
@@ -5307,40 +6006,31 @@ func (s *IntContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
}
}
-func (p *CELParser) Literal() (localctx ILiteralContext) {
- this := p
- _ = this
+
+func (p *CELParser) Literal() (localctx ILiteralContext) {
localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 30, CELParserRULE_literal)
var _la int
- defer func() {
- p.ExitRule()
- }()
-
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
-
p.SetState(248)
p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 34, p.GetParserRuleContext()) {
+ if p.HasError() {
+ goto errorExit
+ }
+
+ switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 34, p.GetParserRuleContext()) {
case 1:
localctx = NewIntContext(p, localctx)
p.EnterOuterAlt(localctx, 1)
p.SetState(235)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserMINUS {
{
p.SetState(234)
@@ -5348,6 +6038,10 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserMINUS)
localctx.(*IntContext).sign = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -5357,8 +6051,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserNUM_INT)
localctx.(*IntContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 2:
localctx = NewUintContext(p, localctx)
p.EnterOuterAlt(localctx, 2)
@@ -5368,15 +6067,24 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserNUM_UINT)
localctx.(*UintContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 3:
localctx = NewDoubleContext(p, localctx)
p.EnterOuterAlt(localctx, 3)
p.SetState(240)
p.GetErrorHandler().Sync(p)
+ if p.HasError() {
+ goto errorExit
+ }
_la = p.GetTokenStream().LA(1)
+
if _la == CELParserMINUS {
{
p.SetState(239)
@@ -5384,6 +6092,10 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserMINUS)
localctx.(*DoubleContext).sign = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
}
@@ -5393,8 +6105,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserNUM_FLOAT)
localctx.(*DoubleContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 4:
localctx = NewStringContext(p, localctx)
p.EnterOuterAlt(localctx, 4)
@@ -5404,8 +6121,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserSTRING)
localctx.(*StringContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 5:
localctx = NewBytesContext(p, localctx)
p.EnterOuterAlt(localctx, 5)
@@ -5415,8 +6137,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserBYTES)
localctx.(*BytesContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 6:
localctx = NewBoolTrueContext(p, localctx)
p.EnterOuterAlt(localctx, 6)
@@ -5426,8 +6153,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserCEL_TRUE)
localctx.(*BoolTrueContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 7:
localctx = NewBoolFalseContext(p, localctx)
p.EnterOuterAlt(localctx, 7)
@@ -5437,8 +6169,13 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserCEL_FALSE)
localctx.(*BoolFalseContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+
case 8:
localctx = NewNullContext(p, localctx)
p.EnterOuterAlt(localctx, 8)
@@ -5448,35 +6185,48 @@ func (p *CELParser) Literal() (localctx ILiteralContext) {
var _m = p.Match(CELParserNUL)
localctx.(*NullContext).tok = _m
+ if p.HasError() {
+ // Recognition error - abort rule
+ goto errorExit
+ }
}
+ case antlr.ATNInvalidAltNumber:
+ goto errorExit
}
+
+errorExit:
+ if p.HasError() {
+ v := p.GetError()
+ localctx.SetException(v)
+ p.GetErrorHandler().ReportError(p, v)
+ p.GetErrorHandler().Recover(p, v)
+ p.SetError(nil)
+ }
+ p.ExitRule()
return localctx
+ goto errorExit // Trick to prevent compiler error if the label is not used
}
+
func (p *CELParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool {
switch ruleIndex {
case 4:
- var t *RelationContext = nil
- if localctx != nil {
- t = localctx.(*RelationContext)
- }
- return p.Relation_Sempred(t, predIndex)
+ var t *RelationContext = nil
+ if localctx != nil { t = localctx.(*RelationContext) }
+ return p.Relation_Sempred(t, predIndex)
case 5:
- var t *CalcContext = nil
- if localctx != nil {
- t = localctx.(*CalcContext)
- }
- return p.Calc_Sempred(t, predIndex)
+ var t *CalcContext = nil
+ if localctx != nil { t = localctx.(*CalcContext) }
+ return p.Calc_Sempred(t, predIndex)
case 7:
- var t *MemberContext = nil
- if localctx != nil {
- t = localctx.(*MemberContext)
- }
- return p.Member_Sempred(t, predIndex)
+ var t *MemberContext = nil
+ if localctx != nil { t = localctx.(*MemberContext) }
+ return p.Member_Sempred(t, predIndex)
+
default:
panic("No predicate with index: " + fmt.Sprint(ruleIndex))
@@ -5484,12 +6234,9 @@ func (p *CELParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int
}
func (p *CELParser) Relation_Sempred(localctx antlr.RuleContext, predIndex int) bool {
- this := p
- _ = this
-
switch predIndex {
case 0:
- return p.Precpred(p.GetParserRuleContext(), 1)
+ return p.Precpred(p.GetParserRuleContext(), 1)
default:
panic("No predicate with index: " + fmt.Sprint(predIndex))
@@ -5497,15 +6244,12 @@ func (p *CELParser) Relation_Sempred(localctx antlr.RuleContext, predIndex int)
}
func (p *CELParser) Calc_Sempred(localctx antlr.RuleContext, predIndex int) bool {
- this := p
- _ = this
-
switch predIndex {
case 1:
- return p.Precpred(p.GetParserRuleContext(), 2)
+ return p.Precpred(p.GetParserRuleContext(), 2)
case 2:
- return p.Precpred(p.GetParserRuleContext(), 1)
+ return p.Precpred(p.GetParserRuleContext(), 1)
default:
panic("No predicate with index: " + fmt.Sprint(predIndex))
@@ -5513,20 +6257,18 @@ func (p *CELParser) Calc_Sempred(localctx antlr.RuleContext, predIndex int) bool
}
func (p *CELParser) Member_Sempred(localctx antlr.RuleContext, predIndex int) bool {
- this := p
- _ = this
-
switch predIndex {
case 3:
- return p.Precpred(p.GetParserRuleContext(), 3)
+ return p.Precpred(p.GetParserRuleContext(), 3)
case 4:
- return p.Precpred(p.GetParserRuleContext(), 2)
+ return p.Precpred(p.GetParserRuleContext(), 2)
case 5:
- return p.Precpred(p.GetParserRuleContext(), 1)
+ return p.Precpred(p.GetParserRuleContext(), 1)
default:
panic("No predicate with index: " + fmt.Sprint(predIndex))
}
}
+
diff --git a/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go b/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go
index 2c54e2cb02..d2fbd563ab 100644
--- a/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go
+++ b/vendor/github.com/google/cel-go/parser/gen/cel_visitor.go
@@ -1,7 +1,8 @@
-// Code generated from /Users/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.12.0. DO NOT EDIT.
+// Code generated from /usr/local/google/home/tswadell/go/src/github.com/google/cel-go/parser/gen/CEL.g4 by ANTLR 4.13.1. DO NOT EDIT.
package gen // CEL
-import "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+import "github.com/antlr4-go/antlr/v4"
+
// A complete Visitor for a parse tree produced by CELParser.
type CELVisitor interface {
@@ -105,4 +106,5 @@ type CELVisitor interface {
// Visit a parse tree produced by CELParser#Null.
VisitNull(ctx *NullContext) interface{}
-}
+
+}
\ No newline at end of file
diff --git a/vendor/github.com/google/cel-go/parser/gen/generate.sh b/vendor/github.com/google/cel-go/parser/gen/generate.sh
index 389107c6a5..27a9559f7c 100644
--- a/vendor/github.com/google/cel-go/parser/gen/generate.sh
+++ b/vendor/github.com/google/cel-go/parser/gen/generate.sh
@@ -27,7 +27,7 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Generate AntLR artifacts.
-java -Xmx500M -cp ${DIR}/antlr-4.12.0-complete.jar org.antlr.v4.Tool \
+java -Xmx500M -cp ${DIR}/antlr-4.13.1-complete.jar org.antlr.v4.Tool \
-Dlanguage=Go \
-package gen \
-o ${DIR} \
diff --git a/vendor/github.com/google/cel-go/parser/helper.go b/vendor/github.com/google/cel-go/parser/helper.go
index a5f29e3d7a..182ff034c2 100644
--- a/vendor/github.com/google/cel-go/parser/helper.go
+++ b/vendor/github.com/google/cel-go/parser/helper.go
@@ -17,284 +17,209 @@ package parser
import (
"sync"
- antlr "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+ antlr "github.com/antlr4-go/antlr/v4"
"github.com/google/cel-go/common"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
)
type parserHelper struct {
- source common.Source
- nextID int64
- positions map[int64]int32
- macroCalls map[int64]*exprpb.Expr
+ exprFactory ast.ExprFactory
+ source common.Source
+ sourceInfo *ast.SourceInfo
+ nextID int64
}
-func newParserHelper(source common.Source) *parserHelper {
+func newParserHelper(source common.Source, fac ast.ExprFactory) *parserHelper {
return &parserHelper{
- source: source,
- nextID: 1,
- positions: make(map[int64]int32),
- macroCalls: make(map[int64]*exprpb.Expr),
+ exprFactory: fac,
+ source: source,
+ sourceInfo: ast.NewSourceInfo(source),
+ nextID: 1,
}
}
-func (p *parserHelper) getSourceInfo() *exprpb.SourceInfo {
- return &exprpb.SourceInfo{
- Location: p.source.Description(),
- Positions: p.positions,
- LineOffsets: p.source.LineOffsets(),
- MacroCalls: p.macroCalls}
+func (p *parserHelper) getSourceInfo() *ast.SourceInfo {
+ return p.sourceInfo
}
-func (p *parserHelper) newLiteral(ctx any, value *exprpb.Constant) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_ConstExpr{ConstExpr: value}
- return exprNode
+func (p *parserHelper) newLiteral(ctx any, value ref.Val) ast.Expr {
+ return p.exprFactory.NewLiteral(p.newID(ctx), value)
}
-func (p *parserHelper) newLiteralBool(ctx any, value bool) *exprpb.Expr {
- return p.newLiteral(ctx,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_BoolValue{BoolValue: value}})
+func (p *parserHelper) newLiteralBool(ctx any, value bool) ast.Expr {
+ return p.newLiteral(ctx, types.Bool(value))
}
-func (p *parserHelper) newLiteralString(ctx any, value string) *exprpb.Expr {
- return p.newLiteral(ctx,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: value}})
+func (p *parserHelper) newLiteralString(ctx any, value string) ast.Expr {
+ return p.newLiteral(ctx, types.String(value))
}
-func (p *parserHelper) newLiteralBytes(ctx any, value []byte) *exprpb.Expr {
- return p.newLiteral(ctx,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_BytesValue{BytesValue: value}})
+func (p *parserHelper) newLiteralBytes(ctx any, value []byte) ast.Expr {
+ return p.newLiteral(ctx, types.Bytes(value))
}
-func (p *parserHelper) newLiteralInt(ctx any, value int64) *exprpb.Expr {
- return p.newLiteral(ctx,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_Int64Value{Int64Value: value}})
+func (p *parserHelper) newLiteralInt(ctx any, value int64) ast.Expr {
+ return p.newLiteral(ctx, types.Int(value))
}
-func (p *parserHelper) newLiteralUint(ctx any, value uint64) *exprpb.Expr {
- return p.newLiteral(ctx, &exprpb.Constant{ConstantKind: &exprpb.Constant_Uint64Value{Uint64Value: value}})
+func (p *parserHelper) newLiteralUint(ctx any, value uint64) ast.Expr {
+ return p.newLiteral(ctx, types.Uint(value))
}
-func (p *parserHelper) newLiteralDouble(ctx any, value float64) *exprpb.Expr {
- return p.newLiteral(ctx,
- &exprpb.Constant{ConstantKind: &exprpb.Constant_DoubleValue{DoubleValue: value}})
+func (p *parserHelper) newLiteralDouble(ctx any, value float64) ast.Expr {
+ return p.newLiteral(ctx, types.Double(value))
}
-func (p *parserHelper) newIdent(ctx any, name string) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_IdentExpr{IdentExpr: &exprpb.Expr_Ident{Name: name}}
- return exprNode
+func (p *parserHelper) newIdent(ctx any, name string) ast.Expr {
+ return p.exprFactory.NewIdent(p.newID(ctx), name)
}
-func (p *parserHelper) newSelect(ctx any, operand *exprpb.Expr, field string) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_SelectExpr{
- SelectExpr: &exprpb.Expr_Select{Operand: operand, Field: field}}
- return exprNode
+func (p *parserHelper) newSelect(ctx any, operand ast.Expr, field string) ast.Expr {
+ return p.exprFactory.NewSelect(p.newID(ctx), operand, field)
}
-func (p *parserHelper) newPresenceTest(ctx any, operand *exprpb.Expr, field string) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_SelectExpr{
- SelectExpr: &exprpb.Expr_Select{Operand: operand, Field: field, TestOnly: true}}
- return exprNode
+func (p *parserHelper) newPresenceTest(ctx any, operand ast.Expr, field string) ast.Expr {
+ return p.exprFactory.NewPresenceTest(p.newID(ctx), operand, field)
}
-func (p *parserHelper) newGlobalCall(ctx any, function string, args ...*exprpb.Expr) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{Function: function, Args: args}}
- return exprNode
+func (p *parserHelper) newGlobalCall(ctx any, function string, args ...ast.Expr) ast.Expr {
+ return p.exprFactory.NewCall(p.newID(ctx), function, args...)
}
-func (p *parserHelper) newReceiverCall(ctx any, function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{Function: function, Target: target, Args: args}}
- return exprNode
+func (p *parserHelper) newReceiverCall(ctx any, function string, target ast.Expr, args ...ast.Expr) ast.Expr {
+ return p.exprFactory.NewMemberCall(p.newID(ctx), function, target, args...)
}
-func (p *parserHelper) newList(ctx any, elements []*exprpb.Expr, optionals ...int32) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_ListExpr{
- ListExpr: &exprpb.Expr_CreateList{
- Elements: elements,
- OptionalIndices: optionals,
- }}
- return exprNode
+func (p *parserHelper) newList(ctx any, elements []ast.Expr, optionals ...int32) ast.Expr {
+ return p.exprFactory.NewList(p.newID(ctx), elements, optionals)
}
-func (p *parserHelper) newMap(ctx any, entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_StructExpr{
- StructExpr: &exprpb.Expr_CreateStruct{Entries: entries}}
- return exprNode
+func (p *parserHelper) newMap(ctx any, entries ...ast.EntryExpr) ast.Expr {
+ return p.exprFactory.NewMap(p.newID(ctx), entries)
}
-func (p *parserHelper) newMapEntry(entryID int64, key *exprpb.Expr, value *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
- return &exprpb.Expr_CreateStruct_Entry{
- Id: entryID,
- KeyKind: &exprpb.Expr_CreateStruct_Entry_MapKey{MapKey: key},
- Value: value,
- OptionalEntry: optional,
- }
+func (p *parserHelper) newMapEntry(entryID int64, key ast.Expr, value ast.Expr, optional bool) ast.EntryExpr {
+ return p.exprFactory.NewMapEntry(entryID, key, value, optional)
}
-func (p *parserHelper) newObject(ctx any, typeName string, entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_StructExpr{
- StructExpr: &exprpb.Expr_CreateStruct{
- MessageName: typeName,
- Entries: entries,
- },
- }
- return exprNode
+func (p *parserHelper) newObject(ctx any, typeName string, fields ...ast.EntryExpr) ast.Expr {
+ return p.exprFactory.NewStruct(p.newID(ctx), typeName, fields)
}
-func (p *parserHelper) newObjectField(fieldID int64, field string, value *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
- return &exprpb.Expr_CreateStruct_Entry{
- Id: fieldID,
- KeyKind: &exprpb.Expr_CreateStruct_Entry_FieldKey{FieldKey: field},
- Value: value,
- OptionalEntry: optional,
- }
+func (p *parserHelper) newObjectField(fieldID int64, field string, value ast.Expr, optional bool) ast.EntryExpr {
+ return p.exprFactory.NewStructField(fieldID, field, value, optional)
}
-func (p *parserHelper) newComprehension(ctx any, iterVar string,
- iterRange *exprpb.Expr,
+func (p *parserHelper) newComprehension(ctx any,
+ iterRange ast.Expr,
+ iterVar string,
accuVar string,
- accuInit *exprpb.Expr,
- condition *exprpb.Expr,
- step *exprpb.Expr,
- result *exprpb.Expr) *exprpb.Expr {
- exprNode := p.newExpr(ctx)
- exprNode.ExprKind = &exprpb.Expr_ComprehensionExpr{
- ComprehensionExpr: &exprpb.Expr_Comprehension{
- AccuVar: accuVar,
- AccuInit: accuInit,
- IterVar: iterVar,
- IterRange: iterRange,
- LoopCondition: condition,
- LoopStep: step,
- Result: result}}
- return exprNode
-}
-
-func (p *parserHelper) newExpr(ctx any) *exprpb.Expr {
- id, isID := ctx.(int64)
- if isID {
- return &exprpb.Expr{Id: id}
+ accuInit ast.Expr,
+ condition ast.Expr,
+ step ast.Expr,
+ result ast.Expr) ast.Expr {
+ return p.exprFactory.NewComprehension(
+ p.newID(ctx), iterRange, iterVar, accuVar, accuInit, condition, step, result)
+}
+
+func (p *parserHelper) newID(ctx any) int64 {
+ if id, isID := ctx.(int64); isID {
+ return id
}
- return &exprpb.Expr{Id: p.id(ctx)}
+ return p.id(ctx)
+}
+
+func (p *parserHelper) newExpr(ctx any) ast.Expr {
+ return p.exprFactory.NewUnspecifiedExpr(p.newID(ctx))
}
func (p *parserHelper) id(ctx any) int64 {
- var location common.Location
+ var offset ast.OffsetRange
switch c := ctx.(type) {
case antlr.ParserRuleContext:
- token := c.GetStart()
- location = p.source.NewLocation(token.GetLine(), token.GetColumn())
+ start, stop := c.GetStart(), c.GetStop()
+ if stop == nil {
+ stop = start
+ }
+ offset.Start = p.sourceInfo.ComputeOffset(int32(start.GetLine()), int32(start.GetColumn()))
+ offset.Stop = p.sourceInfo.ComputeOffset(int32(stop.GetLine()), int32(stop.GetColumn()))
case antlr.Token:
- token := c
- location = p.source.NewLocation(token.GetLine(), token.GetColumn())
+ offset.Start = p.sourceInfo.ComputeOffset(int32(c.GetLine()), int32(c.GetColumn()))
+ offset.Stop = offset.Start
case common.Location:
- location = c
+ offset.Start = p.sourceInfo.ComputeOffset(int32(c.Line()), int32(c.Column()))
+ offset.Stop = offset.Start
+ case ast.OffsetRange:
+ offset = c
default:
// This should only happen if the ctx is nil
return -1
}
id := p.nextID
- p.positions[id], _ = p.source.LocationOffset(location)
+ p.sourceInfo.SetOffsetRange(id, offset)
p.nextID++
return id
}
func (p *parserHelper) getLocation(id int64) common.Location {
- characterOffset := p.positions[id]
- location, _ := p.source.OffsetLocation(characterOffset)
- return location
+ return p.sourceInfo.GetStartLocation(id)
}
// buildMacroCallArg iterates the expression and returns a new expression
// where all macros have been replaced by their IDs in MacroCalls
-func (p *parserHelper) buildMacroCallArg(expr *exprpb.Expr) *exprpb.Expr {
- if _, found := p.macroCalls[expr.GetId()]; found {
- return &exprpb.Expr{Id: expr.GetId()}
+func (p *parserHelper) buildMacroCallArg(expr ast.Expr) ast.Expr {
+ if _, found := p.sourceInfo.GetMacroCall(expr.ID()); found {
+ return p.exprFactory.NewUnspecifiedExpr(expr.ID())
}
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_CallExpr:
+ switch expr.Kind() {
+ case ast.CallKind:
// Iterate the AST from `expr` recursively looking for macros. Because we are at most
// starting from the top level macro, this recursion is bounded by the size of the AST. This
// means that the depth check on the AST during parsing will catch recursion overflows
// before we get to here.
- macroTarget := expr.GetCallExpr().GetTarget()
- if macroTarget != nil {
- macroTarget = p.buildMacroCallArg(macroTarget)
- }
- macroArgs := make([]*exprpb.Expr, len(expr.GetCallExpr().GetArgs()))
- for index, arg := range expr.GetCallExpr().GetArgs() {
+ call := expr.AsCall()
+ macroArgs := make([]ast.Expr, len(call.Args()))
+ for index, arg := range call.Args() {
macroArgs[index] = p.buildMacroCallArg(arg)
}
- return &exprpb.Expr{
- Id: expr.GetId(),
- ExprKind: &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{
- Target: macroTarget,
- Function: expr.GetCallExpr().GetFunction(),
- Args: macroArgs,
- },
- },
+ if !call.IsMemberFunction() {
+ return p.exprFactory.NewCall(expr.ID(), call.FunctionName(), macroArgs...)
}
- case *exprpb.Expr_ListExpr:
- listExpr := expr.GetListExpr()
- macroListArgs := make([]*exprpb.Expr, len(listExpr.GetElements()))
- for i, elem := range listExpr.GetElements() {
+ macroTarget := p.buildMacroCallArg(call.Target())
+ return p.exprFactory.NewMemberCall(expr.ID(), call.FunctionName(), macroTarget, macroArgs...)
+ case ast.ListKind:
+ list := expr.AsList()
+ macroListArgs := make([]ast.Expr, list.Size())
+ for i, elem := range list.Elements() {
macroListArgs[i] = p.buildMacroCallArg(elem)
}
- return &exprpb.Expr{
- Id: expr.GetId(),
- ExprKind: &exprpb.Expr_ListExpr{
- ListExpr: &exprpb.Expr_CreateList{
- Elements: macroListArgs,
- OptionalIndices: listExpr.GetOptionalIndices(),
- },
- },
- }
+ return p.exprFactory.NewList(expr.ID(), macroListArgs, list.OptionalIndices())
}
-
return expr
}
// addMacroCall adds the macro the the MacroCalls map in source info. If a macro has args/subargs/target
// that are macros, their ID will be stored instead for later self-lookups.
-func (p *parserHelper) addMacroCall(exprID int64, function string, target *exprpb.Expr, args ...*exprpb.Expr) {
- macroTarget := target
- if target != nil {
- if _, found := p.macroCalls[target.GetId()]; found {
- macroTarget = &exprpb.Expr{Id: target.GetId()}
- } else {
- macroTarget = p.buildMacroCallArg(target)
- }
- }
-
- macroArgs := make([]*exprpb.Expr, len(args))
+func (p *parserHelper) addMacroCall(exprID int64, function string, target ast.Expr, args ...ast.Expr) {
+ macroArgs := make([]ast.Expr, len(args))
for index, arg := range args {
macroArgs[index] = p.buildMacroCallArg(arg)
}
-
- p.macroCalls[exprID] = &exprpb.Expr{
- ExprKind: &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{
- Target: macroTarget,
- Function: function,
- Args: macroArgs,
- },
- },
+ if target == nil {
+ p.sourceInfo.SetMacroCall(exprID, p.exprFactory.NewCall(0, function, macroArgs...))
+ return
}
+ macroTarget := target
+ if _, found := p.sourceInfo.GetMacroCall(target.ID()); found {
+ macroTarget = p.exprFactory.NewUnspecifiedExpr(target.ID())
+ } else {
+ macroTarget = p.buildMacroCallArg(target)
+ }
+ p.sourceInfo.SetMacroCall(exprID, p.exprFactory.NewMemberCall(0, function, macroTarget, macroArgs...))
}
// logicManager compacts logical trees into a more efficient structure which is semantically
@@ -309,71 +234,71 @@ func (p *parserHelper) addMacroCall(exprID int64, function string, target *exprp
// controversial choice as it alters the traditional order of execution assumptions present in most
// expressions.
type logicManager struct {
- helper *parserHelper
+ exprFactory ast.ExprFactory
function string
- terms []*exprpb.Expr
+ terms []ast.Expr
ops []int64
variadicASTs bool
}
// newVariadicLogicManager creates a logic manager instance bound to a specific function and its first term.
-func newVariadicLogicManager(h *parserHelper, function string, term *exprpb.Expr) *logicManager {
+func newVariadicLogicManager(fac ast.ExprFactory, function string, term ast.Expr) *logicManager {
return &logicManager{
- helper: h,
+ exprFactory: fac,
function: function,
- terms: []*exprpb.Expr{term},
+ terms: []ast.Expr{term},
ops: []int64{},
variadicASTs: true,
}
}
// newBalancingLogicManager creates a logic manager instance bound to a specific function and its first term.
-func newBalancingLogicManager(h *parserHelper, function string, term *exprpb.Expr) *logicManager {
+func newBalancingLogicManager(fac ast.ExprFactory, function string, term ast.Expr) *logicManager {
return &logicManager{
- helper: h,
+ exprFactory: fac,
function: function,
- terms: []*exprpb.Expr{term},
+ terms: []ast.Expr{term},
ops: []int64{},
variadicASTs: false,
}
}
// addTerm adds an operation identifier and term to the set of terms to be balanced.
-func (l *logicManager) addTerm(op int64, term *exprpb.Expr) {
+func (l *logicManager) addTerm(op int64, term ast.Expr) {
l.terms = append(l.terms, term)
l.ops = append(l.ops, op)
}
// toExpr renders the logic graph into an Expr value, either balancing a tree of logical
// operations or creating a variadic representation of the logical operator.
-func (l *logicManager) toExpr() *exprpb.Expr {
+func (l *logicManager) toExpr() ast.Expr {
if len(l.terms) == 1 {
return l.terms[0]
}
if l.variadicASTs {
- return l.helper.newGlobalCall(l.ops[0], l.function, l.terms...)
+ return l.exprFactory.NewCall(l.ops[0], l.function, l.terms...)
}
return l.balancedTree(0, len(l.ops)-1)
}
// balancedTree recursively balances the terms provided to a commutative operator.
-func (l *logicManager) balancedTree(lo, hi int) *exprpb.Expr {
+func (l *logicManager) balancedTree(lo, hi int) ast.Expr {
mid := (lo + hi + 1) / 2
- var left *exprpb.Expr
+ var left ast.Expr
if mid == lo {
left = l.terms[mid]
} else {
left = l.balancedTree(lo, mid-1)
}
- var right *exprpb.Expr
+ var right ast.Expr
if mid == hi {
right = l.terms[mid+1]
} else {
right = l.balancedTree(mid+1, hi)
}
- return l.helper.newGlobalCall(l.ops[mid], l.function, left, right)
+ return l.exprFactory.NewCall(l.ops[mid], l.function, left, right)
}
type exprHelper struct {
@@ -387,202 +312,151 @@ func (e *exprHelper) nextMacroID() int64 {
// Copy implements the ExprHelper interface method by producing a copy of the input Expr value
// with a fresh set of numeric identifiers the Expr and all its descendants.
-func (e *exprHelper) Copy(expr *exprpb.Expr) *exprpb.Expr {
- copy := e.parserHelper.newExpr(e.parserHelper.getLocation(expr.GetId()))
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_ConstExpr:
- copy.ExprKind = &exprpb.Expr_ConstExpr{ConstExpr: expr.GetConstExpr()}
- case *exprpb.Expr_IdentExpr:
- copy.ExprKind = &exprpb.Expr_IdentExpr{IdentExpr: expr.GetIdentExpr()}
- case *exprpb.Expr_SelectExpr:
- op := expr.GetSelectExpr().GetOperand()
- copy.ExprKind = &exprpb.Expr_SelectExpr{SelectExpr: &exprpb.Expr_Select{
- Operand: e.Copy(op),
- Field: expr.GetSelectExpr().GetField(),
- TestOnly: expr.GetSelectExpr().GetTestOnly(),
- }}
- case *exprpb.Expr_CallExpr:
- call := expr.GetCallExpr()
- target := call.GetTarget()
- if target != nil {
- target = e.Copy(target)
+func (e *exprHelper) Copy(expr ast.Expr) ast.Expr {
+ offsetRange, _ := e.parserHelper.sourceInfo.GetOffsetRange(expr.ID())
+ copyID := e.parserHelper.newID(offsetRange)
+ switch expr.Kind() {
+ case ast.LiteralKind:
+ return e.exprFactory.NewLiteral(copyID, expr.AsLiteral())
+ case ast.IdentKind:
+ return e.exprFactory.NewIdent(copyID, expr.AsIdent())
+ case ast.SelectKind:
+ sel := expr.AsSelect()
+ op := e.Copy(sel.Operand())
+ if sel.IsTestOnly() {
+ return e.exprFactory.NewPresenceTest(copyID, op, sel.FieldName())
}
- args := call.GetArgs()
- argsCopy := make([]*exprpb.Expr, len(args))
+ return e.exprFactory.NewSelect(copyID, op, sel.FieldName())
+ case ast.CallKind:
+ call := expr.AsCall()
+ args := call.Args()
+ argsCopy := make([]ast.Expr, len(args))
for i, arg := range args {
argsCopy[i] = e.Copy(arg)
}
- copy.ExprKind = &exprpb.Expr_CallExpr{
- CallExpr: &exprpb.Expr_Call{
- Function: call.GetFunction(),
- Target: target,
- Args: argsCopy,
- },
+ if !call.IsMemberFunction() {
+ return e.exprFactory.NewCall(copyID, call.FunctionName(), argsCopy...)
}
- case *exprpb.Expr_ListExpr:
- elems := expr.GetListExpr().GetElements()
- elemsCopy := make([]*exprpb.Expr, len(elems))
+ return e.exprFactory.NewMemberCall(copyID, call.FunctionName(), e.Copy(call.Target()), argsCopy...)
+ case ast.ListKind:
+ list := expr.AsList()
+ elems := list.Elements()
+ elemsCopy := make([]ast.Expr, len(elems))
for i, elem := range elems {
elemsCopy[i] = e.Copy(elem)
}
- copy.ExprKind = &exprpb.Expr_ListExpr{
- ListExpr: &exprpb.Expr_CreateList{Elements: elemsCopy},
- }
- case *exprpb.Expr_StructExpr:
- entries := expr.GetStructExpr().GetEntries()
- entriesCopy := make([]*exprpb.Expr_CreateStruct_Entry, len(entries))
- for i, entry := range entries {
- entryCopy := &exprpb.Expr_CreateStruct_Entry{}
- entryCopy.Id = e.nextMacroID()
- switch entry.GetKeyKind().(type) {
- case *exprpb.Expr_CreateStruct_Entry_FieldKey:
- entryCopy.KeyKind = &exprpb.Expr_CreateStruct_Entry_FieldKey{
- FieldKey: entry.GetFieldKey(),
- }
- case *exprpb.Expr_CreateStruct_Entry_MapKey:
- entryCopy.KeyKind = &exprpb.Expr_CreateStruct_Entry_MapKey{
- MapKey: e.Copy(entry.GetMapKey()),
- }
- }
- entryCopy.Value = e.Copy(entry.GetValue())
- entriesCopy[i] = entryCopy
+ return e.exprFactory.NewList(copyID, elemsCopy, list.OptionalIndices())
+ case ast.MapKind:
+ m := expr.AsMap()
+ entries := m.Entries()
+ entriesCopy := make([]ast.EntryExpr, len(entries))
+ for i, en := range entries {
+ entry := en.AsMapEntry()
+ entryID := e.nextMacroID()
+ entriesCopy[i] = e.exprFactory.NewMapEntry(entryID,
+ e.Copy(entry.Key()), e.Copy(entry.Value()), entry.IsOptional())
}
- copy.ExprKind = &exprpb.Expr_StructExpr{
- StructExpr: &exprpb.Expr_CreateStruct{
- MessageName: expr.GetStructExpr().GetMessageName(),
- Entries: entriesCopy,
- },
- }
- case *exprpb.Expr_ComprehensionExpr:
- iterRange := e.Copy(expr.GetComprehensionExpr().GetIterRange())
- accuInit := e.Copy(expr.GetComprehensionExpr().GetAccuInit())
- cond := e.Copy(expr.GetComprehensionExpr().GetLoopCondition())
- step := e.Copy(expr.GetComprehensionExpr().GetLoopStep())
- result := e.Copy(expr.GetComprehensionExpr().GetResult())
- copy.ExprKind = &exprpb.Expr_ComprehensionExpr{
- ComprehensionExpr: &exprpb.Expr_Comprehension{
- IterRange: iterRange,
- IterVar: expr.GetComprehensionExpr().GetIterVar(),
- AccuInit: accuInit,
- AccuVar: expr.GetComprehensionExpr().GetAccuVar(),
- LoopCondition: cond,
- LoopStep: step,
- Result: result,
- },
+ return e.exprFactory.NewMap(copyID, entriesCopy)
+ case ast.StructKind:
+ s := expr.AsStruct()
+ fields := s.Fields()
+ fieldsCopy := make([]ast.EntryExpr, len(fields))
+ for i, f := range fields {
+ field := f.AsStructField()
+ fieldID := e.nextMacroID()
+ fieldsCopy[i] = e.exprFactory.NewStructField(fieldID,
+ field.Name(), e.Copy(field.Value()), field.IsOptional())
}
+ return e.exprFactory.NewStruct(copyID, s.TypeName(), fieldsCopy)
+ case ast.ComprehensionKind:
+ compre := expr.AsComprehension()
+ iterRange := e.Copy(compre.IterRange())
+ accuInit := e.Copy(compre.AccuInit())
+ cond := e.Copy(compre.LoopCondition())
+ step := e.Copy(compre.LoopStep())
+ result := e.Copy(compre.Result())
+ return e.exprFactory.NewComprehension(copyID,
+ iterRange, compre.IterVar(), compre.AccuVar(), accuInit, cond, step, result)
}
- return copy
-}
-
-// LiteralBool implements the ExprHelper interface method.
-func (e *exprHelper) LiteralBool(value bool) *exprpb.Expr {
- return e.parserHelper.newLiteralBool(e.nextMacroID(), value)
-}
-
-// LiteralBytes implements the ExprHelper interface method.
-func (e *exprHelper) LiteralBytes(value []byte) *exprpb.Expr {
- return e.parserHelper.newLiteralBytes(e.nextMacroID(), value)
-}
-
-// LiteralDouble implements the ExprHelper interface method.
-func (e *exprHelper) LiteralDouble(value float64) *exprpb.Expr {
- return e.parserHelper.newLiteralDouble(e.nextMacroID(), value)
-}
-
-// LiteralInt implements the ExprHelper interface method.
-func (e *exprHelper) LiteralInt(value int64) *exprpb.Expr {
- return e.parserHelper.newLiteralInt(e.nextMacroID(), value)
+ return e.exprFactory.NewUnspecifiedExpr(copyID)
}
-// LiteralString implements the ExprHelper interface method.
-func (e *exprHelper) LiteralString(value string) *exprpb.Expr {
- return e.parserHelper.newLiteralString(e.nextMacroID(), value)
-}
-
-// LiteralUint implements the ExprHelper interface method.
-func (e *exprHelper) LiteralUint(value uint64) *exprpb.Expr {
- return e.parserHelper.newLiteralUint(e.nextMacroID(), value)
+// NewLiteral implements the ExprHelper interface method.
+func (e *exprHelper) NewLiteral(value ref.Val) ast.Expr {
+ return e.exprFactory.NewLiteral(e.nextMacroID(), value)
}
// NewList implements the ExprHelper interface method.
-func (e *exprHelper) NewList(elems ...*exprpb.Expr) *exprpb.Expr {
- return e.parserHelper.newList(e.nextMacroID(), elems)
+func (e *exprHelper) NewList(elems ...ast.Expr) ast.Expr {
+ return e.exprFactory.NewList(e.nextMacroID(), elems, []int32{})
}
// NewMap implements the ExprHelper interface method.
-func (e *exprHelper) NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
- return e.parserHelper.newMap(e.nextMacroID(), entries...)
+func (e *exprHelper) NewMap(entries ...ast.EntryExpr) ast.Expr {
+ return e.exprFactory.NewMap(e.nextMacroID(), entries)
}
// NewMapEntry implements the ExprHelper interface method.
-func (e *exprHelper) NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
- return e.parserHelper.newMapEntry(e.nextMacroID(), key, val, optional)
+func (e *exprHelper) NewMapEntry(key ast.Expr, val ast.Expr, optional bool) ast.EntryExpr {
+ return e.exprFactory.NewMapEntry(e.nextMacroID(), key, val, optional)
}
-// NewObject implements the ExprHelper interface method.
-func (e *exprHelper) NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
- return e.parserHelper.newObject(e.nextMacroID(), typeName, fieldInits...)
+// NewStruct implements the ExprHelper interface method.
+func (e *exprHelper) NewStruct(typeName string, fieldInits ...ast.EntryExpr) ast.Expr {
+ return e.exprFactory.NewStruct(e.nextMacroID(), typeName, fieldInits)
}
-// NewObjectFieldInit implements the ExprHelper interface method.
-func (e *exprHelper) NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {
- return e.parserHelper.newObjectField(e.nextMacroID(), field, init, optional)
+// NewStructField implements the ExprHelper interface method.
+func (e *exprHelper) NewStructField(field string, init ast.Expr, optional bool) ast.EntryExpr {
+ return e.exprFactory.NewStructField(e.nextMacroID(), field, init, optional)
}
-// Fold implements the ExprHelper interface method.
-func (e *exprHelper) Fold(iterVar string,
- iterRange *exprpb.Expr,
+// NewComprehension implements the ExprHelper interface method.
+func (e *exprHelper) NewComprehension(
+ iterRange ast.Expr,
+ iterVar string,
accuVar string,
- accuInit *exprpb.Expr,
- condition *exprpb.Expr,
- step *exprpb.Expr,
- result *exprpb.Expr) *exprpb.Expr {
- return e.parserHelper.newComprehension(
- e.nextMacroID(), iterVar, iterRange, accuVar, accuInit, condition, step, result)
+ accuInit ast.Expr,
+ condition ast.Expr,
+ step ast.Expr,
+ result ast.Expr) ast.Expr {
+ return e.exprFactory.NewComprehension(
+ e.nextMacroID(), iterRange, iterVar, accuVar, accuInit, condition, step, result)
}
-// Ident implements the ExprHelper interface method.
-func (e *exprHelper) Ident(name string) *exprpb.Expr {
- return e.parserHelper.newIdent(e.nextMacroID(), name)
+// NewIdent implements the ExprHelper interface method.
+func (e *exprHelper) NewIdent(name string) ast.Expr {
+ return e.exprFactory.NewIdent(e.nextMacroID(), name)
}
-// AccuIdent implements the ExprHelper interface method.
-func (e *exprHelper) AccuIdent() *exprpb.Expr {
- return e.parserHelper.newIdent(e.nextMacroID(), AccumulatorName)
+// NewAccuIdent implements the ExprHelper interface method.
+func (e *exprHelper) NewAccuIdent() ast.Expr {
+ return e.exprFactory.NewAccuIdent(e.nextMacroID())
}
-// GlobalCall implements the ExprHelper interface method.
-func (e *exprHelper) GlobalCall(function string, args ...*exprpb.Expr) *exprpb.Expr {
- return e.parserHelper.newGlobalCall(e.nextMacroID(), function, args...)
+// NewGlobalCall implements the ExprHelper interface method.
+func (e *exprHelper) NewCall(function string, args ...ast.Expr) ast.Expr {
+ return e.exprFactory.NewCall(e.nextMacroID(), function, args...)
}
-// ReceiverCall implements the ExprHelper interface method.
-func (e *exprHelper) ReceiverCall(function string,
- target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr {
- return e.parserHelper.newReceiverCall(e.nextMacroID(), function, target, args...)
+// NewMemberCall implements the ExprHelper interface method.
+func (e *exprHelper) NewMemberCall(function string, target ast.Expr, args ...ast.Expr) ast.Expr {
+ return e.exprFactory.NewMemberCall(e.nextMacroID(), function, target, args...)
}
-// PresenceTest implements the ExprHelper interface method.
-func (e *exprHelper) PresenceTest(operand *exprpb.Expr, field string) *exprpb.Expr {
- return e.parserHelper.newPresenceTest(e.nextMacroID(), operand, field)
+// NewPresenceTest implements the ExprHelper interface method.
+func (e *exprHelper) NewPresenceTest(operand ast.Expr, field string) ast.Expr {
+ return e.exprFactory.NewPresenceTest(e.nextMacroID(), operand, field)
}
-// Select implements the ExprHelper interface method.
-func (e *exprHelper) Select(operand *exprpb.Expr, field string) *exprpb.Expr {
- return e.parserHelper.newSelect(e.nextMacroID(), operand, field)
+// NewSelect implements the ExprHelper interface method.
+func (e *exprHelper) NewSelect(operand ast.Expr, field string) ast.Expr {
+ return e.exprFactory.NewSelect(e.nextMacroID(), operand, field)
}
// OffsetLocation implements the ExprHelper interface method.
func (e *exprHelper) OffsetLocation(exprID int64) common.Location {
- offset, found := e.parserHelper.positions[exprID]
- if !found {
- return common.NoLocation
- }
- location, found := e.parserHelper.source.OffsetLocation(offset)
- if !found {
- return common.NoLocation
- }
- return location
+ return e.parserHelper.sourceInfo.GetStartLocation(exprID)
}
// NewError associates an error message with a given expression id, populating the source offset location of the error if possible.
diff --git a/vendor/github.com/google/cel-go/parser/input.go b/vendor/github.com/google/cel-go/parser/input.go
index 810eaff218..44792455d8 100644
--- a/vendor/github.com/google/cel-go/parser/input.go
+++ b/vendor/github.com/google/cel-go/parser/input.go
@@ -15,7 +15,7 @@
package parser
import (
- antlr "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+ antlr "github.com/antlr4-go/antlr/v4"
"github.com/google/cel-go/common/runes"
)
@@ -110,7 +110,7 @@ func (c *charStream) GetTextFromTokens(start, stop antlr.Token) string {
}
// GetTextFromInterval implements (antlr.CharStream).GetTextFromInterval.
-func (c *charStream) GetTextFromInterval(i *antlr.Interval) string {
+func (c *charStream) GetTextFromInterval(i antlr.Interval) string {
return c.GetText(i.Start, i.Stop)
}
diff --git a/vendor/github.com/google/cel-go/parser/macro.go b/vendor/github.com/google/cel-go/parser/macro.go
index 6066e8ef4f..1f4c847e0d 100644
--- a/vendor/github.com/google/cel-go/parser/macro.go
+++ b/vendor/github.com/google/cel-go/parser/macro.go
@@ -18,9 +18,10 @@ import (
"fmt"
"github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
)
// NewGlobalMacro creates a Macro for a global function with the specified arg count.
@@ -142,58 +143,38 @@ func makeVarArgMacroKey(name string, receiverStyle bool) string {
// and produces as output an Expr ast node.
//
// Note: when the Macro.IsReceiverStyle() method returns true, the target argument will be nil.
-type MacroExpander func(eh ExprHelper,
- target *exprpb.Expr,
- args []*exprpb.Expr) (*exprpb.Expr, *common.Error)
+type MacroExpander func(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error)
-// ExprHelper assists with the manipulation of proto-based Expr values in a manner which is
-// consistent with the source position and expression id generation code leveraged by both
-// the parser and type-checker.
+// ExprHelper assists with the creation of Expr values in a manner which is consistent
+// the internal semantics and id generation behaviors of the parser and checker libraries.
type ExprHelper interface {
// Copy the input expression with a brand new set of identifiers.
- Copy(*exprpb.Expr) *exprpb.Expr
-
- // LiteralBool creates an Expr value for a bool literal.
- LiteralBool(value bool) *exprpb.Expr
-
- // LiteralBytes creates an Expr value for a byte literal.
- LiteralBytes(value []byte) *exprpb.Expr
-
- // LiteralDouble creates an Expr value for double literal.
- LiteralDouble(value float64) *exprpb.Expr
+ Copy(ast.Expr) ast.Expr
- // LiteralInt creates an Expr value for an int literal.
- LiteralInt(value int64) *exprpb.Expr
+ // Literal creates an Expr value for a scalar literal value.
+ NewLiteral(value ref.Val) ast.Expr
- // LiteralString creates am Expr value for a string literal.
- LiteralString(value string) *exprpb.Expr
-
- // LiteralUint creates an Expr value for a uint literal.
- LiteralUint(value uint64) *exprpb.Expr
-
- // NewList creates a CreateList instruction where the list is comprised of the optional set
- // of elements provided as arguments.
- NewList(elems ...*exprpb.Expr) *exprpb.Expr
+ // NewList creates a list literal instruction with an optional set of elements.
+ NewList(elems ...ast.Expr) ast.Expr
// NewMap creates a CreateStruct instruction for a map where the map is comprised of the
// optional set of key, value entries.
- NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr
+ NewMap(entries ...ast.EntryExpr) ast.Expr
// NewMapEntry creates a Map Entry for the key, value pair.
- NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry
+ NewMapEntry(key ast.Expr, val ast.Expr, optional bool) ast.EntryExpr
- // NewObject creates a CreateStruct instruction for an object with a given type name and
- // optional set of field initializers.
- NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr
+ // NewStruct creates a struct literal expression with an optional set of field initializers.
+ NewStruct(typeName string, fieldInits ...ast.EntryExpr) ast.Expr
- // NewObjectFieldInit creates a new Object field initializer from the field name and value.
- NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry
+ // NewStructField creates a new struct field initializer from the field name and value.
+ NewStructField(field string, init ast.Expr, optional bool) ast.EntryExpr
- // Fold creates a fold comprehension instruction.
+ // NewComprehension creates a new comprehension instruction.
//
- // - iterVar is the iteration variable name.
// - iterRange represents the expression that resolves to a list or map where the elements or
// keys (respectively) will be iterated over.
+ // - iterVar is the iteration variable name.
// - accuVar is the accumulation variable name, typically parser.AccumulatorName.
// - accuInit is the initial expression whose value will be set for the accuVar prior to
// folding.
@@ -204,31 +185,31 @@ type ExprHelper interface {
// The accuVar should not shadow variable names that you would like to reference within the
// environment in the step and condition expressions. Presently, the name __result__ is commonly
// used by built-in macros but this may change in the future.
- Fold(iterVar string,
- iterRange *exprpb.Expr,
+ NewComprehension(iterRange ast.Expr,
+ iterVar string,
accuVar string,
- accuInit *exprpb.Expr,
- condition *exprpb.Expr,
- step *exprpb.Expr,
- result *exprpb.Expr) *exprpb.Expr
+ accuInit ast.Expr,
+ condition ast.Expr,
+ step ast.Expr,
+ result ast.Expr) ast.Expr
- // Ident creates an identifier Expr value.
- Ident(name string) *exprpb.Expr
+ // NewIdent creates an identifier Expr value.
+ NewIdent(name string) ast.Expr
- // AccuIdent returns an accumulator identifier for use with comprehension results.
- AccuIdent() *exprpb.Expr
+ // NewAccuIdent returns an accumulator identifier for use with comprehension results.
+ NewAccuIdent() ast.Expr
- // GlobalCall creates a function call Expr value for a global (free) function.
- GlobalCall(function string, args ...*exprpb.Expr) *exprpb.Expr
+ // NewCall creates a function call Expr value for a global (free) function.
+ NewCall(function string, args ...ast.Expr) ast.Expr
- // ReceiverCall creates a function call Expr value for a receiver-style function.
- ReceiverCall(function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr
+ // NewMemberCall creates a function call Expr value for a receiver-style function.
+ NewMemberCall(function string, target ast.Expr, args ...ast.Expr) ast.Expr
- // PresenceTest creates a Select TestOnly Expr value for modelling has() semantics.
- PresenceTest(operand *exprpb.Expr, field string) *exprpb.Expr
+ // NewPresenceTest creates a Select TestOnly Expr value for modelling has() semantics.
+ NewPresenceTest(operand ast.Expr, field string) ast.Expr
- // Select create a field traversal Expr value.
- Select(operand *exprpb.Expr, field string) *exprpb.Expr
+ // NewSelect create a field traversal Expr value.
+ NewSelect(operand ast.Expr, field string) ast.Expr
// OffsetLocation returns the Location of the expression identifier.
OffsetLocation(exprID int64) common.Location
@@ -296,21 +277,21 @@ const (
// MakeAll expands the input call arguments into a comprehension that returns true if all of the
// elements in the range match the predicate expressions:
// .all(, )
-func MakeAll(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func MakeAll(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
return makeQuantifier(quantifierAll, eh, target, args)
}
// MakeExists expands the input call arguments into a comprehension that returns true if any of the
// elements in the range match the predicate expressions:
// .exists(, )
-func MakeExists(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func MakeExists(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
return makeQuantifier(quantifierExists, eh, target, args)
}
// MakeExistsOne expands the input call arguments into a comprehension that returns true if exactly
// one of the elements in the range match the predicate expressions:
// .exists_one(, )
-func MakeExistsOne(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func MakeExistsOne(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
return makeQuantifier(quantifierExistsOne, eh, target, args)
}
@@ -324,14 +305,14 @@ func MakeExistsOne(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*ex
//
// In the second form only iterVar values which return true when provided to the predicate expression
// are transformed.
-func MakeMap(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func MakeMap(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
v, found := extractIdent(args[0])
if !found {
- return nil, eh.NewError(args[0].GetId(), "argument is not an identifier")
+ return nil, eh.NewError(args[0].ID(), "argument is not an identifier")
}
- var fn *exprpb.Expr
- var filter *exprpb.Expr
+ var fn ast.Expr
+ var filter ast.Expr
if len(args) == 3 {
filter = args[1]
@@ -341,84 +322,83 @@ func MakeMap(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.E
fn = args[1]
}
- accuExpr := eh.Ident(AccumulatorName)
init := eh.NewList()
- condition := eh.LiteralBool(true)
- step := eh.GlobalCall(operators.Add, accuExpr, eh.NewList(fn))
+ condition := eh.NewLiteral(types.True)
+ step := eh.NewCall(operators.Add, eh.NewAccuIdent(), eh.NewList(fn))
if filter != nil {
- step = eh.GlobalCall(operators.Conditional, filter, step, accuExpr)
+ step = eh.NewCall(operators.Conditional, filter, step, eh.NewAccuIdent())
}
- return eh.Fold(v, target, AccumulatorName, init, condition, step, accuExpr), nil
+ return eh.NewComprehension(target, v, AccumulatorName, init, condition, step, eh.NewAccuIdent()), nil
}
// MakeFilter expands the input call arguments into a comprehension which produces a list which contains
// only elements which match the provided predicate expression:
// .filter(, )
-func MakeFilter(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func MakeFilter(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
v, found := extractIdent(args[0])
if !found {
- return nil, eh.NewError(args[0].GetId(), "argument is not an identifier")
+ return nil, eh.NewError(args[0].ID(), "argument is not an identifier")
}
filter := args[1]
- accuExpr := eh.Ident(AccumulatorName)
init := eh.NewList()
- condition := eh.LiteralBool(true)
- step := eh.GlobalCall(operators.Add, accuExpr, eh.NewList(args[0]))
- step = eh.GlobalCall(operators.Conditional, filter, step, accuExpr)
- return eh.Fold(v, target, AccumulatorName, init, condition, step, accuExpr), nil
+ condition := eh.NewLiteral(types.True)
+ step := eh.NewCall(operators.Add, eh.NewAccuIdent(), eh.NewList(args[0]))
+ step = eh.NewCall(operators.Conditional, filter, step, eh.NewAccuIdent())
+ return eh.NewComprehension(target, v, AccumulatorName, init, condition, step, eh.NewAccuIdent()), nil
}
// MakeHas expands the input call arguments into a presence test, e.g. has(.field)
-func MakeHas(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
- if s, ok := args[0].ExprKind.(*exprpb.Expr_SelectExpr); ok {
- return eh.PresenceTest(s.SelectExpr.GetOperand(), s.SelectExpr.GetField()), nil
+func MakeHas(eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
+ if args[0].Kind() == ast.SelectKind {
+ s := args[0].AsSelect()
+ return eh.NewPresenceTest(s.Operand(), s.FieldName()), nil
}
- return nil, eh.NewError(args[0].GetId(), "invalid argument to has() macro")
+ return nil, eh.NewError(args[0].ID(), "invalid argument to has() macro")
}
-func makeQuantifier(kind quantifierKind, eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {
+func makeQuantifier(kind quantifierKind, eh ExprHelper, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) {
v, found := extractIdent(args[0])
if !found {
- return nil, eh.NewError(args[0].GetId(), "argument must be a simple name")
+ return nil, eh.NewError(args[0].ID(), "argument must be a simple name")
}
- var init *exprpb.Expr
- var condition *exprpb.Expr
- var step *exprpb.Expr
- var result *exprpb.Expr
+ var init ast.Expr
+ var condition ast.Expr
+ var step ast.Expr
+ var result ast.Expr
switch kind {
case quantifierAll:
- init = eh.LiteralBool(true)
- condition = eh.GlobalCall(operators.NotStrictlyFalse, eh.AccuIdent())
- step = eh.GlobalCall(operators.LogicalAnd, eh.AccuIdent(), args[1])
- result = eh.AccuIdent()
+ init = eh.NewLiteral(types.True)
+ condition = eh.NewCall(operators.NotStrictlyFalse, eh.NewAccuIdent())
+ step = eh.NewCall(operators.LogicalAnd, eh.NewAccuIdent(), args[1])
+ result = eh.NewAccuIdent()
case quantifierExists:
- init = eh.LiteralBool(false)
- condition = eh.GlobalCall(
+ init = eh.NewLiteral(types.False)
+ condition = eh.NewCall(
operators.NotStrictlyFalse,
- eh.GlobalCall(operators.LogicalNot, eh.AccuIdent()))
- step = eh.GlobalCall(operators.LogicalOr, eh.AccuIdent(), args[1])
- result = eh.AccuIdent()
+ eh.NewCall(operators.LogicalNot, eh.NewAccuIdent()))
+ step = eh.NewCall(operators.LogicalOr, eh.NewAccuIdent(), args[1])
+ result = eh.NewAccuIdent()
case quantifierExistsOne:
- zeroExpr := eh.LiteralInt(0)
- oneExpr := eh.LiteralInt(1)
+ zeroExpr := eh.NewLiteral(types.Int(0))
+ oneExpr := eh.NewLiteral(types.Int(1))
init = zeroExpr
- condition = eh.LiteralBool(true)
- step = eh.GlobalCall(operators.Conditional, args[1],
- eh.GlobalCall(operators.Add, eh.AccuIdent(), oneExpr), eh.AccuIdent())
- result = eh.GlobalCall(operators.Equals, eh.AccuIdent(), oneExpr)
+ condition = eh.NewLiteral(types.True)
+ step = eh.NewCall(operators.Conditional, args[1],
+ eh.NewCall(operators.Add, eh.NewAccuIdent(), oneExpr), eh.NewAccuIdent())
+ result = eh.NewCall(operators.Equals, eh.NewAccuIdent(), oneExpr)
default:
- return nil, eh.NewError(args[0].GetId(), fmt.Sprintf("unrecognized quantifier '%v'", kind))
+ return nil, eh.NewError(args[0].ID(), fmt.Sprintf("unrecognized quantifier '%v'", kind))
}
- return eh.Fold(v, target, AccumulatorName, init, condition, step, result), nil
+ return eh.NewComprehension(target, v, AccumulatorName, init, condition, step, result), nil
}
-func extractIdent(e *exprpb.Expr) (string, bool) {
- switch e.ExprKind.(type) {
- case *exprpb.Expr_IdentExpr:
- return e.GetIdentExpr().GetName(), true
+func extractIdent(e ast.Expr) (string, bool) {
+ switch e.Kind() {
+ case ast.IdentKind:
+ return e.AsIdent(), true
}
return "", false
}
diff --git a/vendor/github.com/google/cel-go/parser/parser.go b/vendor/github.com/google/cel-go/parser/parser.go
index 109326a939..cb753df73d 100644
--- a/vendor/github.com/google/cel-go/parser/parser.go
+++ b/vendor/github.com/google/cel-go/parser/parser.go
@@ -21,17 +21,15 @@ import (
"regexp"
"strconv"
"strings"
- "sync"
- antlr "github.com/antlr/antlr4/runtime/Go/antlr/v4"
+ antlr "github.com/antlr4-go/antlr/v4"
"github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/runes"
+ "github.com/google/cel-go/common/types"
"github.com/google/cel-go/parser/gen"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
- structpb "google.golang.org/protobuf/types/known/structpb"
)
// Parser encapsulates the context necessary to perform parsing for different expressions.
@@ -88,11 +86,13 @@ func mustNewParser(opts ...Option) *Parser {
}
// Parse parses the expression represented by source and returns the result.
-func (p *Parser) Parse(source common.Source) (*exprpb.ParsedExpr, *common.Errors) {
+func (p *Parser) Parse(source common.Source) (*ast.AST, *common.Errors) {
errs := common.NewErrors(source)
+ fac := ast.NewExprFactory()
impl := parser{
errors: &parseErrors{errs},
- helper: newParserHelper(source),
+ exprFactory: fac,
+ helper: newParserHelper(source, fac),
macros: p.macros,
maxRecursionDepth: p.maxRecursionDepth,
errorReportingLimit: p.errorReportingLimit,
@@ -106,18 +106,15 @@ func (p *Parser) Parse(source common.Source) (*exprpb.ParsedExpr, *common.Errors
if !ok {
buf = runes.NewBuffer(source.Content())
}
- var e *exprpb.Expr
+ var out ast.Expr
if buf.Len() > p.expressionSizeCodePointLimit {
- e = impl.reportError(common.NoLocation,
+ out = impl.reportError(common.NoLocation,
"expression code point size exceeds limit: size: %d, limit %d",
buf.Len(), p.expressionSizeCodePointLimit)
} else {
- e = impl.parse(buf, source.Description())
+ out = impl.parse(buf, source.Description())
}
- return &exprpb.ParsedExpr{
- Expr: e,
- SourceInfo: impl.helper.getSourceInfo(),
- }, errs
+ return ast.NewAST(out, impl.helper.getSourceInfo()), errs
}
// reservedIds are not legal to use as variables. We exclude them post-parse, as they *are* valid
@@ -150,7 +147,7 @@ var reservedIds = map[string]struct{}{
// This function calls ParseWithMacros with AllMacros.
//
// Deprecated: Use NewParser().Parse() instead.
-func Parse(source common.Source) (*exprpb.ParsedExpr, *common.Errors) {
+func Parse(source common.Source) (*ast.AST, *common.Errors) {
return mustNewParser(Macros(AllMacros...)).Parse(source)
}
@@ -287,6 +284,7 @@ var _ antlr.ErrorStrategy = &recoveryLimitErrorStrategy{}
type parser struct {
gen.BaseCELVisitor
errors *parseErrors
+ exprFactory ast.ExprFactory
helper *parserHelper
macros map[string]Macro
recursionDepth int
@@ -300,53 +298,21 @@ type parser struct {
enableVariadicOperatorASTs bool
}
-var (
- _ gen.CELVisitor = (*parser)(nil)
-
- lexerPool *sync.Pool = &sync.Pool{
- New: func() any {
- l := gen.NewCELLexer(nil)
- l.RemoveErrorListeners()
- return l
- },
- }
+var _ gen.CELVisitor = (*parser)(nil)
- parserPool *sync.Pool = &sync.Pool{
- New: func() any {
- p := gen.NewCELParser(nil)
- p.RemoveErrorListeners()
- return p
- },
- }
-)
+func (p *parser) parse(expr runes.Buffer, desc string) ast.Expr {
+ lexer := gen.NewCELLexer(newCharStream(expr, desc))
+ lexer.RemoveErrorListeners()
+ lexer.AddErrorListener(p)
-func (p *parser) parse(expr runes.Buffer, desc string) *exprpb.Expr {
- // TODO: get rid of these pools once https://github.com/antlr/antlr4/pull/3571 is in a release
- lexer := lexerPool.Get().(*gen.CELLexer)
- prsr := parserPool.Get().(*gen.CELParser)
+ prsr := gen.NewCELParser(antlr.NewCommonTokenStream(lexer, 0))
+ prsr.RemoveErrorListeners()
prsrListener := &recursionListener{
maxDepth: p.maxRecursionDepth,
ruleTypeDepth: map[int]*int{},
}
- defer func() {
- // Unfortunately ANTLR Go runtime is missing (*antlr.BaseParser).RemoveParseListeners,
- // so this is good enough until that is exported.
- // Reset the lexer and parser before putting them back in the pool.
- lexer.RemoveErrorListeners()
- prsr.RemoveParseListener(prsrListener)
- prsr.RemoveErrorListeners()
- lexer.SetInputStream(nil)
- prsr.SetInputStream(nil)
- lexerPool.Put(lexer)
- parserPool.Put(prsr)
- }()
-
- lexer.SetInputStream(newCharStream(expr, desc))
- prsr.SetInputStream(antlr.NewCommonTokenStream(lexer, 0))
-
- lexer.AddErrorListener(p)
prsr.AddErrorListener(p)
prsr.AddParseListener(prsrListener)
@@ -373,7 +339,7 @@ func (p *parser) parse(expr runes.Buffer, desc string) *exprpb.Expr {
}
}()
- return p.Visit(prsr.Start()).(*exprpb.Expr)
+ return p.Visit(prsr.Start_()).(ast.Expr)
}
// Visitor implementations.
@@ -470,26 +436,26 @@ func (p *parser) VisitStart(ctx *gen.StartContext) any {
// Visit a parse tree produced by CELParser#expr.
func (p *parser) VisitExpr(ctx *gen.ExprContext) any {
- result := p.Visit(ctx.GetE()).(*exprpb.Expr)
+ result := p.Visit(ctx.GetE()).(ast.Expr)
if ctx.GetOp() == nil {
return result
}
opID := p.helper.id(ctx.GetOp())
- ifTrue := p.Visit(ctx.GetE1()).(*exprpb.Expr)
- ifFalse := p.Visit(ctx.GetE2()).(*exprpb.Expr)
+ ifTrue := p.Visit(ctx.GetE1()).(ast.Expr)
+ ifFalse := p.Visit(ctx.GetE2()).(ast.Expr)
return p.globalCallOrMacro(opID, operators.Conditional, result, ifTrue, ifFalse)
}
// Visit a parse tree produced by CELParser#conditionalOr.
func (p *parser) VisitConditionalOr(ctx *gen.ConditionalOrContext) any {
- result := p.Visit(ctx.GetE()).(*exprpb.Expr)
+ result := p.Visit(ctx.GetE()).(ast.Expr)
l := p.newLogicManager(operators.LogicalOr, result)
rest := ctx.GetE1()
for i, op := range ctx.GetOps() {
if i >= len(rest) {
return p.reportError(ctx, "unexpected character, wanted '||'")
}
- next := p.Visit(rest[i]).(*exprpb.Expr)
+ next := p.Visit(rest[i]).(ast.Expr)
opID := p.helper.id(op)
l.addTerm(opID, next)
}
@@ -498,14 +464,14 @@ func (p *parser) VisitConditionalOr(ctx *gen.ConditionalOrContext) any {
// Visit a parse tree produced by CELParser#conditionalAnd.
func (p *parser) VisitConditionalAnd(ctx *gen.ConditionalAndContext) any {
- result := p.Visit(ctx.GetE()).(*exprpb.Expr)
+ result := p.Visit(ctx.GetE()).(ast.Expr)
l := p.newLogicManager(operators.LogicalAnd, result)
rest := ctx.GetE1()
for i, op := range ctx.GetOps() {
if i >= len(rest) {
return p.reportError(ctx, "unexpected character, wanted '&&'")
}
- next := p.Visit(rest[i]).(*exprpb.Expr)
+ next := p.Visit(rest[i]).(ast.Expr)
opID := p.helper.id(op)
l.addTerm(opID, next)
}
@@ -519,9 +485,9 @@ func (p *parser) VisitRelation(ctx *gen.RelationContext) any {
opText = ctx.GetOp().GetText()
}
if op, found := operators.Find(opText); found {
- lhs := p.Visit(ctx.Relation(0)).(*exprpb.Expr)
+ lhs := p.Visit(ctx.Relation(0)).(ast.Expr)
opID := p.helper.id(ctx.GetOp())
- rhs := p.Visit(ctx.Relation(1)).(*exprpb.Expr)
+ rhs := p.Visit(ctx.Relation(1)).(ast.Expr)
return p.globalCallOrMacro(opID, op, lhs, rhs)
}
return p.reportError(ctx, "operator not found")
@@ -534,9 +500,9 @@ func (p *parser) VisitCalc(ctx *gen.CalcContext) any {
opText = ctx.GetOp().GetText()
}
if op, found := operators.Find(opText); found {
- lhs := p.Visit(ctx.Calc(0)).(*exprpb.Expr)
+ lhs := p.Visit(ctx.Calc(0)).(ast.Expr)
opID := p.helper.id(ctx.GetOp())
- rhs := p.Visit(ctx.Calc(1)).(*exprpb.Expr)
+ rhs := p.Visit(ctx.Calc(1)).(ast.Expr)
return p.globalCallOrMacro(opID, op, lhs, rhs)
}
return p.reportError(ctx, "operator not found")
@@ -552,7 +518,7 @@ func (p *parser) VisitLogicalNot(ctx *gen.LogicalNotContext) any {
return p.Visit(ctx.Member())
}
opID := p.helper.id(ctx.GetOps()[0])
- target := p.Visit(ctx.Member()).(*exprpb.Expr)
+ target := p.Visit(ctx.Member()).(ast.Expr)
return p.globalCallOrMacro(opID, operators.LogicalNot, target)
}
@@ -561,13 +527,13 @@ func (p *parser) VisitNegate(ctx *gen.NegateContext) any {
return p.Visit(ctx.Member())
}
opID := p.helper.id(ctx.GetOps()[0])
- target := p.Visit(ctx.Member()).(*exprpb.Expr)
+ target := p.Visit(ctx.Member()).(ast.Expr)
return p.globalCallOrMacro(opID, operators.Negate, target)
}
// VisitSelect visits a parse tree produced by CELParser#Select.
func (p *parser) VisitSelect(ctx *gen.SelectContext) any {
- operand := p.Visit(ctx.Member()).(*exprpb.Expr)
+ operand := p.Visit(ctx.Member()).(ast.Expr)
// Handle the error case where no valid identifier is specified.
if ctx.GetId() == nil || ctx.GetOp() == nil {
return p.helper.newExpr(ctx)
@@ -588,7 +554,7 @@ func (p *parser) VisitSelect(ctx *gen.SelectContext) any {
// VisitMemberCall visits a parse tree produced by CELParser#MemberCall.
func (p *parser) VisitMemberCall(ctx *gen.MemberCallContext) any {
- operand := p.Visit(ctx.Member()).(*exprpb.Expr)
+ operand := p.Visit(ctx.Member()).(ast.Expr)
// Handle the error case where no valid identifier is specified.
if ctx.GetId() == nil {
return p.helper.newExpr(ctx)
@@ -600,13 +566,13 @@ func (p *parser) VisitMemberCall(ctx *gen.MemberCallContext) any {
// Visit a parse tree produced by CELParser#Index.
func (p *parser) VisitIndex(ctx *gen.IndexContext) any {
- target := p.Visit(ctx.Member()).(*exprpb.Expr)
+ target := p.Visit(ctx.Member()).(ast.Expr)
// Handle the error case where no valid identifier is specified.
if ctx.GetOp() == nil {
return p.helper.newExpr(ctx)
}
opID := p.helper.id(ctx.GetOp())
- index := p.Visit(ctx.GetIndex()).(*exprpb.Expr)
+ index := p.Visit(ctx.GetIndex()).(ast.Expr)
operator := operators.Index
if ctx.GetOpt() != nil {
if !p.enableOptionalSyntax {
@@ -630,7 +596,7 @@ func (p *parser) VisitCreateMessage(ctx *gen.CreateMessageContext) any {
messageName = "." + messageName
}
objID := p.helper.id(ctx.GetOp())
- entries := p.VisitIFieldInitializerList(ctx.GetEntries()).([]*exprpb.Expr_CreateStruct_Entry)
+ entries := p.VisitIFieldInitializerList(ctx.GetEntries()).([]ast.EntryExpr)
return p.helper.newObject(objID, messageName, entries...)
}
@@ -638,16 +604,16 @@ func (p *parser) VisitCreateMessage(ctx *gen.CreateMessageContext) any {
func (p *parser) VisitIFieldInitializerList(ctx gen.IFieldInitializerListContext) any {
if ctx == nil || ctx.GetFields() == nil {
// This is the result of a syntax error handled elswhere, return empty.
- return []*exprpb.Expr_CreateStruct_Entry{}
+ return []ast.EntryExpr{}
}
- result := make([]*exprpb.Expr_CreateStruct_Entry, len(ctx.GetFields()))
+ result := make([]ast.EntryExpr, len(ctx.GetFields()))
cols := ctx.GetCols()
vals := ctx.GetValues()
for i, f := range ctx.GetFields() {
if i >= len(cols) || i >= len(vals) {
// This is the result of a syntax error detected elsewhere.
- return []*exprpb.Expr_CreateStruct_Entry{}
+ return []ast.EntryExpr{}
}
initID := p.helper.id(cols[i])
optField := f.(*gen.OptFieldContext)
@@ -659,10 +625,10 @@ func (p *parser) VisitIFieldInitializerList(ctx gen.IFieldInitializerListContext
// The field may be empty due to a prior error.
id := optField.IDENTIFIER()
if id == nil {
- return []*exprpb.Expr_CreateStruct_Entry{}
+ return []ast.EntryExpr{}
}
fieldName := id.GetText()
- value := p.Visit(vals[i]).(*exprpb.Expr)
+ value := p.Visit(vals[i]).(ast.Expr)
field := p.helper.newObjectField(initID, fieldName, value, optional)
result[i] = field
}
@@ -702,9 +668,9 @@ func (p *parser) VisitCreateList(ctx *gen.CreateListContext) any {
// Visit a parse tree produced by CELParser#CreateStruct.
func (p *parser) VisitCreateStruct(ctx *gen.CreateStructContext) any {
structID := p.helper.id(ctx.GetOp())
- entries := []*exprpb.Expr_CreateStruct_Entry{}
+ entries := []ast.EntryExpr{}
if ctx.GetEntries() != nil {
- entries = p.Visit(ctx.GetEntries()).([]*exprpb.Expr_CreateStruct_Entry)
+ entries = p.Visit(ctx.GetEntries()).([]ast.EntryExpr)
}
return p.helper.newMap(structID, entries...)
}
@@ -713,17 +679,17 @@ func (p *parser) VisitCreateStruct(ctx *gen.CreateStructContext) any {
func (p *parser) VisitMapInitializerList(ctx *gen.MapInitializerListContext) any {
if ctx == nil || ctx.GetKeys() == nil {
// This is the result of a syntax error handled elswhere, return empty.
- return []*exprpb.Expr_CreateStruct_Entry{}
+ return []ast.EntryExpr{}
}
- result := make([]*exprpb.Expr_CreateStruct_Entry, len(ctx.GetCols()))
+ result := make([]ast.EntryExpr, len(ctx.GetCols()))
keys := ctx.GetKeys()
vals := ctx.GetValues()
for i, col := range ctx.GetCols() {
colID := p.helper.id(col)
if i >= len(keys) || i >= len(vals) {
// This is the result of a syntax error detected elsewhere.
- return []*exprpb.Expr_CreateStruct_Entry{}
+ return []ast.EntryExpr{}
}
optKey := keys[i]
optional := optKey.GetOpt() != nil
@@ -731,8 +697,8 @@ func (p *parser) VisitMapInitializerList(ctx *gen.MapInitializerListContext) any
p.reportError(optKey, "unsupported syntax '?'")
continue
}
- key := p.Visit(optKey.GetE()).(*exprpb.Expr)
- value := p.Visit(vals[i]).(*exprpb.Expr)
+ key := p.Visit(optKey.GetE()).(ast.Expr)
+ value := p.Visit(vals[i]).(ast.Expr)
entry := p.helper.newMapEntry(colID, key, value, optional)
result[i] = entry
}
@@ -812,30 +778,27 @@ func (p *parser) VisitBoolFalse(ctx *gen.BoolFalseContext) any {
// Visit a parse tree produced by CELParser#Null.
func (p *parser) VisitNull(ctx *gen.NullContext) any {
- return p.helper.newLiteral(ctx,
- &exprpb.Constant{
- ConstantKind: &exprpb.Constant_NullValue{
- NullValue: structpb.NullValue_NULL_VALUE}})
+ return p.helper.exprFactory.NewLiteral(p.helper.newID(ctx), types.NullValue)
}
-func (p *parser) visitExprList(ctx gen.IExprListContext) []*exprpb.Expr {
+func (p *parser) visitExprList(ctx gen.IExprListContext) []ast.Expr {
if ctx == nil {
- return []*exprpb.Expr{}
+ return []ast.Expr{}
}
return p.visitSlice(ctx.GetE())
}
-func (p *parser) visitListInit(ctx gen.IListInitContext) ([]*exprpb.Expr, []int32) {
+func (p *parser) visitListInit(ctx gen.IListInitContext) ([]ast.Expr, []int32) {
if ctx == nil {
- return []*exprpb.Expr{}, []int32{}
+ return []ast.Expr{}, []int32{}
}
elements := ctx.GetElems()
- result := make([]*exprpb.Expr, len(elements))
+ result := make([]ast.Expr, len(elements))
optionals := []int32{}
for i, e := range elements {
- ex := p.Visit(e.GetE()).(*exprpb.Expr)
+ ex := p.Visit(e.GetE()).(ast.Expr)
if ex == nil {
- return []*exprpb.Expr{}, []int32{}
+ return []ast.Expr{}, []int32{}
}
result[i] = ex
if e.GetOpt() != nil {
@@ -849,13 +812,13 @@ func (p *parser) visitListInit(ctx gen.IListInitContext) ([]*exprpb.Expr, []int3
return result, optionals
}
-func (p *parser) visitSlice(expressions []gen.IExprContext) []*exprpb.Expr {
+func (p *parser) visitSlice(expressions []gen.IExprContext) []ast.Expr {
if expressions == nil {
- return []*exprpb.Expr{}
+ return []ast.Expr{}
}
- result := make([]*exprpb.Expr, len(expressions))
+ result := make([]ast.Expr, len(expressions))
for i, e := range expressions {
- ex := p.Visit(e).(*exprpb.Expr)
+ ex := p.Visit(e).(ast.Expr)
result[i] = ex
}
return result
@@ -870,24 +833,24 @@ func (p *parser) unquote(ctx any, value string, isBytes bool) string {
return text
}
-func (p *parser) newLogicManager(function string, term *exprpb.Expr) *logicManager {
+func (p *parser) newLogicManager(function string, term ast.Expr) *logicManager {
if p.enableVariadicOperatorASTs {
- return newVariadicLogicManager(p.helper, function, term)
+ return newVariadicLogicManager(p.exprFactory, function, term)
}
- return newBalancingLogicManager(p.helper, function, term)
+ return newBalancingLogicManager(p.exprFactory, function, term)
}
-func (p *parser) reportError(ctx any, format string, args ...any) *exprpb.Expr {
+func (p *parser) reportError(ctx any, format string, args ...any) ast.Expr {
var location common.Location
err := p.helper.newExpr(ctx)
switch c := ctx.(type) {
case common.Location:
location = c
case antlr.Token, antlr.ParserRuleContext:
- location = p.helper.getLocation(err.GetId())
+ location = p.helper.getLocation(err.ID())
}
// Provide arguments to the report error.
- p.errors.reportErrorAtID(err.GetId(), location, format, args...)
+ p.errors.reportErrorAtID(err.ID(), location, format, args...)
return err
}
@@ -912,33 +875,33 @@ func (p *parser) SyntaxError(recognizer antlr.Recognizer, offendingSymbol any, l
}
}
-func (p *parser) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs antlr.ATNConfigSet) {
+func (p *parser) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs *antlr.ATNConfigSet) {
// Intentional
}
-func (p *parser) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs antlr.ATNConfigSet) {
+func (p *parser) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs *antlr.ATNConfigSet) {
// Intentional
}
-func (p *parser) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs antlr.ATNConfigSet) {
+func (p *parser) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs *antlr.ATNConfigSet) {
// Intentional
}
-func (p *parser) globalCallOrMacro(exprID int64, function string, args ...*exprpb.Expr) *exprpb.Expr {
+func (p *parser) globalCallOrMacro(exprID int64, function string, args ...ast.Expr) ast.Expr {
if expr, found := p.expandMacro(exprID, function, nil, args...); found {
return expr
}
return p.helper.newGlobalCall(exprID, function, args...)
}
-func (p *parser) receiverCallOrMacro(exprID int64, function string, target *exprpb.Expr, args ...*exprpb.Expr) *exprpb.Expr {
+func (p *parser) receiverCallOrMacro(exprID int64, function string, target ast.Expr, args ...ast.Expr) ast.Expr {
if expr, found := p.expandMacro(exprID, function, target, args...); found {
return expr
}
return p.helper.newReceiverCall(exprID, function, target, args...)
}
-func (p *parser) expandMacro(exprID int64, function string, target *exprpb.Expr, args ...*exprpb.Expr) (*exprpb.Expr, bool) {
+func (p *parser) expandMacro(exprID int64, function string, target ast.Expr, args ...ast.Expr) (ast.Expr, bool) {
macro, found := p.macros[makeMacroKey(function, len(args), target != nil)]
if !found {
macro, found = p.macros[makeVarArgMacroKey(function, target != nil)]
@@ -964,7 +927,7 @@ func (p *parser) expandMacro(exprID int64, function string, target *exprpb.Expr,
return nil, false
}
if p.populateMacroCalls {
- p.helper.addMacroCall(expr.GetId(), function, target, args...)
+ p.helper.addMacroCall(expr.ID(), function, target, args...)
}
return expr, true
}
diff --git a/vendor/github.com/google/cel-go/parser/unparser.go b/vendor/github.com/google/cel-go/parser/unparser.go
index c3c40a0dd3..91cf729447 100644
--- a/vendor/github.com/google/cel-go/parser/unparser.go
+++ b/vendor/github.com/google/cel-go/parser/unparser.go
@@ -20,9 +20,9 @@ import (
"strconv"
"strings"
+ "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/operators"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/types"
)
// Unparse takes an input expression and source position information and generates a human-readable
@@ -39,7 +39,7 @@ import (
//
// This function optionally takes in one or more UnparserOption to alter the unparsing behavior, such as
// performing word wrapping on expressions.
-func Unparse(expr *exprpb.Expr, info *exprpb.SourceInfo, opts ...UnparserOption) (string, error) {
+func Unparse(expr ast.Expr, info *ast.SourceInfo, opts ...UnparserOption) (string, error) {
unparserOpts := &unparserOption{
wrapOnColumn: defaultWrapOnColumn,
wrapAfterColumnLimit: defaultWrapAfterColumnLimit,
@@ -68,12 +68,12 @@ func Unparse(expr *exprpb.Expr, info *exprpb.SourceInfo, opts ...UnparserOption)
// unparser visits an expression to reconstruct a human-readable string from an AST.
type unparser struct {
str strings.Builder
- info *exprpb.SourceInfo
+ info *ast.SourceInfo
options *unparserOption
lastWrappedIndex int
}
-func (un *unparser) visit(expr *exprpb.Expr) error {
+func (un *unparser) visit(expr ast.Expr) error {
if expr == nil {
return errors.New("unsupported expression")
}
@@ -81,27 +81,29 @@ func (un *unparser) visit(expr *exprpb.Expr) error {
if visited || err != nil {
return err
}
- switch expr.GetExprKind().(type) {
- case *exprpb.Expr_CallExpr:
+ switch expr.Kind() {
+ case ast.CallKind:
return un.visitCall(expr)
- case *exprpb.Expr_ConstExpr:
+ case ast.LiteralKind:
return un.visitConst(expr)
- case *exprpb.Expr_IdentExpr:
+ case ast.IdentKind:
return un.visitIdent(expr)
- case *exprpb.Expr_ListExpr:
+ case ast.ListKind:
return un.visitList(expr)
- case *exprpb.Expr_SelectExpr:
+ case ast.MapKind:
+ return un.visitStructMap(expr)
+ case ast.SelectKind:
return un.visitSelect(expr)
- case *exprpb.Expr_StructExpr:
- return un.visitStruct(expr)
+ case ast.StructKind:
+ return un.visitStructMsg(expr)
default:
return fmt.Errorf("unsupported expression: %v", expr)
}
}
-func (un *unparser) visitCall(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- fun := c.GetFunction()
+func (un *unparser) visitCall(expr ast.Expr) error {
+ c := expr.AsCall()
+ fun := c.FunctionName()
switch fun {
// ternary operator
case operators.Conditional:
@@ -141,10 +143,10 @@ func (un *unparser) visitCall(expr *exprpb.Expr) error {
}
}
-func (un *unparser) visitCallBinary(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- fun := c.GetFunction()
- args := c.GetArgs()
+func (un *unparser) visitCallBinary(expr ast.Expr) error {
+ c := expr.AsCall()
+ fun := c.FunctionName()
+ args := c.Args()
lhs := args[0]
// add parens if the current operator is lower precedence than the lhs expr operator.
lhsParen := isComplexOperatorWithRespectTo(fun, lhs)
@@ -168,9 +170,9 @@ func (un *unparser) visitCallBinary(expr *exprpb.Expr) error {
return un.visitMaybeNested(rhs, rhsParen)
}
-func (un *unparser) visitCallConditional(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- args := c.GetArgs()
+func (un *unparser) visitCallConditional(expr ast.Expr) error {
+ c := expr.AsCall()
+ args := c.Args()
// add parens if operand is a conditional itself.
nested := isSamePrecedence(operators.Conditional, args[0]) ||
isComplexOperator(args[0])
@@ -196,13 +198,13 @@ func (un *unparser) visitCallConditional(expr *exprpb.Expr) error {
return un.visitMaybeNested(args[2], nested)
}
-func (un *unparser) visitCallFunc(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- fun := c.GetFunction()
- args := c.GetArgs()
- if c.GetTarget() != nil {
- nested := isBinaryOrTernaryOperator(c.GetTarget())
- err := un.visitMaybeNested(c.GetTarget(), nested)
+func (un *unparser) visitCallFunc(expr ast.Expr) error {
+ c := expr.AsCall()
+ fun := c.FunctionName()
+ args := c.Args()
+ if c.IsMemberFunction() {
+ nested := isBinaryOrTernaryOperator(c.Target())
+ err := un.visitMaybeNested(c.Target(), nested)
if err != nil {
return err
}
@@ -223,17 +225,17 @@ func (un *unparser) visitCallFunc(expr *exprpb.Expr) error {
return nil
}
-func (un *unparser) visitCallIndex(expr *exprpb.Expr) error {
+func (un *unparser) visitCallIndex(expr ast.Expr) error {
return un.visitCallIndexInternal(expr, "[")
}
-func (un *unparser) visitCallOptIndex(expr *exprpb.Expr) error {
+func (un *unparser) visitCallOptIndex(expr ast.Expr) error {
return un.visitCallIndexInternal(expr, "[?")
}
-func (un *unparser) visitCallIndexInternal(expr *exprpb.Expr, op string) error {
- c := expr.GetCallExpr()
- args := c.GetArgs()
+func (un *unparser) visitCallIndexInternal(expr ast.Expr, op string) error {
+ c := expr.AsCall()
+ args := c.Args()
nested := isBinaryOrTernaryOperator(args[0])
err := un.visitMaybeNested(args[0], nested)
if err != nil {
@@ -248,10 +250,10 @@ func (un *unparser) visitCallIndexInternal(expr *exprpb.Expr, op string) error {
return nil
}
-func (un *unparser) visitCallUnary(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- fun := c.GetFunction()
- args := c.GetArgs()
+func (un *unparser) visitCallUnary(expr ast.Expr) error {
+ c := expr.AsCall()
+ fun := c.FunctionName()
+ args := c.Args()
unmangled, found := operators.FindReverse(fun)
if !found {
return fmt.Errorf("cannot unmangle operator: %s", fun)
@@ -261,35 +263,34 @@ func (un *unparser) visitCallUnary(expr *exprpb.Expr) error {
return un.visitMaybeNested(args[0], nested)
}
-func (un *unparser) visitConst(expr *exprpb.Expr) error {
- c := expr.GetConstExpr()
- switch c.GetConstantKind().(type) {
- case *exprpb.Constant_BoolValue:
- un.str.WriteString(strconv.FormatBool(c.GetBoolValue()))
- case *exprpb.Constant_BytesValue:
+func (un *unparser) visitConst(expr ast.Expr) error {
+ val := expr.AsLiteral()
+ switch val := val.(type) {
+ case types.Bool:
+ un.str.WriteString(strconv.FormatBool(bool(val)))
+ case types.Bytes:
// bytes constants are surrounded with b""
- b := c.GetBytesValue()
un.str.WriteString(`b"`)
- un.str.WriteString(bytesToOctets(b))
+ un.str.WriteString(bytesToOctets([]byte(val)))
un.str.WriteString(`"`)
- case *exprpb.Constant_DoubleValue:
+ case types.Double:
// represent the float using the minimum required digits
- d := strconv.FormatFloat(c.GetDoubleValue(), 'g', -1, 64)
+ d := strconv.FormatFloat(float64(val), 'g', -1, 64)
un.str.WriteString(d)
if !strings.Contains(d, ".") {
un.str.WriteString(".0")
}
- case *exprpb.Constant_Int64Value:
- i := strconv.FormatInt(c.GetInt64Value(), 10)
+ case types.Int:
+ i := strconv.FormatInt(int64(val), 10)
un.str.WriteString(i)
- case *exprpb.Constant_NullValue:
+ case types.Null:
un.str.WriteString("null")
- case *exprpb.Constant_StringValue:
+ case types.String:
// strings will be double quoted with quotes escaped.
- un.str.WriteString(strconv.Quote(c.GetStringValue()))
- case *exprpb.Constant_Uint64Value:
+ un.str.WriteString(strconv.Quote(string(val)))
+ case types.Uint:
// uint literals have a 'u' suffix.
- ui := strconv.FormatUint(c.GetUint64Value(), 10)
+ ui := strconv.FormatUint(uint64(val), 10)
un.str.WriteString(ui)
un.str.WriteString("u")
default:
@@ -298,16 +299,16 @@ func (un *unparser) visitConst(expr *exprpb.Expr) error {
return nil
}
-func (un *unparser) visitIdent(expr *exprpb.Expr) error {
- un.str.WriteString(expr.GetIdentExpr().GetName())
+func (un *unparser) visitIdent(expr ast.Expr) error {
+ un.str.WriteString(expr.AsIdent())
return nil
}
-func (un *unparser) visitList(expr *exprpb.Expr) error {
- l := expr.GetListExpr()
- elems := l.GetElements()
+func (un *unparser) visitList(expr ast.Expr) error {
+ l := expr.AsList()
+ elems := l.Elements()
optIndices := make(map[int]bool, len(elems))
- for _, idx := range l.GetOptionalIndices() {
+ for _, idx := range l.OptionalIndices() {
optIndices[int(idx)] = true
}
un.str.WriteString("[")
@@ -327,20 +328,20 @@ func (un *unparser) visitList(expr *exprpb.Expr) error {
return nil
}
-func (un *unparser) visitOptSelect(expr *exprpb.Expr) error {
- c := expr.GetCallExpr()
- args := c.GetArgs()
+func (un *unparser) visitOptSelect(expr ast.Expr) error {
+ c := expr.AsCall()
+ args := c.Args()
operand := args[0]
- field := args[1].GetConstExpr().GetStringValue()
- return un.visitSelectInternal(operand, false, ".?", field)
+ field := args[1].AsLiteral().(types.String)
+ return un.visitSelectInternal(operand, false, ".?", string(field))
}
-func (un *unparser) visitSelect(expr *exprpb.Expr) error {
- sel := expr.GetSelectExpr()
- return un.visitSelectInternal(sel.GetOperand(), sel.GetTestOnly(), ".", sel.GetField())
+func (un *unparser) visitSelect(expr ast.Expr) error {
+ sel := expr.AsSelect()
+ return un.visitSelectInternal(sel.Operand(), sel.IsTestOnly(), ".", sel.FieldName())
}
-func (un *unparser) visitSelectInternal(operand *exprpb.Expr, testOnly bool, op string, field string) error {
+func (un *unparser) visitSelectInternal(operand ast.Expr, testOnly bool, op string, field string) error {
// handle the case when the select expression was generated by the has() macro.
if testOnly {
un.str.WriteString("has(")
@@ -358,34 +359,25 @@ func (un *unparser) visitSelectInternal(operand *exprpb.Expr, testOnly bool, op
return nil
}
-func (un *unparser) visitStruct(expr *exprpb.Expr) error {
- s := expr.GetStructExpr()
- // If the message name is non-empty, then this should be treated as message construction.
- if s.GetMessageName() != "" {
- return un.visitStructMsg(expr)
- }
- // Otherwise, build a map.
- return un.visitStructMap(expr)
-}
-
-func (un *unparser) visitStructMsg(expr *exprpb.Expr) error {
- m := expr.GetStructExpr()
- entries := m.GetEntries()
- un.str.WriteString(m.GetMessageName())
+func (un *unparser) visitStructMsg(expr ast.Expr) error {
+ m := expr.AsStruct()
+ fields := m.Fields()
+ un.str.WriteString(m.TypeName())
un.str.WriteString("{")
- for i, entry := range entries {
- f := entry.GetFieldKey()
- if entry.GetOptionalEntry() {
+ for i, f := range fields {
+ field := f.AsStructField()
+ f := field.Name()
+ if field.IsOptional() {
un.str.WriteString("?")
}
un.str.WriteString(f)
un.str.WriteString(": ")
- v := entry.GetValue()
+ v := field.Value()
err := un.visit(v)
if err != nil {
return err
}
- if i < len(entries)-1 {
+ if i < len(fields)-1 {
un.str.WriteString(", ")
}
}
@@ -393,13 +385,14 @@ func (un *unparser) visitStructMsg(expr *exprpb.Expr) error {
return nil
}
-func (un *unparser) visitStructMap(expr *exprpb.Expr) error {
- m := expr.GetStructExpr()
- entries := m.GetEntries()
+func (un *unparser) visitStructMap(expr ast.Expr) error {
+ m := expr.AsMap()
+ entries := m.Entries()
un.str.WriteString("{")
- for i, entry := range entries {
- k := entry.GetMapKey()
- if entry.GetOptionalEntry() {
+ for i, e := range entries {
+ entry := e.AsMapEntry()
+ k := entry.Key()
+ if entry.IsOptional() {
un.str.WriteString("?")
}
err := un.visit(k)
@@ -407,7 +400,7 @@ func (un *unparser) visitStructMap(expr *exprpb.Expr) error {
return err
}
un.str.WriteString(": ")
- v := entry.GetValue()
+ v := entry.Value()
err = un.visit(v)
if err != nil {
return err
@@ -420,16 +413,15 @@ func (un *unparser) visitStructMap(expr *exprpb.Expr) error {
return nil
}
-func (un *unparser) visitMaybeMacroCall(expr *exprpb.Expr) (bool, error) {
- macroCalls := un.info.GetMacroCalls()
- call, found := macroCalls[expr.GetId()]
+func (un *unparser) visitMaybeMacroCall(expr ast.Expr) (bool, error) {
+ call, found := un.info.GetMacroCall(expr.ID())
if !found {
return false, nil
}
return true, un.visit(call)
}
-func (un *unparser) visitMaybeNested(expr *exprpb.Expr, nested bool) error {
+func (un *unparser) visitMaybeNested(expr ast.Expr, nested bool) error {
if nested {
un.str.WriteString("(")
}
@@ -453,12 +445,12 @@ func isLeftRecursive(op string) bool {
// precedence of the (possible) operation represented in the input Expr.
//
// If the expr is not a Call, the result is false.
-func isSamePrecedence(op string, expr *exprpb.Expr) bool {
- if expr.GetCallExpr() == nil {
+func isSamePrecedence(op string, expr ast.Expr) bool {
+ if expr.Kind() != ast.CallKind {
return false
}
- c := expr.GetCallExpr()
- other := c.GetFunction()
+ c := expr.AsCall()
+ other := c.FunctionName()
return operators.Precedence(op) == operators.Precedence(other)
}
@@ -466,16 +458,16 @@ func isSamePrecedence(op string, expr *exprpb.Expr) bool {
// than the (possible) operation represented in the input Expr.
//
// If the expr is not a Call, the result is false.
-func isLowerPrecedence(op string, expr *exprpb.Expr) bool {
- c := expr.GetCallExpr()
- other := c.GetFunction()
+func isLowerPrecedence(op string, expr ast.Expr) bool {
+ c := expr.AsCall()
+ other := c.FunctionName()
return operators.Precedence(op) < operators.Precedence(other)
}
// Indicates whether the expr is a complex operator, i.e., a call expression
// with 2 or more arguments.
-func isComplexOperator(expr *exprpb.Expr) bool {
- if expr.GetCallExpr() != nil && len(expr.GetCallExpr().GetArgs()) >= 2 {
+func isComplexOperator(expr ast.Expr) bool {
+ if expr.Kind() == ast.CallKind && len(expr.AsCall().Args()) >= 2 {
return true
}
return false
@@ -484,19 +476,19 @@ func isComplexOperator(expr *exprpb.Expr) bool {
// Indicates whether it is a complex operation compared to another.
// expr is *not* considered complex if it is not a call expression or has
// less than two arguments, or if it has a higher precedence than op.
-func isComplexOperatorWithRespectTo(op string, expr *exprpb.Expr) bool {
- if expr.GetCallExpr() == nil || len(expr.GetCallExpr().GetArgs()) < 2 {
+func isComplexOperatorWithRespectTo(op string, expr ast.Expr) bool {
+ if expr.Kind() != ast.CallKind || len(expr.AsCall().Args()) < 2 {
return false
}
return isLowerPrecedence(op, expr)
}
// Indicate whether this is a binary or ternary operator.
-func isBinaryOrTernaryOperator(expr *exprpb.Expr) bool {
- if expr.GetCallExpr() == nil || len(expr.GetCallExpr().GetArgs()) < 2 {
+func isBinaryOrTernaryOperator(expr ast.Expr) bool {
+ if expr.Kind() != ast.CallKind || len(expr.AsCall().Args()) < 2 {
return false
}
- _, isBinaryOp := operators.FindReverseBinaryOperator(expr.GetCallExpr().GetFunction())
+ _, isBinaryOp := operators.FindReverseBinaryOperator(expr.AsCall().FunctionName())
return isBinaryOp || isSamePrecedence(operators.Conditional, expr)
}
diff --git a/vendor/github.com/google/pprof/AUTHORS b/vendor/github.com/google/pprof/AUTHORS
new file mode 100644
index 0000000000..fd736cb1cf
--- /dev/null
+++ b/vendor/github.com/google/pprof/AUTHORS
@@ -0,0 +1,7 @@
+# This is the official list of pprof authors for copyright purposes.
+# This file is distinct from the CONTRIBUTORS files.
+# See the latter for an explanation.
+# Names should be added to this file as:
+# Name or Organization
+# The email address is not required for organizations.
+Google Inc.
\ No newline at end of file
diff --git a/vendor/github.com/google/pprof/CONTRIBUTORS b/vendor/github.com/google/pprof/CONTRIBUTORS
new file mode 100644
index 0000000000..8c8c37d2c8
--- /dev/null
+++ b/vendor/github.com/google/pprof/CONTRIBUTORS
@@ -0,0 +1,16 @@
+# People who have agreed to one of the CLAs and can contribute patches.
+# The AUTHORS file lists the copyright holders; this file
+# lists people. For example, Google employees are listed here
+# but not in AUTHORS, because Google holds the copyright.
+#
+# https://developers.google.com/open-source/cla/individual
+# https://developers.google.com/open-source/cla/corporate
+#
+# Names should be added to this file as:
+# Name
+Raul Silvera
+Tipp Moseley
+Hyoun Kyu Cho
+Martin Spier
+Taco de Wolff
+Andrew Hunter
diff --git a/vendor/google.golang.org/appengine/LICENSE b/vendor/github.com/google/pprof/LICENSE
similarity index 100%
rename from vendor/google.golang.org/appengine/LICENSE
rename to vendor/github.com/google/pprof/LICENSE
diff --git a/vendor/github.com/google/pprof/profile/encode.go b/vendor/github.com/google/pprof/profile/encode.go
new file mode 100644
index 0000000000..860bb304c3
--- /dev/null
+++ b/vendor/github.com/google/pprof/profile/encode.go
@@ -0,0 +1,591 @@
+// Copyright 2014 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 profile
+
+import (
+ "errors"
+ "sort"
+ "strings"
+)
+
+func (p *Profile) decoder() []decoder {
+ return profileDecoder
+}
+
+// preEncode populates the unexported fields to be used by encode
+// (with suffix X) from the corresponding exported fields. The
+// exported fields are cleared up to facilitate testing.
+func (p *Profile) preEncode() {
+ strings := make(map[string]int)
+ addString(strings, "")
+
+ for _, st := range p.SampleType {
+ st.typeX = addString(strings, st.Type)
+ st.unitX = addString(strings, st.Unit)
+ }
+
+ for _, s := range p.Sample {
+ s.labelX = nil
+ var keys []string
+ for k := range s.Label {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+ for _, k := range keys {
+ vs := s.Label[k]
+ for _, v := range vs {
+ s.labelX = append(s.labelX,
+ label{
+ keyX: addString(strings, k),
+ strX: addString(strings, v),
+ },
+ )
+ }
+ }
+ var numKeys []string
+ for k := range s.NumLabel {
+ numKeys = append(numKeys, k)
+ }
+ sort.Strings(numKeys)
+ for _, k := range numKeys {
+ keyX := addString(strings, k)
+ vs := s.NumLabel[k]
+ units := s.NumUnit[k]
+ for i, v := range vs {
+ var unitX int64
+ if len(units) != 0 {
+ unitX = addString(strings, units[i])
+ }
+ s.labelX = append(s.labelX,
+ label{
+ keyX: keyX,
+ numX: v,
+ unitX: unitX,
+ },
+ )
+ }
+ }
+ s.locationIDX = make([]uint64, len(s.Location))
+ for i, loc := range s.Location {
+ s.locationIDX[i] = loc.ID
+ }
+ }
+
+ for _, m := range p.Mapping {
+ m.fileX = addString(strings, m.File)
+ m.buildIDX = addString(strings, m.BuildID)
+ }
+
+ for _, l := range p.Location {
+ for i, ln := range l.Line {
+ if ln.Function != nil {
+ l.Line[i].functionIDX = ln.Function.ID
+ } else {
+ l.Line[i].functionIDX = 0
+ }
+ }
+ if l.Mapping != nil {
+ l.mappingIDX = l.Mapping.ID
+ } else {
+ l.mappingIDX = 0
+ }
+ }
+ for _, f := range p.Function {
+ f.nameX = addString(strings, f.Name)
+ f.systemNameX = addString(strings, f.SystemName)
+ f.filenameX = addString(strings, f.Filename)
+ }
+
+ p.dropFramesX = addString(strings, p.DropFrames)
+ p.keepFramesX = addString(strings, p.KeepFrames)
+
+ if pt := p.PeriodType; pt != nil {
+ pt.typeX = addString(strings, pt.Type)
+ pt.unitX = addString(strings, pt.Unit)
+ }
+
+ p.commentX = nil
+ for _, c := range p.Comments {
+ p.commentX = append(p.commentX, addString(strings, c))
+ }
+
+ p.defaultSampleTypeX = addString(strings, p.DefaultSampleType)
+
+ p.stringTable = make([]string, len(strings))
+ for s, i := range strings {
+ p.stringTable[i] = s
+ }
+}
+
+func (p *Profile) encode(b *buffer) {
+ for _, x := range p.SampleType {
+ encodeMessage(b, 1, x)
+ }
+ for _, x := range p.Sample {
+ encodeMessage(b, 2, x)
+ }
+ for _, x := range p.Mapping {
+ encodeMessage(b, 3, x)
+ }
+ for _, x := range p.Location {
+ encodeMessage(b, 4, x)
+ }
+ for _, x := range p.Function {
+ encodeMessage(b, 5, x)
+ }
+ encodeStrings(b, 6, p.stringTable)
+ encodeInt64Opt(b, 7, p.dropFramesX)
+ encodeInt64Opt(b, 8, p.keepFramesX)
+ encodeInt64Opt(b, 9, p.TimeNanos)
+ encodeInt64Opt(b, 10, p.DurationNanos)
+ if pt := p.PeriodType; pt != nil && (pt.typeX != 0 || pt.unitX != 0) {
+ encodeMessage(b, 11, p.PeriodType)
+ }
+ encodeInt64Opt(b, 12, p.Period)
+ encodeInt64s(b, 13, p.commentX)
+ encodeInt64(b, 14, p.defaultSampleTypeX)
+}
+
+var profileDecoder = []decoder{
+ nil, // 0
+ // repeated ValueType sample_type = 1
+ func(b *buffer, m message) error {
+ x := new(ValueType)
+ pp := m.(*Profile)
+ pp.SampleType = append(pp.SampleType, x)
+ return decodeMessage(b, x)
+ },
+ // repeated Sample sample = 2
+ func(b *buffer, m message) error {
+ x := new(Sample)
+ pp := m.(*Profile)
+ pp.Sample = append(pp.Sample, x)
+ return decodeMessage(b, x)
+ },
+ // repeated Mapping mapping = 3
+ func(b *buffer, m message) error {
+ x := new(Mapping)
+ pp := m.(*Profile)
+ pp.Mapping = append(pp.Mapping, x)
+ return decodeMessage(b, x)
+ },
+ // repeated Location location = 4
+ func(b *buffer, m message) error {
+ x := new(Location)
+ x.Line = b.tmpLines[:0] // Use shared space temporarily
+ pp := m.(*Profile)
+ pp.Location = append(pp.Location, x)
+ err := decodeMessage(b, x)
+ b.tmpLines = x.Line[:0]
+ // Copy to shrink size and detach from shared space.
+ x.Line = append([]Line(nil), x.Line...)
+ return err
+ },
+ // repeated Function function = 5
+ func(b *buffer, m message) error {
+ x := new(Function)
+ pp := m.(*Profile)
+ pp.Function = append(pp.Function, x)
+ return decodeMessage(b, x)
+ },
+ // repeated string string_table = 6
+ func(b *buffer, m message) error {
+ err := decodeStrings(b, &m.(*Profile).stringTable)
+ if err != nil {
+ return err
+ }
+ if m.(*Profile).stringTable[0] != "" {
+ return errors.New("string_table[0] must be ''")
+ }
+ return nil
+ },
+ // int64 drop_frames = 7
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Profile).dropFramesX) },
+ // int64 keep_frames = 8
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Profile).keepFramesX) },
+ // int64 time_nanos = 9
+ func(b *buffer, m message) error {
+ if m.(*Profile).TimeNanos != 0 {
+ return errConcatProfile
+ }
+ return decodeInt64(b, &m.(*Profile).TimeNanos)
+ },
+ // int64 duration_nanos = 10
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Profile).DurationNanos) },
+ // ValueType period_type = 11
+ func(b *buffer, m message) error {
+ x := new(ValueType)
+ pp := m.(*Profile)
+ pp.PeriodType = x
+ return decodeMessage(b, x)
+ },
+ // int64 period = 12
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Profile).Period) },
+ // repeated int64 comment = 13
+ func(b *buffer, m message) error { return decodeInt64s(b, &m.(*Profile).commentX) },
+ // int64 defaultSampleType = 14
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Profile).defaultSampleTypeX) },
+}
+
+// postDecode takes the unexported fields populated by decode (with
+// suffix X) and populates the corresponding exported fields.
+// The unexported fields are cleared up to facilitate testing.
+func (p *Profile) postDecode() error {
+ var err error
+ mappings := make(map[uint64]*Mapping, len(p.Mapping))
+ mappingIds := make([]*Mapping, len(p.Mapping)+1)
+ for _, m := range p.Mapping {
+ m.File, err = getString(p.stringTable, &m.fileX, err)
+ m.BuildID, err = getString(p.stringTable, &m.buildIDX, err)
+ if m.ID < uint64(len(mappingIds)) {
+ mappingIds[m.ID] = m
+ } else {
+ mappings[m.ID] = m
+ }
+
+ // If this a main linux kernel mapping with a relocation symbol suffix
+ // ("[kernel.kallsyms]_text"), extract said suffix.
+ // It is fairly hacky to handle at this level, but the alternatives appear even worse.
+ const prefix = "[kernel.kallsyms]"
+ if strings.HasPrefix(m.File, prefix) {
+ m.KernelRelocationSymbol = m.File[len(prefix):]
+ }
+ }
+
+ functions := make(map[uint64]*Function, len(p.Function))
+ functionIds := make([]*Function, len(p.Function)+1)
+ for _, f := range p.Function {
+ f.Name, err = getString(p.stringTable, &f.nameX, err)
+ f.SystemName, err = getString(p.stringTable, &f.systemNameX, err)
+ f.Filename, err = getString(p.stringTable, &f.filenameX, err)
+ if f.ID < uint64(len(functionIds)) {
+ functionIds[f.ID] = f
+ } else {
+ functions[f.ID] = f
+ }
+ }
+
+ locations := make(map[uint64]*Location, len(p.Location))
+ locationIds := make([]*Location, len(p.Location)+1)
+ for _, l := range p.Location {
+ if id := l.mappingIDX; id < uint64(len(mappingIds)) {
+ l.Mapping = mappingIds[id]
+ } else {
+ l.Mapping = mappings[id]
+ }
+ l.mappingIDX = 0
+ for i, ln := range l.Line {
+ if id := ln.functionIDX; id != 0 {
+ l.Line[i].functionIDX = 0
+ if id < uint64(len(functionIds)) {
+ l.Line[i].Function = functionIds[id]
+ } else {
+ l.Line[i].Function = functions[id]
+ }
+ }
+ }
+ if l.ID < uint64(len(locationIds)) {
+ locationIds[l.ID] = l
+ } else {
+ locations[l.ID] = l
+ }
+ }
+
+ for _, st := range p.SampleType {
+ st.Type, err = getString(p.stringTable, &st.typeX, err)
+ st.Unit, err = getString(p.stringTable, &st.unitX, err)
+ }
+
+ // Pre-allocate space for all locations.
+ numLocations := 0
+ for _, s := range p.Sample {
+ numLocations += len(s.locationIDX)
+ }
+ locBuffer := make([]*Location, numLocations)
+
+ for _, s := range p.Sample {
+ if len(s.labelX) > 0 {
+ labels := make(map[string][]string, len(s.labelX))
+ numLabels := make(map[string][]int64, len(s.labelX))
+ numUnits := make(map[string][]string, len(s.labelX))
+ for _, l := range s.labelX {
+ var key, value string
+ key, err = getString(p.stringTable, &l.keyX, err)
+ if l.strX != 0 {
+ value, err = getString(p.stringTable, &l.strX, err)
+ labels[key] = append(labels[key], value)
+ } else if l.numX != 0 || l.unitX != 0 {
+ numValues := numLabels[key]
+ units := numUnits[key]
+ if l.unitX != 0 {
+ var unit string
+ unit, err = getString(p.stringTable, &l.unitX, err)
+ units = padStringArray(units, len(numValues))
+ numUnits[key] = append(units, unit)
+ }
+ numLabels[key] = append(numLabels[key], l.numX)
+ }
+ }
+ if len(labels) > 0 {
+ s.Label = labels
+ }
+ if len(numLabels) > 0 {
+ s.NumLabel = numLabels
+ for key, units := range numUnits {
+ if len(units) > 0 {
+ numUnits[key] = padStringArray(units, len(numLabels[key]))
+ }
+ }
+ s.NumUnit = numUnits
+ }
+ }
+
+ s.Location = locBuffer[:len(s.locationIDX)]
+ locBuffer = locBuffer[len(s.locationIDX):]
+ for i, lid := range s.locationIDX {
+ if lid < uint64(len(locationIds)) {
+ s.Location[i] = locationIds[lid]
+ } else {
+ s.Location[i] = locations[lid]
+ }
+ }
+ s.locationIDX = nil
+ }
+
+ p.DropFrames, err = getString(p.stringTable, &p.dropFramesX, err)
+ p.KeepFrames, err = getString(p.stringTable, &p.keepFramesX, err)
+
+ if pt := p.PeriodType; pt == nil {
+ p.PeriodType = &ValueType{}
+ }
+
+ if pt := p.PeriodType; pt != nil {
+ pt.Type, err = getString(p.stringTable, &pt.typeX, err)
+ pt.Unit, err = getString(p.stringTable, &pt.unitX, err)
+ }
+
+ for _, i := range p.commentX {
+ var c string
+ c, err = getString(p.stringTable, &i, err)
+ p.Comments = append(p.Comments, c)
+ }
+
+ p.commentX = nil
+ p.DefaultSampleType, err = getString(p.stringTable, &p.defaultSampleTypeX, err)
+ p.stringTable = nil
+ return err
+}
+
+// padStringArray pads arr with enough empty strings to make arr
+// length l when arr's length is less than l.
+func padStringArray(arr []string, l int) []string {
+ if l <= len(arr) {
+ return arr
+ }
+ return append(arr, make([]string, l-len(arr))...)
+}
+
+func (p *ValueType) decoder() []decoder {
+ return valueTypeDecoder
+}
+
+func (p *ValueType) encode(b *buffer) {
+ encodeInt64Opt(b, 1, p.typeX)
+ encodeInt64Opt(b, 2, p.unitX)
+}
+
+var valueTypeDecoder = []decoder{
+ nil, // 0
+ // optional int64 type = 1
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*ValueType).typeX) },
+ // optional int64 unit = 2
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*ValueType).unitX) },
+}
+
+func (p *Sample) decoder() []decoder {
+ return sampleDecoder
+}
+
+func (p *Sample) encode(b *buffer) {
+ encodeUint64s(b, 1, p.locationIDX)
+ encodeInt64s(b, 2, p.Value)
+ for _, x := range p.labelX {
+ encodeMessage(b, 3, x)
+ }
+}
+
+var sampleDecoder = []decoder{
+ nil, // 0
+ // repeated uint64 location = 1
+ func(b *buffer, m message) error { return decodeUint64s(b, &m.(*Sample).locationIDX) },
+ // repeated int64 value = 2
+ func(b *buffer, m message) error { return decodeInt64s(b, &m.(*Sample).Value) },
+ // repeated Label label = 3
+ func(b *buffer, m message) error {
+ s := m.(*Sample)
+ n := len(s.labelX)
+ s.labelX = append(s.labelX, label{})
+ return decodeMessage(b, &s.labelX[n])
+ },
+}
+
+func (p label) decoder() []decoder {
+ return labelDecoder
+}
+
+func (p label) encode(b *buffer) {
+ encodeInt64Opt(b, 1, p.keyX)
+ encodeInt64Opt(b, 2, p.strX)
+ encodeInt64Opt(b, 3, p.numX)
+ encodeInt64Opt(b, 4, p.unitX)
+}
+
+var labelDecoder = []decoder{
+ nil, // 0
+ // optional int64 key = 1
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*label).keyX) },
+ // optional int64 str = 2
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*label).strX) },
+ // optional int64 num = 3
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*label).numX) },
+ // optional int64 num = 4
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*label).unitX) },
+}
+
+func (p *Mapping) decoder() []decoder {
+ return mappingDecoder
+}
+
+func (p *Mapping) encode(b *buffer) {
+ encodeUint64Opt(b, 1, p.ID)
+ encodeUint64Opt(b, 2, p.Start)
+ encodeUint64Opt(b, 3, p.Limit)
+ encodeUint64Opt(b, 4, p.Offset)
+ encodeInt64Opt(b, 5, p.fileX)
+ encodeInt64Opt(b, 6, p.buildIDX)
+ encodeBoolOpt(b, 7, p.HasFunctions)
+ encodeBoolOpt(b, 8, p.HasFilenames)
+ encodeBoolOpt(b, 9, p.HasLineNumbers)
+ encodeBoolOpt(b, 10, p.HasInlineFrames)
+}
+
+var mappingDecoder = []decoder{
+ nil, // 0
+ func(b *buffer, m message) error { return decodeUint64(b, &m.(*Mapping).ID) }, // optional uint64 id = 1
+ func(b *buffer, m message) error { return decodeUint64(b, &m.(*Mapping).Start) }, // optional uint64 memory_offset = 2
+ func(b *buffer, m message) error { return decodeUint64(b, &m.(*Mapping).Limit) }, // optional uint64 memory_limit = 3
+ func(b *buffer, m message) error { return decodeUint64(b, &m.(*Mapping).Offset) }, // optional uint64 file_offset = 4
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Mapping).fileX) }, // optional int64 filename = 5
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Mapping).buildIDX) }, // optional int64 build_id = 6
+ func(b *buffer, m message) error { return decodeBool(b, &m.(*Mapping).HasFunctions) }, // optional bool has_functions = 7
+ func(b *buffer, m message) error { return decodeBool(b, &m.(*Mapping).HasFilenames) }, // optional bool has_filenames = 8
+ func(b *buffer, m message) error { return decodeBool(b, &m.(*Mapping).HasLineNumbers) }, // optional bool has_line_numbers = 9
+ func(b *buffer, m message) error { return decodeBool(b, &m.(*Mapping).HasInlineFrames) }, // optional bool has_inline_frames = 10
+}
+
+func (p *Location) decoder() []decoder {
+ return locationDecoder
+}
+
+func (p *Location) encode(b *buffer) {
+ encodeUint64Opt(b, 1, p.ID)
+ encodeUint64Opt(b, 2, p.mappingIDX)
+ encodeUint64Opt(b, 3, p.Address)
+ for i := range p.Line {
+ encodeMessage(b, 4, &p.Line[i])
+ }
+ encodeBoolOpt(b, 5, p.IsFolded)
+}
+
+var locationDecoder = []decoder{
+ nil, // 0
+ func(b *buffer, m message) error { return decodeUint64(b, &m.(*Location).ID) }, // optional uint64 id = 1;
+ func(b *buffer, m message) error { return decodeUint64(b, &m.(*Location).mappingIDX) }, // optional uint64 mapping_id = 2;
+ func(b *buffer, m message) error { return decodeUint64(b, &m.(*Location).Address) }, // optional uint64 address = 3;
+ func(b *buffer, m message) error { // repeated Line line = 4
+ pp := m.(*Location)
+ n := len(pp.Line)
+ pp.Line = append(pp.Line, Line{})
+ return decodeMessage(b, &pp.Line[n])
+ },
+ func(b *buffer, m message) error { return decodeBool(b, &m.(*Location).IsFolded) }, // optional bool is_folded = 5;
+}
+
+func (p *Line) decoder() []decoder {
+ return lineDecoder
+}
+
+func (p *Line) encode(b *buffer) {
+ encodeUint64Opt(b, 1, p.functionIDX)
+ encodeInt64Opt(b, 2, p.Line)
+ encodeInt64Opt(b, 3, p.Column)
+}
+
+var lineDecoder = []decoder{
+ nil, // 0
+ // optional uint64 function_id = 1
+ func(b *buffer, m message) error { return decodeUint64(b, &m.(*Line).functionIDX) },
+ // optional int64 line = 2
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Line).Line) },
+ // optional int64 column = 3
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Line).Column) },
+}
+
+func (p *Function) decoder() []decoder {
+ return functionDecoder
+}
+
+func (p *Function) encode(b *buffer) {
+ encodeUint64Opt(b, 1, p.ID)
+ encodeInt64Opt(b, 2, p.nameX)
+ encodeInt64Opt(b, 3, p.systemNameX)
+ encodeInt64Opt(b, 4, p.filenameX)
+ encodeInt64Opt(b, 5, p.StartLine)
+}
+
+var functionDecoder = []decoder{
+ nil, // 0
+ // optional uint64 id = 1
+ func(b *buffer, m message) error { return decodeUint64(b, &m.(*Function).ID) },
+ // optional int64 function_name = 2
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Function).nameX) },
+ // optional int64 function_system_name = 3
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Function).systemNameX) },
+ // repeated int64 filename = 4
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Function).filenameX) },
+ // optional int64 start_line = 5
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Function).StartLine) },
+}
+
+func addString(strings map[string]int, s string) int64 {
+ i, ok := strings[s]
+ if !ok {
+ i = len(strings)
+ strings[s] = i
+ }
+ return int64(i)
+}
+
+func getString(strings []string, strng *int64, err error) (string, error) {
+ if err != nil {
+ return "", err
+ }
+ s := int(*strng)
+ if s < 0 || s >= len(strings) {
+ return "", errMalformed
+ }
+ *strng = 0
+ return strings[s], nil
+}
diff --git a/vendor/github.com/google/pprof/profile/filter.go b/vendor/github.com/google/pprof/profile/filter.go
new file mode 100644
index 0000000000..c794b93906
--- /dev/null
+++ b/vendor/github.com/google/pprof/profile/filter.go
@@ -0,0 +1,274 @@
+// Copyright 2014 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 profile
+
+// Implements methods to filter samples from profiles.
+
+import "regexp"
+
+// FilterSamplesByName filters the samples in a profile and only keeps
+// samples where at least one frame matches focus but none match ignore.
+// Returns true is the corresponding regexp matched at least one sample.
+func (p *Profile) FilterSamplesByName(focus, ignore, hide, show *regexp.Regexp) (fm, im, hm, hnm bool) {
+ if focus == nil && ignore == nil && hide == nil && show == nil {
+ fm = true // Missing focus implies a match
+ return
+ }
+ focusOrIgnore := make(map[uint64]bool)
+ hidden := make(map[uint64]bool)
+ for _, l := range p.Location {
+ if ignore != nil && l.matchesName(ignore) {
+ im = true
+ focusOrIgnore[l.ID] = false
+ } else if focus == nil || l.matchesName(focus) {
+ fm = true
+ focusOrIgnore[l.ID] = true
+ }
+
+ if hide != nil && l.matchesName(hide) {
+ hm = true
+ l.Line = l.unmatchedLines(hide)
+ if len(l.Line) == 0 {
+ hidden[l.ID] = true
+ }
+ }
+ if show != nil {
+ l.Line = l.matchedLines(show)
+ if len(l.Line) == 0 {
+ hidden[l.ID] = true
+ } else {
+ hnm = true
+ }
+ }
+ }
+
+ s := make([]*Sample, 0, len(p.Sample))
+ for _, sample := range p.Sample {
+ if focusedAndNotIgnored(sample.Location, focusOrIgnore) {
+ if len(hidden) > 0 {
+ var locs []*Location
+ for _, loc := range sample.Location {
+ if !hidden[loc.ID] {
+ locs = append(locs, loc)
+ }
+ }
+ if len(locs) == 0 {
+ // Remove sample with no locations (by not adding it to s).
+ continue
+ }
+ sample.Location = locs
+ }
+ s = append(s, sample)
+ }
+ }
+ p.Sample = s
+
+ return
+}
+
+// ShowFrom drops all stack frames above the highest matching frame and returns
+// whether a match was found. If showFrom is nil it returns false and does not
+// modify the profile.
+//
+// Example: consider a sample with frames [A, B, C, B], where A is the root.
+// ShowFrom(nil) returns false and has frames [A, B, C, B].
+// ShowFrom(A) returns true and has frames [A, B, C, B].
+// ShowFrom(B) returns true and has frames [B, C, B].
+// ShowFrom(C) returns true and has frames [C, B].
+// ShowFrom(D) returns false and drops the sample because no frames remain.
+func (p *Profile) ShowFrom(showFrom *regexp.Regexp) (matched bool) {
+ if showFrom == nil {
+ return false
+ }
+ // showFromLocs stores location IDs that matched ShowFrom.
+ showFromLocs := make(map[uint64]bool)
+ // Apply to locations.
+ for _, loc := range p.Location {
+ if filterShowFromLocation(loc, showFrom) {
+ showFromLocs[loc.ID] = true
+ matched = true
+ }
+ }
+ // For all samples, strip locations after the highest matching one.
+ s := make([]*Sample, 0, len(p.Sample))
+ for _, sample := range p.Sample {
+ for i := len(sample.Location) - 1; i >= 0; i-- {
+ if showFromLocs[sample.Location[i].ID] {
+ sample.Location = sample.Location[:i+1]
+ s = append(s, sample)
+ break
+ }
+ }
+ }
+ p.Sample = s
+ return matched
+}
+
+// filterShowFromLocation tests a showFrom regex against a location, removes
+// lines after the last match and returns whether a match was found. If the
+// mapping is matched, then all lines are kept.
+func filterShowFromLocation(loc *Location, showFrom *regexp.Regexp) bool {
+ if m := loc.Mapping; m != nil && showFrom.MatchString(m.File) {
+ return true
+ }
+ if i := loc.lastMatchedLineIndex(showFrom); i >= 0 {
+ loc.Line = loc.Line[:i+1]
+ return true
+ }
+ return false
+}
+
+// lastMatchedLineIndex returns the index of the last line that matches a regex,
+// or -1 if no match is found.
+func (loc *Location) lastMatchedLineIndex(re *regexp.Regexp) int {
+ for i := len(loc.Line) - 1; i >= 0; i-- {
+ if fn := loc.Line[i].Function; fn != nil {
+ if re.MatchString(fn.Name) || re.MatchString(fn.Filename) {
+ return i
+ }
+ }
+ }
+ return -1
+}
+
+// FilterTagsByName filters the tags in a profile and only keeps
+// tags that match show and not hide.
+func (p *Profile) FilterTagsByName(show, hide *regexp.Regexp) (sm, hm bool) {
+ matchRemove := func(name string) bool {
+ matchShow := show == nil || show.MatchString(name)
+ matchHide := hide != nil && hide.MatchString(name)
+
+ if matchShow {
+ sm = true
+ }
+ if matchHide {
+ hm = true
+ }
+ return !matchShow || matchHide
+ }
+ for _, s := range p.Sample {
+ for lab := range s.Label {
+ if matchRemove(lab) {
+ delete(s.Label, lab)
+ }
+ }
+ for lab := range s.NumLabel {
+ if matchRemove(lab) {
+ delete(s.NumLabel, lab)
+ }
+ }
+ }
+ return
+}
+
+// matchesName returns whether the location matches the regular
+// expression. It checks any available function names, file names, and
+// mapping object filename.
+func (loc *Location) matchesName(re *regexp.Regexp) bool {
+ for _, ln := range loc.Line {
+ if fn := ln.Function; fn != nil {
+ if re.MatchString(fn.Name) || re.MatchString(fn.Filename) {
+ return true
+ }
+ }
+ }
+ if m := loc.Mapping; m != nil && re.MatchString(m.File) {
+ return true
+ }
+ return false
+}
+
+// unmatchedLines returns the lines in the location that do not match
+// the regular expression.
+func (loc *Location) unmatchedLines(re *regexp.Regexp) []Line {
+ if m := loc.Mapping; m != nil && re.MatchString(m.File) {
+ return nil
+ }
+ var lines []Line
+ for _, ln := range loc.Line {
+ if fn := ln.Function; fn != nil {
+ if re.MatchString(fn.Name) || re.MatchString(fn.Filename) {
+ continue
+ }
+ }
+ lines = append(lines, ln)
+ }
+ return lines
+}
+
+// matchedLines returns the lines in the location that match
+// the regular expression.
+func (loc *Location) matchedLines(re *regexp.Regexp) []Line {
+ if m := loc.Mapping; m != nil && re.MatchString(m.File) {
+ return loc.Line
+ }
+ var lines []Line
+ for _, ln := range loc.Line {
+ if fn := ln.Function; fn != nil {
+ if !re.MatchString(fn.Name) && !re.MatchString(fn.Filename) {
+ continue
+ }
+ }
+ lines = append(lines, ln)
+ }
+ return lines
+}
+
+// focusedAndNotIgnored looks up a slice of ids against a map of
+// focused/ignored locations. The map only contains locations that are
+// explicitly focused or ignored. Returns whether there is at least
+// one focused location but no ignored locations.
+func focusedAndNotIgnored(locs []*Location, m map[uint64]bool) bool {
+ var f bool
+ for _, loc := range locs {
+ if focus, focusOrIgnore := m[loc.ID]; focusOrIgnore {
+ if focus {
+ // Found focused location. Must keep searching in case there
+ // is an ignored one as well.
+ f = true
+ } else {
+ // Found ignored location. Can return false right away.
+ return false
+ }
+ }
+ }
+ return f
+}
+
+// TagMatch selects tags for filtering
+type TagMatch func(s *Sample) bool
+
+// FilterSamplesByTag removes all samples from the profile, except
+// those that match focus and do not match the ignore regular
+// expression.
+func (p *Profile) FilterSamplesByTag(focus, ignore TagMatch) (fm, im bool) {
+ samples := make([]*Sample, 0, len(p.Sample))
+ for _, s := range p.Sample {
+ focused, ignored := true, false
+ if focus != nil {
+ focused = focus(s)
+ }
+ if ignore != nil {
+ ignored = ignore(s)
+ }
+ fm = fm || focused
+ im = im || ignored
+ if focused && !ignored {
+ samples = append(samples, s)
+ }
+ }
+ p.Sample = samples
+ return
+}
diff --git a/vendor/github.com/google/pprof/profile/index.go b/vendor/github.com/google/pprof/profile/index.go
new file mode 100644
index 0000000000..bef1d60467
--- /dev/null
+++ b/vendor/github.com/google/pprof/profile/index.go
@@ -0,0 +1,64 @@
+// Copyright 2016 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 profile
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// SampleIndexByName returns the appropriate index for a value of sample index.
+// If numeric, it returns the number, otherwise it looks up the text in the
+// profile sample types.
+func (p *Profile) SampleIndexByName(sampleIndex string) (int, error) {
+ if sampleIndex == "" {
+ if dst := p.DefaultSampleType; dst != "" {
+ for i, t := range sampleTypes(p) {
+ if t == dst {
+ return i, nil
+ }
+ }
+ }
+ // By default select the last sample value
+ return len(p.SampleType) - 1, nil
+ }
+ if i, err := strconv.Atoi(sampleIndex); err == nil {
+ if i < 0 || i >= len(p.SampleType) {
+ return 0, fmt.Errorf("sample_index %s is outside the range [0..%d]", sampleIndex, len(p.SampleType)-1)
+ }
+ return i, nil
+ }
+
+ // Remove the inuse_ prefix to support legacy pprof options
+ // "inuse_space" and "inuse_objects" for profiles containing types
+ // "space" and "objects".
+ noInuse := strings.TrimPrefix(sampleIndex, "inuse_")
+ for i, t := range p.SampleType {
+ if t.Type == sampleIndex || t.Type == noInuse {
+ return i, nil
+ }
+ }
+
+ return 0, fmt.Errorf("sample_index %q must be one of: %v", sampleIndex, sampleTypes(p))
+}
+
+func sampleTypes(p *Profile) []string {
+ types := make([]string, len(p.SampleType))
+ for i, t := range p.SampleType {
+ types[i] = t.Type
+ }
+ return types
+}
diff --git a/vendor/github.com/google/pprof/profile/legacy_java_profile.go b/vendor/github.com/google/pprof/profile/legacy_java_profile.go
new file mode 100644
index 0000000000..4580bab183
--- /dev/null
+++ b/vendor/github.com/google/pprof/profile/legacy_java_profile.go
@@ -0,0 +1,315 @@
+// Copyright 2014 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This file implements parsers to convert java legacy profiles into
+// the profile.proto format.
+
+package profile
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "path/filepath"
+ "regexp"
+ "strconv"
+ "strings"
+)
+
+var (
+ attributeRx = regexp.MustCompile(`([\w ]+)=([\w ]+)`)
+ javaSampleRx = regexp.MustCompile(` *(\d+) +(\d+) +@ +([ x0-9a-f]*)`)
+ javaLocationRx = regexp.MustCompile(`^\s*0x([[:xdigit:]]+)\s+(.*)\s*$`)
+ javaLocationFileLineRx = regexp.MustCompile(`^(.*)\s+\((.+):(-?[[:digit:]]+)\)$`)
+ javaLocationPathRx = regexp.MustCompile(`^(.*)\s+\((.*)\)$`)
+)
+
+// javaCPUProfile returns a new Profile from profilez data.
+// b is the profile bytes after the header, period is the profiling
+// period, and parse is a function to parse 8-byte chunks from the
+// profile in its native endianness.
+func javaCPUProfile(b []byte, period int64, parse func(b []byte) (uint64, []byte)) (*Profile, error) {
+ p := &Profile{
+ Period: period * 1000,
+ PeriodType: &ValueType{Type: "cpu", Unit: "nanoseconds"},
+ SampleType: []*ValueType{{Type: "samples", Unit: "count"}, {Type: "cpu", Unit: "nanoseconds"}},
+ }
+ var err error
+ var locs map[uint64]*Location
+ if b, locs, err = parseCPUSamples(b, parse, false, p); err != nil {
+ return nil, err
+ }
+
+ if err = parseJavaLocations(b, locs, p); err != nil {
+ return nil, err
+ }
+
+ // Strip out addresses for better merge.
+ if err = p.Aggregate(true, true, true, true, false, false); err != nil {
+ return nil, err
+ }
+
+ return p, nil
+}
+
+// parseJavaProfile returns a new profile from heapz or contentionz
+// data. b is the profile bytes after the header.
+func parseJavaProfile(b []byte) (*Profile, error) {
+ h := bytes.SplitAfterN(b, []byte("\n"), 2)
+ if len(h) < 2 {
+ return nil, errUnrecognized
+ }
+
+ p := &Profile{
+ PeriodType: &ValueType{},
+ }
+ header := string(bytes.TrimSpace(h[0]))
+
+ var err error
+ var pType string
+ switch header {
+ case "--- heapz 1 ---":
+ pType = "heap"
+ case "--- contentionz 1 ---":
+ pType = "contention"
+ default:
+ return nil, errUnrecognized
+ }
+
+ if b, err = parseJavaHeader(pType, h[1], p); err != nil {
+ return nil, err
+ }
+ var locs map[uint64]*Location
+ if b, locs, err = parseJavaSamples(pType, b, p); err != nil {
+ return nil, err
+ }
+ if err = parseJavaLocations(b, locs, p); err != nil {
+ return nil, err
+ }
+
+ // Strip out addresses for better merge.
+ if err = p.Aggregate(true, true, true, true, false, false); err != nil {
+ return nil, err
+ }
+
+ return p, nil
+}
+
+// parseJavaHeader parses the attribute section on a java profile and
+// populates a profile. Returns the remainder of the buffer after all
+// attributes.
+func parseJavaHeader(pType string, b []byte, p *Profile) ([]byte, error) {
+ nextNewLine := bytes.IndexByte(b, byte('\n'))
+ for nextNewLine != -1 {
+ line := string(bytes.TrimSpace(b[0:nextNewLine]))
+ if line != "" {
+ h := attributeRx.FindStringSubmatch(line)
+ if h == nil {
+ // Not a valid attribute, exit.
+ return b, nil
+ }
+
+ attribute, value := strings.TrimSpace(h[1]), strings.TrimSpace(h[2])
+ var err error
+ switch pType + "/" + attribute {
+ case "heap/format", "cpu/format", "contention/format":
+ if value != "java" {
+ return nil, errUnrecognized
+ }
+ case "heap/resolution":
+ p.SampleType = []*ValueType{
+ {Type: "inuse_objects", Unit: "count"},
+ {Type: "inuse_space", Unit: value},
+ }
+ case "contention/resolution":
+ p.SampleType = []*ValueType{
+ {Type: "contentions", Unit: "count"},
+ {Type: "delay", Unit: value},
+ }
+ case "contention/sampling period":
+ p.PeriodType = &ValueType{
+ Type: "contentions", Unit: "count",
+ }
+ if p.Period, err = strconv.ParseInt(value, 0, 64); err != nil {
+ return nil, fmt.Errorf("failed to parse attribute %s: %v", line, err)
+ }
+ case "contention/ms since reset":
+ millis, err := strconv.ParseInt(value, 0, 64)
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse attribute %s: %v", line, err)
+ }
+ p.DurationNanos = millis * 1000 * 1000
+ default:
+ return nil, errUnrecognized
+ }
+ }
+ // Grab next line.
+ b = b[nextNewLine+1:]
+ nextNewLine = bytes.IndexByte(b, byte('\n'))
+ }
+ return b, nil
+}
+
+// parseJavaSamples parses the samples from a java profile and
+// populates the Samples in a profile. Returns the remainder of the
+// buffer after the samples.
+func parseJavaSamples(pType string, b []byte, p *Profile) ([]byte, map[uint64]*Location, error) {
+ nextNewLine := bytes.IndexByte(b, byte('\n'))
+ locs := make(map[uint64]*Location)
+ for nextNewLine != -1 {
+ line := string(bytes.TrimSpace(b[0:nextNewLine]))
+ if line != "" {
+ sample := javaSampleRx.FindStringSubmatch(line)
+ if sample == nil {
+ // Not a valid sample, exit.
+ return b, locs, nil
+ }
+
+ // Java profiles have data/fields inverted compared to other
+ // profile types.
+ var err error
+ value1, value2, value3 := sample[2], sample[1], sample[3]
+ addrs, err := parseHexAddresses(value3)
+ if err != nil {
+ return nil, nil, fmt.Errorf("malformed sample: %s: %v", line, err)
+ }
+
+ var sloc []*Location
+ for _, addr := range addrs {
+ loc := locs[addr]
+ if locs[addr] == nil {
+ loc = &Location{
+ Address: addr,
+ }
+ p.Location = append(p.Location, loc)
+ locs[addr] = loc
+ }
+ sloc = append(sloc, loc)
+ }
+ s := &Sample{
+ Value: make([]int64, 2),
+ Location: sloc,
+ }
+
+ if s.Value[0], err = strconv.ParseInt(value1, 0, 64); err != nil {
+ return nil, nil, fmt.Errorf("parsing sample %s: %v", line, err)
+ }
+ if s.Value[1], err = strconv.ParseInt(value2, 0, 64); err != nil {
+ return nil, nil, fmt.Errorf("parsing sample %s: %v", line, err)
+ }
+
+ switch pType {
+ case "heap":
+ const javaHeapzSamplingRate = 524288 // 512K
+ if s.Value[0] == 0 {
+ return nil, nil, fmt.Errorf("parsing sample %s: second value must be non-zero", line)
+ }
+ s.NumLabel = map[string][]int64{"bytes": {s.Value[1] / s.Value[0]}}
+ s.Value[0], s.Value[1] = scaleHeapSample(s.Value[0], s.Value[1], javaHeapzSamplingRate)
+ case "contention":
+ if period := p.Period; period != 0 {
+ s.Value[0] = s.Value[0] * p.Period
+ s.Value[1] = s.Value[1] * p.Period
+ }
+ }
+ p.Sample = append(p.Sample, s)
+ }
+ // Grab next line.
+ b = b[nextNewLine+1:]
+ nextNewLine = bytes.IndexByte(b, byte('\n'))
+ }
+ return b, locs, nil
+}
+
+// parseJavaLocations parses the location information in a java
+// profile and populates the Locations in a profile. It uses the
+// location addresses from the profile as both the ID of each
+// location.
+func parseJavaLocations(b []byte, locs map[uint64]*Location, p *Profile) error {
+ r := bytes.NewBuffer(b)
+ fns := make(map[string]*Function)
+ for {
+ line, err := r.ReadString('\n')
+ if err != nil {
+ if err != io.EOF {
+ return err
+ }
+ if line == "" {
+ break
+ }
+ }
+
+ if line = strings.TrimSpace(line); line == "" {
+ continue
+ }
+
+ jloc := javaLocationRx.FindStringSubmatch(line)
+ if len(jloc) != 3 {
+ continue
+ }
+ addr, err := strconv.ParseUint(jloc[1], 16, 64)
+ if err != nil {
+ return fmt.Errorf("parsing sample %s: %v", line, err)
+ }
+ loc := locs[addr]
+ if loc == nil {
+ // Unused/unseen
+ continue
+ }
+ var lineFunc, lineFile string
+ var lineNo int64
+
+ if fileLine := javaLocationFileLineRx.FindStringSubmatch(jloc[2]); len(fileLine) == 4 {
+ // Found a line of the form: "function (file:line)"
+ lineFunc, lineFile = fileLine[1], fileLine[2]
+ if n, err := strconv.ParseInt(fileLine[3], 10, 64); err == nil && n > 0 {
+ lineNo = n
+ }
+ } else if filePath := javaLocationPathRx.FindStringSubmatch(jloc[2]); len(filePath) == 3 {
+ // If there's not a file:line, it's a shared library path.
+ // The path isn't interesting, so just give the .so.
+ lineFunc, lineFile = filePath[1], filepath.Base(filePath[2])
+ } else if strings.Contains(jloc[2], "generated stub/JIT") {
+ lineFunc = "STUB"
+ } else {
+ // Treat whole line as the function name. This is used by the
+ // java agent for internal states such as "GC" or "VM".
+ lineFunc = jloc[2]
+ }
+ fn := fns[lineFunc]
+
+ if fn == nil {
+ fn = &Function{
+ Name: lineFunc,
+ SystemName: lineFunc,
+ Filename: lineFile,
+ }
+ fns[lineFunc] = fn
+ p.Function = append(p.Function, fn)
+ }
+ loc.Line = []Line{
+ {
+ Function: fn,
+ Line: lineNo,
+ },
+ }
+ loc.Address = 0
+ }
+
+ p.remapLocationIDs()
+ p.remapFunctionIDs()
+ p.remapMappingIDs()
+
+ return nil
+}
diff --git a/vendor/github.com/google/pprof/profile/legacy_profile.go b/vendor/github.com/google/pprof/profile/legacy_profile.go
new file mode 100644
index 0000000000..8d07fd6c27
--- /dev/null
+++ b/vendor/github.com/google/pprof/profile/legacy_profile.go
@@ -0,0 +1,1228 @@
+// Copyright 2014 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This file implements parsers to convert legacy profiles into the
+// profile.proto format.
+
+package profile
+
+import (
+ "bufio"
+ "bytes"
+ "fmt"
+ "io"
+ "math"
+ "regexp"
+ "strconv"
+ "strings"
+)
+
+var (
+ countStartRE = regexp.MustCompile(`\A(\S+) profile: total \d+\z`)
+ countRE = regexp.MustCompile(`\A(\d+) @(( 0x[0-9a-f]+)+)\z`)
+
+ heapHeaderRE = regexp.MustCompile(`heap profile: *(\d+): *(\d+) *\[ *(\d+): *(\d+) *\] *@ *(heap[_a-z0-9]*)/?(\d*)`)
+ heapSampleRE = regexp.MustCompile(`(-?\d+): *(-?\d+) *\[ *(\d+): *(\d+) *] @([ x0-9a-f]*)`)
+
+ contentionSampleRE = regexp.MustCompile(`(\d+) *(\d+) @([ x0-9a-f]*)`)
+
+ hexNumberRE = regexp.MustCompile(`0x[0-9a-f]+`)
+
+ growthHeaderRE = regexp.MustCompile(`heap profile: *(\d+): *(\d+) *\[ *(\d+): *(\d+) *\] @ growthz?`)
+
+ fragmentationHeaderRE = regexp.MustCompile(`heap profile: *(\d+): *(\d+) *\[ *(\d+): *(\d+) *\] @ fragmentationz?`)
+
+ threadzStartRE = regexp.MustCompile(`--- threadz \d+ ---`)
+ threadStartRE = regexp.MustCompile(`--- Thread ([[:xdigit:]]+) \(name: (.*)/(\d+)\) stack: ---`)
+
+ // Regular expressions to parse process mappings. Support the format used by Linux /proc/.../maps and other tools.
+ // Recommended format:
+ // Start End object file name offset(optional) linker build id
+ // 0x40000-0x80000 /path/to/binary (@FF00) abc123456
+ spaceDigits = `\s+[[:digit:]]+`
+ hexPair = `\s+[[:xdigit:]]+:[[:xdigit:]]+`
+ oSpace = `\s*`
+ // Capturing expressions.
+ cHex = `(?:0x)?([[:xdigit:]]+)`
+ cHexRange = `\s*` + cHex + `[\s-]?` + oSpace + cHex + `:?`
+ cSpaceString = `(?:\s+(\S+))?`
+ cSpaceHex = `(?:\s+([[:xdigit:]]+))?`
+ cSpaceAtOffset = `(?:\s+\(@([[:xdigit:]]+)\))?`
+ cPerm = `(?:\s+([-rwxp]+))?`
+
+ procMapsRE = regexp.MustCompile(`^` + cHexRange + cPerm + cSpaceHex + hexPair + spaceDigits + cSpaceString)
+ briefMapsRE = regexp.MustCompile(`^` + cHexRange + cPerm + cSpaceString + cSpaceAtOffset + cSpaceHex)
+
+ // Regular expression to parse log data, of the form:
+ // ... file:line] msg...
+ logInfoRE = regexp.MustCompile(`^[^\[\]]+:[0-9]+]\s`)
+)
+
+func isSpaceOrComment(line string) bool {
+ trimmed := strings.TrimSpace(line)
+ return len(trimmed) == 0 || trimmed[0] == '#'
+}
+
+// parseGoCount parses a Go count profile (e.g., threadcreate or
+// goroutine) and returns a new Profile.
+func parseGoCount(b []byte) (*Profile, error) {
+ s := bufio.NewScanner(bytes.NewBuffer(b))
+ // Skip comments at the beginning of the file.
+ for s.Scan() && isSpaceOrComment(s.Text()) {
+ }
+ if err := s.Err(); err != nil {
+ return nil, err
+ }
+ m := countStartRE.FindStringSubmatch(s.Text())
+ if m == nil {
+ return nil, errUnrecognized
+ }
+ profileType := m[1]
+ p := &Profile{
+ PeriodType: &ValueType{Type: profileType, Unit: "count"},
+ Period: 1,
+ SampleType: []*ValueType{{Type: profileType, Unit: "count"}},
+ }
+ locations := make(map[uint64]*Location)
+ for s.Scan() {
+ line := s.Text()
+ if isSpaceOrComment(line) {
+ continue
+ }
+ if strings.HasPrefix(line, "---") {
+ break
+ }
+ m := countRE.FindStringSubmatch(line)
+ if m == nil {
+ return nil, errMalformed
+ }
+ n, err := strconv.ParseInt(m[1], 0, 64)
+ if err != nil {
+ return nil, errMalformed
+ }
+ fields := strings.Fields(m[2])
+ locs := make([]*Location, 0, len(fields))
+ for _, stk := range fields {
+ addr, err := strconv.ParseUint(stk, 0, 64)
+ if err != nil {
+ return nil, errMalformed
+ }
+ // Adjust all frames by -1 to land on top of the call instruction.
+ addr--
+ loc := locations[addr]
+ if loc == nil {
+ loc = &Location{
+ Address: addr,
+ }
+ locations[addr] = loc
+ p.Location = append(p.Location, loc)
+ }
+ locs = append(locs, loc)
+ }
+ p.Sample = append(p.Sample, &Sample{
+ Location: locs,
+ Value: []int64{n},
+ })
+ }
+ if err := s.Err(); err != nil {
+ return nil, err
+ }
+
+ if err := parseAdditionalSections(s, p); err != nil {
+ return nil, err
+ }
+ return p, nil
+}
+
+// remapLocationIDs ensures there is a location for each address
+// referenced by a sample, and remaps the samples to point to the new
+// location ids.
+func (p *Profile) remapLocationIDs() {
+ seen := make(map[*Location]bool, len(p.Location))
+ var locs []*Location
+
+ for _, s := range p.Sample {
+ for _, l := range s.Location {
+ if seen[l] {
+ continue
+ }
+ l.ID = uint64(len(locs) + 1)
+ locs = append(locs, l)
+ seen[l] = true
+ }
+ }
+ p.Location = locs
+}
+
+func (p *Profile) remapFunctionIDs() {
+ seen := make(map[*Function]bool, len(p.Function))
+ var fns []*Function
+
+ for _, l := range p.Location {
+ for _, ln := range l.Line {
+ fn := ln.Function
+ if fn == nil || seen[fn] {
+ continue
+ }
+ fn.ID = uint64(len(fns) + 1)
+ fns = append(fns, fn)
+ seen[fn] = true
+ }
+ }
+ p.Function = fns
+}
+
+// remapMappingIDs matches location addresses with existing mappings
+// and updates them appropriately. This is O(N*M), if this ever shows
+// up as a bottleneck, evaluate sorting the mappings and doing a
+// binary search, which would make it O(N*log(M)).
+func (p *Profile) remapMappingIDs() {
+ // Some profile handlers will incorrectly set regions for the main
+ // executable if its section is remapped. Fix them through heuristics.
+
+ if len(p.Mapping) > 0 {
+ // Remove the initial mapping if named '/anon_hugepage' and has a
+ // consecutive adjacent mapping.
+ if m := p.Mapping[0]; strings.HasPrefix(m.File, "/anon_hugepage") {
+ if len(p.Mapping) > 1 && m.Limit == p.Mapping[1].Start {
+ p.Mapping = p.Mapping[1:]
+ }
+ }
+ }
+
+ // Subtract the offset from the start of the main mapping if it
+ // ends up at a recognizable start address.
+ if len(p.Mapping) > 0 {
+ const expectedStart = 0x400000
+ if m := p.Mapping[0]; m.Start-m.Offset == expectedStart {
+ m.Start = expectedStart
+ m.Offset = 0
+ }
+ }
+
+ // Associate each location with an address to the corresponding
+ // mapping. Create fake mapping if a suitable one isn't found.
+ var fake *Mapping
+nextLocation:
+ for _, l := range p.Location {
+ a := l.Address
+ if l.Mapping != nil || a == 0 {
+ continue
+ }
+ for _, m := range p.Mapping {
+ if m.Start <= a && a < m.Limit {
+ l.Mapping = m
+ continue nextLocation
+ }
+ }
+ // Work around legacy handlers failing to encode the first
+ // part of mappings split into adjacent ranges.
+ for _, m := range p.Mapping {
+ if m.Offset != 0 && m.Start-m.Offset <= a && a < m.Start {
+ m.Start -= m.Offset
+ m.Offset = 0
+ l.Mapping = m
+ continue nextLocation
+ }
+ }
+ // If there is still no mapping, create a fake one.
+ // This is important for the Go legacy handler, which produced
+ // no mappings.
+ if fake == nil {
+ fake = &Mapping{
+ ID: 1,
+ Limit: ^uint64(0),
+ }
+ p.Mapping = append(p.Mapping, fake)
+ }
+ l.Mapping = fake
+ }
+
+ // Reset all mapping IDs.
+ for i, m := range p.Mapping {
+ m.ID = uint64(i + 1)
+ }
+}
+
+var cpuInts = []func([]byte) (uint64, []byte){
+ get32l,
+ get32b,
+ get64l,
+ get64b,
+}
+
+func get32l(b []byte) (uint64, []byte) {
+ if len(b) < 4 {
+ return 0, nil
+ }
+ return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24, b[4:]
+}
+
+func get32b(b []byte) (uint64, []byte) {
+ if len(b) < 4 {
+ return 0, nil
+ }
+ return uint64(b[3]) | uint64(b[2])<<8 | uint64(b[1])<<16 | uint64(b[0])<<24, b[4:]
+}
+
+func get64l(b []byte) (uint64, []byte) {
+ if len(b) < 8 {
+ return 0, nil
+ }
+ return 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, b[8:]
+}
+
+func get64b(b []byte) (uint64, []byte) {
+ if len(b) < 8 {
+ return 0, nil
+ }
+ return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 | uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56, b[8:]
+}
+
+// parseCPU parses a profilez legacy profile and returns a newly
+// populated Profile.
+//
+// The general format for profilez samples is a sequence of words in
+// binary format. The first words are a header with the following data:
+//
+// 1st word -- 0
+// 2nd word -- 3
+// 3rd word -- 0 if a c++ application, 1 if a java application.
+// 4th word -- Sampling period (in microseconds).
+// 5th word -- Padding.
+func parseCPU(b []byte) (*Profile, error) {
+ var parse func([]byte) (uint64, []byte)
+ var n1, n2, n3, n4, n5 uint64
+ for _, parse = range cpuInts {
+ var tmp []byte
+ n1, tmp = parse(b)
+ n2, tmp = parse(tmp)
+ n3, tmp = parse(tmp)
+ n4, tmp = parse(tmp)
+ n5, tmp = parse(tmp)
+
+ if tmp != nil && n1 == 0 && n2 == 3 && n3 == 0 && n4 > 0 && n5 == 0 {
+ b = tmp
+ return cpuProfile(b, int64(n4), parse)
+ }
+ if tmp != nil && n1 == 0 && n2 == 3 && n3 == 1 && n4 > 0 && n5 == 0 {
+ b = tmp
+ return javaCPUProfile(b, int64(n4), parse)
+ }
+ }
+ return nil, errUnrecognized
+}
+
+// cpuProfile returns a new Profile from C++ profilez data.
+// b is the profile bytes after the header, period is the profiling
+// period, and parse is a function to parse 8-byte chunks from the
+// profile in its native endianness.
+func cpuProfile(b []byte, period int64, parse func(b []byte) (uint64, []byte)) (*Profile, error) {
+ p := &Profile{
+ Period: period * 1000,
+ PeriodType: &ValueType{Type: "cpu", Unit: "nanoseconds"},
+ SampleType: []*ValueType{
+ {Type: "samples", Unit: "count"},
+ {Type: "cpu", Unit: "nanoseconds"},
+ },
+ }
+ var err error
+ if b, _, err = parseCPUSamples(b, parse, true, p); err != nil {
+ return nil, err
+ }
+
+ // If *most* samples have the same second-to-the-bottom frame, it
+ // strongly suggests that it is an uninteresting artifact of
+ // measurement -- a stack frame pushed by the signal handler. The
+ // bottom frame is always correct as it is picked up from the signal
+ // structure, not the stack. Check if this is the case and if so,
+ // remove.
+
+ // Remove up to two frames.
+ maxiter := 2
+ // Allow one different sample for this many samples with the same
+ // second-to-last frame.
+ similarSamples := 32
+ margin := len(p.Sample) / similarSamples
+
+ for iter := 0; iter < maxiter; iter++ {
+ addr1 := make(map[uint64]int)
+ for _, s := range p.Sample {
+ if len(s.Location) > 1 {
+ a := s.Location[1].Address
+ addr1[a] = addr1[a] + 1
+ }
+ }
+
+ for id1, count := range addr1 {
+ if count >= len(p.Sample)-margin {
+ // Found uninteresting frame, strip it out from all samples
+ for _, s := range p.Sample {
+ if len(s.Location) > 1 && s.Location[1].Address == id1 {
+ s.Location = append(s.Location[:1], s.Location[2:]...)
+ }
+ }
+ break
+ }
+ }
+ }
+
+ if err := p.ParseMemoryMap(bytes.NewBuffer(b)); err != nil {
+ return nil, err
+ }
+
+ cleanupDuplicateLocations(p)
+ return p, nil
+}
+
+func cleanupDuplicateLocations(p *Profile) {
+ // The profile handler may duplicate the leaf frame, because it gets
+ // its address both from stack unwinding and from the signal
+ // context. Detect this and delete the duplicate, which has been
+ // adjusted by -1. The leaf address should not be adjusted as it is
+ // not a call.
+ for _, s := range p.Sample {
+ if len(s.Location) > 1 && s.Location[0].Address == s.Location[1].Address+1 {
+ s.Location = append(s.Location[:1], s.Location[2:]...)
+ }
+ }
+}
+
+// parseCPUSamples parses a collection of profilez samples from a
+// profile.
+//
+// profilez samples are a repeated sequence of stack frames of the
+// form:
+//
+// 1st word -- The number of times this stack was encountered.
+// 2nd word -- The size of the stack (StackSize).
+// 3rd word -- The first address on the stack.
+// ...
+// StackSize + 2 -- The last address on the stack
+//
+// The last stack trace is of the form:
+//
+// 1st word -- 0
+// 2nd word -- 1
+// 3rd word -- 0
+//
+// Addresses from stack traces may point to the next instruction after
+// each call. Optionally adjust by -1 to land somewhere on the actual
+// call (except for the leaf, which is not a call).
+func parseCPUSamples(b []byte, parse func(b []byte) (uint64, []byte), adjust bool, p *Profile) ([]byte, map[uint64]*Location, error) {
+ locs := make(map[uint64]*Location)
+ for len(b) > 0 {
+ var count, nstk uint64
+ count, b = parse(b)
+ nstk, b = parse(b)
+ if b == nil || nstk > uint64(len(b)/4) {
+ return nil, nil, errUnrecognized
+ }
+ var sloc []*Location
+ addrs := make([]uint64, nstk)
+ for i := 0; i < int(nstk); i++ {
+ addrs[i], b = parse(b)
+ }
+
+ if count == 0 && nstk == 1 && addrs[0] == 0 {
+ // End of data marker
+ break
+ }
+ for i, addr := range addrs {
+ if adjust && i > 0 {
+ addr--
+ }
+ loc := locs[addr]
+ if loc == nil {
+ loc = &Location{
+ Address: addr,
+ }
+ locs[addr] = loc
+ p.Location = append(p.Location, loc)
+ }
+ sloc = append(sloc, loc)
+ }
+ p.Sample = append(p.Sample,
+ &Sample{
+ Value: []int64{int64(count), int64(count) * p.Period},
+ Location: sloc,
+ })
+ }
+ // Reached the end without finding the EOD marker.
+ return b, locs, nil
+}
+
+// parseHeap parses a heapz legacy or a growthz profile and
+// returns a newly populated Profile.
+func parseHeap(b []byte) (p *Profile, err error) {
+ s := bufio.NewScanner(bytes.NewBuffer(b))
+ if !s.Scan() {
+ if err := s.Err(); err != nil {
+ return nil, err
+ }
+ return nil, errUnrecognized
+ }
+ p = &Profile{}
+
+ sampling := ""
+ hasAlloc := false
+
+ line := s.Text()
+ p.PeriodType = &ValueType{Type: "space", Unit: "bytes"}
+ if header := heapHeaderRE.FindStringSubmatch(line); header != nil {
+ sampling, p.Period, hasAlloc, err = parseHeapHeader(line)
+ if err != nil {
+ return nil, err
+ }
+ } else if header = growthHeaderRE.FindStringSubmatch(line); header != nil {
+ p.Period = 1
+ } else if header = fragmentationHeaderRE.FindStringSubmatch(line); header != nil {
+ p.Period = 1
+ } else {
+ return nil, errUnrecognized
+ }
+
+ if hasAlloc {
+ // Put alloc before inuse so that default pprof selection
+ // will prefer inuse_space.
+ p.SampleType = []*ValueType{
+ {Type: "alloc_objects", Unit: "count"},
+ {Type: "alloc_space", Unit: "bytes"},
+ {Type: "inuse_objects", Unit: "count"},
+ {Type: "inuse_space", Unit: "bytes"},
+ }
+ } else {
+ p.SampleType = []*ValueType{
+ {Type: "objects", Unit: "count"},
+ {Type: "space", Unit: "bytes"},
+ }
+ }
+
+ locs := make(map[uint64]*Location)
+ for s.Scan() {
+ line := strings.TrimSpace(s.Text())
+
+ if isSpaceOrComment(line) {
+ continue
+ }
+
+ if isMemoryMapSentinel(line) {
+ break
+ }
+
+ value, blocksize, addrs, err := parseHeapSample(line, p.Period, sampling, hasAlloc)
+ if err != nil {
+ return nil, err
+ }
+
+ var sloc []*Location
+ for _, addr := range addrs {
+ // Addresses from stack traces point to the next instruction after
+ // each call. Adjust by -1 to land somewhere on the actual call.
+ addr--
+ loc := locs[addr]
+ if locs[addr] == nil {
+ loc = &Location{
+ Address: addr,
+ }
+ p.Location = append(p.Location, loc)
+ locs[addr] = loc
+ }
+ sloc = append(sloc, loc)
+ }
+
+ p.Sample = append(p.Sample, &Sample{
+ Value: value,
+ Location: sloc,
+ NumLabel: map[string][]int64{"bytes": {blocksize}},
+ })
+ }
+ if err := s.Err(); err != nil {
+ return nil, err
+ }
+ if err := parseAdditionalSections(s, p); err != nil {
+ return nil, err
+ }
+ return p, nil
+}
+
+func parseHeapHeader(line string) (sampling string, period int64, hasAlloc bool, err error) {
+ header := heapHeaderRE.FindStringSubmatch(line)
+ if header == nil {
+ return "", 0, false, errUnrecognized
+ }
+
+ if len(header[6]) > 0 {
+ if period, err = strconv.ParseInt(header[6], 10, 64); err != nil {
+ return "", 0, false, errUnrecognized
+ }
+ }
+
+ if (header[3] != header[1] && header[3] != "0") || (header[4] != header[2] && header[4] != "0") {
+ hasAlloc = true
+ }
+
+ switch header[5] {
+ case "heapz_v2", "heap_v2":
+ return "v2", period, hasAlloc, nil
+ case "heapprofile":
+ return "", 1, hasAlloc, nil
+ case "heap":
+ return "v2", period / 2, hasAlloc, nil
+ default:
+ return "", 0, false, errUnrecognized
+ }
+}
+
+// parseHeapSample parses a single row from a heap profile into a new Sample.
+func parseHeapSample(line string, rate int64, sampling string, includeAlloc bool) (value []int64, blocksize int64, addrs []uint64, err error) {
+ sampleData := heapSampleRE.FindStringSubmatch(line)
+ if len(sampleData) != 6 {
+ return nil, 0, nil, fmt.Errorf("unexpected number of sample values: got %d, want 6", len(sampleData))
+ }
+
+ // This is a local-scoped helper function to avoid needing to pass
+ // around rate, sampling and many return parameters.
+ addValues := func(countString, sizeString string, label string) error {
+ count, err := strconv.ParseInt(countString, 10, 64)
+ if err != nil {
+ return fmt.Errorf("malformed sample: %s: %v", line, err)
+ }
+ size, err := strconv.ParseInt(sizeString, 10, 64)
+ if err != nil {
+ return fmt.Errorf("malformed sample: %s: %v", line, err)
+ }
+ if count == 0 && size != 0 {
+ return fmt.Errorf("%s count was 0 but %s bytes was %d", label, label, size)
+ }
+ if count != 0 {
+ blocksize = size / count
+ if sampling == "v2" {
+ count, size = scaleHeapSample(count, size, rate)
+ }
+ }
+ value = append(value, count, size)
+ return nil
+ }
+
+ if includeAlloc {
+ if err := addValues(sampleData[3], sampleData[4], "allocation"); err != nil {
+ return nil, 0, nil, err
+ }
+ }
+
+ if err := addValues(sampleData[1], sampleData[2], "inuse"); err != nil {
+ return nil, 0, nil, err
+ }
+
+ addrs, err = parseHexAddresses(sampleData[5])
+ if err != nil {
+ return nil, 0, nil, fmt.Errorf("malformed sample: %s: %v", line, err)
+ }
+
+ return value, blocksize, addrs, nil
+}
+
+// parseHexAddresses extracts hex numbers from a string, attempts to convert
+// each to an unsigned 64-bit number and returns the resulting numbers as a
+// slice, or an error if the string contains hex numbers which are too large to
+// handle (which means a malformed profile).
+func parseHexAddresses(s string) ([]uint64, error) {
+ hexStrings := hexNumberRE.FindAllString(s, -1)
+ var addrs []uint64
+ for _, s := range hexStrings {
+ if addr, err := strconv.ParseUint(s, 0, 64); err == nil {
+ addrs = append(addrs, addr)
+ } else {
+ return nil, fmt.Errorf("failed to parse as hex 64-bit number: %s", s)
+ }
+ }
+ return addrs, nil
+}
+
+// scaleHeapSample adjusts the data from a heapz Sample to
+// account for its probability of appearing in the collected
+// data. heapz profiles are a sampling of the memory allocations
+// requests in a program. We estimate the unsampled value by dividing
+// each collected sample by its probability of appearing in the
+// profile. heapz v2 profiles rely on a poisson process to determine
+// which samples to collect, based on the desired average collection
+// rate R. The probability of a sample of size S to appear in that
+// profile is 1-exp(-S/R).
+func scaleHeapSample(count, size, rate int64) (int64, int64) {
+ if count == 0 || size == 0 {
+ return 0, 0
+ }
+
+ if rate <= 1 {
+ // if rate==1 all samples were collected so no adjustment is needed.
+ // if rate<1 treat as unknown and skip scaling.
+ return count, size
+ }
+
+ avgSize := float64(size) / float64(count)
+ scale := 1 / (1 - math.Exp(-avgSize/float64(rate)))
+
+ return int64(float64(count) * scale), int64(float64(size) * scale)
+}
+
+// parseContention parses a mutex or contention profile. There are 2 cases:
+// "--- contentionz " for legacy C++ profiles (and backwards compatibility)
+// "--- mutex:" or "--- contention:" for profiles generated by the Go runtime.
+func parseContention(b []byte) (*Profile, error) {
+ s := bufio.NewScanner(bytes.NewBuffer(b))
+ if !s.Scan() {
+ if err := s.Err(); err != nil {
+ return nil, err
+ }
+ return nil, errUnrecognized
+ }
+
+ switch l := s.Text(); {
+ case strings.HasPrefix(l, "--- contentionz "):
+ case strings.HasPrefix(l, "--- mutex:"):
+ case strings.HasPrefix(l, "--- contention:"):
+ default:
+ return nil, errUnrecognized
+ }
+
+ p := &Profile{
+ PeriodType: &ValueType{Type: "contentions", Unit: "count"},
+ Period: 1,
+ SampleType: []*ValueType{
+ {Type: "contentions", Unit: "count"},
+ {Type: "delay", Unit: "nanoseconds"},
+ },
+ }
+
+ var cpuHz int64
+ // Parse text of the form "attribute = value" before the samples.
+ const delimiter = "="
+ for s.Scan() {
+ line := s.Text()
+ if line = strings.TrimSpace(line); isSpaceOrComment(line) {
+ continue
+ }
+ if strings.HasPrefix(line, "---") {
+ break
+ }
+ attr := strings.SplitN(line, delimiter, 2)
+ if len(attr) != 2 {
+ break
+ }
+ key, val := strings.TrimSpace(attr[0]), strings.TrimSpace(attr[1])
+ var err error
+ switch key {
+ case "cycles/second":
+ if cpuHz, err = strconv.ParseInt(val, 0, 64); err != nil {
+ return nil, errUnrecognized
+ }
+ case "sampling period":
+ if p.Period, err = strconv.ParseInt(val, 0, 64); err != nil {
+ return nil, errUnrecognized
+ }
+ case "ms since reset":
+ ms, err := strconv.ParseInt(val, 0, 64)
+ if err != nil {
+ return nil, errUnrecognized
+ }
+ p.DurationNanos = ms * 1000 * 1000
+ case "format":
+ // CPP contentionz profiles don't have format.
+ return nil, errUnrecognized
+ case "resolution":
+ // CPP contentionz profiles don't have resolution.
+ return nil, errUnrecognized
+ case "discarded samples":
+ default:
+ return nil, errUnrecognized
+ }
+ }
+ if err := s.Err(); err != nil {
+ return nil, err
+ }
+
+ locs := make(map[uint64]*Location)
+ for {
+ line := strings.TrimSpace(s.Text())
+ if strings.HasPrefix(line, "---") {
+ break
+ }
+ if !isSpaceOrComment(line) {
+ value, addrs, err := parseContentionSample(line, p.Period, cpuHz)
+ if err != nil {
+ return nil, err
+ }
+ var sloc []*Location
+ for _, addr := range addrs {
+ // Addresses from stack traces point to the next instruction after
+ // each call. Adjust by -1 to land somewhere on the actual call.
+ addr--
+ loc := locs[addr]
+ if locs[addr] == nil {
+ loc = &Location{
+ Address: addr,
+ }
+ p.Location = append(p.Location, loc)
+ locs[addr] = loc
+ }
+ sloc = append(sloc, loc)
+ }
+ p.Sample = append(p.Sample, &Sample{
+ Value: value,
+ Location: sloc,
+ })
+ }
+ if !s.Scan() {
+ break
+ }
+ }
+ if err := s.Err(); err != nil {
+ return nil, err
+ }
+
+ if err := parseAdditionalSections(s, p); err != nil {
+ return nil, err
+ }
+
+ return p, nil
+}
+
+// parseContentionSample parses a single row from a contention profile
+// into a new Sample.
+func parseContentionSample(line string, period, cpuHz int64) (value []int64, addrs []uint64, err error) {
+ sampleData := contentionSampleRE.FindStringSubmatch(line)
+ if sampleData == nil {
+ return nil, nil, errUnrecognized
+ }
+
+ v1, err := strconv.ParseInt(sampleData[1], 10, 64)
+ if err != nil {
+ return nil, nil, fmt.Errorf("malformed sample: %s: %v", line, err)
+ }
+ v2, err := strconv.ParseInt(sampleData[2], 10, 64)
+ if err != nil {
+ return nil, nil, fmt.Errorf("malformed sample: %s: %v", line, err)
+ }
+
+ // Unsample values if period and cpuHz are available.
+ // - Delays are scaled to cycles and then to nanoseconds.
+ // - Contentions are scaled to cycles.
+ if period > 0 {
+ if cpuHz > 0 {
+ cpuGHz := float64(cpuHz) / 1e9
+ v1 = int64(float64(v1) * float64(period) / cpuGHz)
+ }
+ v2 = v2 * period
+ }
+
+ value = []int64{v2, v1}
+ addrs, err = parseHexAddresses(sampleData[3])
+ if err != nil {
+ return nil, nil, fmt.Errorf("malformed sample: %s: %v", line, err)
+ }
+
+ return value, addrs, nil
+}
+
+// parseThread parses a Threadz profile and returns a new Profile.
+func parseThread(b []byte) (*Profile, error) {
+ s := bufio.NewScanner(bytes.NewBuffer(b))
+ // Skip past comments and empty lines seeking a real header.
+ for s.Scan() && isSpaceOrComment(s.Text()) {
+ }
+
+ line := s.Text()
+ if m := threadzStartRE.FindStringSubmatch(line); m != nil {
+ // Advance over initial comments until first stack trace.
+ for s.Scan() {
+ if line = s.Text(); isMemoryMapSentinel(line) || strings.HasPrefix(line, "-") {
+ break
+ }
+ }
+ } else if t := threadStartRE.FindStringSubmatch(line); len(t) != 4 {
+ return nil, errUnrecognized
+ }
+
+ p := &Profile{
+ SampleType: []*ValueType{{Type: "thread", Unit: "count"}},
+ PeriodType: &ValueType{Type: "thread", Unit: "count"},
+ Period: 1,
+ }
+
+ locs := make(map[uint64]*Location)
+ // Recognize each thread and populate profile samples.
+ for !isMemoryMapSentinel(line) {
+ if strings.HasPrefix(line, "---- no stack trace for") {
+ break
+ }
+ if t := threadStartRE.FindStringSubmatch(line); len(t) != 4 {
+ return nil, errUnrecognized
+ }
+
+ var addrs []uint64
+ var err error
+ line, addrs, err = parseThreadSample(s)
+ if err != nil {
+ return nil, err
+ }
+ if len(addrs) == 0 {
+ // We got a --same as previous threads--. Bump counters.
+ if len(p.Sample) > 0 {
+ s := p.Sample[len(p.Sample)-1]
+ s.Value[0]++
+ }
+ continue
+ }
+
+ var sloc []*Location
+ for i, addr := range addrs {
+ // Addresses from stack traces point to the next instruction after
+ // each call. Adjust by -1 to land somewhere on the actual call
+ // (except for the leaf, which is not a call).
+ if i > 0 {
+ addr--
+ }
+ loc := locs[addr]
+ if locs[addr] == nil {
+ loc = &Location{
+ Address: addr,
+ }
+ p.Location = append(p.Location, loc)
+ locs[addr] = loc
+ }
+ sloc = append(sloc, loc)
+ }
+
+ p.Sample = append(p.Sample, &Sample{
+ Value: []int64{1},
+ Location: sloc,
+ })
+ }
+
+ if err := parseAdditionalSections(s, p); err != nil {
+ return nil, err
+ }
+
+ cleanupDuplicateLocations(p)
+ return p, nil
+}
+
+// parseThreadSample parses a symbolized or unsymbolized stack trace.
+// Returns the first line after the traceback, the sample (or nil if
+// it hits a 'same-as-previous' marker) and an error.
+func parseThreadSample(s *bufio.Scanner) (nextl string, addrs []uint64, err error) {
+ var line string
+ sameAsPrevious := false
+ for s.Scan() {
+ line = strings.TrimSpace(s.Text())
+ if line == "" {
+ continue
+ }
+
+ if strings.HasPrefix(line, "---") {
+ break
+ }
+ if strings.Contains(line, "same as previous thread") {
+ sameAsPrevious = true
+ continue
+ }
+
+ curAddrs, err := parseHexAddresses(line)
+ if err != nil {
+ return "", nil, fmt.Errorf("malformed sample: %s: %v", line, err)
+ }
+ addrs = append(addrs, curAddrs...)
+ }
+ if err := s.Err(); err != nil {
+ return "", nil, err
+ }
+ if sameAsPrevious {
+ return line, nil, nil
+ }
+ return line, addrs, nil
+}
+
+// parseAdditionalSections parses any additional sections in the
+// profile, ignoring any unrecognized sections.
+func parseAdditionalSections(s *bufio.Scanner, p *Profile) error {
+ for !isMemoryMapSentinel(s.Text()) && s.Scan() {
+ }
+ if err := s.Err(); err != nil {
+ return err
+ }
+ return p.ParseMemoryMapFromScanner(s)
+}
+
+// ParseProcMaps parses a memory map in the format of /proc/self/maps.
+// ParseMemoryMap should be called after setting on a profile to
+// associate locations to the corresponding mapping based on their
+// address.
+func ParseProcMaps(rd io.Reader) ([]*Mapping, error) {
+ s := bufio.NewScanner(rd)
+ return parseProcMapsFromScanner(s)
+}
+
+func parseProcMapsFromScanner(s *bufio.Scanner) ([]*Mapping, error) {
+ var mapping []*Mapping
+
+ var attrs []string
+ const delimiter = "="
+ r := strings.NewReplacer()
+ for s.Scan() {
+ line := r.Replace(removeLoggingInfo(s.Text()))
+ m, err := parseMappingEntry(line)
+ if err != nil {
+ if err == errUnrecognized {
+ // Recognize assignments of the form: attr=value, and replace
+ // $attr with value on subsequent mappings.
+ if attr := strings.SplitN(line, delimiter, 2); len(attr) == 2 {
+ attrs = append(attrs, "$"+strings.TrimSpace(attr[0]), strings.TrimSpace(attr[1]))
+ r = strings.NewReplacer(attrs...)
+ }
+ // Ignore any unrecognized entries
+ continue
+ }
+ return nil, err
+ }
+ if m == nil {
+ continue
+ }
+ mapping = append(mapping, m)
+ }
+ if err := s.Err(); err != nil {
+ return nil, err
+ }
+ return mapping, nil
+}
+
+// removeLoggingInfo detects and removes log prefix entries generated
+// by the glog package. If no logging prefix is detected, the string
+// is returned unmodified.
+func removeLoggingInfo(line string) string {
+ if match := logInfoRE.FindStringIndex(line); match != nil {
+ return line[match[1]:]
+ }
+ return line
+}
+
+// ParseMemoryMap parses a memory map in the format of
+// /proc/self/maps, and overrides the mappings in the current profile.
+// It renumbers the samples and locations in the profile correspondingly.
+func (p *Profile) ParseMemoryMap(rd io.Reader) error {
+ return p.ParseMemoryMapFromScanner(bufio.NewScanner(rd))
+}
+
+// ParseMemoryMapFromScanner parses a memory map in the format of
+// /proc/self/maps or a variety of legacy format, and overrides the
+// mappings in the current profile. It renumbers the samples and
+// locations in the profile correspondingly.
+func (p *Profile) ParseMemoryMapFromScanner(s *bufio.Scanner) error {
+ mapping, err := parseProcMapsFromScanner(s)
+ if err != nil {
+ return err
+ }
+ p.Mapping = append(p.Mapping, mapping...)
+ p.massageMappings()
+ p.remapLocationIDs()
+ p.remapFunctionIDs()
+ p.remapMappingIDs()
+ return nil
+}
+
+func parseMappingEntry(l string) (*Mapping, error) {
+ var start, end, perm, file, offset, buildID string
+ if me := procMapsRE.FindStringSubmatch(l); len(me) == 6 {
+ start, end, perm, offset, file = me[1], me[2], me[3], me[4], me[5]
+ } else if me := briefMapsRE.FindStringSubmatch(l); len(me) == 7 {
+ start, end, perm, file, offset, buildID = me[1], me[2], me[3], me[4], me[5], me[6]
+ } else {
+ return nil, errUnrecognized
+ }
+
+ var err error
+ mapping := &Mapping{
+ File: file,
+ BuildID: buildID,
+ }
+ if perm != "" && !strings.Contains(perm, "x") {
+ // Skip non-executable entries.
+ return nil, nil
+ }
+ if mapping.Start, err = strconv.ParseUint(start, 16, 64); err != nil {
+ return nil, errUnrecognized
+ }
+ if mapping.Limit, err = strconv.ParseUint(end, 16, 64); err != nil {
+ return nil, errUnrecognized
+ }
+ if offset != "" {
+ if mapping.Offset, err = strconv.ParseUint(offset, 16, 64); err != nil {
+ return nil, errUnrecognized
+ }
+ }
+ return mapping, nil
+}
+
+var memoryMapSentinels = []string{
+ "--- Memory map: ---",
+ "MAPPED_LIBRARIES:",
+}
+
+// isMemoryMapSentinel returns true if the string contains one of the
+// known sentinels for memory map information.
+func isMemoryMapSentinel(line string) bool {
+ for _, s := range memoryMapSentinels {
+ if strings.Contains(line, s) {
+ return true
+ }
+ }
+ return false
+}
+
+func (p *Profile) addLegacyFrameInfo() {
+ switch {
+ case isProfileType(p, heapzSampleTypes):
+ p.DropFrames, p.KeepFrames = allocRxStr, allocSkipRxStr
+ case isProfileType(p, contentionzSampleTypes):
+ p.DropFrames, p.KeepFrames = lockRxStr, ""
+ default:
+ p.DropFrames, p.KeepFrames = cpuProfilerRxStr, ""
+ }
+}
+
+var heapzSampleTypes = [][]string{
+ {"allocations", "size"}, // early Go pprof profiles
+ {"objects", "space"},
+ {"inuse_objects", "inuse_space"},
+ {"alloc_objects", "alloc_space"},
+ {"alloc_objects", "alloc_space", "inuse_objects", "inuse_space"}, // Go pprof legacy profiles
+}
+var contentionzSampleTypes = [][]string{
+ {"contentions", "delay"},
+}
+
+func isProfileType(p *Profile, types [][]string) bool {
+ st := p.SampleType
+nextType:
+ for _, t := range types {
+ if len(st) != len(t) {
+ continue
+ }
+
+ for i := range st {
+ if st[i].Type != t[i] {
+ continue nextType
+ }
+ }
+ return true
+ }
+ return false
+}
+
+var allocRxStr = strings.Join([]string{
+ // POSIX entry points.
+ `calloc`,
+ `cfree`,
+ `malloc`,
+ `free`,
+ `memalign`,
+ `do_memalign`,
+ `(__)?posix_memalign`,
+ `pvalloc`,
+ `valloc`,
+ `realloc`,
+
+ // TC malloc.
+ `tcmalloc::.*`,
+ `tc_calloc`,
+ `tc_cfree`,
+ `tc_malloc`,
+ `tc_free`,
+ `tc_memalign`,
+ `tc_posix_memalign`,
+ `tc_pvalloc`,
+ `tc_valloc`,
+ `tc_realloc`,
+ `tc_new`,
+ `tc_delete`,
+ `tc_newarray`,
+ `tc_deletearray`,
+ `tc_new_nothrow`,
+ `tc_newarray_nothrow`,
+
+ // Memory-allocation routines on OS X.
+ `malloc_zone_malloc`,
+ `malloc_zone_calloc`,
+ `malloc_zone_valloc`,
+ `malloc_zone_realloc`,
+ `malloc_zone_memalign`,
+ `malloc_zone_free`,
+
+ // Go runtime
+ `runtime\..*`,
+
+ // Other misc. memory allocation routines
+ `BaseArena::.*`,
+ `(::)?do_malloc_no_errno`,
+ `(::)?do_malloc_pages`,
+ `(::)?do_malloc`,
+ `DoSampledAllocation`,
+ `MallocedMemBlock::MallocedMemBlock`,
+ `_M_allocate`,
+ `__builtin_(vec_)?delete`,
+ `__builtin_(vec_)?new`,
+ `__gnu_cxx::new_allocator::allocate`,
+ `__libc_malloc`,
+ `__malloc_alloc_template::allocate`,
+ `allocate`,
+ `cpp_alloc`,
+ `operator new(\[\])?`,
+ `simple_alloc::allocate`,
+}, `|`)
+
+var allocSkipRxStr = strings.Join([]string{
+ // Preserve Go runtime frames that appear in the middle/bottom of
+ // the stack.
+ `runtime\.panic`,
+ `runtime\.reflectcall`,
+ `runtime\.call[0-9]*`,
+}, `|`)
+
+var cpuProfilerRxStr = strings.Join([]string{
+ `ProfileData::Add`,
+ `ProfileData::prof_handler`,
+ `CpuProfiler::prof_handler`,
+ `__pthread_sighandler`,
+ `__restore`,
+}, `|`)
+
+var lockRxStr = strings.Join([]string{
+ `RecordLockProfileData`,
+ `(base::)?RecordLockProfileData.*`,
+ `(base::)?SubmitMutexProfileData.*`,
+ `(base::)?SubmitSpinLockProfileData.*`,
+ `(base::Mutex::)?AwaitCommon.*`,
+ `(base::Mutex::)?Unlock.*`,
+ `(base::Mutex::)?UnlockSlow.*`,
+ `(base::Mutex::)?ReaderUnlock.*`,
+ `(base::MutexLock::)?~MutexLock.*`,
+ `(Mutex::)?AwaitCommon.*`,
+ `(Mutex::)?Unlock.*`,
+ `(Mutex::)?UnlockSlow.*`,
+ `(Mutex::)?ReaderUnlock.*`,
+ `(MutexLock::)?~MutexLock.*`,
+ `(SpinLock::)?Unlock.*`,
+ `(SpinLock::)?SlowUnlock.*`,
+ `(SpinLockHolder::)?~SpinLockHolder.*`,
+}, `|`)
diff --git a/vendor/github.com/google/pprof/profile/merge.go b/vendor/github.com/google/pprof/profile/merge.go
new file mode 100644
index 0000000000..eee0132e74
--- /dev/null
+++ b/vendor/github.com/google/pprof/profile/merge.go
@@ -0,0 +1,669 @@
+// Copyright 2014 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 profile
+
+import (
+ "encoding/binary"
+ "fmt"
+ "sort"
+ "strconv"
+ "strings"
+)
+
+// Compact performs garbage collection on a profile to remove any
+// unreferenced fields. This is useful to reduce the size of a profile
+// after samples or locations have been removed.
+func (p *Profile) Compact() *Profile {
+ p, _ = Merge([]*Profile{p})
+ return p
+}
+
+// Merge merges all the profiles in profs into a single Profile.
+// Returns a new profile independent of the input profiles. The merged
+// profile is compacted to eliminate unused samples, locations,
+// functions and mappings. Profiles must have identical profile sample
+// and period types or the merge will fail. profile.Period of the
+// resulting profile will be the maximum of all profiles, and
+// profile.TimeNanos will be the earliest nonzero one. Merges are
+// associative with the caveat of the first profile having some
+// specialization in how headers are combined. There may be other
+// subtleties now or in the future regarding associativity.
+func Merge(srcs []*Profile) (*Profile, error) {
+ if len(srcs) == 0 {
+ return nil, fmt.Errorf("no profiles to merge")
+ }
+ p, err := combineHeaders(srcs)
+ if err != nil {
+ return nil, err
+ }
+
+ pm := &profileMerger{
+ p: p,
+ samples: make(map[sampleKey]*Sample, len(srcs[0].Sample)),
+ locations: make(map[locationKey]*Location, len(srcs[0].Location)),
+ functions: make(map[functionKey]*Function, len(srcs[0].Function)),
+ mappings: make(map[mappingKey]*Mapping, len(srcs[0].Mapping)),
+ }
+
+ for _, src := range srcs {
+ // Clear the profile-specific hash tables
+ pm.locationsByID = makeLocationIDMap(len(src.Location))
+ pm.functionsByID = make(map[uint64]*Function, len(src.Function))
+ pm.mappingsByID = make(map[uint64]mapInfo, len(src.Mapping))
+
+ if len(pm.mappings) == 0 && len(src.Mapping) > 0 {
+ // The Mapping list has the property that the first mapping
+ // represents the main binary. Take the first Mapping we see,
+ // otherwise the operations below will add mappings in an
+ // arbitrary order.
+ pm.mapMapping(src.Mapping[0])
+ }
+
+ for _, s := range src.Sample {
+ if !isZeroSample(s) {
+ pm.mapSample(s)
+ }
+ }
+ }
+
+ for _, s := range p.Sample {
+ if isZeroSample(s) {
+ // If there are any zero samples, re-merge the profile to GC
+ // them.
+ return Merge([]*Profile{p})
+ }
+ }
+
+ return p, nil
+}
+
+// Normalize normalizes the source profile by multiplying each value in profile by the
+// ratio of the sum of the base profile's values of that sample type to the sum of the
+// source profile's value of that sample type.
+func (p *Profile) Normalize(pb *Profile) error {
+
+ if err := p.compatible(pb); err != nil {
+ return err
+ }
+
+ baseVals := make([]int64, len(p.SampleType))
+ for _, s := range pb.Sample {
+ for i, v := range s.Value {
+ baseVals[i] += v
+ }
+ }
+
+ srcVals := make([]int64, len(p.SampleType))
+ for _, s := range p.Sample {
+ for i, v := range s.Value {
+ srcVals[i] += v
+ }
+ }
+
+ normScale := make([]float64, len(baseVals))
+ for i := range baseVals {
+ if srcVals[i] == 0 {
+ normScale[i] = 0.0
+ } else {
+ normScale[i] = float64(baseVals[i]) / float64(srcVals[i])
+ }
+ }
+ p.ScaleN(normScale)
+ return nil
+}
+
+func isZeroSample(s *Sample) bool {
+ for _, v := range s.Value {
+ if v != 0 {
+ return false
+ }
+ }
+ return true
+}
+
+type profileMerger struct {
+ p *Profile
+
+ // Memoization tables within a profile.
+ locationsByID locationIDMap
+ functionsByID map[uint64]*Function
+ mappingsByID map[uint64]mapInfo
+
+ // Memoization tables for profile entities.
+ samples map[sampleKey]*Sample
+ locations map[locationKey]*Location
+ functions map[functionKey]*Function
+ mappings map[mappingKey]*Mapping
+}
+
+type mapInfo struct {
+ m *Mapping
+ offset int64
+}
+
+func (pm *profileMerger) mapSample(src *Sample) *Sample {
+ // Check memoization table
+ k := pm.sampleKey(src)
+ if ss, ok := pm.samples[k]; ok {
+ for i, v := range src.Value {
+ ss.Value[i] += v
+ }
+ return ss
+ }
+
+ // Make new sample.
+ s := &Sample{
+ Location: make([]*Location, len(src.Location)),
+ Value: make([]int64, len(src.Value)),
+ Label: make(map[string][]string, len(src.Label)),
+ NumLabel: make(map[string][]int64, len(src.NumLabel)),
+ NumUnit: make(map[string][]string, len(src.NumLabel)),
+ }
+ for i, l := range src.Location {
+ s.Location[i] = pm.mapLocation(l)
+ }
+ for k, v := range src.Label {
+ vv := make([]string, len(v))
+ copy(vv, v)
+ s.Label[k] = vv
+ }
+ for k, v := range src.NumLabel {
+ u := src.NumUnit[k]
+ vv := make([]int64, len(v))
+ uu := make([]string, len(u))
+ copy(vv, v)
+ copy(uu, u)
+ s.NumLabel[k] = vv
+ s.NumUnit[k] = uu
+ }
+ copy(s.Value, src.Value)
+ pm.samples[k] = s
+ pm.p.Sample = append(pm.p.Sample, s)
+ return s
+}
+
+func (pm *profileMerger) sampleKey(sample *Sample) sampleKey {
+ // Accumulate contents into a string.
+ var buf strings.Builder
+ buf.Grow(64) // Heuristic to avoid extra allocs
+
+ // encode a number
+ putNumber := func(v uint64) {
+ var num [binary.MaxVarintLen64]byte
+ n := binary.PutUvarint(num[:], v)
+ buf.Write(num[:n])
+ }
+
+ // encode a string prefixed with its length.
+ putDelimitedString := func(s string) {
+ putNumber(uint64(len(s)))
+ buf.WriteString(s)
+ }
+
+ for _, l := range sample.Location {
+ // Get the location in the merged profile, which may have a different ID.
+ if loc := pm.mapLocation(l); loc != nil {
+ putNumber(loc.ID)
+ }
+ }
+ putNumber(0) // Delimiter
+
+ for _, l := range sortedKeys1(sample.Label) {
+ putDelimitedString(l)
+ values := sample.Label[l]
+ putNumber(uint64(len(values)))
+ for _, v := range values {
+ putDelimitedString(v)
+ }
+ }
+
+ for _, l := range sortedKeys2(sample.NumLabel) {
+ putDelimitedString(l)
+ values := sample.NumLabel[l]
+ putNumber(uint64(len(values)))
+ for _, v := range values {
+ putNumber(uint64(v))
+ }
+ units := sample.NumUnit[l]
+ putNumber(uint64(len(units)))
+ for _, v := range units {
+ putDelimitedString(v)
+ }
+ }
+
+ return sampleKey(buf.String())
+}
+
+type sampleKey string
+
+// sortedKeys1 returns the sorted keys found in a string->[]string map.
+//
+// Note: this is currently non-generic since github pprof runs golint,
+// which does not support generics. When that issue is fixed, it can
+// be merged with sortedKeys2 and made into a generic function.
+func sortedKeys1(m map[string][]string) []string {
+ if len(m) == 0 {
+ return nil
+ }
+ keys := make([]string, 0, len(m))
+ for k := range m {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+ return keys
+}
+
+// sortedKeys2 returns the sorted keys found in a string->[]int64 map.
+//
+// Note: this is currently non-generic since github pprof runs golint,
+// which does not support generics. When that issue is fixed, it can
+// be merged with sortedKeys1 and made into a generic function.
+func sortedKeys2(m map[string][]int64) []string {
+ if len(m) == 0 {
+ return nil
+ }
+ keys := make([]string, 0, len(m))
+ for k := range m {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+ return keys
+}
+
+func (pm *profileMerger) mapLocation(src *Location) *Location {
+ if src == nil {
+ return nil
+ }
+
+ if l := pm.locationsByID.get(src.ID); l != nil {
+ return l
+ }
+
+ mi := pm.mapMapping(src.Mapping)
+ l := &Location{
+ ID: uint64(len(pm.p.Location) + 1),
+ Mapping: mi.m,
+ Address: uint64(int64(src.Address) + mi.offset),
+ Line: make([]Line, len(src.Line)),
+ IsFolded: src.IsFolded,
+ }
+ for i, ln := range src.Line {
+ l.Line[i] = pm.mapLine(ln)
+ }
+ // Check memoization table. Must be done on the remapped location to
+ // account for the remapped mapping ID.
+ k := l.key()
+ if ll, ok := pm.locations[k]; ok {
+ pm.locationsByID.set(src.ID, ll)
+ return ll
+ }
+ pm.locationsByID.set(src.ID, l)
+ pm.locations[k] = l
+ pm.p.Location = append(pm.p.Location, l)
+ return l
+}
+
+// key generates locationKey to be used as a key for maps.
+func (l *Location) key() locationKey {
+ key := locationKey{
+ addr: l.Address,
+ isFolded: l.IsFolded,
+ }
+ if l.Mapping != nil {
+ // Normalizes address to handle address space randomization.
+ key.addr -= l.Mapping.Start
+ key.mappingID = l.Mapping.ID
+ }
+ lines := make([]string, len(l.Line)*3)
+ for i, line := range l.Line {
+ if line.Function != nil {
+ lines[i*2] = strconv.FormatUint(line.Function.ID, 16)
+ }
+ lines[i*2+1] = strconv.FormatInt(line.Line, 16)
+ lines[i*2+2] = strconv.FormatInt(line.Column, 16)
+ }
+ key.lines = strings.Join(lines, "|")
+ return key
+}
+
+type locationKey struct {
+ addr, mappingID uint64
+ lines string
+ isFolded bool
+}
+
+func (pm *profileMerger) mapMapping(src *Mapping) mapInfo {
+ if src == nil {
+ return mapInfo{}
+ }
+
+ if mi, ok := pm.mappingsByID[src.ID]; ok {
+ return mi
+ }
+
+ // Check memoization tables.
+ mk := src.key()
+ if m, ok := pm.mappings[mk]; ok {
+ mi := mapInfo{m, int64(m.Start) - int64(src.Start)}
+ pm.mappingsByID[src.ID] = mi
+ return mi
+ }
+ m := &Mapping{
+ ID: uint64(len(pm.p.Mapping) + 1),
+ Start: src.Start,
+ Limit: src.Limit,
+ Offset: src.Offset,
+ File: src.File,
+ KernelRelocationSymbol: src.KernelRelocationSymbol,
+ BuildID: src.BuildID,
+ HasFunctions: src.HasFunctions,
+ HasFilenames: src.HasFilenames,
+ HasLineNumbers: src.HasLineNumbers,
+ HasInlineFrames: src.HasInlineFrames,
+ }
+ pm.p.Mapping = append(pm.p.Mapping, m)
+
+ // Update memoization tables.
+ pm.mappings[mk] = m
+ mi := mapInfo{m, 0}
+ pm.mappingsByID[src.ID] = mi
+ return mi
+}
+
+// key generates encoded strings of Mapping to be used as a key for
+// maps.
+func (m *Mapping) key() mappingKey {
+ // Normalize addresses to handle address space randomization.
+ // Round up to next 4K boundary to avoid minor discrepancies.
+ const mapsizeRounding = 0x1000
+
+ size := m.Limit - m.Start
+ size = size + mapsizeRounding - 1
+ size = size - (size % mapsizeRounding)
+ key := mappingKey{
+ size: size,
+ offset: m.Offset,
+ }
+
+ switch {
+ case m.BuildID != "":
+ key.buildIDOrFile = m.BuildID
+ case m.File != "":
+ key.buildIDOrFile = m.File
+ default:
+ // A mapping containing neither build ID nor file name is a fake mapping. A
+ // key with empty buildIDOrFile is used for fake mappings so that they are
+ // treated as the same mapping during merging.
+ }
+ return key
+}
+
+type mappingKey struct {
+ size, offset uint64
+ buildIDOrFile string
+}
+
+func (pm *profileMerger) mapLine(src Line) Line {
+ ln := Line{
+ Function: pm.mapFunction(src.Function),
+ Line: src.Line,
+ Column: src.Column,
+ }
+ return ln
+}
+
+func (pm *profileMerger) mapFunction(src *Function) *Function {
+ if src == nil {
+ return nil
+ }
+ if f, ok := pm.functionsByID[src.ID]; ok {
+ return f
+ }
+ k := src.key()
+ if f, ok := pm.functions[k]; ok {
+ pm.functionsByID[src.ID] = f
+ return f
+ }
+ f := &Function{
+ ID: uint64(len(pm.p.Function) + 1),
+ Name: src.Name,
+ SystemName: src.SystemName,
+ Filename: src.Filename,
+ StartLine: src.StartLine,
+ }
+ pm.functions[k] = f
+ pm.functionsByID[src.ID] = f
+ pm.p.Function = append(pm.p.Function, f)
+ return f
+}
+
+// key generates a struct to be used as a key for maps.
+func (f *Function) key() functionKey {
+ return functionKey{
+ f.StartLine,
+ f.Name,
+ f.SystemName,
+ f.Filename,
+ }
+}
+
+type functionKey struct {
+ startLine int64
+ name, systemName, fileName string
+}
+
+// combineHeaders checks that all profiles can be merged and returns
+// their combined profile.
+func combineHeaders(srcs []*Profile) (*Profile, error) {
+ for _, s := range srcs[1:] {
+ if err := srcs[0].compatible(s); err != nil {
+ return nil, err
+ }
+ }
+
+ var timeNanos, durationNanos, period int64
+ var comments []string
+ seenComments := map[string]bool{}
+ var defaultSampleType string
+ for _, s := range srcs {
+ if timeNanos == 0 || s.TimeNanos < timeNanos {
+ timeNanos = s.TimeNanos
+ }
+ durationNanos += s.DurationNanos
+ if period == 0 || period < s.Period {
+ period = s.Period
+ }
+ for _, c := range s.Comments {
+ if seen := seenComments[c]; !seen {
+ comments = append(comments, c)
+ seenComments[c] = true
+ }
+ }
+ if defaultSampleType == "" {
+ defaultSampleType = s.DefaultSampleType
+ }
+ }
+
+ p := &Profile{
+ SampleType: make([]*ValueType, len(srcs[0].SampleType)),
+
+ DropFrames: srcs[0].DropFrames,
+ KeepFrames: srcs[0].KeepFrames,
+
+ TimeNanos: timeNanos,
+ DurationNanos: durationNanos,
+ PeriodType: srcs[0].PeriodType,
+ Period: period,
+
+ Comments: comments,
+ DefaultSampleType: defaultSampleType,
+ }
+ copy(p.SampleType, srcs[0].SampleType)
+ return p, nil
+}
+
+// compatible determines if two profiles can be compared/merged.
+// returns nil if the profiles are compatible; otherwise an error with
+// details on the incompatibility.
+func (p *Profile) compatible(pb *Profile) error {
+ if !equalValueType(p.PeriodType, pb.PeriodType) {
+ return fmt.Errorf("incompatible period types %v and %v", p.PeriodType, pb.PeriodType)
+ }
+
+ if len(p.SampleType) != len(pb.SampleType) {
+ return fmt.Errorf("incompatible sample types %v and %v", p.SampleType, pb.SampleType)
+ }
+
+ for i := range p.SampleType {
+ if !equalValueType(p.SampleType[i], pb.SampleType[i]) {
+ return fmt.Errorf("incompatible sample types %v and %v", p.SampleType, pb.SampleType)
+ }
+ }
+ return nil
+}
+
+// equalValueType returns true if the two value types are semantically
+// equal. It ignores the internal fields used during encode/decode.
+func equalValueType(st1, st2 *ValueType) bool {
+ return st1.Type == st2.Type && st1.Unit == st2.Unit
+}
+
+// locationIDMap is like a map[uint64]*Location, but provides efficiency for
+// ids that are densely numbered, which is often the case.
+type locationIDMap struct {
+ dense []*Location // indexed by id for id < len(dense)
+ sparse map[uint64]*Location // indexed by id for id >= len(dense)
+}
+
+func makeLocationIDMap(n int) locationIDMap {
+ return locationIDMap{
+ dense: make([]*Location, n),
+ sparse: map[uint64]*Location{},
+ }
+}
+
+func (lm locationIDMap) get(id uint64) *Location {
+ if id < uint64(len(lm.dense)) {
+ return lm.dense[int(id)]
+ }
+ return lm.sparse[id]
+}
+
+func (lm locationIDMap) set(id uint64, loc *Location) {
+ if id < uint64(len(lm.dense)) {
+ lm.dense[id] = loc
+ return
+ }
+ lm.sparse[id] = loc
+}
+
+// CompatibilizeSampleTypes makes profiles compatible to be compared/merged. It
+// keeps sample types that appear in all profiles only and drops/reorders the
+// sample types as necessary.
+//
+// In the case of sample types order is not the same for given profiles the
+// order is derived from the first profile.
+//
+// Profiles are modified in-place.
+//
+// It returns an error if the sample type's intersection is empty.
+func CompatibilizeSampleTypes(ps []*Profile) error {
+ sTypes := commonSampleTypes(ps)
+ if len(sTypes) == 0 {
+ return fmt.Errorf("profiles have empty common sample type list")
+ }
+ for _, p := range ps {
+ if err := compatibilizeSampleTypes(p, sTypes); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// commonSampleTypes returns sample types that appear in all profiles in the
+// order how they ordered in the first profile.
+func commonSampleTypes(ps []*Profile) []string {
+ if len(ps) == 0 {
+ return nil
+ }
+ sTypes := map[string]int{}
+ for _, p := range ps {
+ for _, st := range p.SampleType {
+ sTypes[st.Type]++
+ }
+ }
+ var res []string
+ for _, st := range ps[0].SampleType {
+ if sTypes[st.Type] == len(ps) {
+ res = append(res, st.Type)
+ }
+ }
+ return res
+}
+
+// compatibilizeSampleTypes drops sample types that are not present in sTypes
+// list and reorder them if needed.
+//
+// It sets DefaultSampleType to sType[0] if it is not in sType list.
+//
+// It assumes that all sample types from the sTypes list are present in the
+// given profile otherwise it returns an error.
+func compatibilizeSampleTypes(p *Profile, sTypes []string) error {
+ if len(sTypes) == 0 {
+ return fmt.Errorf("sample type list is empty")
+ }
+ defaultSampleType := sTypes[0]
+ reMap, needToModify := make([]int, len(sTypes)), false
+ for i, st := range sTypes {
+ if st == p.DefaultSampleType {
+ defaultSampleType = p.DefaultSampleType
+ }
+ idx := searchValueType(p.SampleType, st)
+ if idx < 0 {
+ return fmt.Errorf("%q sample type is not found in profile", st)
+ }
+ reMap[i] = idx
+ if idx != i {
+ needToModify = true
+ }
+ }
+ if !needToModify && len(sTypes) == len(p.SampleType) {
+ return nil
+ }
+ p.DefaultSampleType = defaultSampleType
+ oldSampleTypes := p.SampleType
+ p.SampleType = make([]*ValueType, len(sTypes))
+ for i, idx := range reMap {
+ p.SampleType[i] = oldSampleTypes[idx]
+ }
+ values := make([]int64, len(sTypes))
+ for _, s := range p.Sample {
+ for i, idx := range reMap {
+ values[i] = s.Value[idx]
+ }
+ s.Value = s.Value[:len(values)]
+ copy(s.Value, values)
+ }
+ return nil
+}
+
+func searchValueType(vts []*ValueType, s string) int {
+ for i, vt := range vts {
+ if vt.Type == s {
+ return i
+ }
+ }
+ return -1
+}
diff --git a/vendor/github.com/google/pprof/profile/profile.go b/vendor/github.com/google/pprof/profile/profile.go
new file mode 100644
index 0000000000..5551eb0bfa
--- /dev/null
+++ b/vendor/github.com/google/pprof/profile/profile.go
@@ -0,0 +1,864 @@
+// Copyright 2014 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 profile provides a representation of profile.proto and
+// methods to encode/decode profiles in this format.
+package profile
+
+import (
+ "bytes"
+ "compress/gzip"
+ "fmt"
+ "io"
+ "math"
+ "path/filepath"
+ "regexp"
+ "sort"
+ "strings"
+ "sync"
+ "time"
+)
+
+// Profile is an in-memory representation of profile.proto.
+type Profile struct {
+ SampleType []*ValueType
+ DefaultSampleType string
+ Sample []*Sample
+ Mapping []*Mapping
+ Location []*Location
+ Function []*Function
+ Comments []string
+
+ DropFrames string
+ KeepFrames string
+
+ TimeNanos int64
+ DurationNanos int64
+ PeriodType *ValueType
+ Period int64
+
+ // The following fields are modified during encoding and copying,
+ // so are protected by a Mutex.
+ encodeMu sync.Mutex
+
+ commentX []int64
+ dropFramesX int64
+ keepFramesX int64
+ stringTable []string
+ defaultSampleTypeX int64
+}
+
+// ValueType corresponds to Profile.ValueType
+type ValueType struct {
+ Type string // cpu, wall, inuse_space, etc
+ Unit string // seconds, nanoseconds, bytes, etc
+
+ typeX int64
+ unitX int64
+}
+
+// Sample corresponds to Profile.Sample
+type Sample struct {
+ Location []*Location
+ Value []int64
+ // Label is a per-label-key map to values for string labels.
+ //
+ // In general, having multiple values for the given label key is strongly
+ // discouraged - see docs for the sample label field in profile.proto. The
+ // main reason this unlikely state is tracked here is to make the
+ // decoding->encoding roundtrip not lossy. But we expect that the value
+ // slices present in this map are always of length 1.
+ Label map[string][]string
+ // NumLabel is a per-label-key map to values for numeric labels. See a note
+ // above on handling multiple values for a label.
+ NumLabel map[string][]int64
+ // NumUnit is a per-label-key map to the unit names of corresponding numeric
+ // label values. The unit info may be missing even if the label is in
+ // NumLabel, see the docs in profile.proto for details. When the value is
+ // slice is present and not nil, its length must be equal to the length of
+ // the corresponding value slice in NumLabel.
+ NumUnit map[string][]string
+
+ locationIDX []uint64
+ labelX []label
+}
+
+// label corresponds to Profile.Label
+type label struct {
+ keyX int64
+ // Exactly one of the two following values must be set
+ strX int64
+ numX int64 // Integer value for this label
+ // can be set if numX has value
+ unitX int64
+}
+
+// Mapping corresponds to Profile.Mapping
+type Mapping struct {
+ ID uint64
+ Start uint64
+ Limit uint64
+ Offset uint64
+ File string
+ BuildID string
+ HasFunctions bool
+ HasFilenames bool
+ HasLineNumbers bool
+ HasInlineFrames bool
+
+ fileX int64
+ buildIDX int64
+
+ // Name of the kernel relocation symbol ("_text" or "_stext"), extracted from File.
+ // For linux kernel mappings generated by some tools, correct symbolization depends
+ // on knowing which of the two possible relocation symbols was used for `Start`.
+ // This is given to us as a suffix in `File` (e.g. "[kernel.kallsyms]_stext").
+ //
+ // Note, this public field is not persisted in the proto. For the purposes of
+ // copying / merging / hashing profiles, it is considered subsumed by `File`.
+ KernelRelocationSymbol string
+}
+
+// Location corresponds to Profile.Location
+type Location struct {
+ ID uint64
+ Mapping *Mapping
+ Address uint64
+ Line []Line
+ IsFolded bool
+
+ mappingIDX uint64
+}
+
+// Line corresponds to Profile.Line
+type Line struct {
+ Function *Function
+ Line int64
+ Column int64
+
+ functionIDX uint64
+}
+
+// Function corresponds to Profile.Function
+type Function struct {
+ ID uint64
+ Name string
+ SystemName string
+ Filename string
+ StartLine int64
+
+ nameX int64
+ systemNameX int64
+ filenameX int64
+}
+
+// Parse parses a profile and checks for its validity. The input
+// may be a gzip-compressed encoded protobuf or one of many legacy
+// profile formats which may be unsupported in the future.
+func Parse(r io.Reader) (*Profile, error) {
+ data, err := io.ReadAll(r)
+ if err != nil {
+ return nil, err
+ }
+ return ParseData(data)
+}
+
+// ParseData parses a profile from a buffer and checks for its
+// validity.
+func ParseData(data []byte) (*Profile, error) {
+ var p *Profile
+ var err error
+ if len(data) >= 2 && data[0] == 0x1f && data[1] == 0x8b {
+ gz, err := gzip.NewReader(bytes.NewBuffer(data))
+ if err == nil {
+ data, err = io.ReadAll(gz)
+ }
+ if err != nil {
+ return nil, fmt.Errorf("decompressing profile: %v", err)
+ }
+ }
+ if p, err = ParseUncompressed(data); err != nil && err != errNoData && err != errConcatProfile {
+ p, err = parseLegacy(data)
+ }
+
+ if err != nil {
+ return nil, fmt.Errorf("parsing profile: %v", err)
+ }
+
+ if err := p.CheckValid(); err != nil {
+ return nil, fmt.Errorf("malformed profile: %v", err)
+ }
+ return p, nil
+}
+
+var errUnrecognized = fmt.Errorf("unrecognized profile format")
+var errMalformed = fmt.Errorf("malformed profile format")
+var errNoData = fmt.Errorf("empty input file")
+var errConcatProfile = fmt.Errorf("concatenated profiles detected")
+
+func parseLegacy(data []byte) (*Profile, error) {
+ parsers := []func([]byte) (*Profile, error){
+ parseCPU,
+ parseHeap,
+ parseGoCount, // goroutine, threadcreate
+ parseThread,
+ parseContention,
+ parseJavaProfile,
+ }
+
+ for _, parser := range parsers {
+ p, err := parser(data)
+ if err == nil {
+ p.addLegacyFrameInfo()
+ return p, nil
+ }
+ if err != errUnrecognized {
+ return nil, err
+ }
+ }
+ return nil, errUnrecognized
+}
+
+// ParseUncompressed parses an uncompressed protobuf into a profile.
+func ParseUncompressed(data []byte) (*Profile, error) {
+ if len(data) == 0 {
+ return nil, errNoData
+ }
+ p := &Profile{}
+ if err := unmarshal(data, p); err != nil {
+ return nil, err
+ }
+
+ if err := p.postDecode(); err != nil {
+ return nil, err
+ }
+
+ return p, nil
+}
+
+var libRx = regexp.MustCompile(`([.]so$|[.]so[._][0-9]+)`)
+
+// massageMappings applies heuristic-based changes to the profile
+// mappings to account for quirks of some environments.
+func (p *Profile) massageMappings() {
+ // Merge adjacent regions with matching names, checking that the offsets match
+ if len(p.Mapping) > 1 {
+ mappings := []*Mapping{p.Mapping[0]}
+ for _, m := range p.Mapping[1:] {
+ lm := mappings[len(mappings)-1]
+ if adjacent(lm, m) {
+ lm.Limit = m.Limit
+ if m.File != "" {
+ lm.File = m.File
+ }
+ if m.BuildID != "" {
+ lm.BuildID = m.BuildID
+ }
+ p.updateLocationMapping(m, lm)
+ continue
+ }
+ mappings = append(mappings, m)
+ }
+ p.Mapping = mappings
+ }
+
+ // Use heuristics to identify main binary and move it to the top of the list of mappings
+ for i, m := range p.Mapping {
+ file := strings.TrimSpace(strings.Replace(m.File, "(deleted)", "", -1))
+ if len(file) == 0 {
+ continue
+ }
+ if len(libRx.FindStringSubmatch(file)) > 0 {
+ continue
+ }
+ if file[0] == '[' {
+ continue
+ }
+ // Swap what we guess is main to position 0.
+ p.Mapping[0], p.Mapping[i] = p.Mapping[i], p.Mapping[0]
+ break
+ }
+
+ // Keep the mapping IDs neatly sorted
+ for i, m := range p.Mapping {
+ m.ID = uint64(i + 1)
+ }
+}
+
+// adjacent returns whether two mapping entries represent the same
+// mapping that has been split into two. Check that their addresses are adjacent,
+// and if the offsets match, if they are available.
+func adjacent(m1, m2 *Mapping) bool {
+ if m1.File != "" && m2.File != "" {
+ if m1.File != m2.File {
+ return false
+ }
+ }
+ if m1.BuildID != "" && m2.BuildID != "" {
+ if m1.BuildID != m2.BuildID {
+ return false
+ }
+ }
+ if m1.Limit != m2.Start {
+ return false
+ }
+ if m1.Offset != 0 && m2.Offset != 0 {
+ offset := m1.Offset + (m1.Limit - m1.Start)
+ if offset != m2.Offset {
+ return false
+ }
+ }
+ return true
+}
+
+func (p *Profile) updateLocationMapping(from, to *Mapping) {
+ for _, l := range p.Location {
+ if l.Mapping == from {
+ l.Mapping = to
+ }
+ }
+}
+
+func serialize(p *Profile) []byte {
+ p.encodeMu.Lock()
+ p.preEncode()
+ b := marshal(p)
+ p.encodeMu.Unlock()
+ return b
+}
+
+// Write writes the profile as a gzip-compressed marshaled protobuf.
+func (p *Profile) Write(w io.Writer) error {
+ zw := gzip.NewWriter(w)
+ defer zw.Close()
+ _, err := zw.Write(serialize(p))
+ return err
+}
+
+// WriteUncompressed writes the profile as a marshaled protobuf.
+func (p *Profile) WriteUncompressed(w io.Writer) error {
+ _, err := w.Write(serialize(p))
+ return err
+}
+
+// CheckValid tests whether the profile is valid. Checks include, but are
+// not limited to:
+// - len(Profile.Sample[n].value) == len(Profile.value_unit)
+// - Sample.id has a corresponding Profile.Location
+func (p *Profile) CheckValid() error {
+ // Check that sample values are consistent
+ sampleLen := len(p.SampleType)
+ if sampleLen == 0 && len(p.Sample) != 0 {
+ return fmt.Errorf("missing sample type information")
+ }
+ for _, s := range p.Sample {
+ if s == nil {
+ return fmt.Errorf("profile has nil sample")
+ }
+ if len(s.Value) != sampleLen {
+ return fmt.Errorf("mismatch: sample has %d values vs. %d types", len(s.Value), len(p.SampleType))
+ }
+ for _, l := range s.Location {
+ if l == nil {
+ return fmt.Errorf("sample has nil location")
+ }
+ }
+ }
+
+ // Check that all mappings/locations/functions are in the tables
+ // Check that there are no duplicate ids
+ mappings := make(map[uint64]*Mapping, len(p.Mapping))
+ for _, m := range p.Mapping {
+ if m == nil {
+ return fmt.Errorf("profile has nil mapping")
+ }
+ if m.ID == 0 {
+ return fmt.Errorf("found mapping with reserved ID=0")
+ }
+ if mappings[m.ID] != nil {
+ return fmt.Errorf("multiple mappings with same id: %d", m.ID)
+ }
+ mappings[m.ID] = m
+ }
+ functions := make(map[uint64]*Function, len(p.Function))
+ for _, f := range p.Function {
+ if f == nil {
+ return fmt.Errorf("profile has nil function")
+ }
+ if f.ID == 0 {
+ return fmt.Errorf("found function with reserved ID=0")
+ }
+ if functions[f.ID] != nil {
+ return fmt.Errorf("multiple functions with same id: %d", f.ID)
+ }
+ functions[f.ID] = f
+ }
+ locations := make(map[uint64]*Location, len(p.Location))
+ for _, l := range p.Location {
+ if l == nil {
+ return fmt.Errorf("profile has nil location")
+ }
+ if l.ID == 0 {
+ return fmt.Errorf("found location with reserved id=0")
+ }
+ if locations[l.ID] != nil {
+ return fmt.Errorf("multiple locations with same id: %d", l.ID)
+ }
+ locations[l.ID] = l
+ if m := l.Mapping; m != nil {
+ if m.ID == 0 || mappings[m.ID] != m {
+ return fmt.Errorf("inconsistent mapping %p: %d", m, m.ID)
+ }
+ }
+ for _, ln := range l.Line {
+ f := ln.Function
+ if f == nil {
+ return fmt.Errorf("location id: %d has a line with nil function", l.ID)
+ }
+ if f.ID == 0 || functions[f.ID] != f {
+ return fmt.Errorf("inconsistent function %p: %d", f, f.ID)
+ }
+ }
+ }
+ return nil
+}
+
+// Aggregate merges the locations in the profile into equivalence
+// classes preserving the request attributes. It also updates the
+// samples to point to the merged locations.
+func (p *Profile) Aggregate(inlineFrame, function, filename, linenumber, columnnumber, address bool) error {
+ for _, m := range p.Mapping {
+ m.HasInlineFrames = m.HasInlineFrames && inlineFrame
+ m.HasFunctions = m.HasFunctions && function
+ m.HasFilenames = m.HasFilenames && filename
+ m.HasLineNumbers = m.HasLineNumbers && linenumber
+ }
+
+ // Aggregate functions
+ if !function || !filename {
+ for _, f := range p.Function {
+ if !function {
+ f.Name = ""
+ f.SystemName = ""
+ }
+ if !filename {
+ f.Filename = ""
+ }
+ }
+ }
+
+ // Aggregate locations
+ if !inlineFrame || !address || !linenumber || !columnnumber {
+ for _, l := range p.Location {
+ if !inlineFrame && len(l.Line) > 1 {
+ l.Line = l.Line[len(l.Line)-1:]
+ }
+ if !linenumber {
+ for i := range l.Line {
+ l.Line[i].Line = 0
+ l.Line[i].Column = 0
+ }
+ }
+ if !columnnumber {
+ for i := range l.Line {
+ l.Line[i].Column = 0
+ }
+ }
+ if !address {
+ l.Address = 0
+ }
+ }
+ }
+
+ return p.CheckValid()
+}
+
+// NumLabelUnits returns a map of numeric label keys to the units
+// associated with those keys and a map of those keys to any units
+// that were encountered but not used.
+// Unit for a given key is the first encountered unit for that key. If multiple
+// units are encountered for values paired with a particular key, then the first
+// unit encountered is used and all other units are returned in sorted order
+// in map of ignored units.
+// If no units are encountered for a particular key, the unit is then inferred
+// based on the key.
+func (p *Profile) NumLabelUnits() (map[string]string, map[string][]string) {
+ numLabelUnits := map[string]string{}
+ ignoredUnits := map[string]map[string]bool{}
+ encounteredKeys := map[string]bool{}
+
+ // Determine units based on numeric tags for each sample.
+ for _, s := range p.Sample {
+ for k := range s.NumLabel {
+ encounteredKeys[k] = true
+ for _, unit := range s.NumUnit[k] {
+ if unit == "" {
+ continue
+ }
+ if wantUnit, ok := numLabelUnits[k]; !ok {
+ numLabelUnits[k] = unit
+ } else if wantUnit != unit {
+ if v, ok := ignoredUnits[k]; ok {
+ v[unit] = true
+ } else {
+ ignoredUnits[k] = map[string]bool{unit: true}
+ }
+ }
+ }
+ }
+ }
+ // Infer units for keys without any units associated with
+ // numeric tag values.
+ for key := range encounteredKeys {
+ unit := numLabelUnits[key]
+ if unit == "" {
+ switch key {
+ case "alignment", "request":
+ numLabelUnits[key] = "bytes"
+ default:
+ numLabelUnits[key] = key
+ }
+ }
+ }
+
+ // Copy ignored units into more readable format
+ unitsIgnored := make(map[string][]string, len(ignoredUnits))
+ for key, values := range ignoredUnits {
+ units := make([]string, len(values))
+ i := 0
+ for unit := range values {
+ units[i] = unit
+ i++
+ }
+ sort.Strings(units)
+ unitsIgnored[key] = units
+ }
+
+ return numLabelUnits, unitsIgnored
+}
+
+// String dumps a text representation of a profile. Intended mainly
+// for debugging purposes.
+func (p *Profile) String() string {
+ ss := make([]string, 0, len(p.Comments)+len(p.Sample)+len(p.Mapping)+len(p.Location))
+ for _, c := range p.Comments {
+ ss = append(ss, "Comment: "+c)
+ }
+ if pt := p.PeriodType; pt != nil {
+ ss = append(ss, fmt.Sprintf("PeriodType: %s %s", pt.Type, pt.Unit))
+ }
+ ss = append(ss, fmt.Sprintf("Period: %d", p.Period))
+ if p.TimeNanos != 0 {
+ ss = append(ss, fmt.Sprintf("Time: %v", time.Unix(0, p.TimeNanos)))
+ }
+ if p.DurationNanos != 0 {
+ ss = append(ss, fmt.Sprintf("Duration: %.4v", time.Duration(p.DurationNanos)))
+ }
+
+ ss = append(ss, "Samples:")
+ var sh1 string
+ for _, s := range p.SampleType {
+ dflt := ""
+ if s.Type == p.DefaultSampleType {
+ dflt = "[dflt]"
+ }
+ sh1 = sh1 + fmt.Sprintf("%s/%s%s ", s.Type, s.Unit, dflt)
+ }
+ ss = append(ss, strings.TrimSpace(sh1))
+ for _, s := range p.Sample {
+ ss = append(ss, s.string())
+ }
+
+ ss = append(ss, "Locations")
+ for _, l := range p.Location {
+ ss = append(ss, l.string())
+ }
+
+ ss = append(ss, "Mappings")
+ for _, m := range p.Mapping {
+ ss = append(ss, m.string())
+ }
+
+ return strings.Join(ss, "\n") + "\n"
+}
+
+// string dumps a text representation of a mapping. Intended mainly
+// for debugging purposes.
+func (m *Mapping) string() string {
+ bits := ""
+ if m.HasFunctions {
+ bits = bits + "[FN]"
+ }
+ if m.HasFilenames {
+ bits = bits + "[FL]"
+ }
+ if m.HasLineNumbers {
+ bits = bits + "[LN]"
+ }
+ if m.HasInlineFrames {
+ bits = bits + "[IN]"
+ }
+ return fmt.Sprintf("%d: %#x/%#x/%#x %s %s %s",
+ m.ID,
+ m.Start, m.Limit, m.Offset,
+ m.File,
+ m.BuildID,
+ bits)
+}
+
+// string dumps a text representation of a location. Intended mainly
+// for debugging purposes.
+func (l *Location) string() string {
+ ss := []string{}
+ locStr := fmt.Sprintf("%6d: %#x ", l.ID, l.Address)
+ if m := l.Mapping; m != nil {
+ locStr = locStr + fmt.Sprintf("M=%d ", m.ID)
+ }
+ if l.IsFolded {
+ locStr = locStr + "[F] "
+ }
+ if len(l.Line) == 0 {
+ ss = append(ss, locStr)
+ }
+ for li := range l.Line {
+ lnStr := "??"
+ if fn := l.Line[li].Function; fn != nil {
+ lnStr = fmt.Sprintf("%s %s:%d:%d s=%d",
+ fn.Name,
+ fn.Filename,
+ l.Line[li].Line,
+ l.Line[li].Column,
+ fn.StartLine)
+ if fn.Name != fn.SystemName {
+ lnStr = lnStr + "(" + fn.SystemName + ")"
+ }
+ }
+ ss = append(ss, locStr+lnStr)
+ // Do not print location details past the first line
+ locStr = " "
+ }
+ return strings.Join(ss, "\n")
+}
+
+// string dumps a text representation of a sample. Intended mainly
+// for debugging purposes.
+func (s *Sample) string() string {
+ ss := []string{}
+ var sv string
+ for _, v := range s.Value {
+ sv = fmt.Sprintf("%s %10d", sv, v)
+ }
+ sv = sv + ": "
+ for _, l := range s.Location {
+ sv = sv + fmt.Sprintf("%d ", l.ID)
+ }
+ ss = append(ss, sv)
+ const labelHeader = " "
+ if len(s.Label) > 0 {
+ ss = append(ss, labelHeader+labelsToString(s.Label))
+ }
+ if len(s.NumLabel) > 0 {
+ ss = append(ss, labelHeader+numLabelsToString(s.NumLabel, s.NumUnit))
+ }
+ return strings.Join(ss, "\n")
+}
+
+// labelsToString returns a string representation of a
+// map representing labels.
+func labelsToString(labels map[string][]string) string {
+ ls := []string{}
+ for k, v := range labels {
+ ls = append(ls, fmt.Sprintf("%s:%v", k, v))
+ }
+ sort.Strings(ls)
+ return strings.Join(ls, " ")
+}
+
+// numLabelsToString returns a string representation of a map
+// representing numeric labels.
+func numLabelsToString(numLabels map[string][]int64, numUnits map[string][]string) string {
+ ls := []string{}
+ for k, v := range numLabels {
+ units := numUnits[k]
+ var labelString string
+ if len(units) == len(v) {
+ values := make([]string, len(v))
+ for i, vv := range v {
+ values[i] = fmt.Sprintf("%d %s", vv, units[i])
+ }
+ labelString = fmt.Sprintf("%s:%v", k, values)
+ } else {
+ labelString = fmt.Sprintf("%s:%v", k, v)
+ }
+ ls = append(ls, labelString)
+ }
+ sort.Strings(ls)
+ return strings.Join(ls, " ")
+}
+
+// SetLabel sets the specified key to the specified value for all samples in the
+// profile.
+func (p *Profile) SetLabel(key string, value []string) {
+ for _, sample := range p.Sample {
+ if sample.Label == nil {
+ sample.Label = map[string][]string{key: value}
+ } else {
+ sample.Label[key] = value
+ }
+ }
+}
+
+// RemoveLabel removes all labels associated with the specified key for all
+// samples in the profile.
+func (p *Profile) RemoveLabel(key string) {
+ for _, sample := range p.Sample {
+ delete(sample.Label, key)
+ }
+}
+
+// HasLabel returns true if a sample has a label with indicated key and value.
+func (s *Sample) HasLabel(key, value string) bool {
+ for _, v := range s.Label[key] {
+ if v == value {
+ return true
+ }
+ }
+ return false
+}
+
+// SetNumLabel sets the specified key to the specified value for all samples in the
+// profile. "unit" is a slice that describes the units that each corresponding member
+// of "values" is measured in (e.g. bytes or seconds). If there is no relevant
+// unit for a given value, that member of "unit" should be the empty string.
+// "unit" must either have the same length as "value", or be nil.
+func (p *Profile) SetNumLabel(key string, value []int64, unit []string) {
+ for _, sample := range p.Sample {
+ if sample.NumLabel == nil {
+ sample.NumLabel = map[string][]int64{key: value}
+ } else {
+ sample.NumLabel[key] = value
+ }
+ if sample.NumUnit == nil {
+ sample.NumUnit = map[string][]string{key: unit}
+ } else {
+ sample.NumUnit[key] = unit
+ }
+ }
+}
+
+// RemoveNumLabel removes all numerical labels associated with the specified key for all
+// samples in the profile.
+func (p *Profile) RemoveNumLabel(key string) {
+ for _, sample := range p.Sample {
+ delete(sample.NumLabel, key)
+ delete(sample.NumUnit, key)
+ }
+}
+
+// DiffBaseSample returns true if a sample belongs to the diff base and false
+// otherwise.
+func (s *Sample) DiffBaseSample() bool {
+ return s.HasLabel("pprof::base", "true")
+}
+
+// Scale multiplies all sample values in a profile by a constant and keeps
+// only samples that have at least one non-zero value.
+func (p *Profile) Scale(ratio float64) {
+ if ratio == 1 {
+ return
+ }
+ ratios := make([]float64, len(p.SampleType))
+ for i := range p.SampleType {
+ ratios[i] = ratio
+ }
+ p.ScaleN(ratios)
+}
+
+// ScaleN multiplies each sample values in a sample by a different amount
+// and keeps only samples that have at least one non-zero value.
+func (p *Profile) ScaleN(ratios []float64) error {
+ if len(p.SampleType) != len(ratios) {
+ return fmt.Errorf("mismatched scale ratios, got %d, want %d", len(ratios), len(p.SampleType))
+ }
+ allOnes := true
+ for _, r := range ratios {
+ if r != 1 {
+ allOnes = false
+ break
+ }
+ }
+ if allOnes {
+ return nil
+ }
+ fillIdx := 0
+ for _, s := range p.Sample {
+ keepSample := false
+ for i, v := range s.Value {
+ if ratios[i] != 1 {
+ val := int64(math.Round(float64(v) * ratios[i]))
+ s.Value[i] = val
+ keepSample = keepSample || val != 0
+ }
+ }
+ if keepSample {
+ p.Sample[fillIdx] = s
+ fillIdx++
+ }
+ }
+ p.Sample = p.Sample[:fillIdx]
+ return nil
+}
+
+// HasFunctions determines if all locations in this profile have
+// symbolized function information.
+func (p *Profile) HasFunctions() bool {
+ for _, l := range p.Location {
+ if l.Mapping != nil && !l.Mapping.HasFunctions {
+ return false
+ }
+ }
+ return true
+}
+
+// HasFileLines determines if all locations in this profile have
+// symbolized file and line number information.
+func (p *Profile) HasFileLines() bool {
+ for _, l := range p.Location {
+ if l.Mapping != nil && (!l.Mapping.HasFilenames || !l.Mapping.HasLineNumbers) {
+ return false
+ }
+ }
+ return true
+}
+
+// Unsymbolizable returns true if a mapping points to a binary for which
+// locations can't be symbolized in principle, at least now. Examples are
+// "[vdso]", [vsyscall]" and some others, see the code.
+func (m *Mapping) Unsymbolizable() bool {
+ name := filepath.Base(m.File)
+ return strings.HasPrefix(name, "[") || strings.HasPrefix(name, "linux-vdso") || strings.HasPrefix(m.File, "/dev/dri/") || m.File == "//anon"
+}
+
+// Copy makes a fully independent copy of a profile.
+func (p *Profile) Copy() *Profile {
+ pp := &Profile{}
+ if err := unmarshal(serialize(p), pp); err != nil {
+ panic(err)
+ }
+ if err := pp.postDecode(); err != nil {
+ panic(err)
+ }
+
+ return pp
+}
diff --git a/vendor/github.com/google/pprof/profile/proto.go b/vendor/github.com/google/pprof/profile/proto.go
new file mode 100644
index 0000000000..a15696ba16
--- /dev/null
+++ b/vendor/github.com/google/pprof/profile/proto.go
@@ -0,0 +1,367 @@
+// Copyright 2014 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This file is a simple protocol buffer encoder and decoder.
+// The format is described at
+// https://developers.google.com/protocol-buffers/docs/encoding
+//
+// A protocol message must implement the message interface:
+// decoder() []decoder
+// encode(*buffer)
+//
+// The decode method returns a slice indexed by field number that gives the
+// function to decode that field.
+// The encode method encodes its receiver into the given buffer.
+//
+// The two methods are simple enough to be implemented by hand rather than
+// by using a protocol compiler.
+//
+// See profile.go for examples of messages implementing this interface.
+//
+// There is no support for groups, message sets, or "has" bits.
+
+package profile
+
+import (
+ "errors"
+ "fmt"
+)
+
+type buffer struct {
+ field int // field tag
+ typ int // proto wire type code for field
+ u64 uint64
+ data []byte
+ tmp [16]byte
+ tmpLines []Line // temporary storage used while decoding "repeated Line".
+}
+
+type decoder func(*buffer, message) error
+
+type message interface {
+ decoder() []decoder
+ encode(*buffer)
+}
+
+func marshal(m message) []byte {
+ var b buffer
+ m.encode(&b)
+ return b.data
+}
+
+func encodeVarint(b *buffer, x uint64) {
+ for x >= 128 {
+ b.data = append(b.data, byte(x)|0x80)
+ x >>= 7
+ }
+ b.data = append(b.data, byte(x))
+}
+
+func encodeLength(b *buffer, tag int, len int) {
+ encodeVarint(b, uint64(tag)<<3|2)
+ encodeVarint(b, uint64(len))
+}
+
+func encodeUint64(b *buffer, tag int, x uint64) {
+ // append varint to b.data
+ encodeVarint(b, uint64(tag)<<3)
+ encodeVarint(b, x)
+}
+
+func encodeUint64s(b *buffer, tag int, x []uint64) {
+ if len(x) > 2 {
+ // Use packed encoding
+ n1 := len(b.data)
+ for _, u := range x {
+ encodeVarint(b, u)
+ }
+ n2 := len(b.data)
+ encodeLength(b, tag, n2-n1)
+ n3 := len(b.data)
+ copy(b.tmp[:], b.data[n2:n3])
+ copy(b.data[n1+(n3-n2):], b.data[n1:n2])
+ copy(b.data[n1:], b.tmp[:n3-n2])
+ return
+ }
+ for _, u := range x {
+ encodeUint64(b, tag, u)
+ }
+}
+
+func encodeUint64Opt(b *buffer, tag int, x uint64) {
+ if x == 0 {
+ return
+ }
+ encodeUint64(b, tag, x)
+}
+
+func encodeInt64(b *buffer, tag int, x int64) {
+ u := uint64(x)
+ encodeUint64(b, tag, u)
+}
+
+func encodeInt64s(b *buffer, tag int, x []int64) {
+ if len(x) > 2 {
+ // Use packed encoding
+ n1 := len(b.data)
+ for _, u := range x {
+ encodeVarint(b, uint64(u))
+ }
+ n2 := len(b.data)
+ encodeLength(b, tag, n2-n1)
+ n3 := len(b.data)
+ copy(b.tmp[:], b.data[n2:n3])
+ copy(b.data[n1+(n3-n2):], b.data[n1:n2])
+ copy(b.data[n1:], b.tmp[:n3-n2])
+ return
+ }
+ for _, u := range x {
+ encodeInt64(b, tag, u)
+ }
+}
+
+func encodeInt64Opt(b *buffer, tag int, x int64) {
+ if x == 0 {
+ return
+ }
+ encodeInt64(b, tag, x)
+}
+
+func encodeString(b *buffer, tag int, x string) {
+ encodeLength(b, tag, len(x))
+ b.data = append(b.data, x...)
+}
+
+func encodeStrings(b *buffer, tag int, x []string) {
+ for _, s := range x {
+ encodeString(b, tag, s)
+ }
+}
+
+func encodeBool(b *buffer, tag int, x bool) {
+ if x {
+ encodeUint64(b, tag, 1)
+ } else {
+ encodeUint64(b, tag, 0)
+ }
+}
+
+func encodeBoolOpt(b *buffer, tag int, x bool) {
+ if x {
+ encodeBool(b, tag, x)
+ }
+}
+
+func encodeMessage(b *buffer, tag int, m message) {
+ n1 := len(b.data)
+ m.encode(b)
+ n2 := len(b.data)
+ encodeLength(b, tag, n2-n1)
+ n3 := len(b.data)
+ copy(b.tmp[:], b.data[n2:n3])
+ copy(b.data[n1+(n3-n2):], b.data[n1:n2])
+ copy(b.data[n1:], b.tmp[:n3-n2])
+}
+
+func unmarshal(data []byte, m message) (err error) {
+ b := buffer{data: data, typ: 2}
+ return decodeMessage(&b, m)
+}
+
+func le64(p []byte) uint64 {
+ return uint64(p[0]) | uint64(p[1])<<8 | uint64(p[2])<<16 | uint64(p[3])<<24 | uint64(p[4])<<32 | uint64(p[5])<<40 | uint64(p[6])<<48 | uint64(p[7])<<56
+}
+
+func le32(p []byte) uint32 {
+ return uint32(p[0]) | uint32(p[1])<<8 | uint32(p[2])<<16 | uint32(p[3])<<24
+}
+
+func decodeVarint(data []byte) (uint64, []byte, error) {
+ var u uint64
+ for i := 0; ; i++ {
+ if i >= 10 || i >= len(data) {
+ return 0, nil, errors.New("bad varint")
+ }
+ u |= uint64(data[i]&0x7F) << uint(7*i)
+ if data[i]&0x80 == 0 {
+ return u, data[i+1:], nil
+ }
+ }
+}
+
+func decodeField(b *buffer, data []byte) ([]byte, error) {
+ x, data, err := decodeVarint(data)
+ if err != nil {
+ return nil, err
+ }
+ b.field = int(x >> 3)
+ b.typ = int(x & 7)
+ b.data = nil
+ b.u64 = 0
+ switch b.typ {
+ case 0:
+ b.u64, data, err = decodeVarint(data)
+ if err != nil {
+ return nil, err
+ }
+ case 1:
+ if len(data) < 8 {
+ return nil, errors.New("not enough data")
+ }
+ b.u64 = le64(data[:8])
+ data = data[8:]
+ case 2:
+ var n uint64
+ n, data, err = decodeVarint(data)
+ if err != nil {
+ return nil, err
+ }
+ if n > uint64(len(data)) {
+ return nil, errors.New("too much data")
+ }
+ b.data = data[:n]
+ data = data[n:]
+ case 5:
+ if len(data) < 4 {
+ return nil, errors.New("not enough data")
+ }
+ b.u64 = uint64(le32(data[:4]))
+ data = data[4:]
+ default:
+ return nil, fmt.Errorf("unknown wire type: %d", b.typ)
+ }
+
+ return data, nil
+}
+
+func checkType(b *buffer, typ int) error {
+ if b.typ != typ {
+ return errors.New("type mismatch")
+ }
+ return nil
+}
+
+func decodeMessage(b *buffer, m message) error {
+ if err := checkType(b, 2); err != nil {
+ return err
+ }
+ dec := m.decoder()
+ data := b.data
+ for len(data) > 0 {
+ // pull varint field# + type
+ var err error
+ data, err = decodeField(b, data)
+ if err != nil {
+ return err
+ }
+ if b.field >= len(dec) || dec[b.field] == nil {
+ continue
+ }
+ if err := dec[b.field](b, m); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func decodeInt64(b *buffer, x *int64) error {
+ if err := checkType(b, 0); err != nil {
+ return err
+ }
+ *x = int64(b.u64)
+ return nil
+}
+
+func decodeInt64s(b *buffer, x *[]int64) error {
+ if b.typ == 2 {
+ // Packed encoding
+ data := b.data
+ for len(data) > 0 {
+ var u uint64
+ var err error
+
+ if u, data, err = decodeVarint(data); err != nil {
+ return err
+ }
+ *x = append(*x, int64(u))
+ }
+ return nil
+ }
+ var i int64
+ if err := decodeInt64(b, &i); err != nil {
+ return err
+ }
+ *x = append(*x, i)
+ return nil
+}
+
+func decodeUint64(b *buffer, x *uint64) error {
+ if err := checkType(b, 0); err != nil {
+ return err
+ }
+ *x = b.u64
+ return nil
+}
+
+func decodeUint64s(b *buffer, x *[]uint64) error {
+ if b.typ == 2 {
+ data := b.data
+ // Packed encoding
+ for len(data) > 0 {
+ var u uint64
+ var err error
+
+ if u, data, err = decodeVarint(data); err != nil {
+ return err
+ }
+ *x = append(*x, u)
+ }
+ return nil
+ }
+ var u uint64
+ if err := decodeUint64(b, &u); err != nil {
+ return err
+ }
+ *x = append(*x, u)
+ return nil
+}
+
+func decodeString(b *buffer, x *string) error {
+ if err := checkType(b, 2); err != nil {
+ return err
+ }
+ *x = string(b.data)
+ return nil
+}
+
+func decodeStrings(b *buffer, x *[]string) error {
+ var s string
+ if err := decodeString(b, &s); err != nil {
+ return err
+ }
+ *x = append(*x, s)
+ return nil
+}
+
+func decodeBool(b *buffer, x *bool) error {
+ if err := checkType(b, 0); err != nil {
+ return err
+ }
+ if int64(b.u64) == 0 {
+ *x = false
+ } else {
+ *x = true
+ }
+ return nil
+}
diff --git a/vendor/github.com/google/pprof/profile/prune.go b/vendor/github.com/google/pprof/profile/prune.go
new file mode 100644
index 0000000000..b2f9fd5466
--- /dev/null
+++ b/vendor/github.com/google/pprof/profile/prune.go
@@ -0,0 +1,194 @@
+// Copyright 2014 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Implements methods to remove frames from profiles.
+
+package profile
+
+import (
+ "fmt"
+ "regexp"
+ "strings"
+)
+
+var (
+ reservedNames = []string{"(anonymous namespace)", "operator()"}
+ bracketRx = func() *regexp.Regexp {
+ var quotedNames []string
+ for _, name := range append(reservedNames, "(") {
+ quotedNames = append(quotedNames, regexp.QuoteMeta(name))
+ }
+ return regexp.MustCompile(strings.Join(quotedNames, "|"))
+ }()
+)
+
+// simplifyFunc does some primitive simplification of function names.
+func simplifyFunc(f string) string {
+ // Account for leading '.' on the PPC ELF v1 ABI.
+ funcName := strings.TrimPrefix(f, ".")
+ // Account for unsimplified names -- try to remove the argument list by trimming
+ // starting from the first '(', but skipping reserved names that have '('.
+ for _, ind := range bracketRx.FindAllStringSubmatchIndex(funcName, -1) {
+ foundReserved := false
+ for _, res := range reservedNames {
+ if funcName[ind[0]:ind[1]] == res {
+ foundReserved = true
+ break
+ }
+ }
+ if !foundReserved {
+ funcName = funcName[:ind[0]]
+ break
+ }
+ }
+ return funcName
+}
+
+// Prune removes all nodes beneath a node matching dropRx, and not
+// matching keepRx. If the root node of a Sample matches, the sample
+// will have an empty stack.
+func (p *Profile) Prune(dropRx, keepRx *regexp.Regexp) {
+ prune := make(map[uint64]bool)
+ pruneBeneath := make(map[uint64]bool)
+
+ // simplifyFunc can be expensive, so cache results.
+ // Note that the same function name can be encountered many times due
+ // different lines and addresses in the same function.
+ pruneCache := map[string]bool{} // Map from function to whether or not to prune
+ pruneFromHere := func(s string) bool {
+ if r, ok := pruneCache[s]; ok {
+ return r
+ }
+ funcName := simplifyFunc(s)
+ if dropRx.MatchString(funcName) {
+ if keepRx == nil || !keepRx.MatchString(funcName) {
+ pruneCache[s] = true
+ return true
+ }
+ }
+ pruneCache[s] = false
+ return false
+ }
+
+ for _, loc := range p.Location {
+ var i int
+ for i = len(loc.Line) - 1; i >= 0; i-- {
+ if fn := loc.Line[i].Function; fn != nil && fn.Name != "" {
+ if pruneFromHere(fn.Name) {
+ break
+ }
+ }
+ }
+
+ if i >= 0 {
+ // Found matching entry to prune.
+ pruneBeneath[loc.ID] = true
+
+ // Remove the matching location.
+ if i == len(loc.Line)-1 {
+ // Matched the top entry: prune the whole location.
+ prune[loc.ID] = true
+ } else {
+ loc.Line = loc.Line[i+1:]
+ }
+ }
+ }
+
+ // Prune locs from each Sample
+ for _, sample := range p.Sample {
+ // Scan from the root to the leaves to find the prune location.
+ // Do not prune frames before the first user frame, to avoid
+ // pruning everything.
+ foundUser := false
+ for i := len(sample.Location) - 1; i >= 0; i-- {
+ id := sample.Location[i].ID
+ if !prune[id] && !pruneBeneath[id] {
+ foundUser = true
+ continue
+ }
+ if !foundUser {
+ continue
+ }
+ if prune[id] {
+ sample.Location = sample.Location[i+1:]
+ break
+ }
+ if pruneBeneath[id] {
+ sample.Location = sample.Location[i:]
+ break
+ }
+ }
+ }
+}
+
+// RemoveUninteresting prunes and elides profiles using built-in
+// tables of uninteresting function names.
+func (p *Profile) RemoveUninteresting() error {
+ var keep, drop *regexp.Regexp
+ var err error
+
+ if p.DropFrames != "" {
+ if drop, err = regexp.Compile("^(" + p.DropFrames + ")$"); err != nil {
+ return fmt.Errorf("failed to compile regexp %s: %v", p.DropFrames, err)
+ }
+ if p.KeepFrames != "" {
+ if keep, err = regexp.Compile("^(" + p.KeepFrames + ")$"); err != nil {
+ return fmt.Errorf("failed to compile regexp %s: %v", p.KeepFrames, err)
+ }
+ }
+ p.Prune(drop, keep)
+ }
+ return nil
+}
+
+// PruneFrom removes all nodes beneath the lowest node matching dropRx, not including itself.
+//
+// Please see the example below to understand this method as well as
+// the difference from Prune method.
+//
+// A sample contains Location of [A,B,C,B,D] where D is the top frame and there's no inline.
+//
+// PruneFrom(A) returns [A,B,C,B,D] because there's no node beneath A.
+// Prune(A, nil) returns [B,C,B,D] by removing A itself.
+//
+// PruneFrom(B) returns [B,C,B,D] by removing all nodes beneath the first B when scanning from the bottom.
+// Prune(B, nil) returns [D] because a matching node is found by scanning from the root.
+func (p *Profile) PruneFrom(dropRx *regexp.Regexp) {
+ pruneBeneath := make(map[uint64]bool)
+
+ for _, loc := range p.Location {
+ for i := 0; i < len(loc.Line); i++ {
+ if fn := loc.Line[i].Function; fn != nil && fn.Name != "" {
+ funcName := simplifyFunc(fn.Name)
+ if dropRx.MatchString(funcName) {
+ // Found matching entry to prune.
+ pruneBeneath[loc.ID] = true
+ loc.Line = loc.Line[i:]
+ break
+ }
+ }
+ }
+ }
+
+ // Prune locs from each Sample
+ for _, sample := range p.Sample {
+ // Scan from the bottom leaf to the root to find the prune location.
+ for i, loc := range sample.Location {
+ if pruneBeneath[loc.ID] {
+ sample.Location = sample.Location[i:]
+ break
+ }
+ }
+ }
+}
diff --git a/vendor/github.com/google/uuid/.travis.yml b/vendor/github.com/google/uuid/.travis.yml
deleted file mode 100644
index d8156a60ba..0000000000
--- a/vendor/github.com/google/uuid/.travis.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-language: go
-
-go:
- - 1.4.3
- - 1.5.3
- - tip
-
-script:
- - go test -v ./...
diff --git a/vendor/github.com/google/uuid/CHANGELOG.md b/vendor/github.com/google/uuid/CHANGELOG.md
new file mode 100644
index 0000000000..7ec5ac7ea9
--- /dev/null
+++ b/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/vendor/github.com/google/uuid/CONTRIBUTING.md b/vendor/github.com/google/uuid/CONTRIBUTING.md
index 04fdf09f13..a502fdc515 100644
--- a/vendor/github.com/google/uuid/CONTRIBUTING.md
+++ b/vendor/github.com/google/uuid/CONTRIBUTING.md
@@ -2,6 +2,22 @@
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
diff --git a/vendor/github.com/google/uuid/README.md b/vendor/github.com/google/uuid/README.md
index f765a46f91..3e9a61889d 100644
--- a/vendor/github.com/google/uuid/README.md
+++ b/vendor/github.com/google/uuid/README.md
@@ -1,6 +1,6 @@
-# uuid 
+# uuid
The uuid package generates and inspects UUIDs based on
-[RFC 4122](http://tools.ietf.org/html/rfc4122)
+[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
@@ -9,10 +9,12 @@ 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
-`go get github.com/google/uuid`
+```sh
+go get github.com/google/uuid
+```
###### Documentation
-[](http://godoc.org/github.com/google/uuid)
+[](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:
diff --git a/vendor/github.com/google/uuid/hash.go b/vendor/github.com/google/uuid/hash.go
index b404f4bec2..dc60082d3b 100644
--- a/vendor/github.com/google/uuid/hash.go
+++ b/vendor/github.com/google/uuid/hash.go
@@ -17,6 +17,12 @@ var (
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
diff --git a/vendor/github.com/google/uuid/node_js.go b/vendor/github.com/google/uuid/node_js.go
index 24b78edc90..b2a0bc8711 100644
--- a/vendor/github.com/google/uuid/node_js.go
+++ b/vendor/github.com/google/uuid/node_js.go
@@ -7,6 +7,6 @@
package uuid
// getHardwareInterface returns nil values for the JS version of the code.
-// This remvoves the "net" dependency, because it is not used in the browser.
+// 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/vendor/github.com/google/uuid/time.go b/vendor/github.com/google/uuid/time.go
index e6ef06cdc8..c351129279 100644
--- a/vendor/github.com/google/uuid/time.go
+++ b/vendor/github.com/google/uuid/time.go
@@ -108,12 +108,23 @@ func setClockSequence(seq int) {
}
// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
-// uuid. The time is only defined for version 1 and 2 UUIDs.
+// uuid. The time is only defined for version 1, 2, 6 and 7 UUIDs.
func (uuid UUID) Time() Time {
- 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
- return 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.
diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go
index a57207aeb6..5232b48678 100644
--- a/vendor/github.com/google/uuid/uuid.go
+++ b/vendor/github.com/google/uuid/uuid.go
@@ -56,11 +56,15 @@ func IsInvalidLengthError(err error) bool {
return ok
}
-// Parse decodes s into a UUID or returns an error. Both the standard UUID
-// forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
-// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the
-// Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex
-// encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
+// 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) {
@@ -69,7 +73,7 @@ func Parse(s string) (UUID, error) {
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
case 36 + 9:
- if strings.ToLower(s[:9]) != "urn:uuid:" {
+ if !strings.EqualFold(s[:9], "urn:uuid:") {
return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9])
}
s = s[9:]
@@ -101,7 +105,8 @@ func Parse(s string) (UUID, error) {
9, 11,
14, 16,
19, 21,
- 24, 26, 28, 30, 32, 34} {
+ 24, 26, 28, 30, 32, 34,
+ } {
v, ok := xtob(s[x], s[x+1])
if !ok {
return uuid, errors.New("invalid UUID format")
@@ -117,7 +122,7 @@ func ParseBytes(b []byte) (UUID, error) {
switch len(b) {
case 36: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
case 36 + 9: // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- if !bytes.Equal(bytes.ToLower(b[:9]), []byte("urn:uuid:")) {
+ if !bytes.EqualFold(b[:9], []byte("urn:uuid:")) {
return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9])
}
b = b[9:]
@@ -145,7 +150,8 @@ func ParseBytes(b []byte) (UUID, error) {
9, 11,
14, 16,
19, 21,
- 24, 26, 28, 30, 32, 34} {
+ 24, 26, 28, 30, 32, 34,
+ } {
v, ok := xtob(b[x], b[x+1])
if !ok {
return uuid, errors.New("invalid UUID format")
@@ -180,6 +186,59 @@ func Must(uuid UUID, err error) UUID {
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 {
@@ -292,3 +351,15 @@ func DisableRandPool() {
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/vendor/github.com/google/uuid/version6.go b/vendor/github.com/google/uuid/version6.go
new file mode 100644
index 0000000000..339a959a7a
--- /dev/null
+++ b/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/vendor/github.com/google/uuid/version7.go b/vendor/github.com/google/uuid/version7.go
new file mode 100644
index 0000000000..3167b643d4
--- /dev/null
+++ b/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/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/LICENSE.txt b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/LICENSE
similarity index 100%
rename from vendor/github.com/grpc-ecosystem/grpc-gateway/v2/LICENSE.txt
rename to vendor/github.com/grpc-ecosystem/grpc-gateway/v2/LICENSE
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel
index f694f3c0d0..b8fbb2b77c 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel
@@ -24,7 +24,7 @@ go_test(
embed = [":httprule"],
deps = [
"//utilities",
- "@com_github_golang_glog//:glog",
+ "@org_golang_google_grpc//grpclog",
],
)
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel
index a8789f1702..78d7c9f5c8 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel
@@ -26,7 +26,7 @@ go_library(
deps = [
"//internal/httprule",
"//utilities",
- "@go_googleapis//google/api:httpbody_go_proto",
+ "@org_golang_google_genproto_googleapis_api//httpbody",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//grpclog",
"@org_golang_google_grpc//health/grpc_health_v1",
@@ -70,9 +70,9 @@ go_test(
"//utilities",
"@com_github_google_go_cmp//cmp",
"@com_github_google_go_cmp//cmp/cmpopts",
- "@go_googleapis//google/api:httpbody_go_proto",
- "@go_googleapis//google/rpc:errdetails_go_proto",
- "@go_googleapis//google/rpc:status_go_proto",
+ "@org_golang_google_genproto_googleapis_api//httpbody",
+ "@org_golang_google_genproto_googleapis_rpc//errdetails",
+ "@org_golang_google_genproto_googleapis_rpc//status",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//health/grpc_health_v1",
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go
index 31553e7848..5dd4e44786 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/context.go
@@ -148,6 +148,12 @@ func annotateContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcM
var pairs []string
for key, vals := range req.Header {
key = textproto.CanonicalMIMEHeaderKey(key)
+ switch key {
+ case xForwardedFor, xForwardedHost:
+ // Handled separately below
+ continue
+ }
+
for _, val := range vals {
// For backwards-compatibility, pass through 'authorization' header with no prefix.
if key == "Authorization" {
@@ -181,18 +187,17 @@ func annotateContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcM
pairs = append(pairs, strings.ToLower(xForwardedHost), req.Host)
}
+ xff := req.Header.Values(xForwardedFor)
if addr := req.RemoteAddr; addr != "" {
if remoteIP, _, err := net.SplitHostPort(addr); err == nil {
- if fwd := req.Header.Get(xForwardedFor); fwd == "" {
- pairs = append(pairs, strings.ToLower(xForwardedFor), remoteIP)
- } else {
- pairs = append(pairs, strings.ToLower(xForwardedFor), fmt.Sprintf("%s, %s", fwd, remoteIP))
- }
+ xff = append(xff, remoteIP)
}
}
+ if len(xff) > 0 {
+ pairs = append(pairs, strings.ToLower(xForwardedFor), strings.Join(xff, ", "))
+ }
if timeout != 0 {
- //nolint:govet // The context outlives this function
ctx, _ = context.WithTimeout(ctx, timeout)
}
if len(pairs) == 0 {
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go
index d2bcbb7d2a..5682998699 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go
@@ -71,7 +71,7 @@ func HTTPStatusFromCode(code codes.Code) int {
case codes.DataLoss:
return http.StatusInternalServerError
default:
- grpclog.Infof("Unknown gRPC error code: %v", code)
+ grpclog.Warningf("Unknown gRPC error code: %v", code)
return http.StatusInternalServerError
}
}
@@ -114,17 +114,17 @@ func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marsh
buf, merr := marshaler.Marshal(pb)
if merr != nil {
- grpclog.Infof("Failed to marshal error message %q: %v", s, merr)
+ grpclog.Errorf("Failed to marshal error message %q: %v", s, merr)
w.WriteHeader(http.StatusInternalServerError)
if _, err := io.WriteString(w, fallback); err != nil {
- grpclog.Infof("Failed to write response: %v", err)
+ grpclog.Errorf("Failed to write response: %v", err)
}
return
}
md, ok := ServerMetadataFromContext(ctx)
if !ok {
- grpclog.Infof("Failed to extract ServerMetadata from context")
+ grpclog.Error("Failed to extract ServerMetadata from context")
}
handleForwardResponseServerMetadata(w, mux, md)
@@ -137,7 +137,7 @@ func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marsh
doForwardTrailers := requestAcceptsTrailers(r)
if doForwardTrailers {
- handleForwardResponseTrailerHeader(w, md)
+ handleForwardResponseTrailerHeader(w, mux, md)
w.Header().Set("Transfer-Encoding", "chunked")
}
@@ -148,11 +148,11 @@ func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marsh
w.WriteHeader(st)
if _, err := w.Write(buf); err != nil {
- grpclog.Infof("Failed to write response: %v", err)
+ grpclog.Errorf("Failed to write response: %v", err)
}
if doForwardTrailers {
- handleForwardResponseTrailer(w, md)
+ handleForwardResponseTrailer(w, mux, md)
}
}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go
index a03dd166bd..9005d6a0bf 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go
@@ -27,7 +27,7 @@ func FieldMaskFromRequestBody(r io.Reader, msg proto.Message) (*field_mask.Field
var root interface{}
if err := json.NewDecoder(r).Decode(&root); err != nil {
- if err == io.EOF {
+ if errors.Is(err, io.EOF) {
return fm, nil
}
return nil, err
@@ -41,7 +41,7 @@ func FieldMaskFromRequestBody(r io.Reader, msg proto.Message) (*field_mask.Field
m, ok := item.node.(map[string]interface{})
switch {
- case ok:
+ case ok && len(m) > 0:
// if the item is an object, then enqueue all of its children
for k, v := range m {
if item.msg == nil {
@@ -96,6 +96,8 @@ func FieldMaskFromRequestBody(r io.Reader, msg proto.Message) (*field_mask.Field
queue = append(queue, child)
}
}
+ case ok && len(m) == 0:
+ fallthrough
case len(item.path) > 0:
// otherwise, it's a leaf node so print its path
fm.Paths = append(fm.Paths, item.path)
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go
index 945f3a5ebf..de1eef1f4f 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go
@@ -2,10 +2,11 @@ package runtime
import (
"context"
- "fmt"
+ "errors"
"io"
"net/http"
"net/textproto"
+ "strconv"
"strings"
"google.golang.org/genproto/googleapis/api/httpbody"
@@ -17,16 +18,10 @@ import (
// ForwardResponseStream forwards the stream from gRPC server to REST client.
func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, recv func() (proto.Message, error), opts ...func(context.Context, http.ResponseWriter, proto.Message) error) {
- f, ok := w.(http.Flusher)
- if !ok {
- grpclog.Infof("Flush not supported in %T", w)
- http.Error(w, "unexpected type of web server", http.StatusInternalServerError)
- return
- }
-
+ rc := http.NewResponseController(w)
md, ok := ServerMetadataFromContext(ctx)
if !ok {
- grpclog.Infof("Failed to extract ServerMetadata from context")
+ grpclog.Error("Failed to extract ServerMetadata from context")
http.Error(w, "unexpected error", http.StatusInternalServerError)
return
}
@@ -48,7 +43,7 @@ func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshal
var wroteHeader bool
for {
resp, err := recv()
- if err == io.EOF {
+ if errors.Is(err, io.EOF) {
return
}
if err != nil {
@@ -81,20 +76,29 @@ func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshal
}
if err != nil {
- grpclog.Infof("Failed to marshal response chunk: %v", err)
+ grpclog.Errorf("Failed to marshal response chunk: %v", err)
handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err, delimiter)
return
}
if _, err := w.Write(buf); err != nil {
- grpclog.Infof("Failed to send response chunk: %v", err)
+ grpclog.Errorf("Failed to send response chunk: %v", err)
return
}
wroteHeader = true
if _, err := w.Write(delimiter); err != nil {
- grpclog.Infof("Failed to send delimiter chunk: %v", err)
+ grpclog.Errorf("Failed to send delimiter chunk: %v", err)
+ return
+ }
+ err = rc.Flush()
+ if err != nil {
+ if errors.Is(err, http.ErrNotSupported) {
+ grpclog.Errorf("Flush not supported in %T", w)
+ http.Error(w, "unexpected type of web server", http.StatusInternalServerError)
+ return
+ }
+ grpclog.Errorf("Failed to flush response to client: %v", err)
return
}
- f.Flush()
}
}
@@ -108,18 +112,20 @@ func handleForwardResponseServerMetadata(w http.ResponseWriter, mux *ServeMux, m
}
}
-func handleForwardResponseTrailerHeader(w http.ResponseWriter, md ServerMetadata) {
+func handleForwardResponseTrailerHeader(w http.ResponseWriter, mux *ServeMux, md ServerMetadata) {
for k := range md.TrailerMD {
- tKey := textproto.CanonicalMIMEHeaderKey(fmt.Sprintf("%s%s", MetadataTrailerPrefix, k))
- w.Header().Add("Trailer", tKey)
+ if h, ok := mux.outgoingTrailerMatcher(k); ok {
+ w.Header().Add("Trailer", textproto.CanonicalMIMEHeaderKey(h))
+ }
}
}
-func handleForwardResponseTrailer(w http.ResponseWriter, md ServerMetadata) {
+func handleForwardResponseTrailer(w http.ResponseWriter, mux *ServeMux, md ServerMetadata) {
for k, vs := range md.TrailerMD {
- tKey := fmt.Sprintf("%s%s", MetadataTrailerPrefix, k)
- for _, v := range vs {
- w.Header().Add(tKey, v)
+ if h, ok := mux.outgoingTrailerMatcher(k); ok {
+ for _, v := range vs {
+ w.Header().Add(h, v)
+ }
}
}
}
@@ -134,7 +140,7 @@ type responseBody interface {
func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, resp proto.Message, opts ...func(context.Context, http.ResponseWriter, proto.Message) error) {
md, ok := ServerMetadataFromContext(ctx)
if !ok {
- grpclog.Infof("Failed to extract ServerMetadata from context")
+ grpclog.Error("Failed to extract ServerMetadata from context")
}
handleForwardResponseServerMetadata(w, mux, md)
@@ -147,12 +153,10 @@ func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marsha
doForwardTrailers := requestAcceptsTrailers(req)
if doForwardTrailers {
- handleForwardResponseTrailerHeader(w, md)
+ handleForwardResponseTrailerHeader(w, mux, md)
w.Header().Set("Transfer-Encoding", "chunked")
}
- handleForwardResponseTrailerHeader(w, md)
-
contentType := marshaler.ContentType(resp)
w.Header().Set("Content-Type", contentType)
@@ -168,17 +172,21 @@ func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marsha
buf, err = marshaler.Marshal(resp)
}
if err != nil {
- grpclog.Infof("Marshal error: %v", err)
+ grpclog.Errorf("Marshal error: %v", err)
HTTPError(ctx, mux, marshaler, w, req, err)
return
}
+ if !doForwardTrailers {
+ w.Header().Set("Content-Length", strconv.Itoa(len(buf)))
+ }
+
if _, err = w.Write(buf); err != nil {
- grpclog.Infof("Failed to write response: %v", err)
+ grpclog.Errorf("Failed to write response: %v", err)
}
if doForwardTrailers {
- handleForwardResponseTrailer(w, md)
+ handleForwardResponseTrailer(w, mux, md)
}
}
@@ -193,7 +201,7 @@ func handleForwardResponseOptions(ctx context.Context, w http.ResponseWriter, re
}
for _, opt := range opts {
if err := opt(ctx, w, resp); err != nil {
- grpclog.Infof("Error handling ForwardResponseOptions: %v", err)
+ grpclog.Errorf("Error handling ForwardResponseOptions: %v", err)
return err
}
}
@@ -209,15 +217,15 @@ func handleForwardResponseStreamError(ctx context.Context, wroteHeader bool, mar
}
buf, err := marshaler.Marshal(msg)
if err != nil {
- grpclog.Infof("Failed to marshal an error: %v", err)
+ grpclog.Errorf("Failed to marshal an error: %v", err)
return
}
if _, err := w.Write(buf); err != nil {
- grpclog.Infof("Failed to notify error to client: %v", err)
+ grpclog.Errorf("Failed to notify error to client: %v", err)
return
}
if _, err := w.Write(delimiter); err != nil {
- grpclog.Infof("Failed to send delimiter chunk: %v", err)
+ grpclog.Errorf("Failed to send delimiter chunk: %v", err)
return
}
}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_httpbodyproto.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_httpbodyproto.go
index b86135c889..6de2e220c7 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_httpbodyproto.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_httpbodyproto.go
@@ -26,7 +26,7 @@ func (h *HTTPBodyMarshaler) ContentType(v interface{}) string {
// google.api.HttpBody message, otherwise it falls back to the default Marshaler.
func (h *HTTPBodyMarshaler) Marshal(v interface{}) ([]byte, error) {
if httpBody, ok := v.(*httpbody.HttpBody); ok {
- return httpBody.Data, nil
+ return httpBody.GetData(), nil
}
return h.Marshaler.Marshal(v)
}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go
index d6aa825783..fe52081ab9 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_json.go
@@ -24,6 +24,11 @@ func (j *JSONBuiltin) Marshal(v interface{}) ([]byte, error) {
return json.Marshal(v)
}
+// MarshalIndent is like Marshal but applies Indent to format the output
+func (j *JSONBuiltin) MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
+ return json.MarshalIndent(v, prefix, indent)
+}
+
// Unmarshal unmarshals JSON data into "v".
func (j *JSONBuiltin) Unmarshal(data []byte, v interface{}) error {
return json.Unmarshal(data, v)
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go
index 51b8247da2..8376d1e0ef 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshal_jsonpb.go
@@ -30,10 +30,6 @@ func (*JSONPb) ContentType(_ interface{}) string {
// Marshal marshals "v" into JSON.
func (j *JSONPb) Marshal(v interface{}) ([]byte, error) {
- if _, ok := v.(proto.Message); !ok {
- return j.marshalNonProtoField(v)
- }
-
var buf bytes.Buffer
if err := j.marshalTo(&buf, v); err != nil {
return nil, err
@@ -48,9 +44,17 @@ func (j *JSONPb) marshalTo(w io.Writer, v interface{}) error {
if err != nil {
return err
}
+ if j.Indent != "" {
+ b := &bytes.Buffer{}
+ if err := json.Indent(b, buf, "", j.Indent); err != nil {
+ return err
+ }
+ buf = b.Bytes()
+ }
_, err = w.Write(buf)
return err
}
+
b, err := j.MarshalOptions.Marshal(p)
if err != nil {
return err
@@ -150,9 +154,6 @@ func (j *JSONPb) marshalNonProtoField(v interface{}) ([]byte, error) {
}
m[fmt.Sprintf("%v", k.Interface())] = (*json.RawMessage)(&buf)
}
- if j.Indent != "" {
- return json.MarshalIndent(m, "", j.Indent)
- }
return json.Marshal(m)
}
if enum, ok := rv.Interface().(protoEnum); ok && !j.UseEnumNumbers {
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go
index a714de0240..0b051e6e89 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/marshaler_registry.go
@@ -46,7 +46,7 @@ func MarshalerForRequest(mux *ServeMux, r *http.Request) (inbound Marshaler, out
for _, contentTypeVal := range r.Header[contentTypeHeader] {
contentType, _, err := mime.ParseMediaType(contentTypeVal)
if err != nil {
- grpclog.Infof("Failed to parse Content-Type %s: %v", contentTypeVal, err)
+ grpclog.Errorf("Failed to parse Content-Type %s: %v", contentTypeVal, err)
continue
}
if m, ok := mux.marshalers.mimeMap[contentType]; ok {
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go
index f451cb441f..ed9a7e4387 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go
@@ -57,6 +57,7 @@ type ServeMux struct {
marshalers marshalerRegistry
incomingHeaderMatcher HeaderMatcherFunc
outgoingHeaderMatcher HeaderMatcherFunc
+ outgoingTrailerMatcher HeaderMatcherFunc
metadataAnnotators []func(context.Context, *http.Request) metadata.MD
errorHandler ErrorHandlerFunc
streamErrorHandler StreamErrorHandlerFunc
@@ -114,10 +115,18 @@ func DefaultHeaderMatcher(key string) (string, bool) {
return "", false
}
+func defaultOutgoingHeaderMatcher(key string) (string, bool) {
+ return fmt.Sprintf("%s%s", MetadataHeaderPrefix, key), true
+}
+
+func defaultOutgoingTrailerMatcher(key string) (string, bool) {
+ return fmt.Sprintf("%s%s", MetadataTrailerPrefix, key), true
+}
+
// WithIncomingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for incoming request to gateway.
//
// This matcher will be called with each header in http.Request. If matcher returns true, that header will be
-// passed to gRPC context. To transform the header before passing to gRPC context, matcher should return modified header.
+// passed to gRPC context. To transform the header before passing to gRPC context, matcher should return the modified header.
func WithIncomingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption {
for _, header := range fn.matchedMalformedHeaders() {
grpclog.Warningf("The configured forwarding filter would allow %q to be sent to the gRPC server, which will likely cause errors. See https://github.com/grpc/grpc-go/pull/4803#issuecomment-986093310 for more information.", header)
@@ -147,13 +156,24 @@ func (fn HeaderMatcherFunc) matchedMalformedHeaders() []string {
//
// This matcher will be called with each header in response header metadata. If matcher returns true, that header will be
// passed to http response returned from gateway. To transform the header before passing to response,
-// matcher should return modified header.
+// matcher should return the modified header.
func WithOutgoingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption {
return func(mux *ServeMux) {
mux.outgoingHeaderMatcher = fn
}
}
+// WithOutgoingTrailerMatcher returns a ServeMuxOption representing a headerMatcher for outgoing response from gateway.
+//
+// This matcher will be called with each header in response trailer metadata. If matcher returns true, that header will be
+// passed to http response returned from gateway. To transform the header before passing to response,
+// matcher should return the modified header.
+func WithOutgoingTrailerMatcher(fn HeaderMatcherFunc) ServeMuxOption {
+ return func(mux *ServeMux) {
+ mux.outgoingTrailerMatcher = fn
+ }
+}
+
// WithMetadata returns a ServeMuxOption for passing metadata to a gRPC context.
//
// This can be used by services that need to read from http.Request and modify gRPC context. A common use case
@@ -273,11 +293,11 @@ func NewServeMux(opts ...ServeMuxOption) *ServeMux {
if serveMux.incomingHeaderMatcher == nil {
serveMux.incomingHeaderMatcher = DefaultHeaderMatcher
}
-
if serveMux.outgoingHeaderMatcher == nil {
- serveMux.outgoingHeaderMatcher = func(key string) (string, bool) {
- return fmt.Sprintf("%s%s", MetadataHeaderPrefix, key), true
- }
+ serveMux.outgoingHeaderMatcher = defaultOutgoingHeaderMatcher
+ }
+ if serveMux.outgoingTrailerMatcher == nil {
+ serveMux.outgoingTrailerMatcher = defaultOutgoingTrailerMatcher
}
return serveMux
@@ -321,13 +341,13 @@ func (s *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
if override := r.Header.Get("X-HTTP-Method-Override"); override != "" && s.isPathLengthFallback(r) {
- r.Method = strings.ToUpper(override)
if err := r.ParseForm(); err != nil {
_, outboundMarshaler := MarshalerForRequest(s, r)
sterr := status.Error(codes.InvalidArgument, err.Error())
s.errorHandler(ctx, s, outboundMarshaler, w, r, sterr)
return
}
+ r.Method = strings.ToUpper(override)
}
var pathComponents []string
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go
index 8f90d15a56..e54507145b 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/pattern.go
@@ -52,13 +52,13 @@ type Pattern struct {
// It returns an error if the given definition is invalid.
func NewPattern(version int, ops []int, pool []string, verb string) (Pattern, error) {
if version != 1 {
- grpclog.Infof("unsupported version: %d", version)
+ grpclog.Errorf("unsupported version: %d", version)
return Pattern{}, ErrInvalidPattern
}
l := len(ops)
if l%2 != 0 {
- grpclog.Infof("odd number of ops codes: %d", l)
+ grpclog.Errorf("odd number of ops codes: %d", l)
return Pattern{}, ErrInvalidPattern
}
@@ -81,14 +81,14 @@ func NewPattern(version int, ops []int, pool []string, verb string) (Pattern, er
stack++
case utilities.OpPushM:
if pushMSeen {
- grpclog.Infof("pushM appears twice")
+ grpclog.Error("pushM appears twice")
return Pattern{}, ErrInvalidPattern
}
pushMSeen = true
stack++
case utilities.OpLitPush:
if op.operand < 0 || len(pool) <= op.operand {
- grpclog.Infof("negative literal index: %d", op.operand)
+ grpclog.Errorf("negative literal index: %d", op.operand)
return Pattern{}, ErrInvalidPattern
}
if pushMSeen {
@@ -97,18 +97,18 @@ func NewPattern(version int, ops []int, pool []string, verb string) (Pattern, er
stack++
case utilities.OpConcatN:
if op.operand <= 0 {
- grpclog.Infof("negative concat size: %d", op.operand)
+ grpclog.Errorf("negative concat size: %d", op.operand)
return Pattern{}, ErrInvalidPattern
}
stack -= op.operand
if stack < 0 {
- grpclog.Info("stack underflow")
+ grpclog.Error("stack underflow")
return Pattern{}, ErrInvalidPattern
}
stack++
case utilities.OpCapture:
if op.operand < 0 || len(pool) <= op.operand {
- grpclog.Infof("variable name index out of bound: %d", op.operand)
+ grpclog.Errorf("variable name index out of bound: %d", op.operand)
return Pattern{}, ErrInvalidPattern
}
v := pool[op.operand]
@@ -116,11 +116,11 @@ func NewPattern(version int, ops []int, pool []string, verb string) (Pattern, er
vars = append(vars, v)
stack--
if stack < 0 {
- grpclog.Infof("stack underflow")
+ grpclog.Error("stack underflow")
return Pattern{}, ErrInvalidPattern
}
default:
- grpclog.Infof("invalid opcode: %d", op.code)
+ grpclog.Errorf("invalid opcode: %d", op.code)
return Pattern{}, ErrInvalidPattern
}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go
index d01933c4fd..fe634174b8 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go
@@ -51,11 +51,13 @@ func (*DefaultQueryParser) Parse(msg proto.Message, values url.Values, filter *u
key = match[1]
values = append([]string{match[2]}, values...)
}
- fieldPath := strings.Split(key, ".")
+
+ msgValue := msg.ProtoReflect()
+ fieldPath := normalizeFieldPath(msgValue, strings.Split(key, "."))
if filter.HasCommonPrefix(fieldPath) {
continue
}
- if err := populateFieldValueFromPath(msg.ProtoReflect(), fieldPath, values); err != nil {
+ if err := populateFieldValueFromPath(msgValue, fieldPath, values); err != nil {
return err
}
}
@@ -68,6 +70,38 @@ func PopulateFieldFromPath(msg proto.Message, fieldPathString string, value stri
return populateFieldValueFromPath(msg.ProtoReflect(), fieldPath, []string{value})
}
+func normalizeFieldPath(msgValue protoreflect.Message, fieldPath []string) []string {
+ newFieldPath := make([]string, 0, len(fieldPath))
+ for i, fieldName := range fieldPath {
+ fields := msgValue.Descriptor().Fields()
+ fieldDesc := fields.ByTextName(fieldName)
+ if fieldDesc == nil {
+ fieldDesc = fields.ByJSONName(fieldName)
+ }
+ if fieldDesc == nil {
+ // return initial field path values if no matching message field was found
+ return fieldPath
+ }
+
+ newFieldPath = append(newFieldPath, string(fieldDesc.Name()))
+
+ // If this is the last element, we're done
+ if i == len(fieldPath)-1 {
+ break
+ }
+
+ // Only singular message fields are allowed
+ if fieldDesc.Message() == nil || fieldDesc.Cardinality() == protoreflect.Repeated {
+ return fieldPath
+ }
+
+ // Get the nested message
+ msgValue = msgValue.Get(fieldDesc).Message()
+ }
+
+ return newFieldPath
+}
+
func populateFieldValueFromPath(msgValue protoreflect.Message, fieldPath []string, values []string) error {
if len(fieldPath) < 1 {
return errors.New("no field path")
diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE b/vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE
deleted file mode 100644
index 5d8cb5b72e..0000000000
--- a/vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE
+++ /dev/null
@@ -1 +0,0 @@
-Copyright 2012 Matt T. Proud (matt.proud@gmail.com)
diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore
deleted file mode 100644
index e16fb946bb..0000000000
--- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-cover.dat
diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile
deleted file mode 100644
index 81be214370..0000000000
--- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-all:
-
-cover:
- go test -cover -v -coverprofile=cover.dat ./...
- go tool cover -func cover.dat
-
-.PHONY: cover
diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go
deleted file mode 100644
index 258c0636aa..0000000000
--- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2013 Matt T. Proud
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 pbutil
-
-import (
- "encoding/binary"
- "errors"
- "io"
-
- "github.com/golang/protobuf/proto"
-)
-
-var errInvalidVarint = errors.New("invalid varint32 encountered")
-
-// ReadDelimited decodes a message from the provided length-delimited stream,
-// where the length is encoded as 32-bit varint prefix to the message body.
-// It returns the total number of bytes read and any applicable error. This is
-// roughly equivalent to the companion Java API's
-// MessageLite#parseDelimitedFrom. As per the reader contract, this function
-// calls r.Read repeatedly as required until exactly one message including its
-// prefix is read and decoded (or an error has occurred). The function never
-// reads more bytes from the stream than required. The function never returns
-// an error if a message has been read and decoded correctly, even if the end
-// of the stream has been reached in doing so. In that case, any subsequent
-// calls return (0, io.EOF).
-func ReadDelimited(r io.Reader, m proto.Message) (n int, err error) {
- // Per AbstractParser#parsePartialDelimitedFrom with
- // CodedInputStream#readRawVarint32.
- var headerBuf [binary.MaxVarintLen32]byte
- var bytesRead, varIntBytes int
- var messageLength uint64
- for varIntBytes == 0 { // i.e. no varint has been decoded yet.
- if bytesRead >= len(headerBuf) {
- return bytesRead, errInvalidVarint
- }
- // We have to read byte by byte here to avoid reading more bytes
- // than required. Each read byte is appended to what we have
- // read before.
- newBytesRead, err := r.Read(headerBuf[bytesRead : bytesRead+1])
- if newBytesRead == 0 {
- if err != nil {
- return bytesRead, err
- }
- // A Reader should not return (0, nil), but if it does,
- // it should be treated as no-op (according to the
- // Reader contract). So let's go on...
- continue
- }
- bytesRead += newBytesRead
- // Now present everything read so far to the varint decoder and
- // see if a varint can be decoded already.
- messageLength, varIntBytes = proto.DecodeVarint(headerBuf[:bytesRead])
- }
-
- messageBuf := make([]byte, messageLength)
- newBytesRead, err := io.ReadFull(r, messageBuf)
- bytesRead += newBytesRead
- if err != nil {
- return bytesRead, err
- }
-
- return bytesRead, proto.Unmarshal(messageBuf, m)
-}
diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go b/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go
deleted file mode 100644
index 8fb59ad226..0000000000
--- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2013 Matt T. Proud
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 pbutil
-
-import (
- "encoding/binary"
- "io"
-
- "github.com/golang/protobuf/proto"
-)
-
-// WriteDelimited encodes and dumps a message to the provided writer prefixed
-// with a 32-bit varint indicating the length of the encoded message, producing
-// a length-delimited record stream, which can be used to chain together
-// encoded messages of the same type together in a file. It returns the total
-// number of bytes written and any applicable error. This is roughly
-// equivalent to the companion Java API's MessageLite#writeDelimitedTo.
-func WriteDelimited(w io.Writer, m proto.Message) (n int, err error) {
- buffer, err := proto.Marshal(m)
- if err != nil {
- return 0, err
- }
-
- var buf [binary.MaxVarintLen32]byte
- encodedLength := binary.PutUvarint(buf[:], uint64(len(buffer)))
-
- sync, err := w.Write(buf[:encodedLength])
- if err != nil {
- return sync, err
- }
-
- n, err = w.Write(buffer)
- return n + sync, err
-}
diff --git a/vendor/github.com/openshift/api/config/v1/types_cluster_version.go b/vendor/github.com/openshift/api/config/v1/types_cluster_version.go
index 61386a72e4..24e0b2f093 100644
--- a/vendor/github.com/openshift/api/config/v1/types_cluster_version.go
+++ b/vendor/github.com/openshift/api/config/v1/types_cluster_version.go
@@ -288,7 +288,7 @@ const (
)
// ClusterVersionCapability enumerates optional, core cluster components.
-// +kubebuilder:validation:Enum=openshift-samples;baremetal;marketplace;Console;Insights;Storage;CSISnapshot;NodeTuning;MachineAPI;Build;DeploymentConfig;ImageRegistry;OperatorLifecycleManager;CloudCredential;Ingress;CloudControllerManager
+// +kubebuilder:validation:Enum=openshift-samples;baremetal;marketplace;Console;Insights;Storage;CSISnapshot;NodeTuning;MachineAPI;Build;DeploymentConfig;ImageRegistry;OperatorLifecycleManager;CloudCredential;Ingress;CloudControllerManager;OperatorLifecycleManagerV1
type ClusterVersionCapability string
const (
@@ -379,10 +379,14 @@ const (
// allows to distribute Docker images
ClusterVersionCapabilityImageRegistry ClusterVersionCapability = "ImageRegistry"
- // ClusterVersionCapabilityOperatorLifecycleManager manages the Operator Lifecycle Manager
+ // ClusterVersionCapabilityOperatorLifecycleManager manages the Operator Lifecycle Manager (legacy)
// which itself manages the lifecycle of operators
ClusterVersionCapabilityOperatorLifecycleManager ClusterVersionCapability = "OperatorLifecycleManager"
+ // ClusterVersionCapabilityOperatorLifecycleManagerV1 manages the Operator Lifecycle Manager (v1)
+ // which itself manages the lifecycle of operators
+ ClusterVersionCapabilityOperatorLifecycleManagerV1 ClusterVersionCapability = "OperatorLifecycleManagerV1"
+
// ClusterVersionCapabilityCloudCredential manages credentials for cloud providers
// in openshift cluster
ClusterVersionCapabilityCloudCredential ClusterVersionCapability = "CloudCredential"
@@ -422,6 +426,7 @@ var KnownClusterVersionCapabilities = []ClusterVersionCapability{
ClusterVersionCapabilityDeploymentConfig,
ClusterVersionCapabilityImageRegistry,
ClusterVersionCapabilityOperatorLifecycleManager,
+ ClusterVersionCapabilityOperatorLifecycleManagerV1,
ClusterVersionCapabilityCloudCredential,
ClusterVersionCapabilityIngress,
ClusterVersionCapabilityCloudControllerManager,
@@ -600,6 +605,7 @@ var ClusterVersionCapabilitySets = map[ClusterVersionCapabilitySet][]ClusterVers
ClusterVersionCapabilityDeploymentConfig,
ClusterVersionCapabilityImageRegistry,
ClusterVersionCapabilityOperatorLifecycleManager,
+ ClusterVersionCapabilityOperatorLifecycleManagerV1,
ClusterVersionCapabilityCloudCredential,
ClusterVersionCapabilityIngress,
ClusterVersionCapabilityCloudControllerManager,
@@ -618,6 +624,7 @@ var ClusterVersionCapabilitySets = map[ClusterVersionCapabilitySet][]ClusterVers
ClusterVersionCapabilityDeploymentConfig,
ClusterVersionCapabilityImageRegistry,
ClusterVersionCapabilityOperatorLifecycleManager,
+ ClusterVersionCapabilityOperatorLifecycleManagerV1,
ClusterVersionCapabilityCloudCredential,
ClusterVersionCapabilityIngress,
ClusterVersionCapabilityCloudControllerManager,
diff --git a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go
index 392d128c11..43d27c4468 100644
--- a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go
+++ b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go
@@ -507,6 +507,20 @@ type AWSPlatformStatus struct {
// +listType=atomic
// +optional
ResourceTags []AWSResourceTag `json:"resourceTags,omitempty"`
+
+ // 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.
+ //
+ // +default={"dnsType": "PlatformDefault"}
+ // +kubebuilder:default={"dnsType": "PlatformDefault"}
+ // +openshift:enable:FeatureGate=AWSClusterHostedDNS
+ // +optional
+ // +nullable
+ CloudLoadBalancerConfig *CloudLoadBalancerConfig `json:"cloudLoadBalancerConfig,omitempty"`
}
// AWSResourceTag is a tag to apply to AWS resources created for the cluster.
@@ -647,12 +661,12 @@ type GCPPlatformStatus struct {
// Tombstone the field as a reminder.
// ClusterHostedDNS ClusterHostedDNS `json:"clusterHostedDNS,omitempty"`
- // cloudLoadBalancerConfig is a union that contains the IP addresses of API,
- // API-Int and Ingress Load Balancers created on the cloud platform. These
- // values would not be populated on on-prem platforms. These Load Balancer
- // IPs are used to configure the in-cluster DNS instances for API, API-Int
- // and Ingress services. `dnsType` is expected to be set to `ClusterHosted`
- // when these Load Balancer IP addresses are populated and used.
+ // 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.
//
// +default={"dnsType": "PlatformDefault"}
// +kubebuilder:default={"dnsType": "PlatformDefault"}
@@ -1579,7 +1593,7 @@ type PowerVSServiceEndpoint struct {
// Power Cloud - https://cloud.ibm.com/apidocs/power-cloud
//
// +kubebuilder:validation:Required
- // +kubebuilder:validation:Pattern=`^[a-z0-9-]+$`
+ // +kubebuilder:validation:Enum=CIS;COS;COSConfig;DNSServices;GlobalCatalog;GlobalSearch;GlobalTagging;HyperProtect;IAM;KeyProtect;Power;ResourceController;ResourceManager;VPC
Name string `json:"name"`
// url is fully qualified URI with scheme https, that overrides the default generated
diff --git a/vendor/github.com/openshift/api/config/v1/types_node.go b/vendor/github.com/openshift/api/config/v1/types_node.go
index b3b1b62c4d..a50328c91f 100644
--- a/vendor/github.com/openshift/api/config/v1/types_node.go
+++ b/vendor/github.com/openshift/api/config/v1/types_node.go
@@ -46,6 +46,25 @@ type NodeSpec struct {
// the status and corresponding reaction of the cluster
// +optional
WorkerLatencyProfile WorkerLatencyProfileType `json:"workerLatencyProfile,omitempty"`
+
+ // minimumKubeletVersion is the lowest version of a kubelet that can join the cluster.
+ // Specifically, the apiserver will deny most authorization requests of kubelets that are older
+ // than the specified version, only allowing the kubelet to get and update its node object, and perform
+ // subjectaccessreviews.
+ // This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads,
+ // and will eventually be marked as not ready.
+ // Its max length is 8, so maximum version allowed is either "9.999.99" or "99.99.99".
+ // Since the kubelet reports the version of the kubernetes release, not Openshift, this field references
+ // the underlying kubernetes version this version of Openshift is based off of.
+ // In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then
+ // they should set the minimumKubeletVersion to 1.30.0.
+ // When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version.
+ // Thus, a kubelet with version "1.0.0-ec.0" will be compatible with minimumKubeletVersion "1.0.0" or earlier.
+ // +kubebuilder:validation:XValidation:rule="self == \"\" || self.matches('^[0-9]*.[0-9]*.[0-9]*$')",message="minmumKubeletVersion must be in a semver compatible format of x.y.z, or empty"
+ // +kubebuilder:validation:MaxLength:=8
+ // +openshift:enable:FeatureGate=MinimumKubeletVersion
+ // +optional
+ MinimumKubeletVersion string `json:"minimumKubeletVersion"`
}
type NodeStatus struct {
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusteroperators.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusteroperators.crd.yaml
index b31121980a..1cc395e74b 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusteroperators.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusteroperators.crd.yaml
@@ -41,21 +41,27 @@ spec:
name: v1
schema:
openAPIV3Schema:
- description: "ClusterOperator is the Custom Resource object which holds the
- current state of an operator. This object is used by operators to convey
- their state to the rest of the cluster. \n Compatibility level 1: Stable
- within a major release for a minimum of 12 months or 3 minor releases (whichever
- is longer)."
+ description: |-
+ ClusterOperator is the Custom Resource object which holds the current state
+ of an operator. This object is used by operators to convey their state to
+ the rest of the cluster.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -63,15 +69,17 @@ spec:
description: spec holds configuration that could apply to any operator.
type: object
status:
- description: status holds the information about the state of an operator. It
- is consistent with status information across the Kubernetes ecosystem.
+ description: |-
+ status holds the information about the state of an operator. It is consistent with status information across
+ the Kubernetes ecosystem.
properties:
conditions:
description: conditions describes the state of the operator's managed
and monitored components.
items:
- description: ClusterOperatorStatusCondition represents the state
- of the operator's managed and monitored components.
+ description: |-
+ ClusterOperatorStatusCondition represents the state of the operator's
+ managed and monitored components.
properties:
lastTransitionTime:
description: lastTransitionTime is the time of the last update
@@ -79,10 +87,10 @@ spec:
format: date-time
type: string
message:
- description: message provides additional information about the
- current condition. This is only to be consumed by humans. It
- may contain Line Feed characters (U+000A), which should be
- rendered as new lines.
+ description: |-
+ message provides additional information about the current condition.
+ This is only to be consumed by humans. It may contain Line Feed
+ characters (U+000A), which should be rendered as new lines.
type: string
reason:
description: reason is the CamelCase reason for the condition's
@@ -101,15 +109,18 @@ spec:
type: object
type: array
extension:
- description: extension contains any additional status information
- specific to the operator which owns this status object.
+ description: |-
+ extension contains any additional status information specific to the
+ operator which owns this status object.
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
relatedObjects:
- description: 'relatedObjects is a list of objects that are "interesting"
- or related to this operator. Common uses are: 1. the detailed resource
- driving the operator 2. operator namespaces 3. operand namespaces'
+ description: |-
+ relatedObjects is a list of objects that are "interesting" or related to this operator. Common uses are:
+ 1. the detailed resource driving the operator
+ 2. operator namespaces
+ 3. operand namespaces
items:
description: ObjectReference contains enough information to let
you inspect or modify the referred object.
@@ -133,12 +144,10 @@ spec:
type: object
type: array
versions:
- description: versions is a slice of operator and operand version tuples. Operators
- which manage multiple operands will have multiple operand entries
- in the array. Available operators must report the version of the
- operator itself with the name "operator". An operator reports a
- new "operator" version when it has rolled out the new version to
- all of its operands.
+ description: |-
+ versions is a slice of operator and operand version tuples. Operators which manage multiple operands will have multiple
+ operand entries in the array. Available operators must report the version of the operator itself with the name "operator".
+ An operator reports a new "operator" version when it has rolled out the new version to all of its operands.
items:
properties:
name:
@@ -147,10 +156,10 @@ spec:
operators.
type: string
version:
- description: version indicates which version of a particular
- operand is currently being managed. It must always match
- the Available operand. If 1.0.0 is Available, then this must
- indicate 1.0.0 even if the operator is trying to rollout 1.1.0
+ description: |-
+ version indicates which version of a particular operand is currently being managed. It must always match the Available
+ operand. If 1.0.0 is Available, then this must indicate 1.0.0 even if the operator is trying to rollout
+ 1.1.0
type: string
required:
- name
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-CustomNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-CustomNoUpgrade.crd.yaml
index 4e4a3ca3b1..a55e2937ed 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-CustomNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-CustomNoUpgrade.crd.yaml
@@ -35,36 +35,45 @@ spec:
name: v1
schema:
openAPIV3Schema:
- description: "ClusterVersion is the configuration for the ClusterVersionOperator.
- This is where parameters related to automatic updates can be set. \n Compatibility
- level 1: Stable within a major release for a minimum of 12 months or 3 minor
- releases (whichever is longer)."
+ description: |-
+ ClusterVersion is the configuration for the ClusterVersionOperator. This is where
+ parameters related to automatic updates can be set.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
- description: spec is the desired state of the cluster version - the operator
- will work to ensure that the desired version is applied to the cluster.
+ description: |-
+ spec is the desired state of the cluster version - the operator will work
+ to ensure that the desired version is applied to the cluster.
properties:
capabilities:
- description: capabilities configures the installation of optional,
- core cluster components. A null value here is identical to an empty
- object; see the child properties for default semantics.
+ description: |-
+ capabilities configures the installation of optional, core
+ cluster components. A null value here is identical to an
+ empty object; see the child properties for default semantics.
properties:
additionalEnabledCapabilities:
- description: additionalEnabledCapabilities extends the set of
- managed capabilities beyond the baseline defined in baselineCapabilitySet. The
- default is an empty set.
+ description: |-
+ additionalEnabledCapabilities extends the set of managed
+ capabilities beyond the baseline defined in
+ baselineCapabilitySet. The default is an empty set.
items:
description: ClusterVersionCapability enumerates optional, core
cluster components.
@@ -85,14 +94,17 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
baselineCapabilitySet:
- description: baselineCapabilitySet selects an initial set of optional
- capabilities to enable, which can be extended via additionalEnabledCapabilities. If
- unset, the cluster will choose a default, and the default may
- change over time. The current default is vCurrent.
+ description: |-
+ baselineCapabilitySet selects an initial set of
+ optional capabilities to enable, which can be extended via
+ additionalEnabledCapabilities. If unset, the cluster will
+ choose a default, and the default may change over time.
+ The current default is vCurrent.
enum:
- None
- v4.11
@@ -107,74 +119,76 @@ spec:
type: string
type: object
channel:
- description: channel is an identifier for explicitly requesting that
- a non-default set of updates be applied to this cluster. The default
- channel will be contain stable updates that are appropriate for
- production clusters.
+ description: |-
+ channel is an identifier for explicitly requesting that a non-default
+ set of updates be applied to this cluster. The default channel will be
+ contain stable updates that are appropriate for production clusters.
type: string
clusterID:
- description: clusterID uniquely identifies this cluster. This is expected
- to be an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- in hexadecimal values). This is a required field.
+ description: |-
+ clusterID uniquely identifies this cluster. This is expected to be
+ an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx in
+ hexadecimal values). This is a required field.
type: string
desiredUpdate:
- description: "desiredUpdate is an optional field that indicates the
- desired value of the cluster version. Setting this value will trigger
- an upgrade (if the current version does not match the desired version).
- The set of recommended update values is listed as part of available
- updates in status, and setting values outside that range may cause
- the upgrade to fail. \n Some of the fields are inter-related with
- restrictions and meanings described here. 1. image is specified,
- version is specified, architecture is specified. API validation
- error. 2. image is specified, version is specified, architecture
- is not specified. You should not do this. version is silently ignored
- and image is used. 3. image is specified, version is not specified,
- architecture is specified. API validation error. 4. image is specified,
- version is not specified, architecture is not specified. image is
- used. 5. image is not specified, version is specified, architecture
- is specified. version and desired architecture are used to select
- an image. 6. image is not specified, version is specified, architecture
- is not specified. version and current architecture are used to select
- an image. 7. image is not specified, version is not specified, architecture
- is specified. API validation error. 8. image is not specified, version
- is not specified, architecture is not specified. API validation
- error. \n If an upgrade fails the operator will halt and report
- status about the failing component. Setting the desired update value
- back to the previous version will cause a rollback to be attempted.
- Not all rollbacks will succeed."
+ description: |-
+ desiredUpdate is an optional field that indicates the desired value of
+ the cluster version. Setting this value will trigger an upgrade (if
+ the current version does not match the desired version). The set of
+ recommended update values is listed as part of available updates in
+ status, and setting values outside that range may cause the upgrade
+ to fail.
+
+ Some of the fields are inter-related with restrictions and meanings described here.
+ 1. image is specified, version is specified, architecture is specified. API validation error.
+ 2. image is specified, version is specified, architecture is not specified. You should not do this. version is silently ignored and image is used.
+ 3. image is specified, version is not specified, architecture is specified. API validation error.
+ 4. image is specified, version is not specified, architecture is not specified. image is used.
+ 5. image is not specified, version is specified, architecture is specified. version and desired architecture are used to select an image.
+ 6. image is not specified, version is specified, architecture is not specified. version and current architecture are used to select an image.
+ 7. image is not specified, version is not specified, architecture is specified. API validation error.
+ 8. image is not specified, version is not specified, architecture is not specified. API validation error.
+
+ If an upgrade fails the operator will halt and report status
+ about the failing component. Setting the desired update value back to
+ the previous version will cause a rollback to be attempted. Not all
+ rollbacks will succeed.
properties:
architecture:
- description: architecture is an optional field that indicates
- the desired value of the cluster architecture. In this context
- cluster architecture means either a single architecture or a
- multi architecture. architecture can only be set to Multi thereby
+ description: |-
+ architecture is an optional field that indicates the desired
+ value of the cluster architecture. In this context cluster
+ architecture means either a single architecture or a multi
+ architecture. architecture can only be set to Multi thereby
only allowing updates from single to multi architecture. If
architecture is set, image cannot be set and version must be
- set. Valid values are 'Multi' and empty.
+ set.
+ Valid values are 'Multi' and empty.
enum:
- Multi
- ""
type: string
force:
- description: force allows an administrator to update to an image
- that has failed verification or upgradeable checks. This option
- should only be used when the authenticity of the provided image
- has been verified out of band because the provided image will
- run with full administrative access to the cluster. Do not use
- this flag with images that comes from unknown or potentially
- malicious sources.
+ description: |-
+ force allows an administrator to update to an image that has failed
+ verification or upgradeable checks. This option should only
+ be used when the authenticity of the provided image has been verified out
+ of band because the provided image will run with full administrative access
+ to the cluster. Do not use this flag with images that comes from unknown
+ or potentially malicious sources.
type: boolean
image:
- description: 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,
- version is ignored. When image is set, version should be empty.
+ description: |-
+ 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, version is ignored. When image is set, version should be empty.
When image is set, architecture cannot be specified.
type: string
version:
- description: version is a semantic version identifying the update
- version. version is ignored if image is specified and required
- if architecture is specified.
+ description: |-
+ version is a semantic version identifying the update version.
+ version is ignored if image is specified and required if
+ architecture is specified.
type: string
type: object
x-kubernetes-validations:
@@ -185,12 +199,14 @@ spec:
rule: 'has(self.architecture) && self.architecture != '''' ? self.version
!= '''' : true'
overrides:
- description: overrides is list of overides for components that are
- managed by cluster version operator. Marking a component unmanaged
- will prevent the operator from creating or updating the object.
+ description: |-
+ overrides is list of overides for components that are managed by
+ cluster version operator. Marking a component unmanaged will prevent
+ the operator from creating or updating the object.
items:
- description: ComponentOverride allows overriding cluster version
- operator's behavior for a component.
+ description: |-
+ ComponentOverride allows overriding cluster version operator's behavior
+ for a component.
properties:
group:
description: group identifies the API group that the kind is
@@ -203,13 +219,15 @@ spec:
description: name is the component's name.
type: string
namespace:
- description: namespace is the component's namespace. If the
- resource is cluster scoped, the namespace should be empty.
+ description: |-
+ namespace is the component's namespace. If the resource is cluster
+ scoped, the namespace should be empty.
type: string
unmanaged:
- description: 'unmanaged controls if cluster version operator
- should stop managing the resources in this cluster. Default:
- false'
+ description: |-
+ unmanaged controls if cluster version operator should stop managing the
+ resources in this cluster.
+ Default: false
type: boolean
required:
- group
@@ -226,33 +244,31 @@ spec:
- name
x-kubernetes-list-type: map
signatureStores:
- description: "signatureStores contains the upstream URIs to verify
- release signatures and optional reference to a config map by name
- containing the PEM-encoded CA bundle. \n By default, CVO will use
- existing signature stores if this property is empty. The CVO will
- check the release signatures in the local ConfigMaps first. It will
- search for a valid signature in these stores in parallel only when
- local ConfigMaps did not include a valid signature. Validation will
- fail if none of the signature stores reply with valid signature
- before timeout. Setting signatureStores will replace the default
- signature stores with custom signature stores. Default stores can
- be used with custom signature stores by adding them manually. \n
- A maximum of 32 signature stores may be configured."
+ description: |-
+ signatureStores contains the upstream URIs to verify release signatures and optional
+ reference to a config map by name containing the PEM-encoded CA bundle.
+
+ By default, CVO will use existing signature stores if this property is empty.
+ The CVO will check the release signatures in the local ConfigMaps first. It will search for a valid signature
+ in these stores in parallel only when local ConfigMaps did not include a valid signature.
+ Validation will fail if none of the signature stores reply with valid signature before timeout.
+ Setting signatureStores will replace the default signature stores with custom signature stores.
+ Default stores can be used with custom signature stores by adding them manually.
+
+ A maximum of 32 signature stores may be configured.
items:
description: SignatureStore represents the URL of custom Signature
Store
properties:
ca:
- description: ca is an optional reference to a config map by
- name containing the PEM-encoded CA bundle. It is used as a
- trust anchor to validate the TLS certificate presented by
- the remote server. The key "ca.crt" is used to locate the
- data. If specified and the config map or expected key is not
- found, the signature store is not honored. If the specified
- ca data is not valid, the signature store is not honored.
- If empty, we fall back to the CA configured via Proxy, which
- is appended to the default system roots. The namespace for
- this config map is openshift-config.
+ description: |-
+ ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
+ It is used as a trust anchor to validate the TLS certificate presented by the remote server.
+ The key "ca.crt" is used to locate the data.
+ If specified and the config map or expected key is not found, the signature store is not honored.
+ If the specified ca data is not valid, the signature store is not honored.
+ If empty, we fall back to the CA configured via Proxy, which is appended to the default system roots.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -262,10 +278,10 @@ spec:
- name
type: object
url:
- description: url contains the upstream custom signature store
- URL. url should be a valid absolute http/https URI of an upstream
- signature store as per rfc1738. This must be provided and
- cannot be empty.
+ description: |-
+ url contains the upstream custom signature store URL.
+ url should be a valid absolute http/https URI of an upstream signature store as per rfc1738.
+ This must be provided and cannot be empty.
type: string
x-kubernetes-validations:
- message: url must be a valid absolute URL
@@ -279,52 +295,59 @@ spec:
- url
x-kubernetes-list-type: map
upstream:
- description: upstream may be used to specify the preferred update
- server. By default it will use the appropriate update server for
- the cluster and region.
+ description: |-
+ upstream may be used to specify the preferred update server. By default
+ it will use the appropriate update server for the cluster and region.
type: string
required:
- clusterID
type: object
status:
- description: status contains information about the available updates and
- any in-progress updates.
+ description: |-
+ status contains information about the available updates and any in-progress
+ updates.
properties:
availableUpdates:
- description: 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.
+ description: |-
+ 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.
items:
description: Release represents an OpenShift release image and associated
metadata.
properties:
channels:
- description: channels is the set of Cincinnati channels to which
- the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is optional
- if version is specified and the availableUpdates field contains
- a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release. This
- URL is set by the 'url' metadata property on a release or
- the metadata returned by the update API and should be displayed
- as a link in user interfaces. The URL field may not be set
- for test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the update
- version. When this field is part of spec, version is optional
- if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
nullable: true
type: array
@@ -356,6 +379,7 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
@@ -382,69 +406,62 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
type: object
conditionalUpdates:
- description: conditionalUpdates contains the list of updates that
- may be recommended for this cluster if it meets specific required
+ description: |-
+ 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.
+ 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.
items:
- description: 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.
+ description: |-
+ 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.
properties:
conditions:
- description: '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.'
+ description: |-
+ 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.
items:
- description: "Condition contains details for one aspect of
- the current state of this API Resource. --- This struct
- is intended for direct use as an array at the field path
- .status.conditions. For example, \n type FooStatus struct{
- // Represents the observations of a foo's current state.
- // Known .status.conditions.type are: \"Available\", \"Progressing\",
- and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields
- }"
+ description: Condition contains details for one aspect of
+ the current state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should
- be when the underlying condition changed. If that is
- not known, then using the time when the API field changed
- is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance,
- if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the
- current state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier
- indicating the reason for the condition's last transition.
- Producers of specific condition types may define expected
- values and meanings for this field, and whether the
- values are considered a guaranteed API. The value should
- be a CamelCase string. This field may not be empty.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
@@ -459,11 +476,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across
- resources like Available, but because arbitrary conditions
- can be useful (see .node.status.conditions), the ability
- to deconflict is important. The regex it matches is
- (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -482,75 +494,82 @@ spec:
description: release is the target of the update.
properties:
channels:
- description: channels is the set of Cincinnati channels
- to which the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is
- optional if version is specified and the availableUpdates
- field contains a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release.
- This URL is set by the 'url' metadata property on a release
- or the metadata returned by the update API and should
- be displayed as a link in user interfaces. The URL field
- may not be set for test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the
- update version. When this field is part of spec, version
- is optional if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
risks:
- description: 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.
+ description: |-
+ 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.
items:
- description: ConditionalUpdateRisk represents a reason and
- cluster-state for not recommending a conditional update.
+ description: |-
+ ConditionalUpdateRisk represents a reason and cluster-state
+ for not recommending a conditional update.
properties:
matchingRules:
- description: matchingRules is a slice of conditions for
- deciding which clusters match the risk and which do
- not. The slice is ordered by decreasing precedence.
- The cluster-version operator will walk the slice in
- order, and stop after the first it can successfully
- evaluate. If no condition can be successfully evaluated,
- the update will not be recommended.
+ description: |-
+ matchingRules is a slice of conditions for deciding which
+ clusters match the risk and which do not. The slice is
+ ordered by decreasing precedence. The cluster-version
+ operator will walk the slice in order, and stop after the
+ first it can successfully evaluate. If no condition can be
+ successfully evaluated, the update will not be recommended.
items:
- description: 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.
+ description: |-
+ 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.
properties:
promql:
description: promQL represents a cluster condition
based on PromQL.
properties:
promql:
- description: PromQL is a PromQL query classifying
- clusters. This query query should return a
- 1 in the match case and a 0 in the does-not-match
- case. Queries which return no time series,
- or which return values besides 0 or 1, are
+ description: |-
+ PromQL is a PromQL query classifying clusters. This query
+ query should return a 1 in the match case and a 0 in the
+ does-not-match case. Queries which return no time
+ series, or which return values besides 0 or 1, are
evaluation failures.
type: string
required:
- promql
type: object
type:
- description: type represents the cluster-condition
- type. This defines the members and semantics of
- any additional properties.
+ description: |-
+ type represents the cluster-condition type. This defines
+ the members and semantics of any additional properties.
enum:
- Always
- PromQL
@@ -562,17 +581,19 @@ spec:
type: array
x-kubernetes-list-type: atomic
message:
- description: 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.
+ description: |-
+ 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.
minLength: 1
type: string
name:
- description: name is the CamelCase reason for not recommending
- a conditional update, in the event that matchingRules
- match the cluster state.
+ description: |-
+ name is the CamelCase reason for not recommending a
+ conditional update, in the event that matchingRules match the
+ cluster state.
minLength: 1
type: string
url:
@@ -598,16 +619,18 @@ spec:
type: array
x-kubernetes-list-type: atomic
conditions:
- description: 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.
+ description: |-
+ 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.
items:
- description: ClusterOperatorStatusCondition represents the state
- of the operator's managed and monitored components.
+ description: |-
+ ClusterOperatorStatusCondition represents the state of the operator's
+ managed and monitored components.
properties:
lastTransitionTime:
description: lastTransitionTime is the time of the last update
@@ -615,10 +638,10 @@ spec:
format: date-time
type: string
message:
- description: message provides additional information about the
- current condition. This is only to be consumed by humans. It
- may contain Line Feed characters (U+000A), which should be
- rendered as new lines.
+ description: |-
+ message provides additional information about the current condition.
+ This is only to be consumed by humans. It may contain Line Feed
+ characters (U+000A), which should be rendered as new lines.
type: string
reason:
description: reason is the CamelCase reason for the condition's
@@ -640,67 +663,75 @@ spec:
- type
x-kubernetes-list-type: map
desired:
- description: 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.
+ description: |-
+ 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.
properties:
channels:
- description: channels is the set of Cincinnati channels to which
- the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is optional
- if version is specified and the availableUpdates field contains
- a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release. This
- URL is set by the 'url' metadata property on a release or the
- metadata returned by the update API and should be displayed
- as a link in user interfaces. The URL field may not be set for
- test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the update
- version. When this field is part of spec, version is optional
- if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
history:
- description: 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.
+ description: |-
+ 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.
items:
description: UpdateHistory is a single attempted update to the cluster.
properties:
acceptedRisks:
- description: acceptedRisks records risks which were accepted
- to initiate the update. For example, it may menition an Upgradeable=False
- or missing signature that was overriden via desiredUpdate.force,
- or an update that was initiated despite not being in the availableUpdates
- set of recommended update targets.
+ description: |-
+ acceptedRisks records risks which were accepted to initiate the update.
+ For example, it may menition an Upgradeable=False or missing signature
+ that was overriden via desiredUpdate.force, or an update that was
+ initiated despite not being in the availableUpdates set of recommended
+ update targets.
type: string
completionTime:
- description: completionTime, if set, is when the update was
- fully applied. The update that is currently being applied
- will have a null completion time. Completion time will always
- be set for entries that are not the current update (usually
- to the started time of the next update).
+ description: |-
+ completionTime, if set, is when the update was fully applied. The update
+ that is currently being applied will have a null completion time.
+ Completion time will always be set for entries that are not the current
+ update (usually to the started time of the next update).
format: date-time
nullable: true
type: string
image:
- description: image is a container image location that contains
- the update. This value is always populated.
+ description: |-
+ image is a container image location that contains the update. This value
+ is always populated.
type: string
startedTime:
description: startedTime is the time at which the update was
@@ -708,24 +739,24 @@ spec:
format: date-time
type: string
state:
- description: state reflects whether the update was fully applied.
- The Partial state indicates the update is not fully applied,
- while the Completed state indicates the update was successfully
- rolled out at least once (all parts of the update successfully
- applied).
+ description: |-
+ state reflects whether the update was fully applied. The Partial state
+ indicates the update is not fully applied, while the Completed state
+ indicates the update was successfully rolled out at least once (all
+ parts of the update successfully applied).
type: string
verified:
- description: 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.
+ description: |-
+ 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.
type: boolean
version:
- description: 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.
+ description: |-
+ 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.
type: string
required:
- completionTime
@@ -737,16 +768,17 @@ spec:
type: array
x-kubernetes-list-type: atomic
observedGeneration:
- description: 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.
+ description: |-
+ 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.
format: int64
type: integer
versionHash:
- description: 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.
+ description: |-
+ 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.
type: string
required:
- availableUpdates
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml
index bfc42ee233..92e44d6f7f 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml
@@ -35,36 +35,45 @@ spec:
name: v1
schema:
openAPIV3Schema:
- description: "ClusterVersion is the configuration for the ClusterVersionOperator.
- This is where parameters related to automatic updates can be set. \n Compatibility
- level 1: Stable within a major release for a minimum of 12 months or 3 minor
- releases (whichever is longer)."
+ description: |-
+ ClusterVersion is the configuration for the ClusterVersionOperator. This is where
+ parameters related to automatic updates can be set.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
- description: spec is the desired state of the cluster version - the operator
- will work to ensure that the desired version is applied to the cluster.
+ description: |-
+ spec is the desired state of the cluster version - the operator will work
+ to ensure that the desired version is applied to the cluster.
properties:
capabilities:
- description: capabilities configures the installation of optional,
- core cluster components. A null value here is identical to an empty
- object; see the child properties for default semantics.
+ description: |-
+ capabilities configures the installation of optional, core
+ cluster components. A null value here is identical to an
+ empty object; see the child properties for default semantics.
properties:
additionalEnabledCapabilities:
- description: additionalEnabledCapabilities extends the set of
- managed capabilities beyond the baseline defined in baselineCapabilitySet. The
- default is an empty set.
+ description: |-
+ additionalEnabledCapabilities extends the set of managed
+ capabilities beyond the baseline defined in
+ baselineCapabilitySet. The default is an empty set.
items:
description: ClusterVersionCapability enumerates optional, core
cluster components.
@@ -85,14 +94,17 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
baselineCapabilitySet:
- description: baselineCapabilitySet selects an initial set of optional
- capabilities to enable, which can be extended via additionalEnabledCapabilities. If
- unset, the cluster will choose a default, and the default may
- change over time. The current default is vCurrent.
+ description: |-
+ baselineCapabilitySet selects an initial set of
+ optional capabilities to enable, which can be extended via
+ additionalEnabledCapabilities. If unset, the cluster will
+ choose a default, and the default may change over time.
+ The current default is vCurrent.
enum:
- None
- v4.11
@@ -107,74 +119,76 @@ spec:
type: string
type: object
channel:
- description: channel is an identifier for explicitly requesting that
- a non-default set of updates be applied to this cluster. The default
- channel will be contain stable updates that are appropriate for
- production clusters.
+ description: |-
+ channel is an identifier for explicitly requesting that a non-default
+ set of updates be applied to this cluster. The default channel will be
+ contain stable updates that are appropriate for production clusters.
type: string
clusterID:
- description: clusterID uniquely identifies this cluster. This is expected
- to be an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- in hexadecimal values). This is a required field.
+ description: |-
+ clusterID uniquely identifies this cluster. This is expected to be
+ an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx in
+ hexadecimal values). This is a required field.
type: string
desiredUpdate:
- description: "desiredUpdate is an optional field that indicates the
- desired value of the cluster version. Setting this value will trigger
- an upgrade (if the current version does not match the desired version).
- The set of recommended update values is listed as part of available
- updates in status, and setting values outside that range may cause
- the upgrade to fail. \n Some of the fields are inter-related with
- restrictions and meanings described here. 1. image is specified,
- version is specified, architecture is specified. API validation
- error. 2. image is specified, version is specified, architecture
- is not specified. You should not do this. version is silently ignored
- and image is used. 3. image is specified, version is not specified,
- architecture is specified. API validation error. 4. image is specified,
- version is not specified, architecture is not specified. image is
- used. 5. image is not specified, version is specified, architecture
- is specified. version and desired architecture are used to select
- an image. 6. image is not specified, version is specified, architecture
- is not specified. version and current architecture are used to select
- an image. 7. image is not specified, version is not specified, architecture
- is specified. API validation error. 8. image is not specified, version
- is not specified, architecture is not specified. API validation
- error. \n If an upgrade fails the operator will halt and report
- status about the failing component. Setting the desired update value
- back to the previous version will cause a rollback to be attempted.
- Not all rollbacks will succeed."
+ description: |-
+ desiredUpdate is an optional field that indicates the desired value of
+ the cluster version. Setting this value will trigger an upgrade (if
+ the current version does not match the desired version). The set of
+ recommended update values is listed as part of available updates in
+ status, and setting values outside that range may cause the upgrade
+ to fail.
+
+ Some of the fields are inter-related with restrictions and meanings described here.
+ 1. image is specified, version is specified, architecture is specified. API validation error.
+ 2. image is specified, version is specified, architecture is not specified. You should not do this. version is silently ignored and image is used.
+ 3. image is specified, version is not specified, architecture is specified. API validation error.
+ 4. image is specified, version is not specified, architecture is not specified. image is used.
+ 5. image is not specified, version is specified, architecture is specified. version and desired architecture are used to select an image.
+ 6. image is not specified, version is specified, architecture is not specified. version and current architecture are used to select an image.
+ 7. image is not specified, version is not specified, architecture is specified. API validation error.
+ 8. image is not specified, version is not specified, architecture is not specified. API validation error.
+
+ If an upgrade fails the operator will halt and report status
+ about the failing component. Setting the desired update value back to
+ the previous version will cause a rollback to be attempted. Not all
+ rollbacks will succeed.
properties:
architecture:
- description: architecture is an optional field that indicates
- the desired value of the cluster architecture. In this context
- cluster architecture means either a single architecture or a
- multi architecture. architecture can only be set to Multi thereby
+ description: |-
+ architecture is an optional field that indicates the desired
+ value of the cluster architecture. In this context cluster
+ architecture means either a single architecture or a multi
+ architecture. architecture can only be set to Multi thereby
only allowing updates from single to multi architecture. If
architecture is set, image cannot be set and version must be
- set. Valid values are 'Multi' and empty.
+ set.
+ Valid values are 'Multi' and empty.
enum:
- Multi
- ""
type: string
force:
- description: force allows an administrator to update to an image
- that has failed verification or upgradeable checks. This option
- should only be used when the authenticity of the provided image
- has been verified out of band because the provided image will
- run with full administrative access to the cluster. Do not use
- this flag with images that comes from unknown or potentially
- malicious sources.
+ description: |-
+ force allows an administrator to update to an image that has failed
+ verification or upgradeable checks. This option should only
+ be used when the authenticity of the provided image has been verified out
+ of band because the provided image will run with full administrative access
+ to the cluster. Do not use this flag with images that comes from unknown
+ or potentially malicious sources.
type: boolean
image:
- description: 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,
- version is ignored. When image is set, version should be empty.
+ description: |-
+ 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, version is ignored. When image is set, version should be empty.
When image is set, architecture cannot be specified.
type: string
version:
- description: version is a semantic version identifying the update
- version. version is ignored if image is specified and required
- if architecture is specified.
+ description: |-
+ version is a semantic version identifying the update version.
+ version is ignored if image is specified and required if
+ architecture is specified.
type: string
type: object
x-kubernetes-validations:
@@ -185,12 +199,14 @@ spec:
rule: 'has(self.architecture) && self.architecture != '''' ? self.version
!= '''' : true'
overrides:
- description: overrides is list of overides for components that are
- managed by cluster version operator. Marking a component unmanaged
- will prevent the operator from creating or updating the object.
+ description: |-
+ overrides is list of overides for components that are managed by
+ cluster version operator. Marking a component unmanaged will prevent
+ the operator from creating or updating the object.
items:
- description: ComponentOverride allows overriding cluster version
- operator's behavior for a component.
+ description: |-
+ ComponentOverride allows overriding cluster version operator's behavior
+ for a component.
properties:
group:
description: group identifies the API group that the kind is
@@ -203,13 +219,15 @@ spec:
description: name is the component's name.
type: string
namespace:
- description: namespace is the component's namespace. If the
- resource is cluster scoped, the namespace should be empty.
+ description: |-
+ namespace is the component's namespace. If the resource is cluster
+ scoped, the namespace should be empty.
type: string
unmanaged:
- description: 'unmanaged controls if cluster version operator
- should stop managing the resources in this cluster. Default:
- false'
+ description: |-
+ unmanaged controls if cluster version operator should stop managing the
+ resources in this cluster.
+ Default: false
type: boolean
required:
- group
@@ -226,52 +244,59 @@ spec:
- name
x-kubernetes-list-type: map
upstream:
- description: upstream may be used to specify the preferred update
- server. By default it will use the appropriate update server for
- the cluster and region.
+ description: |-
+ upstream may be used to specify the preferred update server. By default
+ it will use the appropriate update server for the cluster and region.
type: string
required:
- clusterID
type: object
status:
- description: status contains information about the available updates and
- any in-progress updates.
+ description: |-
+ status contains information about the available updates and any in-progress
+ updates.
properties:
availableUpdates:
- description: 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.
+ description: |-
+ 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.
items:
description: Release represents an OpenShift release image and associated
metadata.
properties:
channels:
- description: channels is the set of Cincinnati channels to which
- the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is optional
- if version is specified and the availableUpdates field contains
- a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release. This
- URL is set by the 'url' metadata property on a release or
- the metadata returned by the update API and should be displayed
- as a link in user interfaces. The URL field may not be set
- for test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the update
- version. When this field is part of spec, version is optional
- if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
nullable: true
type: array
@@ -303,6 +328,7 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
@@ -329,69 +355,62 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
type: object
conditionalUpdates:
- description: conditionalUpdates contains the list of updates that
- may be recommended for this cluster if it meets specific required
+ description: |-
+ 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.
+ 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.
items:
- description: 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.
+ description: |-
+ 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.
properties:
conditions:
- description: '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.'
+ description: |-
+ 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.
items:
- description: "Condition contains details for one aspect of
- the current state of this API Resource. --- This struct
- is intended for direct use as an array at the field path
- .status.conditions. For example, \n type FooStatus struct{
- // Represents the observations of a foo's current state.
- // Known .status.conditions.type are: \"Available\", \"Progressing\",
- and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields
- }"
+ description: Condition contains details for one aspect of
+ the current state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should
- be when the underlying condition changed. If that is
- not known, then using the time when the API field changed
- is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance,
- if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the
- current state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier
- indicating the reason for the condition's last transition.
- Producers of specific condition types may define expected
- values and meanings for this field, and whether the
- values are considered a guaranteed API. The value should
- be a CamelCase string. This field may not be empty.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
@@ -406,11 +425,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across
- resources like Available, but because arbitrary conditions
- can be useful (see .node.status.conditions), the ability
- to deconflict is important. The regex it matches is
- (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -429,75 +443,82 @@ spec:
description: release is the target of the update.
properties:
channels:
- description: channels is the set of Cincinnati channels
- to which the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is
- optional if version is specified and the availableUpdates
- field contains a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release.
- This URL is set by the 'url' metadata property on a release
- or the metadata returned by the update API and should
- be displayed as a link in user interfaces. The URL field
- may not be set for test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the
- update version. When this field is part of spec, version
- is optional if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
risks:
- description: 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.
+ description: |-
+ 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.
items:
- description: ConditionalUpdateRisk represents a reason and
- cluster-state for not recommending a conditional update.
+ description: |-
+ ConditionalUpdateRisk represents a reason and cluster-state
+ for not recommending a conditional update.
properties:
matchingRules:
- description: matchingRules is a slice of conditions for
- deciding which clusters match the risk and which do
- not. The slice is ordered by decreasing precedence.
- The cluster-version operator will walk the slice in
- order, and stop after the first it can successfully
- evaluate. If no condition can be successfully evaluated,
- the update will not be recommended.
+ description: |-
+ matchingRules is a slice of conditions for deciding which
+ clusters match the risk and which do not. The slice is
+ ordered by decreasing precedence. The cluster-version
+ operator will walk the slice in order, and stop after the
+ first it can successfully evaluate. If no condition can be
+ successfully evaluated, the update will not be recommended.
items:
- description: 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.
+ description: |-
+ 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.
properties:
promql:
description: promQL represents a cluster condition
based on PromQL.
properties:
promql:
- description: PromQL is a PromQL query classifying
- clusters. This query query should return a
- 1 in the match case and a 0 in the does-not-match
- case. Queries which return no time series,
- or which return values besides 0 or 1, are
+ description: |-
+ PromQL is a PromQL query classifying clusters. This query
+ query should return a 1 in the match case and a 0 in the
+ does-not-match case. Queries which return no time
+ series, or which return values besides 0 or 1, are
evaluation failures.
type: string
required:
- promql
type: object
type:
- description: type represents the cluster-condition
- type. This defines the members and semantics of
- any additional properties.
+ description: |-
+ type represents the cluster-condition type. This defines
+ the members and semantics of any additional properties.
enum:
- Always
- PromQL
@@ -509,17 +530,19 @@ spec:
type: array
x-kubernetes-list-type: atomic
message:
- description: 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.
+ description: |-
+ 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.
minLength: 1
type: string
name:
- description: name is the CamelCase reason for not recommending
- a conditional update, in the event that matchingRules
- match the cluster state.
+ description: |-
+ name is the CamelCase reason for not recommending a
+ conditional update, in the event that matchingRules match the
+ cluster state.
minLength: 1
type: string
url:
@@ -545,16 +568,18 @@ spec:
type: array
x-kubernetes-list-type: atomic
conditions:
- description: 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.
+ description: |-
+ 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.
items:
- description: ClusterOperatorStatusCondition represents the state
- of the operator's managed and monitored components.
+ description: |-
+ ClusterOperatorStatusCondition represents the state of the operator's
+ managed and monitored components.
properties:
lastTransitionTime:
description: lastTransitionTime is the time of the last update
@@ -562,10 +587,10 @@ spec:
format: date-time
type: string
message:
- description: message provides additional information about the
- current condition. This is only to be consumed by humans. It
- may contain Line Feed characters (U+000A), which should be
- rendered as new lines.
+ description: |-
+ message provides additional information about the current condition.
+ This is only to be consumed by humans. It may contain Line Feed
+ characters (U+000A), which should be rendered as new lines.
type: string
reason:
description: reason is the CamelCase reason for the condition's
@@ -587,67 +612,75 @@ spec:
- type
x-kubernetes-list-type: map
desired:
- description: 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.
+ description: |-
+ 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.
properties:
channels:
- description: channels is the set of Cincinnati channels to which
- the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is optional
- if version is specified and the availableUpdates field contains
- a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release. This
- URL is set by the 'url' metadata property on a release or the
- metadata returned by the update API and should be displayed
- as a link in user interfaces. The URL field may not be set for
- test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the update
- version. When this field is part of spec, version is optional
- if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
history:
- description: 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.
+ description: |-
+ 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.
items:
description: UpdateHistory is a single attempted update to the cluster.
properties:
acceptedRisks:
- description: acceptedRisks records risks which were accepted
- to initiate the update. For example, it may menition an Upgradeable=False
- or missing signature that was overriden via desiredUpdate.force,
- or an update that was initiated despite not being in the availableUpdates
- set of recommended update targets.
+ description: |-
+ acceptedRisks records risks which were accepted to initiate the update.
+ For example, it may menition an Upgradeable=False or missing signature
+ that was overriden via desiredUpdate.force, or an update that was
+ initiated despite not being in the availableUpdates set of recommended
+ update targets.
type: string
completionTime:
- description: completionTime, if set, is when the update was
- fully applied. The update that is currently being applied
- will have a null completion time. Completion time will always
- be set for entries that are not the current update (usually
- to the started time of the next update).
+ description: |-
+ completionTime, if set, is when the update was fully applied. The update
+ that is currently being applied will have a null completion time.
+ Completion time will always be set for entries that are not the current
+ update (usually to the started time of the next update).
format: date-time
nullable: true
type: string
image:
- description: image is a container image location that contains
- the update. This value is always populated.
+ description: |-
+ image is a container image location that contains the update. This value
+ is always populated.
type: string
startedTime:
description: startedTime is the time at which the update was
@@ -655,24 +688,24 @@ spec:
format: date-time
type: string
state:
- description: state reflects whether the update was fully applied.
- The Partial state indicates the update is not fully applied,
- while the Completed state indicates the update was successfully
- rolled out at least once (all parts of the update successfully
- applied).
+ description: |-
+ state reflects whether the update was fully applied. The Partial state
+ indicates the update is not fully applied, while the Completed state
+ indicates the update was successfully rolled out at least once (all
+ parts of the update successfully applied).
type: string
verified:
- description: 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.
+ description: |-
+ 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.
type: boolean
version:
- description: 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.
+ description: |-
+ 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.
type: string
required:
- completionTime
@@ -684,16 +717,17 @@ spec:
type: array
x-kubernetes-list-type: atomic
observedGeneration:
- description: 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.
+ description: |-
+ 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.
format: int64
type: integer
versionHash:
- description: 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.
+ description: |-
+ 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.
type: string
required:
- availableUpdates
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-DevPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-DevPreviewNoUpgrade.crd.yaml
index c6b84be678..a323e456b9 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-DevPreviewNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-DevPreviewNoUpgrade.crd.yaml
@@ -35,36 +35,45 @@ spec:
name: v1
schema:
openAPIV3Schema:
- description: "ClusterVersion is the configuration for the ClusterVersionOperator.
- This is where parameters related to automatic updates can be set. \n Compatibility
- level 1: Stable within a major release for a minimum of 12 months or 3 minor
- releases (whichever is longer)."
+ description: |-
+ ClusterVersion is the configuration for the ClusterVersionOperator. This is where
+ parameters related to automatic updates can be set.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
- description: spec is the desired state of the cluster version - the operator
- will work to ensure that the desired version is applied to the cluster.
+ description: |-
+ spec is the desired state of the cluster version - the operator will work
+ to ensure that the desired version is applied to the cluster.
properties:
capabilities:
- description: capabilities configures the installation of optional,
- core cluster components. A null value here is identical to an empty
- object; see the child properties for default semantics.
+ description: |-
+ capabilities configures the installation of optional, core
+ cluster components. A null value here is identical to an
+ empty object; see the child properties for default semantics.
properties:
additionalEnabledCapabilities:
- description: additionalEnabledCapabilities extends the set of
- managed capabilities beyond the baseline defined in baselineCapabilitySet. The
- default is an empty set.
+ description: |-
+ additionalEnabledCapabilities extends the set of managed
+ capabilities beyond the baseline defined in
+ baselineCapabilitySet. The default is an empty set.
items:
description: ClusterVersionCapability enumerates optional, core
cluster components.
@@ -85,14 +94,17 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
baselineCapabilitySet:
- description: baselineCapabilitySet selects an initial set of optional
- capabilities to enable, which can be extended via additionalEnabledCapabilities. If
- unset, the cluster will choose a default, and the default may
- change over time. The current default is vCurrent.
+ description: |-
+ baselineCapabilitySet selects an initial set of
+ optional capabilities to enable, which can be extended via
+ additionalEnabledCapabilities. If unset, the cluster will
+ choose a default, and the default may change over time.
+ The current default is vCurrent.
enum:
- None
- v4.11
@@ -107,74 +119,76 @@ spec:
type: string
type: object
channel:
- description: channel is an identifier for explicitly requesting that
- a non-default set of updates be applied to this cluster. The default
- channel will be contain stable updates that are appropriate for
- production clusters.
+ description: |-
+ channel is an identifier for explicitly requesting that a non-default
+ set of updates be applied to this cluster. The default channel will be
+ contain stable updates that are appropriate for production clusters.
type: string
clusterID:
- description: clusterID uniquely identifies this cluster. This is expected
- to be an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- in hexadecimal values). This is a required field.
+ description: |-
+ clusterID uniquely identifies this cluster. This is expected to be
+ an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx in
+ hexadecimal values). This is a required field.
type: string
desiredUpdate:
- description: "desiredUpdate is an optional field that indicates the
- desired value of the cluster version. Setting this value will trigger
- an upgrade (if the current version does not match the desired version).
- The set of recommended update values is listed as part of available
- updates in status, and setting values outside that range may cause
- the upgrade to fail. \n Some of the fields are inter-related with
- restrictions and meanings described here. 1. image is specified,
- version is specified, architecture is specified. API validation
- error. 2. image is specified, version is specified, architecture
- is not specified. You should not do this. version is silently ignored
- and image is used. 3. image is specified, version is not specified,
- architecture is specified. API validation error. 4. image is specified,
- version is not specified, architecture is not specified. image is
- used. 5. image is not specified, version is specified, architecture
- is specified. version and desired architecture are used to select
- an image. 6. image is not specified, version is specified, architecture
- is not specified. version and current architecture are used to select
- an image. 7. image is not specified, version is not specified, architecture
- is specified. API validation error. 8. image is not specified, version
- is not specified, architecture is not specified. API validation
- error. \n If an upgrade fails the operator will halt and report
- status about the failing component. Setting the desired update value
- back to the previous version will cause a rollback to be attempted.
- Not all rollbacks will succeed."
+ description: |-
+ desiredUpdate is an optional field that indicates the desired value of
+ the cluster version. Setting this value will trigger an upgrade (if
+ the current version does not match the desired version). The set of
+ recommended update values is listed as part of available updates in
+ status, and setting values outside that range may cause the upgrade
+ to fail.
+
+ Some of the fields are inter-related with restrictions and meanings described here.
+ 1. image is specified, version is specified, architecture is specified. API validation error.
+ 2. image is specified, version is specified, architecture is not specified. You should not do this. version is silently ignored and image is used.
+ 3. image is specified, version is not specified, architecture is specified. API validation error.
+ 4. image is specified, version is not specified, architecture is not specified. image is used.
+ 5. image is not specified, version is specified, architecture is specified. version and desired architecture are used to select an image.
+ 6. image is not specified, version is specified, architecture is not specified. version and current architecture are used to select an image.
+ 7. image is not specified, version is not specified, architecture is specified. API validation error.
+ 8. image is not specified, version is not specified, architecture is not specified. API validation error.
+
+ If an upgrade fails the operator will halt and report status
+ about the failing component. Setting the desired update value back to
+ the previous version will cause a rollback to be attempted. Not all
+ rollbacks will succeed.
properties:
architecture:
- description: architecture is an optional field that indicates
- the desired value of the cluster architecture. In this context
- cluster architecture means either a single architecture or a
- multi architecture. architecture can only be set to Multi thereby
+ description: |-
+ architecture is an optional field that indicates the desired
+ value of the cluster architecture. In this context cluster
+ architecture means either a single architecture or a multi
+ architecture. architecture can only be set to Multi thereby
only allowing updates from single to multi architecture. If
architecture is set, image cannot be set and version must be
- set. Valid values are 'Multi' and empty.
+ set.
+ Valid values are 'Multi' and empty.
enum:
- Multi
- ""
type: string
force:
- description: force allows an administrator to update to an image
- that has failed verification or upgradeable checks. This option
- should only be used when the authenticity of the provided image
- has been verified out of band because the provided image will
- run with full administrative access to the cluster. Do not use
- this flag with images that comes from unknown or potentially
- malicious sources.
+ description: |-
+ force allows an administrator to update to an image that has failed
+ verification or upgradeable checks. This option should only
+ be used when the authenticity of the provided image has been verified out
+ of band because the provided image will run with full administrative access
+ to the cluster. Do not use this flag with images that comes from unknown
+ or potentially malicious sources.
type: boolean
image:
- description: 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,
- version is ignored. When image is set, version should be empty.
+ description: |-
+ 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, version is ignored. When image is set, version should be empty.
When image is set, architecture cannot be specified.
type: string
version:
- description: version is a semantic version identifying the update
- version. version is ignored if image is specified and required
- if architecture is specified.
+ description: |-
+ version is a semantic version identifying the update version.
+ version is ignored if image is specified and required if
+ architecture is specified.
type: string
type: object
x-kubernetes-validations:
@@ -185,12 +199,14 @@ spec:
rule: 'has(self.architecture) && self.architecture != '''' ? self.version
!= '''' : true'
overrides:
- description: overrides is list of overides for components that are
- managed by cluster version operator. Marking a component unmanaged
- will prevent the operator from creating or updating the object.
+ description: |-
+ overrides is list of overides for components that are managed by
+ cluster version operator. Marking a component unmanaged will prevent
+ the operator from creating or updating the object.
items:
- description: ComponentOverride allows overriding cluster version
- operator's behavior for a component.
+ description: |-
+ ComponentOverride allows overriding cluster version operator's behavior
+ for a component.
properties:
group:
description: group identifies the API group that the kind is
@@ -203,13 +219,15 @@ spec:
description: name is the component's name.
type: string
namespace:
- description: namespace is the component's namespace. If the
- resource is cluster scoped, the namespace should be empty.
+ description: |-
+ namespace is the component's namespace. If the resource is cluster
+ scoped, the namespace should be empty.
type: string
unmanaged:
- description: 'unmanaged controls if cluster version operator
- should stop managing the resources in this cluster. Default:
- false'
+ description: |-
+ unmanaged controls if cluster version operator should stop managing the
+ resources in this cluster.
+ Default: false
type: boolean
required:
- group
@@ -226,33 +244,31 @@ spec:
- name
x-kubernetes-list-type: map
signatureStores:
- description: "signatureStores contains the upstream URIs to verify
- release signatures and optional reference to a config map by name
- containing the PEM-encoded CA bundle. \n By default, CVO will use
- existing signature stores if this property is empty. The CVO will
- check the release signatures in the local ConfigMaps first. It will
- search for a valid signature in these stores in parallel only when
- local ConfigMaps did not include a valid signature. Validation will
- fail if none of the signature stores reply with valid signature
- before timeout. Setting signatureStores will replace the default
- signature stores with custom signature stores. Default stores can
- be used with custom signature stores by adding them manually. \n
- A maximum of 32 signature stores may be configured."
+ description: |-
+ signatureStores contains the upstream URIs to verify release signatures and optional
+ reference to a config map by name containing the PEM-encoded CA bundle.
+
+ By default, CVO will use existing signature stores if this property is empty.
+ The CVO will check the release signatures in the local ConfigMaps first. It will search for a valid signature
+ in these stores in parallel only when local ConfigMaps did not include a valid signature.
+ Validation will fail if none of the signature stores reply with valid signature before timeout.
+ Setting signatureStores will replace the default signature stores with custom signature stores.
+ Default stores can be used with custom signature stores by adding them manually.
+
+ A maximum of 32 signature stores may be configured.
items:
description: SignatureStore represents the URL of custom Signature
Store
properties:
ca:
- description: ca is an optional reference to a config map by
- name containing the PEM-encoded CA bundle. It is used as a
- trust anchor to validate the TLS certificate presented by
- the remote server. The key "ca.crt" is used to locate the
- data. If specified and the config map or expected key is not
- found, the signature store is not honored. If the specified
- ca data is not valid, the signature store is not honored.
- If empty, we fall back to the CA configured via Proxy, which
- is appended to the default system roots. The namespace for
- this config map is openshift-config.
+ description: |-
+ ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
+ It is used as a trust anchor to validate the TLS certificate presented by the remote server.
+ The key "ca.crt" is used to locate the data.
+ If specified and the config map or expected key is not found, the signature store is not honored.
+ If the specified ca data is not valid, the signature store is not honored.
+ If empty, we fall back to the CA configured via Proxy, which is appended to the default system roots.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -262,10 +278,10 @@ spec:
- name
type: object
url:
- description: url contains the upstream custom signature store
- URL. url should be a valid absolute http/https URI of an upstream
- signature store as per rfc1738. This must be provided and
- cannot be empty.
+ description: |-
+ url contains the upstream custom signature store URL.
+ url should be a valid absolute http/https URI of an upstream signature store as per rfc1738.
+ This must be provided and cannot be empty.
type: string
x-kubernetes-validations:
- message: url must be a valid absolute URL
@@ -279,52 +295,59 @@ spec:
- url
x-kubernetes-list-type: map
upstream:
- description: upstream may be used to specify the preferred update
- server. By default it will use the appropriate update server for
- the cluster and region.
+ description: |-
+ upstream may be used to specify the preferred update server. By default
+ it will use the appropriate update server for the cluster and region.
type: string
required:
- clusterID
type: object
status:
- description: status contains information about the available updates and
- any in-progress updates.
+ description: |-
+ status contains information about the available updates and any in-progress
+ updates.
properties:
availableUpdates:
- description: 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.
+ description: |-
+ 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.
items:
description: Release represents an OpenShift release image and associated
metadata.
properties:
channels:
- description: channels is the set of Cincinnati channels to which
- the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is optional
- if version is specified and the availableUpdates field contains
- a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release. This
- URL is set by the 'url' metadata property on a release or
- the metadata returned by the update API and should be displayed
- as a link in user interfaces. The URL field may not be set
- for test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the update
- version. When this field is part of spec, version is optional
- if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
nullable: true
type: array
@@ -356,6 +379,7 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
@@ -382,69 +406,62 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
type: object
conditionalUpdates:
- description: conditionalUpdates contains the list of updates that
- may be recommended for this cluster if it meets specific required
+ description: |-
+ 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.
+ 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.
items:
- description: 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.
+ description: |-
+ 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.
properties:
conditions:
- description: '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.'
+ description: |-
+ 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.
items:
- description: "Condition contains details for one aspect of
- the current state of this API Resource. --- This struct
- is intended for direct use as an array at the field path
- .status.conditions. For example, \n type FooStatus struct{
- // Represents the observations of a foo's current state.
- // Known .status.conditions.type are: \"Available\", \"Progressing\",
- and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields
- }"
+ description: Condition contains details for one aspect of
+ the current state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should
- be when the underlying condition changed. If that is
- not known, then using the time when the API field changed
- is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance,
- if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the
- current state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier
- indicating the reason for the condition's last transition.
- Producers of specific condition types may define expected
- values and meanings for this field, and whether the
- values are considered a guaranteed API. The value should
- be a CamelCase string. This field may not be empty.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
@@ -459,11 +476,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across
- resources like Available, but because arbitrary conditions
- can be useful (see .node.status.conditions), the ability
- to deconflict is important. The regex it matches is
- (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -482,75 +494,82 @@ spec:
description: release is the target of the update.
properties:
channels:
- description: channels is the set of Cincinnati channels
- to which the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is
- optional if version is specified and the availableUpdates
- field contains a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release.
- This URL is set by the 'url' metadata property on a release
- or the metadata returned by the update API and should
- be displayed as a link in user interfaces. The URL field
- may not be set for test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the
- update version. When this field is part of spec, version
- is optional if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
risks:
- description: 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.
+ description: |-
+ 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.
items:
- description: ConditionalUpdateRisk represents a reason and
- cluster-state for not recommending a conditional update.
+ description: |-
+ ConditionalUpdateRisk represents a reason and cluster-state
+ for not recommending a conditional update.
properties:
matchingRules:
- description: matchingRules is a slice of conditions for
- deciding which clusters match the risk and which do
- not. The slice is ordered by decreasing precedence.
- The cluster-version operator will walk the slice in
- order, and stop after the first it can successfully
- evaluate. If no condition can be successfully evaluated,
- the update will not be recommended.
+ description: |-
+ matchingRules is a slice of conditions for deciding which
+ clusters match the risk and which do not. The slice is
+ ordered by decreasing precedence. The cluster-version
+ operator will walk the slice in order, and stop after the
+ first it can successfully evaluate. If no condition can be
+ successfully evaluated, the update will not be recommended.
items:
- description: 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.
+ description: |-
+ 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.
properties:
promql:
description: promQL represents a cluster condition
based on PromQL.
properties:
promql:
- description: PromQL is a PromQL query classifying
- clusters. This query query should return a
- 1 in the match case and a 0 in the does-not-match
- case. Queries which return no time series,
- or which return values besides 0 or 1, are
+ description: |-
+ PromQL is a PromQL query classifying clusters. This query
+ query should return a 1 in the match case and a 0 in the
+ does-not-match case. Queries which return no time
+ series, or which return values besides 0 or 1, are
evaluation failures.
type: string
required:
- promql
type: object
type:
- description: type represents the cluster-condition
- type. This defines the members and semantics of
- any additional properties.
+ description: |-
+ type represents the cluster-condition type. This defines
+ the members and semantics of any additional properties.
enum:
- Always
- PromQL
@@ -562,17 +581,19 @@ spec:
type: array
x-kubernetes-list-type: atomic
message:
- description: 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.
+ description: |-
+ 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.
minLength: 1
type: string
name:
- description: name is the CamelCase reason for not recommending
- a conditional update, in the event that matchingRules
- match the cluster state.
+ description: |-
+ name is the CamelCase reason for not recommending a
+ conditional update, in the event that matchingRules match the
+ cluster state.
minLength: 1
type: string
url:
@@ -598,16 +619,18 @@ spec:
type: array
x-kubernetes-list-type: atomic
conditions:
- description: 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.
+ description: |-
+ 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.
items:
- description: ClusterOperatorStatusCondition represents the state
- of the operator's managed and monitored components.
+ description: |-
+ ClusterOperatorStatusCondition represents the state of the operator's
+ managed and monitored components.
properties:
lastTransitionTime:
description: lastTransitionTime is the time of the last update
@@ -615,10 +638,10 @@ spec:
format: date-time
type: string
message:
- description: message provides additional information about the
- current condition. This is only to be consumed by humans. It
- may contain Line Feed characters (U+000A), which should be
- rendered as new lines.
+ description: |-
+ message provides additional information about the current condition.
+ This is only to be consumed by humans. It may contain Line Feed
+ characters (U+000A), which should be rendered as new lines.
type: string
reason:
description: reason is the CamelCase reason for the condition's
@@ -640,67 +663,75 @@ spec:
- type
x-kubernetes-list-type: map
desired:
- description: 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.
+ description: |-
+ 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.
properties:
channels:
- description: channels is the set of Cincinnati channels to which
- the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is optional
- if version is specified and the availableUpdates field contains
- a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release. This
- URL is set by the 'url' metadata property on a release or the
- metadata returned by the update API and should be displayed
- as a link in user interfaces. The URL field may not be set for
- test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the update
- version. When this field is part of spec, version is optional
- if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
history:
- description: 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.
+ description: |-
+ 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.
items:
description: UpdateHistory is a single attempted update to the cluster.
properties:
acceptedRisks:
- description: acceptedRisks records risks which were accepted
- to initiate the update. For example, it may menition an Upgradeable=False
- or missing signature that was overriden via desiredUpdate.force,
- or an update that was initiated despite not being in the availableUpdates
- set of recommended update targets.
+ description: |-
+ acceptedRisks records risks which were accepted to initiate the update.
+ For example, it may menition an Upgradeable=False or missing signature
+ that was overriden via desiredUpdate.force, or an update that was
+ initiated despite not being in the availableUpdates set of recommended
+ update targets.
type: string
completionTime:
- description: completionTime, if set, is when the update was
- fully applied. The update that is currently being applied
- will have a null completion time. Completion time will always
- be set for entries that are not the current update (usually
- to the started time of the next update).
+ description: |-
+ completionTime, if set, is when the update was fully applied. The update
+ that is currently being applied will have a null completion time.
+ Completion time will always be set for entries that are not the current
+ update (usually to the started time of the next update).
format: date-time
nullable: true
type: string
image:
- description: image is a container image location that contains
- the update. This value is always populated.
+ description: |-
+ image is a container image location that contains the update. This value
+ is always populated.
type: string
startedTime:
description: startedTime is the time at which the update was
@@ -708,24 +739,24 @@ spec:
format: date-time
type: string
state:
- description: state reflects whether the update was fully applied.
- The Partial state indicates the update is not fully applied,
- while the Completed state indicates the update was successfully
- rolled out at least once (all parts of the update successfully
- applied).
+ description: |-
+ state reflects whether the update was fully applied. The Partial state
+ indicates the update is not fully applied, while the Completed state
+ indicates the update was successfully rolled out at least once (all
+ parts of the update successfully applied).
type: string
verified:
- description: 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.
+ description: |-
+ 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.
type: boolean
version:
- description: 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.
+ description: |-
+ 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.
type: string
required:
- completionTime
@@ -737,16 +768,17 @@ spec:
type: array
x-kubernetes-list-type: atomic
observedGeneration:
- description: 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.
+ description: |-
+ 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.
format: int64
type: integer
versionHash:
- description: 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.
+ description: |-
+ 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.
type: string
required:
- availableUpdates
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-TechPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-TechPreviewNoUpgrade.crd.yaml
index 21cd6c0d71..054817cd29 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-TechPreviewNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-TechPreviewNoUpgrade.crd.yaml
@@ -35,36 +35,45 @@ spec:
name: v1
schema:
openAPIV3Schema:
- description: "ClusterVersion is the configuration for the ClusterVersionOperator.
- This is where parameters related to automatic updates can be set. \n Compatibility
- level 1: Stable within a major release for a minimum of 12 months or 3 minor
- releases (whichever is longer)."
+ description: |-
+ ClusterVersion is the configuration for the ClusterVersionOperator. This is where
+ parameters related to automatic updates can be set.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
- description: spec is the desired state of the cluster version - the operator
- will work to ensure that the desired version is applied to the cluster.
+ description: |-
+ spec is the desired state of the cluster version - the operator will work
+ to ensure that the desired version is applied to the cluster.
properties:
capabilities:
- description: capabilities configures the installation of optional,
- core cluster components. A null value here is identical to an empty
- object; see the child properties for default semantics.
+ description: |-
+ capabilities configures the installation of optional, core
+ cluster components. A null value here is identical to an
+ empty object; see the child properties for default semantics.
properties:
additionalEnabledCapabilities:
- description: additionalEnabledCapabilities extends the set of
- managed capabilities beyond the baseline defined in baselineCapabilitySet. The
- default is an empty set.
+ description: |-
+ additionalEnabledCapabilities extends the set of managed
+ capabilities beyond the baseline defined in
+ baselineCapabilitySet. The default is an empty set.
items:
description: ClusterVersionCapability enumerates optional, core
cluster components.
@@ -85,14 +94,17 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
baselineCapabilitySet:
- description: baselineCapabilitySet selects an initial set of optional
- capabilities to enable, which can be extended via additionalEnabledCapabilities. If
- unset, the cluster will choose a default, and the default may
- change over time. The current default is vCurrent.
+ description: |-
+ baselineCapabilitySet selects an initial set of
+ optional capabilities to enable, which can be extended via
+ additionalEnabledCapabilities. If unset, the cluster will
+ choose a default, and the default may change over time.
+ The current default is vCurrent.
enum:
- None
- v4.11
@@ -107,74 +119,76 @@ spec:
type: string
type: object
channel:
- description: channel is an identifier for explicitly requesting that
- a non-default set of updates be applied to this cluster. The default
- channel will be contain stable updates that are appropriate for
- production clusters.
+ description: |-
+ channel is an identifier for explicitly requesting that a non-default
+ set of updates be applied to this cluster. The default channel will be
+ contain stable updates that are appropriate for production clusters.
type: string
clusterID:
- description: clusterID uniquely identifies this cluster. This is expected
- to be an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- in hexadecimal values). This is a required field.
+ description: |-
+ clusterID uniquely identifies this cluster. This is expected to be
+ an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx in
+ hexadecimal values). This is a required field.
type: string
desiredUpdate:
- description: "desiredUpdate is an optional field that indicates the
- desired value of the cluster version. Setting this value will trigger
- an upgrade (if the current version does not match the desired version).
- The set of recommended update values is listed as part of available
- updates in status, and setting values outside that range may cause
- the upgrade to fail. \n Some of the fields are inter-related with
- restrictions and meanings described here. 1. image is specified,
- version is specified, architecture is specified. API validation
- error. 2. image is specified, version is specified, architecture
- is not specified. You should not do this. version is silently ignored
- and image is used. 3. image is specified, version is not specified,
- architecture is specified. API validation error. 4. image is specified,
- version is not specified, architecture is not specified. image is
- used. 5. image is not specified, version is specified, architecture
- is specified. version and desired architecture are used to select
- an image. 6. image is not specified, version is specified, architecture
- is not specified. version and current architecture are used to select
- an image. 7. image is not specified, version is not specified, architecture
- is specified. API validation error. 8. image is not specified, version
- is not specified, architecture is not specified. API validation
- error. \n If an upgrade fails the operator will halt and report
- status about the failing component. Setting the desired update value
- back to the previous version will cause a rollback to be attempted.
- Not all rollbacks will succeed."
+ description: |-
+ desiredUpdate is an optional field that indicates the desired value of
+ the cluster version. Setting this value will trigger an upgrade (if
+ the current version does not match the desired version). The set of
+ recommended update values is listed as part of available updates in
+ status, and setting values outside that range may cause the upgrade
+ to fail.
+
+ Some of the fields are inter-related with restrictions and meanings described here.
+ 1. image is specified, version is specified, architecture is specified. API validation error.
+ 2. image is specified, version is specified, architecture is not specified. You should not do this. version is silently ignored and image is used.
+ 3. image is specified, version is not specified, architecture is specified. API validation error.
+ 4. image is specified, version is not specified, architecture is not specified. image is used.
+ 5. image is not specified, version is specified, architecture is specified. version and desired architecture are used to select an image.
+ 6. image is not specified, version is specified, architecture is not specified. version and current architecture are used to select an image.
+ 7. image is not specified, version is not specified, architecture is specified. API validation error.
+ 8. image is not specified, version is not specified, architecture is not specified. API validation error.
+
+ If an upgrade fails the operator will halt and report status
+ about the failing component. Setting the desired update value back to
+ the previous version will cause a rollback to be attempted. Not all
+ rollbacks will succeed.
properties:
architecture:
- description: architecture is an optional field that indicates
- the desired value of the cluster architecture. In this context
- cluster architecture means either a single architecture or a
- multi architecture. architecture can only be set to Multi thereby
+ description: |-
+ architecture is an optional field that indicates the desired
+ value of the cluster architecture. In this context cluster
+ architecture means either a single architecture or a multi
+ architecture. architecture can only be set to Multi thereby
only allowing updates from single to multi architecture. If
architecture is set, image cannot be set and version must be
- set. Valid values are 'Multi' and empty.
+ set.
+ Valid values are 'Multi' and empty.
enum:
- Multi
- ""
type: string
force:
- description: force allows an administrator to update to an image
- that has failed verification or upgradeable checks. This option
- should only be used when the authenticity of the provided image
- has been verified out of band because the provided image will
- run with full administrative access to the cluster. Do not use
- this flag with images that comes from unknown or potentially
- malicious sources.
+ description: |-
+ force allows an administrator to update to an image that has failed
+ verification or upgradeable checks. This option should only
+ be used when the authenticity of the provided image has been verified out
+ of band because the provided image will run with full administrative access
+ to the cluster. Do not use this flag with images that comes from unknown
+ or potentially malicious sources.
type: boolean
image:
- description: 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,
- version is ignored. When image is set, version should be empty.
+ description: |-
+ 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, version is ignored. When image is set, version should be empty.
When image is set, architecture cannot be specified.
type: string
version:
- description: version is a semantic version identifying the update
- version. version is ignored if image is specified and required
- if architecture is specified.
+ description: |-
+ version is a semantic version identifying the update version.
+ version is ignored if image is specified and required if
+ architecture is specified.
type: string
type: object
x-kubernetes-validations:
@@ -185,12 +199,14 @@ spec:
rule: 'has(self.architecture) && self.architecture != '''' ? self.version
!= '''' : true'
overrides:
- description: overrides is list of overides for components that are
- managed by cluster version operator. Marking a component unmanaged
- will prevent the operator from creating or updating the object.
+ description: |-
+ overrides is list of overides for components that are managed by
+ cluster version operator. Marking a component unmanaged will prevent
+ the operator from creating or updating the object.
items:
- description: ComponentOverride allows overriding cluster version
- operator's behavior for a component.
+ description: |-
+ ComponentOverride allows overriding cluster version operator's behavior
+ for a component.
properties:
group:
description: group identifies the API group that the kind is
@@ -203,13 +219,15 @@ spec:
description: name is the component's name.
type: string
namespace:
- description: namespace is the component's namespace. If the
- resource is cluster scoped, the namespace should be empty.
+ description: |-
+ namespace is the component's namespace. If the resource is cluster
+ scoped, the namespace should be empty.
type: string
unmanaged:
- description: 'unmanaged controls if cluster version operator
- should stop managing the resources in this cluster. Default:
- false'
+ description: |-
+ unmanaged controls if cluster version operator should stop managing the
+ resources in this cluster.
+ Default: false
type: boolean
required:
- group
@@ -226,33 +244,31 @@ spec:
- name
x-kubernetes-list-type: map
signatureStores:
- description: "signatureStores contains the upstream URIs to verify
- release signatures and optional reference to a config map by name
- containing the PEM-encoded CA bundle. \n By default, CVO will use
- existing signature stores if this property is empty. The CVO will
- check the release signatures in the local ConfigMaps first. It will
- search for a valid signature in these stores in parallel only when
- local ConfigMaps did not include a valid signature. Validation will
- fail if none of the signature stores reply with valid signature
- before timeout. Setting signatureStores will replace the default
- signature stores with custom signature stores. Default stores can
- be used with custom signature stores by adding them manually. \n
- A maximum of 32 signature stores may be configured."
+ description: |-
+ signatureStores contains the upstream URIs to verify release signatures and optional
+ reference to a config map by name containing the PEM-encoded CA bundle.
+
+ By default, CVO will use existing signature stores if this property is empty.
+ The CVO will check the release signatures in the local ConfigMaps first. It will search for a valid signature
+ in these stores in parallel only when local ConfigMaps did not include a valid signature.
+ Validation will fail if none of the signature stores reply with valid signature before timeout.
+ Setting signatureStores will replace the default signature stores with custom signature stores.
+ Default stores can be used with custom signature stores by adding them manually.
+
+ A maximum of 32 signature stores may be configured.
items:
description: SignatureStore represents the URL of custom Signature
Store
properties:
ca:
- description: ca is an optional reference to a config map by
- name containing the PEM-encoded CA bundle. It is used as a
- trust anchor to validate the TLS certificate presented by
- the remote server. The key "ca.crt" is used to locate the
- data. If specified and the config map or expected key is not
- found, the signature store is not honored. If the specified
- ca data is not valid, the signature store is not honored.
- If empty, we fall back to the CA configured via Proxy, which
- is appended to the default system roots. The namespace for
- this config map is openshift-config.
+ description: |-
+ ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
+ It is used as a trust anchor to validate the TLS certificate presented by the remote server.
+ The key "ca.crt" is used to locate the data.
+ If specified and the config map or expected key is not found, the signature store is not honored.
+ If the specified ca data is not valid, the signature store is not honored.
+ If empty, we fall back to the CA configured via Proxy, which is appended to the default system roots.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -262,10 +278,10 @@ spec:
- name
type: object
url:
- description: url contains the upstream custom signature store
- URL. url should be a valid absolute http/https URI of an upstream
- signature store as per rfc1738. This must be provided and
- cannot be empty.
+ description: |-
+ url contains the upstream custom signature store URL.
+ url should be a valid absolute http/https URI of an upstream signature store as per rfc1738.
+ This must be provided and cannot be empty.
type: string
x-kubernetes-validations:
- message: url must be a valid absolute URL
@@ -279,52 +295,59 @@ spec:
- url
x-kubernetes-list-type: map
upstream:
- description: upstream may be used to specify the preferred update
- server. By default it will use the appropriate update server for
- the cluster and region.
+ description: |-
+ upstream may be used to specify the preferred update server. By default
+ it will use the appropriate update server for the cluster and region.
type: string
required:
- clusterID
type: object
status:
- description: status contains information about the available updates and
- any in-progress updates.
+ description: |-
+ status contains information about the available updates and any in-progress
+ updates.
properties:
availableUpdates:
- description: 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.
+ description: |-
+ 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.
items:
description: Release represents an OpenShift release image and associated
metadata.
properties:
channels:
- description: channels is the set of Cincinnati channels to which
- the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is optional
- if version is specified and the availableUpdates field contains
- a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release. This
- URL is set by the 'url' metadata property on a release or
- the metadata returned by the update API and should be displayed
- as a link in user interfaces. The URL field may not be set
- for test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the update
- version. When this field is part of spec, version is optional
- if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
nullable: true
type: array
@@ -356,6 +379,7 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
@@ -382,69 +406,62 @@ spec:
- CloudCredential
- Ingress
- CloudControllerManager
+ - OperatorLifecycleManagerV1
type: string
type: array
x-kubernetes-list-type: atomic
type: object
conditionalUpdates:
- description: conditionalUpdates contains the list of updates that
- may be recommended for this cluster if it meets specific required
+ description: |-
+ 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.
+ 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.
items:
- description: 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.
+ description: |-
+ 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.
properties:
conditions:
- description: '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.'
+ description: |-
+ 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.
items:
- description: "Condition contains details for one aspect of
- the current state of this API Resource. --- This struct
- is intended for direct use as an array at the field path
- .status.conditions. For example, \n type FooStatus struct{
- // Represents the observations of a foo's current state.
- // Known .status.conditions.type are: \"Available\", \"Progressing\",
- and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields
- }"
+ description: Condition contains details for one aspect of
+ the current state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should
- be when the underlying condition changed. If that is
- not known, then using the time when the API field changed
- is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance,
- if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the
- current state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier
- indicating the reason for the condition's last transition.
- Producers of specific condition types may define expected
- values and meanings for this field, and whether the
- values are considered a guaranteed API. The value should
- be a CamelCase string. This field may not be empty.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
@@ -459,11 +476,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across
- resources like Available, but because arbitrary conditions
- can be useful (see .node.status.conditions), the ability
- to deconflict is important. The regex it matches is
- (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -482,75 +494,82 @@ spec:
description: release is the target of the update.
properties:
channels:
- description: channels is the set of Cincinnati channels
- to which the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is
- optional if version is specified and the availableUpdates
- field contains a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release.
- This URL is set by the 'url' metadata property on a release
- or the metadata returned by the update API and should
- be displayed as a link in user interfaces. The URL field
- may not be set for test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the
- update version. When this field is part of spec, version
- is optional if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
risks:
- description: 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.
+ description: |-
+ 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.
items:
- description: ConditionalUpdateRisk represents a reason and
- cluster-state for not recommending a conditional update.
+ description: |-
+ ConditionalUpdateRisk represents a reason and cluster-state
+ for not recommending a conditional update.
properties:
matchingRules:
- description: matchingRules is a slice of conditions for
- deciding which clusters match the risk and which do
- not. The slice is ordered by decreasing precedence.
- The cluster-version operator will walk the slice in
- order, and stop after the first it can successfully
- evaluate. If no condition can be successfully evaluated,
- the update will not be recommended.
+ description: |-
+ matchingRules is a slice of conditions for deciding which
+ clusters match the risk and which do not. The slice is
+ ordered by decreasing precedence. The cluster-version
+ operator will walk the slice in order, and stop after the
+ first it can successfully evaluate. If no condition can be
+ successfully evaluated, the update will not be recommended.
items:
- description: 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.
+ description: |-
+ 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.
properties:
promql:
description: promQL represents a cluster condition
based on PromQL.
properties:
promql:
- description: PromQL is a PromQL query classifying
- clusters. This query query should return a
- 1 in the match case and a 0 in the does-not-match
- case. Queries which return no time series,
- or which return values besides 0 or 1, are
+ description: |-
+ PromQL is a PromQL query classifying clusters. This query
+ query should return a 1 in the match case and a 0 in the
+ does-not-match case. Queries which return no time
+ series, or which return values besides 0 or 1, are
evaluation failures.
type: string
required:
- promql
type: object
type:
- description: type represents the cluster-condition
- type. This defines the members and semantics of
- any additional properties.
+ description: |-
+ type represents the cluster-condition type. This defines
+ the members and semantics of any additional properties.
enum:
- Always
- PromQL
@@ -562,17 +581,19 @@ spec:
type: array
x-kubernetes-list-type: atomic
message:
- description: 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.
+ description: |-
+ 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.
minLength: 1
type: string
name:
- description: name is the CamelCase reason for not recommending
- a conditional update, in the event that matchingRules
- match the cluster state.
+ description: |-
+ name is the CamelCase reason for not recommending a
+ conditional update, in the event that matchingRules match the
+ cluster state.
minLength: 1
type: string
url:
@@ -598,16 +619,18 @@ spec:
type: array
x-kubernetes-list-type: atomic
conditions:
- description: 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.
+ description: |-
+ 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.
items:
- description: ClusterOperatorStatusCondition represents the state
- of the operator's managed and monitored components.
+ description: |-
+ ClusterOperatorStatusCondition represents the state of the operator's
+ managed and monitored components.
properties:
lastTransitionTime:
description: lastTransitionTime is the time of the last update
@@ -615,10 +638,10 @@ spec:
format: date-time
type: string
message:
- description: message provides additional information about the
- current condition. This is only to be consumed by humans. It
- may contain Line Feed characters (U+000A), which should be
- rendered as new lines.
+ description: |-
+ message provides additional information about the current condition.
+ This is only to be consumed by humans. It may contain Line Feed
+ characters (U+000A), which should be rendered as new lines.
type: string
reason:
description: reason is the CamelCase reason for the condition's
@@ -640,67 +663,75 @@ spec:
- type
x-kubernetes-list-type: map
desired:
- description: 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.
+ description: |-
+ 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.
properties:
channels:
- description: channels is the set of Cincinnati channels to which
- the release currently belongs.
+ description: |-
+ channels is the set of Cincinnati channels to which the release
+ currently belongs.
items:
type: string
type: array
x-kubernetes-list-type: set
image:
- description: image is a container image location that contains
- the update. When this field is part of spec, image is optional
- if version is specified and the availableUpdates field contains
- a matching version.
+ description: |-
+ image is a container image location that contains the update. When this
+ field is part of spec, image is optional if version is specified and the
+ availableUpdates field contains a matching version.
type: string
url:
- description: url contains information about this release. This
- URL is set by the 'url' metadata property on a release or the
- metadata returned by the update API and should be displayed
- as a link in user interfaces. The URL field may not be set for
- test or nightly releases.
+ description: |-
+ url contains information about this release. This URL is set by
+ the 'url' metadata property on a release or the metadata returned by
+ the update API and should be displayed as a link in user
+ interfaces. The URL field may not be set for test or nightly
+ releases.
type: string
version:
- description: version is a semantic version identifying the update
- version. When this field is part of spec, version is optional
- if image is specified.
+ description: |-
+ version is a semantic version identifying the update version. When this
+ field is part of spec, version is optional if image is specified.
type: string
+ required:
+ - image
+ - version
type: object
history:
- description: 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.
+ description: |-
+ 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.
items:
description: UpdateHistory is a single attempted update to the cluster.
properties:
acceptedRisks:
- description: acceptedRisks records risks which were accepted
- to initiate the update. For example, it may menition an Upgradeable=False
- or missing signature that was overriden via desiredUpdate.force,
- or an update that was initiated despite not being in the availableUpdates
- set of recommended update targets.
+ description: |-
+ acceptedRisks records risks which were accepted to initiate the update.
+ For example, it may menition an Upgradeable=False or missing signature
+ that was overriden via desiredUpdate.force, or an update that was
+ initiated despite not being in the availableUpdates set of recommended
+ update targets.
type: string
completionTime:
- description: completionTime, if set, is when the update was
- fully applied. The update that is currently being applied
- will have a null completion time. Completion time will always
- be set for entries that are not the current update (usually
- to the started time of the next update).
+ description: |-
+ completionTime, if set, is when the update was fully applied. The update
+ that is currently being applied will have a null completion time.
+ Completion time will always be set for entries that are not the current
+ update (usually to the started time of the next update).
format: date-time
nullable: true
type: string
image:
- description: image is a container image location that contains
- the update. This value is always populated.
+ description: |-
+ image is a container image location that contains the update. This value
+ is always populated.
type: string
startedTime:
description: startedTime is the time at which the update was
@@ -708,24 +739,24 @@ spec:
format: date-time
type: string
state:
- description: state reflects whether the update was fully applied.
- The Partial state indicates the update is not fully applied,
- while the Completed state indicates the update was successfully
- rolled out at least once (all parts of the update successfully
- applied).
+ description: |-
+ state reflects whether the update was fully applied. The Partial state
+ indicates the update is not fully applied, while the Completed state
+ indicates the update was successfully rolled out at least once (all
+ parts of the update successfully applied).
type: string
verified:
- description: 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.
+ description: |-
+ 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.
type: boolean
version:
- description: 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.
+ description: |-
+ 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.
type: string
required:
- completionTime
@@ -737,16 +768,17 @@ spec:
type: array
x-kubernetes-list-type: atomic
observedGeneration:
- description: 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.
+ description: |-
+ 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.
format: int64
type: integer
versionHash:
- description: 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.
+ description: |-
+ 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.
type: string
required:
- availableUpdates
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_03_config-operator_01_proxies.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_03_config-operator_01_proxies.crd.yaml
index d2db3c826f..b774262cd0 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_03_config-operator_01_proxies.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_03_config-operator_01_proxies.crd.yaml
@@ -20,20 +20,25 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Proxy holds cluster-wide information on how to configure default
- proxies for the cluster. The canonical name is `cluster` \n Compatibility
- level 1: Stable within a major release for a minimum of 12 months or 3 minor
- releases (whichever is longer)."
+ description: |-
+ Proxy holds cluster-wide information on how to configure default proxies for the cluster. The canonical name is `cluster`
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -49,9 +54,9 @@ spec:
means unset and will not result in an env var.
type: string
noProxy:
- description: noProxy is a comma-separated list of hostnames and/or
- CIDRs and/or IPs for which the proxy should not be used. Empty means
- unset and will not result in an env var.
+ description: |-
+ noProxy is a comma-separated list of hostnames and/or CIDRs and/or IPs for which the proxy should not be used.
+ Empty means unset and will not result in an env var.
type: string
readinessEndpoints:
description: readinessEndpoints is a list of endpoints used to verify
@@ -60,20 +65,30 @@ spec:
type: string
type: array
trustedCA:
- description: "trustedCA is a reference to a ConfigMap containing a
- CA certificate bundle. The trustedCA field should only be consumed
- by a proxy validator. The validator is responsible for reading the
- certificate bundle from the required key \"ca-bundle.crt\", merging
- it with the system default trust bundle, and writing the merged
- trust bundle to a ConfigMap named \"trusted-ca-bundle\" in the \"openshift-config-managed\"
- namespace. Clients that expect to make proxy connections must use
- the trusted-ca-bundle for all HTTPS requests to the proxy, and may
- use the trusted-ca-bundle for non-proxy HTTPS requests as well.
- \n The namespace for the ConfigMap referenced by trustedCA is \"openshift-config\".
- Here is an example ConfigMap (in yaml): \n apiVersion: v1 kind:
- ConfigMap metadata: name: user-ca-bundle namespace: openshift-config
- data: ca-bundle.crt: | -----BEGIN CERTIFICATE----- Custom CA certificate
- bundle. -----END CERTIFICATE-----"
+ description: |-
+ trustedCA is a reference to a ConfigMap containing a CA certificate bundle.
+ The trustedCA field should only be consumed by a proxy validator. The
+ validator is responsible for reading the certificate bundle from the required
+ key "ca-bundle.crt", merging it with the system default trust bundle,
+ and writing the merged trust bundle to a ConfigMap named "trusted-ca-bundle"
+ in the "openshift-config-managed" namespace. Clients that expect to make
+ proxy connections must use the trusted-ca-bundle for all HTTPS requests to
+ the proxy, and may use the trusted-ca-bundle for non-proxy HTTPS requests as
+ well.
+
+ The namespace for the ConfigMap referenced by trustedCA is
+ "openshift-config". Here is an example ConfigMap (in yaml):
+
+ apiVersion: v1
+ kind: ConfigMap
+ metadata:
+ name: user-ca-bundle
+ namespace: openshift-config
+ data:
+ ca-bundle.crt: |
+ -----BEGIN CERTIFICATE-----
+ Custom CA certificate bundle.
+ -----END CERTIFICATE-----
properties:
name:
description: name is the metadata.name of the referenced config
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_03_marketplace_01_operatorhubs.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_03_marketplace_01_operatorhubs.crd.yaml
index aad0829d92..00c43ede74 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_03_marketplace_01_operatorhubs.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_03_marketplace_01_operatorhubs.crd.yaml
@@ -20,21 +20,27 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "OperatorHub is the Schema for the operatorhubs API. It can be
- used to change the state of the default hub sources for OperatorHub on the
- cluster from enabled to disabled and vice versa. \n Compatibility level
- 1: Stable within a major release for a minimum of 12 months or 3 minor releases
- (whichever is longer)."
+ description: |-
+ OperatorHub is the Schema for the operatorhubs API. It can be used to change
+ the state of the default hub sources for OperatorHub on the cluster from
+ enabled to disabled and vice versa.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,19 +48,21 @@ spec:
description: OperatorHubSpec defines the desired state of OperatorHub
properties:
disableAllDefaultSources:
- description: disableAllDefaultSources allows you to disable all the
- default hub sources. If this is true, a specific entry in sources
- can be used to enable a default source. If this is false, a specific
- entry in sources can be used to disable or enable a default source.
+ description: |-
+ disableAllDefaultSources allows you to disable all the default hub
+ sources. If this is true, a specific entry in sources can be used to
+ enable a default source. If this is false, a specific entry in
+ sources can be used to disable or enable a default source.
type: boolean
sources:
- description: sources is the list of default hub sources and their
- configuration. If the list is empty, it implies that the default
- hub sources are enabled on the cluster unless disableAllDefaultSources
- is true. If disableAllDefaultSources is true and sources is not
- empty, the configuration present in sources will take precedence.
- The list of default hub sources and their current state will always
- be reflected in the status block.
+ description: |-
+ sources is the list of default hub sources and their configuration.
+ If the list is empty, it implies that the default hub sources are
+ enabled on the cluster unless disableAllDefaultSources is true.
+ If disableAllDefaultSources is true and sources is not empty,
+ the configuration present in sources will take precedence. The list of
+ default hub sources and their current state will always be reflected in
+ the status block.
items:
description: HubSource is used to specify the hub source and its
configuration
@@ -72,16 +80,18 @@ spec:
type: array
type: object
status:
- description: OperatorHubStatus defines the observed state of OperatorHub.
- The current state of the default hub sources will always be reflected
- here.
+ description: |-
+ OperatorHubStatus defines the observed state of OperatorHub. The current
+ state of the default hub sources will always be reflected here.
properties:
sources:
- description: sources encapsulates the result of applying the configuration
- for each hub source
+ description: |-
+ sources encapsulates the result of applying the configuration for each
+ hub source
items:
- description: HubSourceStatus is used to reflect the current state
- of applying the configuration to a default source
+ description: |-
+ HubSourceStatus is used to reflect the current state of applying the
+ configuration to a default source
properties:
disabled:
description: disabled is used to disable a default hub source
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers.crd.yaml
index c1ffb1e76e..8dd63a3289 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers.crd.yaml
@@ -20,21 +20,27 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "APIServer holds configuration (like serving certificates, client
- CA and CORS domains) shared by all API servers in the system, among them
- especially kube-apiserver and openshift-apiserver. The canonical name of
- an instance is 'cluster'. \n Compatibility level 1: Stable within a major
- release for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ APIServer holds configuration (like serving certificates, client CA and CORS domains)
+ shared by all API servers in the system, among them especially kube-apiserver
+ and openshift-apiserver. The canonical name of an instance is 'cluster'.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,29 +48,30 @@ spec:
description: spec holds user settable values for configuration
properties:
additionalCORSAllowedOrigins:
- description: 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.
+ description: |-
+ 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.
items:
type: string
type: array
audit:
default:
profile: Default
- description: audit specifies the settings for audit configuration
- to be applied to all OpenShift-provided API servers in the cluster.
+ description: |-
+ audit specifies the settings for audit configuration to be applied to all OpenShift-provided
+ API servers in the cluster.
properties:
customRules:
- description: customRules specify profiles per group. These profile
- take precedence over the top-level profile field if they apply.
- They are evaluation from top to bottom and the first one that
- matches, applies.
+ description: |-
+ customRules specify profiles per group. These profile take precedence over the
+ top-level profile field if they apply. They are evaluation from top to bottom and
+ the first one that matches, applies.
items:
- description: AuditCustomRule describes a custom rule for an
- audit profile that takes precedence over the top-level profile.
+ description: |-
+ AuditCustomRule describes a custom rule for an audit profile that takes precedence over
+ the top-level profile.
properties:
group:
description: group is a name of group a request user must
@@ -72,17 +79,19 @@ spec:
minLength: 1
type: string
profile:
- description: "profile specifies the name of the desired
- audit policy configuration to be deployed to all OpenShift-provided
- API servers in the cluster. \n The following profiles
- are provided: - Default: the existing default policy.
- - WriteRequestBodies: like 'Default', but logs request
- and response HTTP payloads for write requests (create,
- update, patch). - AllRequestBodies: like 'WriteRequestBodies',
- but also logs request and response HTTP payloads for read
- requests (get, list). - None: no requests are logged at
- all, not even oauthaccesstokens and oauthauthorizetokens.
- \n If unset, the 'Default' profile is used as the default."
+ description: |-
+ profile specifies the name of the desired audit policy configuration to be deployed to
+ all OpenShift-provided API servers in the cluster.
+
+ The following profiles are provided:
+ - Default: the existing default policy.
+ - WriteRequestBodies: like 'Default', but logs request and response HTTP payloads for
+ write requests (create, update, patch).
+ - AllRequestBodies: like 'WriteRequestBodies', but also logs request and response
+ HTTP payloads for read requests (get, list).
+ - None: no requests are logged at all, not even oauthaccesstokens and oauthauthorizetokens.
+
+ If unset, the 'Default' profile is used as the default.
enum:
- Default
- WriteRequestBodies
@@ -99,27 +108,28 @@ spec:
x-kubernetes-list-type: map
profile:
default: Default
- description: "profile specifies the name of the desired top-level
- audit profile to be applied to all requests sent to any of the
- OpenShift-provided API servers in the cluster (kube-apiserver,
- openshift-apiserver and oauth-apiserver), with the exception
- of those requests that match one or more of the customRules.
- \n The following profiles are provided: - Default: default policy
- which means MetaData level logging with the exception of events
- (not logged at all), oauthaccesstokens and oauthauthorizetokens
- (both logged at RequestBody level). - WriteRequestBodies: like
- 'Default', but logs request and response HTTP payloads for write
- requests (create, update, patch). - AllRequestBodies: like 'WriteRequestBodies',
- but also logs request and response HTTP payloads for read requests
- (get, list). - None: no requests are logged at all, not even
- oauthaccesstokens and oauthauthorizetokens. \n Warning: It is
- not recommended to disable audit logging by using the `None`
- profile unless you are fully aware of the risks of not logging
- data that can be beneficial when troubleshooting issues. If
- you disable audit logging and a support situation arises, you
- might need to enable audit logging and reproduce the issue in
- order to troubleshoot properly. \n If unset, the 'Default' profile
- is used as the default."
+ description: |-
+ profile specifies the name of the desired top-level audit profile to be applied to all requests
+ sent to any of the OpenShift-provided API servers in the cluster (kube-apiserver,
+ openshift-apiserver and oauth-apiserver), with the exception of those requests that match
+ one or more of the customRules.
+
+ The following profiles are provided:
+ - Default: default policy which means MetaData level logging with the exception of events
+ (not logged at all), oauthaccesstokens and oauthauthorizetokens (both logged at RequestBody
+ level).
+ - WriteRequestBodies: like 'Default', but logs request and response HTTP payloads for
+ write requests (create, update, patch).
+ - AllRequestBodies: like 'WriteRequestBodies', but also logs request and response
+ HTTP payloads for read requests (get, list).
+ - None: no requests are logged at all, not even oauthaccesstokens and oauthauthorizetokens.
+
+ Warning: It is not recommended to disable audit logging by using the `None` profile unless you
+ are fully aware of the risks of not logging data that can be beneficial when troubleshooting issues.
+ If you disable audit logging and a support situation arises, you might need to enable audit logging
+ and reproduce the issue in order to troubleshoot properly.
+
+ If unset, the 'Default' profile is used as the default.
enum:
- Default
- WriteRequestBodies
@@ -128,14 +138,12 @@ spec:
type: string
type: object
clientCA:
- description: 'clientCA references a ConfigMap containing a certificate
- bundle for the signers that will be recognized for incoming client
- certificates in addition to the operator managed signers. If this
- is empty, then only operator managed signers are valid. You usually
- only have to set this if you have your own PKI you wish to honor
- client certificates from. The ConfigMap must exist in the openshift-config
- namespace and contain the following required fields: - ConfigMap.Data["ca-bundle.crt"]
- - CA bundle.'
+ description: |-
+ clientCA references a ConfigMap containing a certificate bundle for the signers that will be recognized for
+ incoming client certificates in addition to the operator managed signers. If this is empty, then only operator managed signers are valid.
+ You usually only have to set this if you have your own PKI you wish to honor client certificates from.
+ The ConfigMap must exist in the openshift-config namespace and contain the following required fields:
+ - ConfigMap.Data["ca-bundle.crt"] - CA bundle.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -149,17 +157,20 @@ spec:
resources at the datastore layer.
properties:
type:
- description: "type defines what encryption type should be used
- to encrypt resources at the datastore layer. When this field
- is unset (i.e. when it is set to the empty string), identity
- is implied. The behavior of unset can and will change over time.
- \ Even if encryption is enabled by default, the meaning of unset
- may change to a different encryption type based on changes in
- best practices. \n When encryption is enabled, all sensitive
- resources shipped with the platform are encrypted. This list
- of sensitive resources can and will change over time. The current
- authoritative list is: \n 1. secrets 2. configmaps 3. routes.route.openshift.io
- 4. oauthaccesstokens.oauth.openshift.io 5. oauthauthorizetokens.oauth.openshift.io"
+ description: |-
+ type defines what encryption type should be used to encrypt resources at the datastore layer.
+ When this field is unset (i.e. when it is set to the empty string), identity is implied.
+ The behavior of unset can and will change over time. Even if encryption is enabled by default,
+ the meaning of unset may change to a different encryption type based on changes in best practices.
+
+ When encryption is enabled, all sensitive resources shipped with the platform are encrypted.
+ This list of sensitive resources can and will change over time. The current authoritative list is:
+
+ 1. secrets
+ 2. configmaps
+ 3. routes.route.openshift.io
+ 4. oauthaccesstokens.oauth.openshift.io
+ 5. oauthauthorizetokens.oauth.openshift.io
enum:
- ""
- identity
@@ -168,37 +179,33 @@ spec:
type: string
type: object
servingCerts:
- description: servingCert is the TLS cert info for serving secure traffic.
- If not specified, operator managed certificates will be used for
- serving secure traffic.
+ description: |-
+ servingCert is the TLS cert info for serving secure traffic. If not specified, operator managed certificates
+ will be used for serving secure traffic.
properties:
namedCertificates:
- description: namedCertificates references secrets containing the
- TLS cert info for serving secure traffic to specific hostnames.
- If no named certificates are provided, or no named certificates
- match the server name as understood by a client, the defaultServingCertificate
- will be used.
+ description: |-
+ namedCertificates references secrets containing the TLS cert info for serving secure traffic to specific hostnames.
+ If no named certificates are provided, or no named certificates match the server name as understood by a client,
+ the defaultServingCertificate will be used.
items:
description: APIServerNamedServingCert maps a server DNS name,
as understood by a client, to a certificate.
properties:
names:
- description: names is a optional list of explicit DNS names
- (leading wildcards allowed) that should use this certificate
- to serve secure traffic. If no names are provided, the
- implicit names will be extracted from the certificates.
- Exact names trump over wildcard names. Explicit names
- defined here trump over extracted implicit names.
+ description: |-
+ names is a optional list of explicit DNS names (leading wildcards allowed) that should use this certificate to
+ serve secure traffic. If no names are provided, the implicit names will be extracted from the certificates.
+ Exact names trump over wildcard names. Explicit names defined here trump over extracted implicit names.
items:
type: string
type: array
servingCertificate:
- description: 'servingCertificate references a kubernetes.io/tls
- type secret containing the TLS cert info for serving secure
- traffic. The secret must exist in the openshift-config
- namespace and contain the following required fields: -
- Secret.Data["tls.key"] - TLS private key. - Secret.Data["tls.crt"]
- - TLS certificate.'
+ description: |-
+ servingCertificate references a kubernetes.io/tls type secret containing the TLS cert info for serving secure traffic.
+ The secret must exist in the openshift-config namespace and contain the following required fields:
+ - Secret.Data["tls.key"] - TLS private key.
+ - Secret.Data["tls.crt"] - TLS certificate.
properties:
name:
description: name is the metadata.name of the referenced
@@ -211,36 +218,53 @@ spec:
type: array
type: object
tlsSecurityProfile:
- description: "tlsSecurityProfile specifies settings for TLS connections
- for externally exposed servers. \n If unset, a default (which may
- change between releases) is chosen. Note that only Old, Intermediate
- and Custom profiles are currently supported, and the maximum available
- minTLSVersion is VersionTLS12."
+ description: |-
+ tlsSecurityProfile specifies settings for TLS connections for externally exposed servers.
+
+ If unset, a default (which may change between releases) is chosen. Note that only Old,
+ Intermediate and Custom profiles are currently supported, and the maximum available
+ minTLSVersion is VersionTLS12.
properties:
custom:
- description: "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 ciphers: \n - ECDHE-ECDSA-CHACHA20-POLY1305 \n - ECDHE-RSA-CHACHA20-POLY1305
- \n - ECDHE-RSA-AES128-GCM-SHA256 \n - ECDHE-ECDSA-AES128-GCM-SHA256
- \n minTLSVersion: VersionTLS11"
+ description: |-
+ 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:
+
+ ciphers:
+
+ - ECDHE-ECDSA-CHACHA20-POLY1305
+
+ - ECDHE-RSA-CHACHA20-POLY1305
+
+ - ECDHE-RSA-AES128-GCM-SHA256
+
+ - ECDHE-ECDSA-AES128-GCM-SHA256
+
+ minTLSVersion: VersionTLS11
nullable: true
properties:
ciphers:
- description: "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 ciphers: - DES-CBC3-SHA"
+ description: |-
+ 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):
+
+ ciphers:
+ - DES-CBC3-SHA
items:
type: string
type: array
x-kubernetes-list-type: atomic
minTLSVersion:
- description: "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 minTLSVersion: VersionTLS11 \n NOTE:
- currently the highest minTLSVersion allowed is VersionTLS12"
+ description: |-
+ 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):
+
+ minTLSVersion: VersionTLS11
+
+ NOTE: currently the highest minTLSVersion allowed is VersionTLS12
enum:
- VersionTLS10
- VersionTLS11
@@ -249,52 +273,144 @@ spec:
type: string
type: object
intermediate:
- description: "intermediate is a TLS security profile based on:
- \n https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29
- \n and looks like this (yaml): \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 - DHE-RSA-AES128-GCM-SHA256 \n - DHE-RSA-AES256-GCM-SHA384
- \n minTLSVersion: VersionTLS12"
+ description: |-
+ 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):
+
+ 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
nullable: true
type: object
modern:
- description: "modern is a TLS security profile based on: \n https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
- \n and looks like this (yaml): \n ciphers: \n - TLS_AES_128_GCM_SHA256
- \n - TLS_AES_256_GCM_SHA384 \n - TLS_CHACHA20_POLY1305_SHA256
- \n minTLSVersion: VersionTLS13"
+ description: |-
+ modern is a TLS security profile based on:
+
+ https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
+
+ and looks like this (yaml):
+
+ ciphers:
+
+ - TLS_AES_128_GCM_SHA256
+
+ - TLS_AES_256_GCM_SHA384
+
+ - TLS_CHACHA20_POLY1305_SHA256
+
+ minTLSVersion: VersionTLS13
nullable: true
type: object
old:
- description: "old is a TLS security profile based on: \n https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility
- \n and looks like this (yaml): \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 - DHE-RSA-AES128-GCM-SHA256 \n - DHE-RSA-AES256-GCM-SHA384
- \n - DHE-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-SHA384 \n - ECDHE-RSA-AES256-SHA384
- \n - ECDHE-ECDSA-AES256-SHA \n - ECDHE-RSA-AES256-SHA \n - DHE-RSA-AES128-SHA256
- \n - DHE-RSA-AES256-SHA256 \n - AES128-GCM-SHA256 \n - AES256-GCM-SHA384
- \n - AES128-SHA256 \n - AES256-SHA256 \n - AES128-SHA \n - AES256-SHA
- \n - DES-CBC3-SHA \n minTLSVersion: VersionTLS10"
+ description: |-
+ old is a TLS security profile based on:
+
+ https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility
+
+ and looks like this (yaml):
+
+ 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
nullable: true
type: object
type:
- description: "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 https://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_configurations
- \n 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. \n Note that the Modern
- profile is currently not supported because it is not yet well
- adopted by common software libraries."
+ description: |-
+ 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:
+
+ https://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_configurations
+
+ 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.
enum:
- Old
- Intermediate
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-Hypershift.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-Hypershift.crd.yaml
index 1d3ed5bca0..8f7dc33442 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-Hypershift.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-Hypershift.crd.yaml
@@ -19,20 +19,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Authentication specifies cluster-wide settings for authentication
- (like OAuth and webhook token authenticators). The canonical name of an
- instance is `cluster`. \n Compatibility level 1: Stable within a major release
- for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Authentication specifies cluster-wide settings for authentication (like OAuth and
+ webhook token authenticators). The canonical name of an instance is `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -40,17 +46,19 @@ spec:
description: spec holds user settable values for configuration
properties:
oauthMetadata:
- description: 'oauthMetadata contains the discovery endpoint data for
- OAuth 2.0 Authorization Server Metadata for an external OAuth server.
+ description: |-
+ oauthMetadata contains the discovery endpoint data for OAuth 2.0
+ Authorization Server Metadata for an external OAuth server.
This discovery document can be viewed from its served location:
- oc get --raw ''/.well-known/oauth-authorization-server'' For further
- details, see the IETF Draft: https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
- If oauthMetadata.name is non-empty, this value has precedence over
- any metadata reference stored in status. The key "oauthMetadata"
- is used to locate the data. If specified and the config map or expected
- key is not found, no metadata is served. If the specified metadata
- is not valid, no metadata is served. The namespace for this config
- map is openshift-config.'
+ oc get --raw '/.well-known/oauth-authorization-server'
+ For further details, see the IETF Draft:
+ https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
+ If oauthMetadata.name is non-empty, this value has precedence
+ over any metadata reference stored in status.
+ The key "oauthMetadata" is used to locate the data.
+ If specified and the config map or expected key is not found, no metadata is served.
+ If the specified metadata is not valid, no metadata is served.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -60,40 +68,49 @@ spec:
- name
type: object
oidcProviders:
- description: "OIDCProviders are OIDC identity providers that can issue
- tokens for this cluster Can only be set if \"Type\" is set to \"OIDC\".
- \n At most one provider can be configured."
+ description: |-
+ 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.
items:
properties:
claimMappings:
- description: ClaimMappings describes rules on how to transform
- information from an ID token into a cluster identity
+ description: |-
+ ClaimMappings describes rules on how to transform information from an
+ ID token into a cluster identity
properties:
groups:
- description: Groups is a name of the claim that should be
- used to construct groups for the cluster identity. The
- referenced claim must use array of strings values.
+ description: |-
+ Groups is a name of the claim that should be used to construct
+ groups for the cluster identity.
+ The referenced claim must use array of strings values.
properties:
claim:
description: Claim is a JWT token claim to be used in
the mapping
type: string
prefix:
- description: "Prefix is a string to prefix the value
- from the token in the result of the claim mapping.
- \n By default, no prefixing occurs. \n 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\"."
+ description: |-
+ Prefix is a string to prefix the value from the token in the result of the
+ claim mapping.
+
+ By default, no prefixing occurs.
+
+ 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".
type: string
required:
- claim
type: object
username:
- description: "Username is a name of the claim that should
- be used to construct usernames for the cluster identity.
- \n Default value: \"sub\""
+ description: |-
+ Username is a name of the claim that should be used to construct
+ usernames for the cluster identity.
+
+ Default value: "sub"
properties:
claim:
description: Claim is a JWT token claim to be used in
@@ -108,23 +125,26 @@ spec:
- prefixString
type: object
prefixPolicy:
- description: "PrefixPolicy specifies how a prefix should
- apply. \n By default, claims other than `email` will
- be prefixed with the issuer URL to prevent naming
- clashes with other plugins. \n Set to \"NoPrefix\"
- to disable prefixing. \n Example: (1) `prefix` is
- set to \"myoidc:\" and `claim` is set to \"username\".
- If the JWT claim `username` contains value `userA`,
- the resulting mapped value will be \"myoidc:userA\".
- (2) `prefix` is set to \"myoidc:\" and `claim` is
- set to \"email\". If the JWT `email` claim contains
- value \"userA@myoidc.tld\", the resulting mapped value
- will be \"myoidc:userA@myoidc.tld\". (3) `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: (a) \"username\": the mapped value will be \"https://myoidc.tld#userA\"
- (b) \"email\": the mapped value will be \"userA@myoidc.tld\""
+ description: |-
+ PrefixPolicy specifies how a prefix should apply.
+
+ By default, claims other than `email` will be prefixed with the issuer URL to
+ prevent naming clashes with other plugins.
+
+ Set to "NoPrefix" to disable prefixing.
+
+ Example:
+ (1) `prefix` is set to "myoidc:" and `claim` is set to "username".
+ If the JWT claim `username` contains value `userA`, the resulting
+ mapped value will be "myoidc:userA".
+ (2) `prefix` is set to "myoidc:" and `claim` is set to "email". If the
+ JWT `email` claim contains value "userA@myoidc.tld", the resulting
+ mapped value will be "myoidc:userA@myoidc.tld".
+ (3) `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:
+ (a) "username": the mapped value will be "https://myoidc.tld#userA"
+ (b) "email": the mapped value will be "userA@myoidc.tld"
enum:
- ""
- NoPrefix
@@ -146,12 +166,14 @@ spec:
items:
properties:
requiredClaim:
- description: RequiredClaim allows configuring a required
- claim name and its expected value
+ description: |-
+ RequiredClaim allows configuring a required claim name and its expected
+ value
properties:
claim:
- description: Claim is a name of a required claim.
- Only claims with string values are supported.
+ description: |-
+ Claim is a name of a required claim. Only claims with string values are
+ supported.
minLength: 1
type: string
requiredValue:
@@ -176,10 +198,11 @@ spec:
description: Issuer describes atributes of the OIDC token issuer
properties:
audiences:
- description: Audiences is an array of audiences that the
- token was issued for. Valid tokens must include at least
- one of these values in their "aud" claim. Must be set
- to exactly one value.
+ description: |-
+ Audiences is an array of audiences that the token was issued for.
+ Valid tokens must include at least one of these values in their
+ "aud" claim.
+ Must be set to exactly one value.
items:
minLength: 1
type: string
@@ -188,10 +211,11 @@ spec:
type: array
x-kubernetes-list-type: set
issuerCertificateAuthority:
- description: CertificateAuthority is a reference to a config
- map in the configuration namespace. The .data of the configMap
- must contain the "ca-bundle.crt" key. If unset, system
- trust is used instead.
+ description: |-
+ CertificateAuthority is a reference to a config map in the
+ configuration namespace. The .data of the configMap must contain
+ the "ca-bundle.crt" key.
+ If unset, system trust is used instead.
properties:
name:
description: name is the metadata.name of the referenced
@@ -201,7 +225,8 @@ spec:
- name
type: object
issuerURL:
- description: URL is the serving URL of the token issuer.
+ description: |-
+ URL is the serving URL of the token issuer.
Must use the https:// scheme.
pattern: ^https:\/\/[^\s]
type: string
@@ -214,8 +239,9 @@ spec:
minLength: 1
type: string
oidcClients:
- description: OIDCClients contains configuration for the platform's
- clients that need to request tokens from the issuer
+ description: |-
+ OIDCClients contains configuration for the platform's clients that
+ need to request tokens from the issuer
items:
properties:
clientID:
@@ -224,9 +250,9 @@ spec:
minLength: 1
type: string
clientSecret:
- description: ClientSecret refers to a secret in the `openshift-config`
- namespace that contains the client secret in the `clientSecret`
- key of the `.data` field
+ description: |-
+ ClientSecret refers to a secret in the `openshift-config` namespace that
+ contains the client secret in the `clientSecret` key of the `.data` field
properties:
name:
description: name is the metadata.name of the referenced
@@ -236,14 +262,16 @@ spec:
- name
type: object
componentName:
- description: ComponentName is the name of the component
- that is supposed to consume this client configuration
+ description: |-
+ ComponentName is the name of the component that is supposed to consume this
+ client configuration
maxLength: 256
minLength: 1
type: string
componentNamespace:
- description: ComponentNamespace is the namespace of the
- component that is supposed to consume this client configuration
+ description: |-
+ ComponentNamespace is the namespace of the component that is supposed to consume this
+ client configuration
maxLength: 63
minLength: 1
type: string
@@ -275,20 +303,21 @@ spec:
- name
x-kubernetes-list-type: map
serviceAccountIssuer:
- description: 'serviceAccountIssuer is the identifier of the bound
- service account token issuer. The default is https://kubernetes.default.svc
- WARNING: Updating this field will not result in immediate invalidation
- of all bound tokens with the previous issuer value. Instead, the
- tokens issued by previous service account issuer will continue to
- be trusted for a time period chosen by the platform (currently set
- to 24h). This time period is subject to change over time. This allows
- internal components to transition to use new service account issuer
- without service distruption.'
+ description: |-
+ serviceAccountIssuer is the identifier of the bound service account token
+ issuer.
+ The default is https://kubernetes.default.svc
+ WARNING: Updating this field will not result in immediate invalidation of all bound tokens with the
+ previous issuer value. Instead, the tokens issued by previous service account issuer will continue to
+ be trusted for a time period chosen by the platform (currently set to 24h).
+ This time period is subject to change over time.
+ This allows internal components to transition to use new service account issuer without service distruption.
type: string
type:
- description: type identifies the cluster managed, user facing authentication
- mode in use. Specifically, it manages the component that responds
- to login attempts. The default is IntegratedOAuth.
+ description: |-
+ type identifies the cluster managed, user facing authentication mode in use.
+ Specifically, it manages the component that responds to login attempts.
+ The default is IntegratedOAuth.
enum:
- ""
- None
@@ -296,22 +325,27 @@ spec:
- OIDC
type: string
webhookTokenAuthenticator:
- description: "webhookTokenAuthenticator configures a remote token
- reviewer. These remote authentication webhooks can be used to verify
- bearer tokens via the tokenreviews.authentication.k8s.io REST API.
- This is required to honor bearer tokens that are provisioned by
- an external authentication service. \n Can only be set if \"Type\"
- is set to \"None\"."
+ description: |-
+ webhookTokenAuthenticator configures a remote token reviewer.
+ These remote authentication webhooks can be used to verify bearer tokens
+ via the tokenreviews.authentication.k8s.io REST API. This is required to
+ honor bearer tokens that are provisioned by an external authentication service.
+
+ Can only be set if "Type" is set to "None".
properties:
kubeConfig:
- description: "kubeConfig references a secret that contains kube
- config file data which describes how to access the remote webhook
- service. The namespace for the referenced secret is openshift-config.
- \n For further details, see: \n https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
- \n The key \"kubeConfig\" is used to locate the data. If the
- secret or expected key is not found, the webhook is not honored.
- If the specified kube config data is not valid, the webhook
- is not honored."
+ description: |-
+ kubeConfig references a secret that contains kube config file data which
+ describes how to access the remote webhook service.
+ The namespace for the referenced secret is openshift-config.
+
+ For further details, see:
+
+ https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
+
+ The key "kubeConfig" is used to locate the data.
+ If the secret or expected key is not found, the webhook is not honored.
+ If the specified kube config data is not valid, the webhook is not honored.
properties:
name:
description: name is the metadata.name of the referenced secret
@@ -326,20 +360,19 @@ spec:
description: webhookTokenAuthenticators is DEPRECATED, setting it
has no effect.
items:
- description: deprecatedWebhookTokenAuthenticator holds the necessary
- configuration options for a remote token authenticator. It's the
- same as WebhookTokenAuthenticator but it's missing the 'required'
- validation on KubeConfig field.
+ description: |-
+ deprecatedWebhookTokenAuthenticator holds the necessary configuration options for a remote token authenticator.
+ It's the same as WebhookTokenAuthenticator but it's missing the 'required' validation on KubeConfig field.
properties:
kubeConfig:
- description: 'kubeConfig contains kube config file data which
- describes how to access the remote webhook service. For further
- details, see: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
- The key "kubeConfig" is used to locate the data. If the secret
- or expected key is not found, the webhook is not honored.
- If the specified kube config data is not valid, the webhook
- is not honored. The namespace for this secret is determined
- by the point of use.'
+ description: |-
+ kubeConfig contains kube config file data which describes how to access the remote webhook service.
+ For further details, see:
+ https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
+ The key "kubeConfig" is used to locate the data.
+ If the secret or expected key is not found, the webhook is not honored.
+ If the specified kube config data is not valid, the webhook is not honored.
+ The namespace for this secret is determined by the point of use.
properties:
name:
description: name is the metadata.name of the referenced
@@ -357,18 +390,20 @@ spec:
be overridden.
properties:
integratedOAuthMetadata:
- description: 'integratedOAuthMetadata contains the discovery endpoint
- data for OAuth 2.0 Authorization Server Metadata for the in-cluster
- integrated OAuth server. This discovery document can be viewed from
- its served location: oc get --raw ''/.well-known/oauth-authorization-server''
- For further details, see the IETF Draft: https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
- This contains the observed value based on cluster state. An explicitly
- set value in spec.oauthMetadata has precedence over this field.
- This field has no meaning if authentication spec.type is not set
- to IntegratedOAuth. The key "oauthMetadata" is used to locate the
- data. If the config map or expected key is not found, no metadata
- is served. If the specified metadata is not valid, no metadata is
- served. The namespace for this config map is openshift-config-managed.'
+ description: |-
+ integratedOAuthMetadata contains the discovery endpoint data for OAuth 2.0
+ Authorization Server Metadata for the in-cluster integrated OAuth server.
+ This discovery document can be viewed from its served location:
+ oc get --raw '/.well-known/oauth-authorization-server'
+ For further details, see the IETF Draft:
+ https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
+ This contains the observed value based on cluster state.
+ An explicitly set value in spec.oauthMetadata has precedence over this field.
+ This field has no meaning if authentication spec.type is not set to IntegratedOAuth.
+ The key "oauthMetadata" is used to locate the data.
+ If the config map or expected key is not found, no metadata is served.
+ If the specified metadata is not valid, no metadata is served.
+ The namespace for this config map is openshift-config-managed.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -378,9 +413,9 @@ spec:
- name
type: object
oidcClients:
- description: OIDCClients is where participating operators place the
- current OIDC client status for OIDC clients that can be customized
- by the cluster-admin.
+ description: |-
+ OIDCClients is where participating operators place the current OIDC client status
+ for OIDC clients that can be customized by the cluster-admin.
items:
properties:
componentName:
@@ -396,56 +431,45 @@ spec:
minLength: 1
type: string
conditions:
- description: "Conditions are used to communicate the state of
- the `oidcClients` entry. \n Supported conditions include Available,
- Degraded and Progressing. \n If 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."
+ description: |-
+ Conditions are used to communicate the state of the `oidcClients` entry.
+
+ Supported conditions include Available, Degraded and Progressing.
+
+ If 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.
items:
- description: "Condition contains details for one aspect of
- the current state of this API Resource. --- This struct
- is intended for direct use as an array at the field path
- .status.conditions. For example, \n type FooStatus struct{
- // Represents the observations of a foo's current state.
- // Known .status.conditions.type are: \"Available\", \"Progressing\",
- and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields
- }"
+ description: Condition contains details for one aspect of
+ the current state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should
- be when the underlying condition changed. If that is
- not known, then using the time when the API field changed
- is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance,
- if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the
- current state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier
- indicating the reason for the condition's last transition.
- Producers of specific condition types may define expected
- values and meanings for this field, and whether the
- values are considered a guaranteed API. The value should
- be a CamelCase string. This field may not be empty.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
@@ -460,11 +484,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across
- resources like Available, but because arbitrary conditions
- can be useful (see .node.status.conditions), the ability
- to deconflict is important. The regex it matches is
- (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -480,8 +499,9 @@ spec:
- type
x-kubernetes-list-type: map
consumingUsers:
- description: ConsumingUsers is a slice of ServiceAccounts that
- need to have read permission on the `clientSecret` secret.
+ description: |-
+ ConsumingUsers is a slice of ServiceAccounts that need to have read
+ permission on the `clientSecret` secret.
items:
description: ConsumingUser is an alias for string which we
add validation to. Currently only service accounts are supported.
@@ -503,7 +523,8 @@ spec:
minLength: 1
type: string
issuerURL:
- description: URL is the serving URL of the token issuer.
+ description: |-
+ URL is the serving URL of the token issuer.
Must use the https:// scheme.
pattern: ^https:\/\/[^\s]
type: string
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-CustomNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-CustomNoUpgrade.crd.yaml
index e6268ff973..9d7058b463 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-CustomNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-CustomNoUpgrade.crd.yaml
@@ -20,20 +20,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Authentication specifies cluster-wide settings for authentication
- (like OAuth and webhook token authenticators). The canonical name of an
- instance is `cluster`. \n Compatibility level 1: Stable within a major release
- for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Authentication specifies cluster-wide settings for authentication (like OAuth and
+ webhook token authenticators). The canonical name of an instance is `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -41,17 +47,19 @@ spec:
description: spec holds user settable values for configuration
properties:
oauthMetadata:
- description: 'oauthMetadata contains the discovery endpoint data for
- OAuth 2.0 Authorization Server Metadata for an external OAuth server.
+ description: |-
+ oauthMetadata contains the discovery endpoint data for OAuth 2.0
+ Authorization Server Metadata for an external OAuth server.
This discovery document can be viewed from its served location:
- oc get --raw ''/.well-known/oauth-authorization-server'' For further
- details, see the IETF Draft: https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
- If oauthMetadata.name is non-empty, this value has precedence over
- any metadata reference stored in status. The key "oauthMetadata"
- is used to locate the data. If specified and the config map or expected
- key is not found, no metadata is served. If the specified metadata
- is not valid, no metadata is served. The namespace for this config
- map is openshift-config.'
+ oc get --raw '/.well-known/oauth-authorization-server'
+ For further details, see the IETF Draft:
+ https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
+ If oauthMetadata.name is non-empty, this value has precedence
+ over any metadata reference stored in status.
+ The key "oauthMetadata" is used to locate the data.
+ If specified and the config map or expected key is not found, no metadata is served.
+ If the specified metadata is not valid, no metadata is served.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -61,40 +69,49 @@ spec:
- name
type: object
oidcProviders:
- description: "OIDCProviders are OIDC identity providers that can issue
- tokens for this cluster Can only be set if \"Type\" is set to \"OIDC\".
- \n At most one provider can be configured."
+ description: |-
+ 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.
items:
properties:
claimMappings:
- description: ClaimMappings describes rules on how to transform
- information from an ID token into a cluster identity
+ description: |-
+ ClaimMappings describes rules on how to transform information from an
+ ID token into a cluster identity
properties:
groups:
- description: Groups is a name of the claim that should be
- used to construct groups for the cluster identity. The
- referenced claim must use array of strings values.
+ description: |-
+ Groups is a name of the claim that should be used to construct
+ groups for the cluster identity.
+ The referenced claim must use array of strings values.
properties:
claim:
description: Claim is a JWT token claim to be used in
the mapping
type: string
prefix:
- description: "Prefix is a string to prefix the value
- from the token in the result of the claim mapping.
- \n By default, no prefixing occurs. \n 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\"."
+ description: |-
+ Prefix is a string to prefix the value from the token in the result of the
+ claim mapping.
+
+ By default, no prefixing occurs.
+
+ 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".
type: string
required:
- claim
type: object
username:
- description: "Username is a name of the claim that should
- be used to construct usernames for the cluster identity.
- \n Default value: \"sub\""
+ description: |-
+ Username is a name of the claim that should be used to construct
+ usernames for the cluster identity.
+
+ Default value: "sub"
properties:
claim:
description: Claim is a JWT token claim to be used in
@@ -109,23 +126,26 @@ spec:
- prefixString
type: object
prefixPolicy:
- description: "PrefixPolicy specifies how a prefix should
- apply. \n By default, claims other than `email` will
- be prefixed with the issuer URL to prevent naming
- clashes with other plugins. \n Set to \"NoPrefix\"
- to disable prefixing. \n Example: (1) `prefix` is
- set to \"myoidc:\" and `claim` is set to \"username\".
- If the JWT claim `username` contains value `userA`,
- the resulting mapped value will be \"myoidc:userA\".
- (2) `prefix` is set to \"myoidc:\" and `claim` is
- set to \"email\". If the JWT `email` claim contains
- value \"userA@myoidc.tld\", the resulting mapped value
- will be \"myoidc:userA@myoidc.tld\". (3) `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: (a) \"username\": the mapped value will be \"https://myoidc.tld#userA\"
- (b) \"email\": the mapped value will be \"userA@myoidc.tld\""
+ description: |-
+ PrefixPolicy specifies how a prefix should apply.
+
+ By default, claims other than `email` will be prefixed with the issuer URL to
+ prevent naming clashes with other plugins.
+
+ Set to "NoPrefix" to disable prefixing.
+
+ Example:
+ (1) `prefix` is set to "myoidc:" and `claim` is set to "username".
+ If the JWT claim `username` contains value `userA`, the resulting
+ mapped value will be "myoidc:userA".
+ (2) `prefix` is set to "myoidc:" and `claim` is set to "email". If the
+ JWT `email` claim contains value "userA@myoidc.tld", the resulting
+ mapped value will be "myoidc:userA@myoidc.tld".
+ (3) `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:
+ (a) "username": the mapped value will be "https://myoidc.tld#userA"
+ (b) "email": the mapped value will be "userA@myoidc.tld"
enum:
- ""
- NoPrefix
@@ -147,12 +167,14 @@ spec:
items:
properties:
requiredClaim:
- description: RequiredClaim allows configuring a required
- claim name and its expected value
+ description: |-
+ RequiredClaim allows configuring a required claim name and its expected
+ value
properties:
claim:
- description: Claim is a name of a required claim.
- Only claims with string values are supported.
+ description: |-
+ Claim is a name of a required claim. Only claims with string values are
+ supported.
minLength: 1
type: string
requiredValue:
@@ -177,10 +199,11 @@ spec:
description: Issuer describes atributes of the OIDC token issuer
properties:
audiences:
- description: Audiences is an array of audiences that the
- token was issued for. Valid tokens must include at least
- one of these values in their "aud" claim. Must be set
- to exactly one value.
+ description: |-
+ Audiences is an array of audiences that the token was issued for.
+ Valid tokens must include at least one of these values in their
+ "aud" claim.
+ Must be set to exactly one value.
items:
minLength: 1
type: string
@@ -189,10 +212,11 @@ spec:
type: array
x-kubernetes-list-type: set
issuerCertificateAuthority:
- description: CertificateAuthority is a reference to a config
- map in the configuration namespace. The .data of the configMap
- must contain the "ca-bundle.crt" key. If unset, system
- trust is used instead.
+ description: |-
+ CertificateAuthority is a reference to a config map in the
+ configuration namespace. The .data of the configMap must contain
+ the "ca-bundle.crt" key.
+ If unset, system trust is used instead.
properties:
name:
description: name is the metadata.name of the referenced
@@ -202,7 +226,8 @@ spec:
- name
type: object
issuerURL:
- description: URL is the serving URL of the token issuer.
+ description: |-
+ URL is the serving URL of the token issuer.
Must use the https:// scheme.
pattern: ^https:\/\/[^\s]
type: string
@@ -215,8 +240,9 @@ spec:
minLength: 1
type: string
oidcClients:
- description: OIDCClients contains configuration for the platform's
- clients that need to request tokens from the issuer
+ description: |-
+ OIDCClients contains configuration for the platform's clients that
+ need to request tokens from the issuer
items:
properties:
clientID:
@@ -225,9 +251,9 @@ spec:
minLength: 1
type: string
clientSecret:
- description: ClientSecret refers to a secret in the `openshift-config`
- namespace that contains the client secret in the `clientSecret`
- key of the `.data` field
+ description: |-
+ ClientSecret refers to a secret in the `openshift-config` namespace that
+ contains the client secret in the `clientSecret` key of the `.data` field
properties:
name:
description: name is the metadata.name of the referenced
@@ -237,14 +263,16 @@ spec:
- name
type: object
componentName:
- description: ComponentName is the name of the component
- that is supposed to consume this client configuration
+ description: |-
+ ComponentName is the name of the component that is supposed to consume this
+ client configuration
maxLength: 256
minLength: 1
type: string
componentNamespace:
- description: ComponentNamespace is the namespace of the
- component that is supposed to consume this client configuration
+ description: |-
+ ComponentNamespace is the namespace of the component that is supposed to consume this
+ client configuration
maxLength: 63
minLength: 1
type: string
@@ -276,20 +304,21 @@ spec:
- name
x-kubernetes-list-type: map
serviceAccountIssuer:
- description: 'serviceAccountIssuer is the identifier of the bound
- service account token issuer. The default is https://kubernetes.default.svc
- WARNING: Updating this field will not result in immediate invalidation
- of all bound tokens with the previous issuer value. Instead, the
- tokens issued by previous service account issuer will continue to
- be trusted for a time period chosen by the platform (currently set
- to 24h). This time period is subject to change over time. This allows
- internal components to transition to use new service account issuer
- without service distruption.'
+ description: |-
+ serviceAccountIssuer is the identifier of the bound service account token
+ issuer.
+ The default is https://kubernetes.default.svc
+ WARNING: Updating this field will not result in immediate invalidation of all bound tokens with the
+ previous issuer value. Instead, the tokens issued by previous service account issuer will continue to
+ be trusted for a time period chosen by the platform (currently set to 24h).
+ This time period is subject to change over time.
+ This allows internal components to transition to use new service account issuer without service distruption.
type: string
type:
- description: type identifies the cluster managed, user facing authentication
- mode in use. Specifically, it manages the component that responds
- to login attempts. The default is IntegratedOAuth.
+ description: |-
+ type identifies the cluster managed, user facing authentication mode in use.
+ Specifically, it manages the component that responds to login attempts.
+ The default is IntegratedOAuth.
enum:
- ""
- None
@@ -297,22 +326,27 @@ spec:
- OIDC
type: string
webhookTokenAuthenticator:
- description: "webhookTokenAuthenticator configures a remote token
- reviewer. These remote authentication webhooks can be used to verify
- bearer tokens via the tokenreviews.authentication.k8s.io REST API.
- This is required to honor bearer tokens that are provisioned by
- an external authentication service. \n Can only be set if \"Type\"
- is set to \"None\"."
+ description: |-
+ webhookTokenAuthenticator configures a remote token reviewer.
+ These remote authentication webhooks can be used to verify bearer tokens
+ via the tokenreviews.authentication.k8s.io REST API. This is required to
+ honor bearer tokens that are provisioned by an external authentication service.
+
+ Can only be set if "Type" is set to "None".
properties:
kubeConfig:
- description: "kubeConfig references a secret that contains kube
- config file data which describes how to access the remote webhook
- service. The namespace for the referenced secret is openshift-config.
- \n For further details, see: \n https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
- \n The key \"kubeConfig\" is used to locate the data. If the
- secret or expected key is not found, the webhook is not honored.
- If the specified kube config data is not valid, the webhook
- is not honored."
+ description: |-
+ kubeConfig references a secret that contains kube config file data which
+ describes how to access the remote webhook service.
+ The namespace for the referenced secret is openshift-config.
+
+ For further details, see:
+
+ https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
+
+ The key "kubeConfig" is used to locate the data.
+ If the secret or expected key is not found, the webhook is not honored.
+ If the specified kube config data is not valid, the webhook is not honored.
properties:
name:
description: name is the metadata.name of the referenced secret
@@ -327,20 +361,19 @@ spec:
description: webhookTokenAuthenticators is DEPRECATED, setting it
has no effect.
items:
- description: deprecatedWebhookTokenAuthenticator holds the necessary
- configuration options for a remote token authenticator. It's the
- same as WebhookTokenAuthenticator but it's missing the 'required'
- validation on KubeConfig field.
+ description: |-
+ deprecatedWebhookTokenAuthenticator holds the necessary configuration options for a remote token authenticator.
+ It's the same as WebhookTokenAuthenticator but it's missing the 'required' validation on KubeConfig field.
properties:
kubeConfig:
- description: 'kubeConfig contains kube config file data which
- describes how to access the remote webhook service. For further
- details, see: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
- The key "kubeConfig" is used to locate the data. If the secret
- or expected key is not found, the webhook is not honored.
- If the specified kube config data is not valid, the webhook
- is not honored. The namespace for this secret is determined
- by the point of use.'
+ description: |-
+ kubeConfig contains kube config file data which describes how to access the remote webhook service.
+ For further details, see:
+ https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
+ The key "kubeConfig" is used to locate the data.
+ If the secret or expected key is not found, the webhook is not honored.
+ If the specified kube config data is not valid, the webhook is not honored.
+ The namespace for this secret is determined by the point of use.
properties:
name:
description: name is the metadata.name of the referenced
@@ -358,18 +391,20 @@ spec:
be overridden.
properties:
integratedOAuthMetadata:
- description: 'integratedOAuthMetadata contains the discovery endpoint
- data for OAuth 2.0 Authorization Server Metadata for the in-cluster
- integrated OAuth server. This discovery document can be viewed from
- its served location: oc get --raw ''/.well-known/oauth-authorization-server''
- For further details, see the IETF Draft: https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
- This contains the observed value based on cluster state. An explicitly
- set value in spec.oauthMetadata has precedence over this field.
- This field has no meaning if authentication spec.type is not set
- to IntegratedOAuth. The key "oauthMetadata" is used to locate the
- data. If the config map or expected key is not found, no metadata
- is served. If the specified metadata is not valid, no metadata is
- served. The namespace for this config map is openshift-config-managed.'
+ description: |-
+ integratedOAuthMetadata contains the discovery endpoint data for OAuth 2.0
+ Authorization Server Metadata for the in-cluster integrated OAuth server.
+ This discovery document can be viewed from its served location:
+ oc get --raw '/.well-known/oauth-authorization-server'
+ For further details, see the IETF Draft:
+ https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
+ This contains the observed value based on cluster state.
+ An explicitly set value in spec.oauthMetadata has precedence over this field.
+ This field has no meaning if authentication spec.type is not set to IntegratedOAuth.
+ The key "oauthMetadata" is used to locate the data.
+ If the config map or expected key is not found, no metadata is served.
+ If the specified metadata is not valid, no metadata is served.
+ The namespace for this config map is openshift-config-managed.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -379,9 +414,9 @@ spec:
- name
type: object
oidcClients:
- description: OIDCClients is where participating operators place the
- current OIDC client status for OIDC clients that can be customized
- by the cluster-admin.
+ description: |-
+ OIDCClients is where participating operators place the current OIDC client status
+ for OIDC clients that can be customized by the cluster-admin.
items:
properties:
componentName:
@@ -397,56 +432,45 @@ spec:
minLength: 1
type: string
conditions:
- description: "Conditions are used to communicate the state of
- the `oidcClients` entry. \n Supported conditions include Available,
- Degraded and Progressing. \n If 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."
+ description: |-
+ Conditions are used to communicate the state of the `oidcClients` entry.
+
+ Supported conditions include Available, Degraded and Progressing.
+
+ If 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.
items:
- description: "Condition contains details for one aspect of
- the current state of this API Resource. --- This struct
- is intended for direct use as an array at the field path
- .status.conditions. For example, \n type FooStatus struct{
- // Represents the observations of a foo's current state.
- // Known .status.conditions.type are: \"Available\", \"Progressing\",
- and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields
- }"
+ description: Condition contains details for one aspect of
+ the current state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should
- be when the underlying condition changed. If that is
- not known, then using the time when the API field changed
- is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance,
- if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the
- current state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier
- indicating the reason for the condition's last transition.
- Producers of specific condition types may define expected
- values and meanings for this field, and whether the
- values are considered a guaranteed API. The value should
- be a CamelCase string. This field may not be empty.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
@@ -461,11 +485,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across
- resources like Available, but because arbitrary conditions
- can be useful (see .node.status.conditions), the ability
- to deconflict is important. The regex it matches is
- (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -481,8 +500,9 @@ spec:
- type
x-kubernetes-list-type: map
consumingUsers:
- description: ConsumingUsers is a slice of ServiceAccounts that
- need to have read permission on the `clientSecret` secret.
+ description: |-
+ ConsumingUsers is a slice of ServiceAccounts that need to have read
+ permission on the `clientSecret` secret.
items:
description: ConsumingUser is an alias for string which we
add validation to. Currently only service accounts are supported.
@@ -504,7 +524,8 @@ spec:
minLength: 1
type: string
issuerURL:
- description: URL is the serving URL of the token issuer.
+ description: |-
+ URL is the serving URL of the token issuer.
Must use the https:// scheme.
pattern: ^https:\/\/[^\s]
type: string
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-Default.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-Default.crd.yaml
index 72ccf31f6d..5979653555 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-Default.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-Default.crd.yaml
@@ -20,20 +20,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Authentication specifies cluster-wide settings for authentication
- (like OAuth and webhook token authenticators). The canonical name of an
- instance is `cluster`. \n Compatibility level 1: Stable within a major release
- for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Authentication specifies cluster-wide settings for authentication (like OAuth and
+ webhook token authenticators). The canonical name of an instance is `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -41,17 +47,19 @@ spec:
description: spec holds user settable values for configuration
properties:
oauthMetadata:
- description: 'oauthMetadata contains the discovery endpoint data for
- OAuth 2.0 Authorization Server Metadata for an external OAuth server.
+ description: |-
+ oauthMetadata contains the discovery endpoint data for OAuth 2.0
+ Authorization Server Metadata for an external OAuth server.
This discovery document can be viewed from its served location:
- oc get --raw ''/.well-known/oauth-authorization-server'' For further
- details, see the IETF Draft: https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
- If oauthMetadata.name is non-empty, this value has precedence over
- any metadata reference stored in status. The key "oauthMetadata"
- is used to locate the data. If specified and the config map or expected
- key is not found, no metadata is served. If the specified metadata
- is not valid, no metadata is served. The namespace for this config
- map is openshift-config.'
+ oc get --raw '/.well-known/oauth-authorization-server'
+ For further details, see the IETF Draft:
+ https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
+ If oauthMetadata.name is non-empty, this value has precedence
+ over any metadata reference stored in status.
+ The key "oauthMetadata" is used to locate the data.
+ If specified and the config map or expected key is not found, no metadata is served.
+ If the specified metadata is not valid, no metadata is served.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -61,42 +69,48 @@ spec:
- name
type: object
serviceAccountIssuer:
- description: 'serviceAccountIssuer is the identifier of the bound
- service account token issuer. The default is https://kubernetes.default.svc
- WARNING: Updating this field will not result in immediate invalidation
- of all bound tokens with the previous issuer value. Instead, the
- tokens issued by previous service account issuer will continue to
- be trusted for a time period chosen by the platform (currently set
- to 24h). This time period is subject to change over time. This allows
- internal components to transition to use new service account issuer
- without service distruption.'
+ description: |-
+ serviceAccountIssuer is the identifier of the bound service account token
+ issuer.
+ The default is https://kubernetes.default.svc
+ WARNING: Updating this field will not result in immediate invalidation of all bound tokens with the
+ previous issuer value. Instead, the tokens issued by previous service account issuer will continue to
+ be trusted for a time period chosen by the platform (currently set to 24h).
+ This time period is subject to change over time.
+ This allows internal components to transition to use new service account issuer without service distruption.
type: string
type:
- description: type identifies the cluster managed, user facing authentication
- mode in use. Specifically, it manages the component that responds
- to login attempts. The default is IntegratedOAuth.
+ description: |-
+ type identifies the cluster managed, user facing authentication mode in use.
+ Specifically, it manages the component that responds to login attempts.
+ The default is IntegratedOAuth.
enum:
- ""
- None
- IntegratedOAuth
type: string
webhookTokenAuthenticator:
- description: "webhookTokenAuthenticator configures a remote token
- reviewer. These remote authentication webhooks can be used to verify
- bearer tokens via the tokenreviews.authentication.k8s.io REST API.
- This is required to honor bearer tokens that are provisioned by
- an external authentication service. \n Can only be set if \"Type\"
- is set to \"None\"."
+ description: |-
+ webhookTokenAuthenticator configures a remote token reviewer.
+ These remote authentication webhooks can be used to verify bearer tokens
+ via the tokenreviews.authentication.k8s.io REST API. This is required to
+ honor bearer tokens that are provisioned by an external authentication service.
+
+ Can only be set if "Type" is set to "None".
properties:
kubeConfig:
- description: "kubeConfig references a secret that contains kube
- config file data which describes how to access the remote webhook
- service. The namespace for the referenced secret is openshift-config.
- \n For further details, see: \n https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
- \n The key \"kubeConfig\" is used to locate the data. If the
- secret or expected key is not found, the webhook is not honored.
- If the specified kube config data is not valid, the webhook
- is not honored."
+ description: |-
+ kubeConfig references a secret that contains kube config file data which
+ describes how to access the remote webhook service.
+ The namespace for the referenced secret is openshift-config.
+
+ For further details, see:
+
+ https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
+
+ The key "kubeConfig" is used to locate the data.
+ If the secret or expected key is not found, the webhook is not honored.
+ If the specified kube config data is not valid, the webhook is not honored.
properties:
name:
description: name is the metadata.name of the referenced secret
@@ -111,20 +125,19 @@ spec:
description: webhookTokenAuthenticators is DEPRECATED, setting it
has no effect.
items:
- description: deprecatedWebhookTokenAuthenticator holds the necessary
- configuration options for a remote token authenticator. It's the
- same as WebhookTokenAuthenticator but it's missing the 'required'
- validation on KubeConfig field.
+ description: |-
+ deprecatedWebhookTokenAuthenticator holds the necessary configuration options for a remote token authenticator.
+ It's the same as WebhookTokenAuthenticator but it's missing the 'required' validation on KubeConfig field.
properties:
kubeConfig:
- description: 'kubeConfig contains kube config file data which
- describes how to access the remote webhook service. For further
- details, see: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
- The key "kubeConfig" is used to locate the data. If the secret
- or expected key is not found, the webhook is not honored.
- If the specified kube config data is not valid, the webhook
- is not honored. The namespace for this secret is determined
- by the point of use.'
+ description: |-
+ kubeConfig contains kube config file data which describes how to access the remote webhook service.
+ For further details, see:
+ https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
+ The key "kubeConfig" is used to locate the data.
+ If the secret or expected key is not found, the webhook is not honored.
+ If the specified kube config data is not valid, the webhook is not honored.
+ The namespace for this secret is determined by the point of use.
properties:
name:
description: name is the metadata.name of the referenced
@@ -142,18 +155,20 @@ spec:
be overridden.
properties:
integratedOAuthMetadata:
- description: 'integratedOAuthMetadata contains the discovery endpoint
- data for OAuth 2.0 Authorization Server Metadata for the in-cluster
- integrated OAuth server. This discovery document can be viewed from
- its served location: oc get --raw ''/.well-known/oauth-authorization-server''
- For further details, see the IETF Draft: https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
- This contains the observed value based on cluster state. An explicitly
- set value in spec.oauthMetadata has precedence over this field.
- This field has no meaning if authentication spec.type is not set
- to IntegratedOAuth. The key "oauthMetadata" is used to locate the
- data. If the config map or expected key is not found, no metadata
- is served. If the specified metadata is not valid, no metadata is
- served. The namespace for this config map is openshift-config-managed.'
+ description: |-
+ integratedOAuthMetadata contains the discovery endpoint data for OAuth 2.0
+ Authorization Server Metadata for the in-cluster integrated OAuth server.
+ This discovery document can be viewed from its served location:
+ oc get --raw '/.well-known/oauth-authorization-server'
+ For further details, see the IETF Draft:
+ https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
+ This contains the observed value based on cluster state.
+ An explicitly set value in spec.oauthMetadata has precedence over this field.
+ This field has no meaning if authentication spec.type is not set to IntegratedOAuth.
+ The key "oauthMetadata" is used to locate the data.
+ If the config map or expected key is not found, no metadata is served.
+ If the specified metadata is not valid, no metadata is served.
+ The namespace for this config map is openshift-config-managed.
properties:
name:
description: name is the metadata.name of the referenced config
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml
index 1bb1e92ddd..b2968832e3 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml
@@ -20,20 +20,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Authentication specifies cluster-wide settings for authentication
- (like OAuth and webhook token authenticators). The canonical name of an
- instance is `cluster`. \n Compatibility level 1: Stable within a major release
- for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Authentication specifies cluster-wide settings for authentication (like OAuth and
+ webhook token authenticators). The canonical name of an instance is `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -41,17 +47,19 @@ spec:
description: spec holds user settable values for configuration
properties:
oauthMetadata:
- description: 'oauthMetadata contains the discovery endpoint data for
- OAuth 2.0 Authorization Server Metadata for an external OAuth server.
+ description: |-
+ oauthMetadata contains the discovery endpoint data for OAuth 2.0
+ Authorization Server Metadata for an external OAuth server.
This discovery document can be viewed from its served location:
- oc get --raw ''/.well-known/oauth-authorization-server'' For further
- details, see the IETF Draft: https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
- If oauthMetadata.name is non-empty, this value has precedence over
- any metadata reference stored in status. The key "oauthMetadata"
- is used to locate the data. If specified and the config map or expected
- key is not found, no metadata is served. If the specified metadata
- is not valid, no metadata is served. The namespace for this config
- map is openshift-config.'
+ oc get --raw '/.well-known/oauth-authorization-server'
+ For further details, see the IETF Draft:
+ https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
+ If oauthMetadata.name is non-empty, this value has precedence
+ over any metadata reference stored in status.
+ The key "oauthMetadata" is used to locate the data.
+ If specified and the config map or expected key is not found, no metadata is served.
+ If the specified metadata is not valid, no metadata is served.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -61,40 +69,49 @@ spec:
- name
type: object
oidcProviders:
- description: "OIDCProviders are OIDC identity providers that can issue
- tokens for this cluster Can only be set if \"Type\" is set to \"OIDC\".
- \n At most one provider can be configured."
+ description: |-
+ 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.
items:
properties:
claimMappings:
- description: ClaimMappings describes rules on how to transform
- information from an ID token into a cluster identity
+ description: |-
+ ClaimMappings describes rules on how to transform information from an
+ ID token into a cluster identity
properties:
groups:
- description: Groups is a name of the claim that should be
- used to construct groups for the cluster identity. The
- referenced claim must use array of strings values.
+ description: |-
+ Groups is a name of the claim that should be used to construct
+ groups for the cluster identity.
+ The referenced claim must use array of strings values.
properties:
claim:
description: Claim is a JWT token claim to be used in
the mapping
type: string
prefix:
- description: "Prefix is a string to prefix the value
- from the token in the result of the claim mapping.
- \n By default, no prefixing occurs. \n 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\"."
+ description: |-
+ Prefix is a string to prefix the value from the token in the result of the
+ claim mapping.
+
+ By default, no prefixing occurs.
+
+ 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".
type: string
required:
- claim
type: object
username:
- description: "Username is a name of the claim that should
- be used to construct usernames for the cluster identity.
- \n Default value: \"sub\""
+ description: |-
+ Username is a name of the claim that should be used to construct
+ usernames for the cluster identity.
+
+ Default value: "sub"
properties:
claim:
description: Claim is a JWT token claim to be used in
@@ -109,23 +126,26 @@ spec:
- prefixString
type: object
prefixPolicy:
- description: "PrefixPolicy specifies how a prefix should
- apply. \n By default, claims other than `email` will
- be prefixed with the issuer URL to prevent naming
- clashes with other plugins. \n Set to \"NoPrefix\"
- to disable prefixing. \n Example: (1) `prefix` is
- set to \"myoidc:\" and `claim` is set to \"username\".
- If the JWT claim `username` contains value `userA`,
- the resulting mapped value will be \"myoidc:userA\".
- (2) `prefix` is set to \"myoidc:\" and `claim` is
- set to \"email\". If the JWT `email` claim contains
- value \"userA@myoidc.tld\", the resulting mapped value
- will be \"myoidc:userA@myoidc.tld\". (3) `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: (a) \"username\": the mapped value will be \"https://myoidc.tld#userA\"
- (b) \"email\": the mapped value will be \"userA@myoidc.tld\""
+ description: |-
+ PrefixPolicy specifies how a prefix should apply.
+
+ By default, claims other than `email` will be prefixed with the issuer URL to
+ prevent naming clashes with other plugins.
+
+ Set to "NoPrefix" to disable prefixing.
+
+ Example:
+ (1) `prefix` is set to "myoidc:" and `claim` is set to "username".
+ If the JWT claim `username` contains value `userA`, the resulting
+ mapped value will be "myoidc:userA".
+ (2) `prefix` is set to "myoidc:" and `claim` is set to "email". If the
+ JWT `email` claim contains value "userA@myoidc.tld", the resulting
+ mapped value will be "myoidc:userA@myoidc.tld".
+ (3) `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:
+ (a) "username": the mapped value will be "https://myoidc.tld#userA"
+ (b) "email": the mapped value will be "userA@myoidc.tld"
enum:
- ""
- NoPrefix
@@ -147,12 +167,14 @@ spec:
items:
properties:
requiredClaim:
- description: RequiredClaim allows configuring a required
- claim name and its expected value
+ description: |-
+ RequiredClaim allows configuring a required claim name and its expected
+ value
properties:
claim:
- description: Claim is a name of a required claim.
- Only claims with string values are supported.
+ description: |-
+ Claim is a name of a required claim. Only claims with string values are
+ supported.
minLength: 1
type: string
requiredValue:
@@ -177,10 +199,11 @@ spec:
description: Issuer describes atributes of the OIDC token issuer
properties:
audiences:
- description: Audiences is an array of audiences that the
- token was issued for. Valid tokens must include at least
- one of these values in their "aud" claim. Must be set
- to exactly one value.
+ description: |-
+ Audiences is an array of audiences that the token was issued for.
+ Valid tokens must include at least one of these values in their
+ "aud" claim.
+ Must be set to exactly one value.
items:
minLength: 1
type: string
@@ -189,10 +212,11 @@ spec:
type: array
x-kubernetes-list-type: set
issuerCertificateAuthority:
- description: CertificateAuthority is a reference to a config
- map in the configuration namespace. The .data of the configMap
- must contain the "ca-bundle.crt" key. If unset, system
- trust is used instead.
+ description: |-
+ CertificateAuthority is a reference to a config map in the
+ configuration namespace. The .data of the configMap must contain
+ the "ca-bundle.crt" key.
+ If unset, system trust is used instead.
properties:
name:
description: name is the metadata.name of the referenced
@@ -202,7 +226,8 @@ spec:
- name
type: object
issuerURL:
- description: URL is the serving URL of the token issuer.
+ description: |-
+ URL is the serving URL of the token issuer.
Must use the https:// scheme.
pattern: ^https:\/\/[^\s]
type: string
@@ -215,8 +240,9 @@ spec:
minLength: 1
type: string
oidcClients:
- description: OIDCClients contains configuration for the platform's
- clients that need to request tokens from the issuer
+ description: |-
+ OIDCClients contains configuration for the platform's clients that
+ need to request tokens from the issuer
items:
properties:
clientID:
@@ -225,9 +251,9 @@ spec:
minLength: 1
type: string
clientSecret:
- description: ClientSecret refers to a secret in the `openshift-config`
- namespace that contains the client secret in the `clientSecret`
- key of the `.data` field
+ description: |-
+ ClientSecret refers to a secret in the `openshift-config` namespace that
+ contains the client secret in the `clientSecret` key of the `.data` field
properties:
name:
description: name is the metadata.name of the referenced
@@ -237,14 +263,16 @@ spec:
- name
type: object
componentName:
- description: ComponentName is the name of the component
- that is supposed to consume this client configuration
+ description: |-
+ ComponentName is the name of the component that is supposed to consume this
+ client configuration
maxLength: 256
minLength: 1
type: string
componentNamespace:
- description: ComponentNamespace is the namespace of the
- component that is supposed to consume this client configuration
+ description: |-
+ ComponentNamespace is the namespace of the component that is supposed to consume this
+ client configuration
maxLength: 63
minLength: 1
type: string
@@ -276,20 +304,21 @@ spec:
- name
x-kubernetes-list-type: map
serviceAccountIssuer:
- description: 'serviceAccountIssuer is the identifier of the bound
- service account token issuer. The default is https://kubernetes.default.svc
- WARNING: Updating this field will not result in immediate invalidation
- of all bound tokens with the previous issuer value. Instead, the
- tokens issued by previous service account issuer will continue to
- be trusted for a time period chosen by the platform (currently set
- to 24h). This time period is subject to change over time. This allows
- internal components to transition to use new service account issuer
- without service distruption.'
+ description: |-
+ serviceAccountIssuer is the identifier of the bound service account token
+ issuer.
+ The default is https://kubernetes.default.svc
+ WARNING: Updating this field will not result in immediate invalidation of all bound tokens with the
+ previous issuer value. Instead, the tokens issued by previous service account issuer will continue to
+ be trusted for a time period chosen by the platform (currently set to 24h).
+ This time period is subject to change over time.
+ This allows internal components to transition to use new service account issuer without service distruption.
type: string
type:
- description: type identifies the cluster managed, user facing authentication
- mode in use. Specifically, it manages the component that responds
- to login attempts. The default is IntegratedOAuth.
+ description: |-
+ type identifies the cluster managed, user facing authentication mode in use.
+ Specifically, it manages the component that responds to login attempts.
+ The default is IntegratedOAuth.
enum:
- ""
- None
@@ -297,22 +326,27 @@ spec:
- OIDC
type: string
webhookTokenAuthenticator:
- description: "webhookTokenAuthenticator configures a remote token
- reviewer. These remote authentication webhooks can be used to verify
- bearer tokens via the tokenreviews.authentication.k8s.io REST API.
- This is required to honor bearer tokens that are provisioned by
- an external authentication service. \n Can only be set if \"Type\"
- is set to \"None\"."
+ description: |-
+ webhookTokenAuthenticator configures a remote token reviewer.
+ These remote authentication webhooks can be used to verify bearer tokens
+ via the tokenreviews.authentication.k8s.io REST API. This is required to
+ honor bearer tokens that are provisioned by an external authentication service.
+
+ Can only be set if "Type" is set to "None".
properties:
kubeConfig:
- description: "kubeConfig references a secret that contains kube
- config file data which describes how to access the remote webhook
- service. The namespace for the referenced secret is openshift-config.
- \n For further details, see: \n https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
- \n The key \"kubeConfig\" is used to locate the data. If the
- secret or expected key is not found, the webhook is not honored.
- If the specified kube config data is not valid, the webhook
- is not honored."
+ description: |-
+ kubeConfig references a secret that contains kube config file data which
+ describes how to access the remote webhook service.
+ The namespace for the referenced secret is openshift-config.
+
+ For further details, see:
+
+ https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
+
+ The key "kubeConfig" is used to locate the data.
+ If the secret or expected key is not found, the webhook is not honored.
+ If the specified kube config data is not valid, the webhook is not honored.
properties:
name:
description: name is the metadata.name of the referenced secret
@@ -327,20 +361,19 @@ spec:
description: webhookTokenAuthenticators is DEPRECATED, setting it
has no effect.
items:
- description: deprecatedWebhookTokenAuthenticator holds the necessary
- configuration options for a remote token authenticator. It's the
- same as WebhookTokenAuthenticator but it's missing the 'required'
- validation on KubeConfig field.
+ description: |-
+ deprecatedWebhookTokenAuthenticator holds the necessary configuration options for a remote token authenticator.
+ It's the same as WebhookTokenAuthenticator but it's missing the 'required' validation on KubeConfig field.
properties:
kubeConfig:
- description: 'kubeConfig contains kube config file data which
- describes how to access the remote webhook service. For further
- details, see: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
- The key "kubeConfig" is used to locate the data. If the secret
- or expected key is not found, the webhook is not honored.
- If the specified kube config data is not valid, the webhook
- is not honored. The namespace for this secret is determined
- by the point of use.'
+ description: |-
+ kubeConfig contains kube config file data which describes how to access the remote webhook service.
+ For further details, see:
+ https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
+ The key "kubeConfig" is used to locate the data.
+ If the secret or expected key is not found, the webhook is not honored.
+ If the specified kube config data is not valid, the webhook is not honored.
+ The namespace for this secret is determined by the point of use.
properties:
name:
description: name is the metadata.name of the referenced
@@ -358,18 +391,20 @@ spec:
be overridden.
properties:
integratedOAuthMetadata:
- description: 'integratedOAuthMetadata contains the discovery endpoint
- data for OAuth 2.0 Authorization Server Metadata for the in-cluster
- integrated OAuth server. This discovery document can be viewed from
- its served location: oc get --raw ''/.well-known/oauth-authorization-server''
- For further details, see the IETF Draft: https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
- This contains the observed value based on cluster state. An explicitly
- set value in spec.oauthMetadata has precedence over this field.
- This field has no meaning if authentication spec.type is not set
- to IntegratedOAuth. The key "oauthMetadata" is used to locate the
- data. If the config map or expected key is not found, no metadata
- is served. If the specified metadata is not valid, no metadata is
- served. The namespace for this config map is openshift-config-managed.'
+ description: |-
+ integratedOAuthMetadata contains the discovery endpoint data for OAuth 2.0
+ Authorization Server Metadata for the in-cluster integrated OAuth server.
+ This discovery document can be viewed from its served location:
+ oc get --raw '/.well-known/oauth-authorization-server'
+ For further details, see the IETF Draft:
+ https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
+ This contains the observed value based on cluster state.
+ An explicitly set value in spec.oauthMetadata has precedence over this field.
+ This field has no meaning if authentication spec.type is not set to IntegratedOAuth.
+ The key "oauthMetadata" is used to locate the data.
+ If the config map or expected key is not found, no metadata is served.
+ If the specified metadata is not valid, no metadata is served.
+ The namespace for this config map is openshift-config-managed.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -379,9 +414,9 @@ spec:
- name
type: object
oidcClients:
- description: OIDCClients is where participating operators place the
- current OIDC client status for OIDC clients that can be customized
- by the cluster-admin.
+ description: |-
+ OIDCClients is where participating operators place the current OIDC client status
+ for OIDC clients that can be customized by the cluster-admin.
items:
properties:
componentName:
@@ -397,56 +432,45 @@ spec:
minLength: 1
type: string
conditions:
- description: "Conditions are used to communicate the state of
- the `oidcClients` entry. \n Supported conditions include Available,
- Degraded and Progressing. \n If 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."
+ description: |-
+ Conditions are used to communicate the state of the `oidcClients` entry.
+
+ Supported conditions include Available, Degraded and Progressing.
+
+ If 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.
items:
- description: "Condition contains details for one aspect of
- the current state of this API Resource. --- This struct
- is intended for direct use as an array at the field path
- .status.conditions. For example, \n type FooStatus struct{
- // Represents the observations of a foo's current state.
- // Known .status.conditions.type are: \"Available\", \"Progressing\",
- and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields
- }"
+ description: Condition contains details for one aspect of
+ the current state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should
- be when the underlying condition changed. If that is
- not known, then using the time when the API field changed
- is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance,
- if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the
- current state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier
- indicating the reason for the condition's last transition.
- Producers of specific condition types may define expected
- values and meanings for this field, and whether the
- values are considered a guaranteed API. The value should
- be a CamelCase string. This field may not be empty.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
@@ -461,11 +485,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across
- resources like Available, but because arbitrary conditions
- can be useful (see .node.status.conditions), the ability
- to deconflict is important. The regex it matches is
- (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -481,8 +500,9 @@ spec:
- type
x-kubernetes-list-type: map
consumingUsers:
- description: ConsumingUsers is a slice of ServiceAccounts that
- need to have read permission on the `clientSecret` secret.
+ description: |-
+ ConsumingUsers is a slice of ServiceAccounts that need to have read
+ permission on the `clientSecret` secret.
items:
description: ConsumingUser is an alias for string which we
add validation to. Currently only service accounts are supported.
@@ -504,7 +524,8 @@ spec:
minLength: 1
type: string
issuerURL:
- description: URL is the serving URL of the token issuer.
+ description: |-
+ URL is the serving URL of the token issuer.
Must use the https:// scheme.
pattern: ^https:\/\/[^\s]
type: string
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml
index c8711ecbae..bd450f3a7d 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml
@@ -20,20 +20,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Authentication specifies cluster-wide settings for authentication
- (like OAuth and webhook token authenticators). The canonical name of an
- instance is `cluster`. \n Compatibility level 1: Stable within a major release
- for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Authentication specifies cluster-wide settings for authentication (like OAuth and
+ webhook token authenticators). The canonical name of an instance is `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -41,17 +47,19 @@ spec:
description: spec holds user settable values for configuration
properties:
oauthMetadata:
- description: 'oauthMetadata contains the discovery endpoint data for
- OAuth 2.0 Authorization Server Metadata for an external OAuth server.
+ description: |-
+ oauthMetadata contains the discovery endpoint data for OAuth 2.0
+ Authorization Server Metadata for an external OAuth server.
This discovery document can be viewed from its served location:
- oc get --raw ''/.well-known/oauth-authorization-server'' For further
- details, see the IETF Draft: https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
- If oauthMetadata.name is non-empty, this value has precedence over
- any metadata reference stored in status. The key "oauthMetadata"
- is used to locate the data. If specified and the config map or expected
- key is not found, no metadata is served. If the specified metadata
- is not valid, no metadata is served. The namespace for this config
- map is openshift-config.'
+ oc get --raw '/.well-known/oauth-authorization-server'
+ For further details, see the IETF Draft:
+ https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
+ If oauthMetadata.name is non-empty, this value has precedence
+ over any metadata reference stored in status.
+ The key "oauthMetadata" is used to locate the data.
+ If specified and the config map or expected key is not found, no metadata is served.
+ If the specified metadata is not valid, no metadata is served.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -61,40 +69,49 @@ spec:
- name
type: object
oidcProviders:
- description: "OIDCProviders are OIDC identity providers that can issue
- tokens for this cluster Can only be set if \"Type\" is set to \"OIDC\".
- \n At most one provider can be configured."
+ description: |-
+ 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.
items:
properties:
claimMappings:
- description: ClaimMappings describes rules on how to transform
- information from an ID token into a cluster identity
+ description: |-
+ ClaimMappings describes rules on how to transform information from an
+ ID token into a cluster identity
properties:
groups:
- description: Groups is a name of the claim that should be
- used to construct groups for the cluster identity. The
- referenced claim must use array of strings values.
+ description: |-
+ Groups is a name of the claim that should be used to construct
+ groups for the cluster identity.
+ The referenced claim must use array of strings values.
properties:
claim:
description: Claim is a JWT token claim to be used in
the mapping
type: string
prefix:
- description: "Prefix is a string to prefix the value
- from the token in the result of the claim mapping.
- \n By default, no prefixing occurs. \n 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\"."
+ description: |-
+ Prefix is a string to prefix the value from the token in the result of the
+ claim mapping.
+
+ By default, no prefixing occurs.
+
+ 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".
type: string
required:
- claim
type: object
username:
- description: "Username is a name of the claim that should
- be used to construct usernames for the cluster identity.
- \n Default value: \"sub\""
+ description: |-
+ Username is a name of the claim that should be used to construct
+ usernames for the cluster identity.
+
+ Default value: "sub"
properties:
claim:
description: Claim is a JWT token claim to be used in
@@ -109,23 +126,26 @@ spec:
- prefixString
type: object
prefixPolicy:
- description: "PrefixPolicy specifies how a prefix should
- apply. \n By default, claims other than `email` will
- be prefixed with the issuer URL to prevent naming
- clashes with other plugins. \n Set to \"NoPrefix\"
- to disable prefixing. \n Example: (1) `prefix` is
- set to \"myoidc:\" and `claim` is set to \"username\".
- If the JWT claim `username` contains value `userA`,
- the resulting mapped value will be \"myoidc:userA\".
- (2) `prefix` is set to \"myoidc:\" and `claim` is
- set to \"email\". If the JWT `email` claim contains
- value \"userA@myoidc.tld\", the resulting mapped value
- will be \"myoidc:userA@myoidc.tld\". (3) `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: (a) \"username\": the mapped value will be \"https://myoidc.tld#userA\"
- (b) \"email\": the mapped value will be \"userA@myoidc.tld\""
+ description: |-
+ PrefixPolicy specifies how a prefix should apply.
+
+ By default, claims other than `email` will be prefixed with the issuer URL to
+ prevent naming clashes with other plugins.
+
+ Set to "NoPrefix" to disable prefixing.
+
+ Example:
+ (1) `prefix` is set to "myoidc:" and `claim` is set to "username".
+ If the JWT claim `username` contains value `userA`, the resulting
+ mapped value will be "myoidc:userA".
+ (2) `prefix` is set to "myoidc:" and `claim` is set to "email". If the
+ JWT `email` claim contains value "userA@myoidc.tld", the resulting
+ mapped value will be "myoidc:userA@myoidc.tld".
+ (3) `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:
+ (a) "username": the mapped value will be "https://myoidc.tld#userA"
+ (b) "email": the mapped value will be "userA@myoidc.tld"
enum:
- ""
- NoPrefix
@@ -147,12 +167,14 @@ spec:
items:
properties:
requiredClaim:
- description: RequiredClaim allows configuring a required
- claim name and its expected value
+ description: |-
+ RequiredClaim allows configuring a required claim name and its expected
+ value
properties:
claim:
- description: Claim is a name of a required claim.
- Only claims with string values are supported.
+ description: |-
+ Claim is a name of a required claim. Only claims with string values are
+ supported.
minLength: 1
type: string
requiredValue:
@@ -177,10 +199,11 @@ spec:
description: Issuer describes atributes of the OIDC token issuer
properties:
audiences:
- description: Audiences is an array of audiences that the
- token was issued for. Valid tokens must include at least
- one of these values in their "aud" claim. Must be set
- to exactly one value.
+ description: |-
+ Audiences is an array of audiences that the token was issued for.
+ Valid tokens must include at least one of these values in their
+ "aud" claim.
+ Must be set to exactly one value.
items:
minLength: 1
type: string
@@ -189,10 +212,11 @@ spec:
type: array
x-kubernetes-list-type: set
issuerCertificateAuthority:
- description: CertificateAuthority is a reference to a config
- map in the configuration namespace. The .data of the configMap
- must contain the "ca-bundle.crt" key. If unset, system
- trust is used instead.
+ description: |-
+ CertificateAuthority is a reference to a config map in the
+ configuration namespace. The .data of the configMap must contain
+ the "ca-bundle.crt" key.
+ If unset, system trust is used instead.
properties:
name:
description: name is the metadata.name of the referenced
@@ -202,7 +226,8 @@ spec:
- name
type: object
issuerURL:
- description: URL is the serving URL of the token issuer.
+ description: |-
+ URL is the serving URL of the token issuer.
Must use the https:// scheme.
pattern: ^https:\/\/[^\s]
type: string
@@ -215,8 +240,9 @@ spec:
minLength: 1
type: string
oidcClients:
- description: OIDCClients contains configuration for the platform's
- clients that need to request tokens from the issuer
+ description: |-
+ OIDCClients contains configuration for the platform's clients that
+ need to request tokens from the issuer
items:
properties:
clientID:
@@ -225,9 +251,9 @@ spec:
minLength: 1
type: string
clientSecret:
- description: ClientSecret refers to a secret in the `openshift-config`
- namespace that contains the client secret in the `clientSecret`
- key of the `.data` field
+ description: |-
+ ClientSecret refers to a secret in the `openshift-config` namespace that
+ contains the client secret in the `clientSecret` key of the `.data` field
properties:
name:
description: name is the metadata.name of the referenced
@@ -237,14 +263,16 @@ spec:
- name
type: object
componentName:
- description: ComponentName is the name of the component
- that is supposed to consume this client configuration
+ description: |-
+ ComponentName is the name of the component that is supposed to consume this
+ client configuration
maxLength: 256
minLength: 1
type: string
componentNamespace:
- description: ComponentNamespace is the namespace of the
- component that is supposed to consume this client configuration
+ description: |-
+ ComponentNamespace is the namespace of the component that is supposed to consume this
+ client configuration
maxLength: 63
minLength: 1
type: string
@@ -276,20 +304,21 @@ spec:
- name
x-kubernetes-list-type: map
serviceAccountIssuer:
- description: 'serviceAccountIssuer is the identifier of the bound
- service account token issuer. The default is https://kubernetes.default.svc
- WARNING: Updating this field will not result in immediate invalidation
- of all bound tokens with the previous issuer value. Instead, the
- tokens issued by previous service account issuer will continue to
- be trusted for a time period chosen by the platform (currently set
- to 24h). This time period is subject to change over time. This allows
- internal components to transition to use new service account issuer
- without service distruption.'
+ description: |-
+ serviceAccountIssuer is the identifier of the bound service account token
+ issuer.
+ The default is https://kubernetes.default.svc
+ WARNING: Updating this field will not result in immediate invalidation of all bound tokens with the
+ previous issuer value. Instead, the tokens issued by previous service account issuer will continue to
+ be trusted for a time period chosen by the platform (currently set to 24h).
+ This time period is subject to change over time.
+ This allows internal components to transition to use new service account issuer without service distruption.
type: string
type:
- description: type identifies the cluster managed, user facing authentication
- mode in use. Specifically, it manages the component that responds
- to login attempts. The default is IntegratedOAuth.
+ description: |-
+ type identifies the cluster managed, user facing authentication mode in use.
+ Specifically, it manages the component that responds to login attempts.
+ The default is IntegratedOAuth.
enum:
- ""
- None
@@ -297,22 +326,27 @@ spec:
- OIDC
type: string
webhookTokenAuthenticator:
- description: "webhookTokenAuthenticator configures a remote token
- reviewer. These remote authentication webhooks can be used to verify
- bearer tokens via the tokenreviews.authentication.k8s.io REST API.
- This is required to honor bearer tokens that are provisioned by
- an external authentication service. \n Can only be set if \"Type\"
- is set to \"None\"."
+ description: |-
+ webhookTokenAuthenticator configures a remote token reviewer.
+ These remote authentication webhooks can be used to verify bearer tokens
+ via the tokenreviews.authentication.k8s.io REST API. This is required to
+ honor bearer tokens that are provisioned by an external authentication service.
+
+ Can only be set if "Type" is set to "None".
properties:
kubeConfig:
- description: "kubeConfig references a secret that contains kube
- config file data which describes how to access the remote webhook
- service. The namespace for the referenced secret is openshift-config.
- \n For further details, see: \n https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
- \n The key \"kubeConfig\" is used to locate the data. If the
- secret or expected key is not found, the webhook is not honored.
- If the specified kube config data is not valid, the webhook
- is not honored."
+ description: |-
+ kubeConfig references a secret that contains kube config file data which
+ describes how to access the remote webhook service.
+ The namespace for the referenced secret is openshift-config.
+
+ For further details, see:
+
+ https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
+
+ The key "kubeConfig" is used to locate the data.
+ If the secret or expected key is not found, the webhook is not honored.
+ If the specified kube config data is not valid, the webhook is not honored.
properties:
name:
description: name is the metadata.name of the referenced secret
@@ -327,20 +361,19 @@ spec:
description: webhookTokenAuthenticators is DEPRECATED, setting it
has no effect.
items:
- description: deprecatedWebhookTokenAuthenticator holds the necessary
- configuration options for a remote token authenticator. It's the
- same as WebhookTokenAuthenticator but it's missing the 'required'
- validation on KubeConfig field.
+ description: |-
+ deprecatedWebhookTokenAuthenticator holds the necessary configuration options for a remote token authenticator.
+ It's the same as WebhookTokenAuthenticator but it's missing the 'required' validation on KubeConfig field.
properties:
kubeConfig:
- description: 'kubeConfig contains kube config file data which
- describes how to access the remote webhook service. For further
- details, see: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
- The key "kubeConfig" is used to locate the data. If the secret
- or expected key is not found, the webhook is not honored.
- If the specified kube config data is not valid, the webhook
- is not honored. The namespace for this secret is determined
- by the point of use.'
+ description: |-
+ kubeConfig contains kube config file data which describes how to access the remote webhook service.
+ For further details, see:
+ https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication
+ The key "kubeConfig" is used to locate the data.
+ If the secret or expected key is not found, the webhook is not honored.
+ If the specified kube config data is not valid, the webhook is not honored.
+ The namespace for this secret is determined by the point of use.
properties:
name:
description: name is the metadata.name of the referenced
@@ -358,18 +391,20 @@ spec:
be overridden.
properties:
integratedOAuthMetadata:
- description: 'integratedOAuthMetadata contains the discovery endpoint
- data for OAuth 2.0 Authorization Server Metadata for the in-cluster
- integrated OAuth server. This discovery document can be viewed from
- its served location: oc get --raw ''/.well-known/oauth-authorization-server''
- For further details, see the IETF Draft: https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
- This contains the observed value based on cluster state. An explicitly
- set value in spec.oauthMetadata has precedence over this field.
- This field has no meaning if authentication spec.type is not set
- to IntegratedOAuth. The key "oauthMetadata" is used to locate the
- data. If the config map or expected key is not found, no metadata
- is served. If the specified metadata is not valid, no metadata is
- served. The namespace for this config map is openshift-config-managed.'
+ description: |-
+ integratedOAuthMetadata contains the discovery endpoint data for OAuth 2.0
+ Authorization Server Metadata for the in-cluster integrated OAuth server.
+ This discovery document can be viewed from its served location:
+ oc get --raw '/.well-known/oauth-authorization-server'
+ For further details, see the IETF Draft:
+ https://tools.ietf.org/html/draft-ietf-oauth-discovery-04#section-2
+ This contains the observed value based on cluster state.
+ An explicitly set value in spec.oauthMetadata has precedence over this field.
+ This field has no meaning if authentication spec.type is not set to IntegratedOAuth.
+ The key "oauthMetadata" is used to locate the data.
+ If the config map or expected key is not found, no metadata is served.
+ If the specified metadata is not valid, no metadata is served.
+ The namespace for this config map is openshift-config-managed.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -379,9 +414,9 @@ spec:
- name
type: object
oidcClients:
- description: OIDCClients is where participating operators place the
- current OIDC client status for OIDC clients that can be customized
- by the cluster-admin.
+ description: |-
+ OIDCClients is where participating operators place the current OIDC client status
+ for OIDC clients that can be customized by the cluster-admin.
items:
properties:
componentName:
@@ -397,56 +432,45 @@ spec:
minLength: 1
type: string
conditions:
- description: "Conditions are used to communicate the state of
- the `oidcClients` entry. \n Supported conditions include Available,
- Degraded and Progressing. \n If 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."
+ description: |-
+ Conditions are used to communicate the state of the `oidcClients` entry.
+
+ Supported conditions include Available, Degraded and Progressing.
+
+ If 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.
items:
- description: "Condition contains details for one aspect of
- the current state of this API Resource. --- This struct
- is intended for direct use as an array at the field path
- .status.conditions. For example, \n type FooStatus struct{
- // Represents the observations of a foo's current state.
- // Known .status.conditions.type are: \"Available\", \"Progressing\",
- and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields
- }"
+ description: Condition contains details for one aspect of
+ the current state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should
- be when the underlying condition changed. If that is
- not known, then using the time when the API field changed
- is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance,
- if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the
- current state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier
- indicating the reason for the condition's last transition.
- Producers of specific condition types may define expected
- values and meanings for this field, and whether the
- values are considered a guaranteed API. The value should
- be a CamelCase string. This field may not be empty.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
@@ -461,11 +485,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across
- resources like Available, but because arbitrary conditions
- can be useful (see .node.status.conditions), the ability
- to deconflict is important. The regex it matches is
- (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -481,8 +500,9 @@ spec:
- type
x-kubernetes-list-type: map
consumingUsers:
- description: ConsumingUsers is a slice of ServiceAccounts that
- need to have read permission on the `clientSecret` secret.
+ description: |-
+ ConsumingUsers is a slice of ServiceAccounts that need to have read
+ permission on the `clientSecret` secret.
items:
description: ConsumingUser is an alias for string which we
add validation to. Currently only service accounts are supported.
@@ -504,7 +524,8 @@ spec:
minLength: 1
type: string
issuerURL:
- description: URL is the serving URL of the token issuer.
+ description: |-
+ URL is the serving URL of the token issuer.
Must use the https:// scheme.
pattern: ^https:\/\/[^\s]
type: string
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_consoles.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_consoles.crd.yaml
index 57c8ee341e..5cad05f15e 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_consoles.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_consoles.crd.yaml
@@ -20,20 +20,27 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Console holds cluster-wide configuration for the web console,
- including the logout URL, and reports the public URL of the console. The
- canonical name is `cluster`. \n Compatibility level 1: Stable within a major
- release for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Console holds cluster-wide configuration for the web console, including the
+ logout URL, and reports the public URL of the console. The canonical name is
+ `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -45,15 +52,17 @@ spec:
for console authentication.
properties:
logoutRedirect:
- description: 'An optional, absolute URL to redirect web browsers
- to after logging out of the console. If not specified, it will
- redirect to the default login page. This is required when using
- an identity provider that supports single sign-on (SSO) such
- as: - OpenID (Keycloak, Azure) - RequestHeader (GSSAPI, SSPI,
- SAML) - OAuth (GitHub, GitLab, Google) Logging out of the console
- will destroy the user''s token. The logoutRedirect provides
- the user the option to perform single logout (SLO) through the
- identity provider to destroy their single sign-on session.'
+ description: |-
+ An optional, absolute URL to redirect web browsers to after logging out of
+ the console. If not specified, it will redirect to the default login page.
+ This is required when using an identity provider that supports single
+ sign-on (SSO) such as:
+ - OpenID (Keycloak, Azure)
+ - RequestHeader (GSSAPI, SSPI, SAML)
+ - OAuth (GitHub, GitLab, Google)
+ Logging out of the console will destroy the user's token. The logoutRedirect
+ provides the user the option to perform single logout (SLO) through the identity
+ provider to destroy their single sign-on session.
pattern: ^$|^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$
type: string
type: object
@@ -63,8 +72,9 @@ spec:
be overridden.
properties:
consoleURL:
- description: The URL for the console. This will be derived from the
- host for the route that is created for the console.
+ description: |-
+ The URL for the console. This will be derived from the host for the route that
+ is created for the console.
type: string
type: object
required:
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses.crd.yaml
index 40432b110f..06fb0be0b2 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses.crd.yaml
@@ -20,19 +20,25 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "DNS holds cluster-wide information about DNS. The canonical
- name is `cluster` \n Compatibility level 1: Stable within a major release
- for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ DNS holds cluster-wide information about DNS. The canonical name is `cluster`
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -40,35 +46,41 @@ spec:
description: spec holds user settable values for configuration
properties:
baseDomain:
- description: "baseDomain is the base domain of the cluster. All managed
- DNS records will be sub-domains of this base. \n For example, given
- the base domain `openshift.example.com`, an API server DNS record
- may be created for `cluster-api.openshift.example.com`. \n Once
- set, this field cannot be changed."
+ description: |-
+ baseDomain is the base domain of the cluster. All managed DNS records will
+ be sub-domains of this base.
+
+ For example, given the base domain `openshift.example.com`, an API server
+ DNS record may be created for `cluster-api.openshift.example.com`.
+
+ Once set, this field cannot be changed.
type: string
platform:
- description: platform holds configuration specific to the underlying
- infrastructure provider for DNS. 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.
+ description: |-
+ platform holds configuration specific to the underlying
+ infrastructure provider for DNS.
+ 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.
properties:
aws:
description: aws contains DNS configuration specific to the Amazon
Web Services cloud provider.
properties:
privateZoneIAMRole:
- description: privateZoneIAMRole contains the ARN of an IAM
- role that should be assumed when performing operations on
- the cluster's private hosted zone specified in the cluster
- DNS config. When left empty, no role should be assumed.
+ description: |-
+ privateZoneIAMRole contains the ARN of an IAM role that should be assumed when performing
+ operations on the cluster's private hosted zone specified in the cluster DNS config.
+ When left empty, no role should be assumed.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
- description: "type is the underlying infrastructure provider for
- the cluster. Allowed values: \"\", \"AWS\". \n Individual components
- may not support all platforms, and must handle unrecognized
- platforms with best-effort defaults."
+ description: |-
+ type is the underlying infrastructure provider for the cluster.
+ Allowed values: "", "AWS".
+
+ Individual components may not support all platforms,
+ and must handle unrecognized platforms with best-effort defaults.
enum:
- ""
- AWS
@@ -100,49 +112,67 @@ spec:
rule: 'has(self.type) && self.type == ''AWS'' ? has(self.aws) :
!has(self.aws)'
privateZone:
- description: "privateZone is the location where all the DNS records
- that are only available internally to the cluster exist. \n If this
- field is nil, no private records should be created. \n Once set,
- this field cannot be changed."
+ description: |-
+ privateZone is the location where all the DNS records that are only available internally
+ to the cluster exist.
+
+ If this field is nil, no private records should be created.
+
+ Once set, this field cannot be changed.
properties:
id:
- description: "id is the identifier that can be used to find the
- DNS hosted zone. \n on AWS zone can be fetched using `ID` as
- id in [1] on Azure zone can be fetched using `ID` as a pre-determined
- name in [2], on GCP zone can be fetched using `ID` as a pre-determined
- name in [3]. \n [1]: https://docs.aws.amazon.com/cli/latest/reference/route53/get-hosted-zone.html#options
+ description: |-
+ id is the identifier that can be used to find the DNS hosted zone.
+
+ on AWS zone can be fetched using `ID` as id in [1]
+ on Azure zone can be fetched using `ID` as a pre-determined name in [2],
+ on GCP zone can be fetched using `ID` as a pre-determined name in [3].
+
+ [1]: https://docs.aws.amazon.com/cli/latest/reference/route53/get-hosted-zone.html#options
[2]: https://docs.microsoft.com/en-us/cli/azure/network/dns/zone?view=azure-cli-latest#az-network-dns-zone-show
- [3]: https://cloud.google.com/dns/docs/reference/v1/managedZones/get"
+ [3]: https://cloud.google.com/dns/docs/reference/v1/managedZones/get
type: string
tags:
additionalProperties:
type: string
- description: "tags can be used to query the DNS hosted zone. \n
- on AWS, resourcegroupstaggingapi [1] can be used to fetch a
- zone using `Tags` as tag-filters, \n [1]: https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html#options"
+ description: |-
+ tags can be used to query the DNS hosted zone.
+
+ on AWS, resourcegroupstaggingapi [1] can be used to fetch a zone using `Tags` as tag-filters,
+
+ [1]: https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html#options
type: object
type: object
publicZone:
- description: "publicZone is the location where all the DNS records
- that are publicly accessible to the internet exist. \n If this field
- is nil, no public records should be created. \n Once set, this field
- cannot be changed."
+ description: |-
+ publicZone is the location where all the DNS records that are publicly accessible to
+ the internet exist.
+
+ If this field is nil, no public records should be created.
+
+ Once set, this field cannot be changed.
properties:
id:
- description: "id is the identifier that can be used to find the
- DNS hosted zone. \n on AWS zone can be fetched using `ID` as
- id in [1] on Azure zone can be fetched using `ID` as a pre-determined
- name in [2], on GCP zone can be fetched using `ID` as a pre-determined
- name in [3]. \n [1]: https://docs.aws.amazon.com/cli/latest/reference/route53/get-hosted-zone.html#options
+ description: |-
+ id is the identifier that can be used to find the DNS hosted zone.
+
+ on AWS zone can be fetched using `ID` as id in [1]
+ on Azure zone can be fetched using `ID` as a pre-determined name in [2],
+ on GCP zone can be fetched using `ID` as a pre-determined name in [3].
+
+ [1]: https://docs.aws.amazon.com/cli/latest/reference/route53/get-hosted-zone.html#options
[2]: https://docs.microsoft.com/en-us/cli/azure/network/dns/zone?view=azure-cli-latest#az-network-dns-zone-show
- [3]: https://cloud.google.com/dns/docs/reference/v1/managedZones/get"
+ [3]: https://cloud.google.com/dns/docs/reference/v1/managedZones/get
type: string
tags:
additionalProperties:
type: string
- description: "tags can be used to query the DNS hosted zone. \n
- on AWS, resourcegroupstaggingapi [1] can be used to fetch a
- zone using `Tags` as tag-filters, \n [1]: https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html#options"
+ description: |-
+ tags can be used to query the DNS hosted zone.
+
+ on AWS, resourcegroupstaggingapi [1] can be used to fetch a zone using `Tags` as tag-filters,
+
+ [1]: https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html#options
type: object
type: object
type: object
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_featuregates.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_featuregates.crd.yaml
index bc7049cd0a..55e5ddcb2c 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_featuregates.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_featuregates.crd.yaml
@@ -20,20 +20,25 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Feature holds cluster-wide information about feature gates.
- \ The canonical name is `cluster` \n Compatibility level 1: Stable within
- a major release for a minimum of 12 months or 3 minor releases (whichever
- is longer)."
+ description: |-
+ Feature holds cluster-wide information about feature gates. The canonical name is `cluster`
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -41,12 +46,10 @@ spec:
description: spec holds user settable values for configuration
properties:
customNoUpgrade:
- description: customNoUpgrade allows the enabling or disabling of any
- feature. Turning this feature set on IS NOT SUPPORTED, CANNOT BE
- UNDONE, and PREVENTS UPGRADES. Because of its nature, this setting
- cannot be validated. If you have any typos or accidentally apply
- invalid combinations your cluster may fail in an unrecoverable way. featureSet
- must equal "CustomNoUpgrade" must be set to use this field.
+ description: |-
+ customNoUpgrade allows the enabling or disabling of any feature. Turning this feature set on IS NOT SUPPORTED, CANNOT BE UNDONE, and PREVENTS UPGRADES.
+ Because of its nature, this setting cannot be validated. If you have any typos or accidentally apply invalid combinations
+ your cluster may fail in an unrecoverable way. featureSet must equal "CustomNoUpgrade" must be set to use this field.
nullable: true
properties:
disabled:
@@ -69,10 +72,9 @@ spec:
type: array
type: object
featureSet:
- description: featureSet changes the list of features in the cluster. The
- default is empty. Be very careful adjusting this setting. Turning
- on or off features may cause irreversible changes in your cluster
- which cannot be undone.
+ description: |-
+ featureSet changes the list of features in the cluster. The default is empty. Be very careful adjusting this setting.
+ Turning on or off features may cause irreversible changes in your cluster which cannot be undone.
enum:
- CustomNoUpgrade
- DevPreviewNoUpgrade
@@ -98,46 +100,39 @@ spec:
be overridden.
properties:
conditions:
- description: 'conditions represent the observations of the current
- state. Known .status.conditions.type are: "DeterminationDegraded"'
+ description: |-
+ conditions represent the observations of the current state.
+ Known .status.conditions.type are: "DeterminationDegraded"
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource. --- This struct is intended for direct
- use as an array at the field path .status.conditions. For example,
- \n type FooStatus struct{ // Represents the observations of a
- foo's current state. // Known .status.conditions.type are: \"Available\",
- \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should be when
- the underlying condition changed. If that is not known, then
- using the time when the API field changed is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance, if .metadata.generation
- is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the current
- state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier indicating
- the reason for the condition's last transition. Producers
- of specific condition types may define expected values and
- meanings for this field, and whether the values are considered
- a guaranteed API. The value should be a CamelCase string.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
@@ -152,10 +147,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across resources
- like Available, but because arbitrary conditions can be useful
- (see .node.status.conditions), the ability to deconflict is
- important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -171,18 +162,15 @@ spec:
- type
x-kubernetes-list-type: map
featureGates:
- description: featureGates contains a list of enabled and disabled
- featureGates that are keyed by payloadVersion. Operators other than
- the CVO and cluster-config-operator, must read the .status.featureGates,
- locate the version they are managing, find the enabled/disabled
- featuregates and make the operand and operator match. The enabled/disabled
- values for a particular version may change during the life of the
- cluster as various .spec.featureSet values are selected. Operators
- may choose to restart their processes to pick up these changes,
- but remembering past enable/disable lists is beyond the scope of
- this API and is the responsibility of individual operators. Only
- featureGates with .version in the ClusterVersion.status will be
- present in this list.
+ description: |-
+ featureGates contains a list of enabled and disabled featureGates that are keyed by payloadVersion.
+ Operators other than the CVO and cluster-config-operator, must read the .status.featureGates, locate
+ the version they are managing, find the enabled/disabled featuregates and make the operand and operator match.
+ The enabled/disabled values for a particular version may change during the life of the cluster as various
+ .spec.featureSet values are selected.
+ Operators may choose to restart their processes to pick up these changes, but remembering past enable/disable
+ lists is beyond the scope of this API and is the responsibility of individual operators.
+ Only featureGates with .version in the ClusterVersion.status will be present in this list.
items:
properties:
disabled:
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagecontentpolicies.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagecontentpolicies.crd.yaml
index d9c1fb40f7..16ff1fe8da 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagecontentpolicies.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagecontentpolicies.crd.yaml
@@ -20,21 +20,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "ImageContentPolicy holds cluster-wide information about how
- to handle registry mirror rules. When multiple policies are defined, the
- outcome of the behavior is defined on each field. \n Compatibility level
- 1: Stable within a major release for a minimum of 12 months or 3 minor releases
- (whichever is longer)."
+ description: |-
+ ImageContentPolicy holds cluster-wide information about how to handle registry mirror rules.
+ When multiple policies are defined, the outcome of the behavior is defined on each field.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,50 +47,45 @@ spec:
description: spec holds user settable values for configuration
properties:
repositoryDigestMirrors:
- description: "repositoryDigestMirrors allows images referenced by
- image digests in pods to be pulled from alternative mirrored repository
- locations. The image pull specification provided to the pod will
- be compared to the source locations described in RepositoryDigestMirrors
- and the image may be pulled down from any of the mirrors in the
- list instead of the specified repository allowing administrators
- to choose a potentially faster mirror. To pull image from mirrors
- by tags, should set the \"allowMirrorByTags\". \n Each “source”
- repository is treated independently; configurations for different
- “source” repositories don’t interact. \n If the \"mirrors\" is not
- specified, the image will continue to be pulled from the specified
- repository in the pull spec. \n When multiple policies are defined
- for the same “source” repository, the sets of defined mirrors will
- be merged together, preserving the relative order of the mirrors,
- if possible. For example, if policy A has mirrors `a, b, c` and
- policy B has mirrors `c, d, e`, the mirrors will be used in the
- order `a, b, c, d, e`. If the orders of mirror entries conflict
- (e.g. `a, b` vs. `b, a`) the configuration is not rejected but the
- resulting order is unspecified."
+ description: |-
+ repositoryDigestMirrors allows images referenced by image digests in pods to be
+ pulled from alternative mirrored repository locations. The image pull specification
+ provided to the pod will be compared to the source locations described in RepositoryDigestMirrors
+ and the image may be pulled down from any of the mirrors in the list instead of the
+ specified repository allowing administrators to choose a potentially faster mirror.
+ To pull image from mirrors by tags, should set the "allowMirrorByTags".
+
+ Each “source” repository is treated independently; configurations for different “source”
+ repositories don’t interact.
+
+ If the "mirrors" is not specified, the image will continue to be pulled from the specified
+ repository in the pull spec.
+
+ When multiple policies are defined for the same “source” repository, the sets of defined
+ mirrors will be merged together, preserving the relative order of the mirrors, if possible.
+ For example, if policy A has mirrors `a, b, c` and policy B has mirrors `c, d, e`, the
+ mirrors will be used in the order `a, b, c, d, e`. If the orders of mirror entries conflict
+ (e.g. `a, b` vs. `b, a`) the configuration is not rejected but the resulting order is unspecified.
items:
description: RepositoryDigestMirrors holds cluster-wide information
about how to handle mirrors in the registries config.
properties:
allowMirrorByTags:
- description: allowMirrorByTags if true, the mirrors can be used
- to pull the images that are referenced by their tags. Default
- is false, the mirrors only work when pulling the images that
- are referenced by their digests. Pulling images by tag can
- potentially yield different images, depending on which endpoint
- we pull from. Forcing digest-pulls for mirrors avoids that
- issue.
+ description: |-
+ allowMirrorByTags if true, the mirrors can be used to pull the images that are referenced by their tags. Default is false, the mirrors only work when pulling the images that are referenced by their digests.
+ Pulling images by tag can potentially yield different images, depending on which endpoint
+ we pull from. Forcing digest-pulls for mirrors avoids that issue.
type: boolean
mirrors:
- description: mirrors is zero or more repositories that may also
- contain the same images. If the "mirrors" is not specified,
- the image will continue to be pulled from the specified repository
- in the pull spec. No mirror will be configured. The order
- of mirrors in this list is treated as the user's desired priority,
- while source is by default considered lower priority than
- all mirrors. Other cluster configuration, including (but not
- limited to) other repositoryDigestMirrors objects, may impact
- the exact order mirrors are contacted in, or some mirrors
- may be contacted in parallel, so this should be considered
- a preference rather than a guarantee of ordering.
+ description: |-
+ mirrors is zero or more repositories that may also contain the same images.
+ If the "mirrors" is not specified, the image will continue to be pulled from the specified
+ repository in the pull spec. No mirror will be configured.
+ The order of mirrors in this list is treated as the user's desired priority, while source
+ is by default considered lower priority than all mirrors. Other cluster configuration,
+ including (but not limited to) other repositoryDigestMirrors objects,
+ may impact the exact order mirrors are contacted in, or some mirrors may be contacted
+ in parallel, so this should be considered a preference rather than a guarantee of ordering.
items:
pattern: ^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])(:[0-9]+)?(\/[^\/:\n]+)*(\/[^\/:\n]+((:[^\/:\n]+)|(@[^\n]+)))?$
type: string
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagedigestmirrorsets.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagedigestmirrorsets.crd.yaml
index 984aa93786..b223ecda68 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagedigestmirrorsets.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagedigestmirrorsets.crd.yaml
@@ -22,21 +22,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "ImageDigestMirrorSet holds cluster-wide information about how
- to handle registry mirror rules on using digest pull specification. When
- multiple policies are defined, the outcome of the behavior is defined on
- each field. \n Compatibility level 1: Stable within a major release for
- a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ ImageDigestMirrorSet holds cluster-wide information about how to handle registry mirror rules on using digest pull specification.
+ When multiple policies are defined, the outcome of the behavior is defined on each field.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -44,84 +49,82 @@ spec:
description: spec holds user settable values for configuration
properties:
imageDigestMirrors:
- description: "imageDigestMirrors allows images referenced by image
- digests in pods to be pulled from alternative mirrored repository
- locations. The image pull specification provided to the pod will
- be compared to the source locations described in imageDigestMirrors
- and the image may be pulled down from any of the mirrors in the
- list instead of the specified repository allowing administrators
- to choose a potentially faster mirror. To use mirrors to pull images
- using tag specification, users should configure a list of mirrors
- using \"ImageTagMirrorSet\" CRD. \n If the image pull specification
- matches the repository of \"source\" in multiple imagedigestmirrorset
- objects, only the objects which define the most specific namespace
- match will be used. For example, if there are objects using quay.io/libpod
- and quay.io/libpod/busybox as the \"source\", only the objects using
- quay.io/libpod/busybox are going to apply for pull specification
- quay.io/libpod/busybox. Each “source” repository is treated independently;
- configurations for different “source” repositories don’t interact.
- \n If the \"mirrors\" is not specified, the image will continue
- to be pulled from the specified repository in the pull spec. \n
- When multiple policies are defined for the same “source” repository,
- the sets of defined mirrors will be merged together, preserving
- the relative order of the mirrors, if possible. For example, if
- policy A has mirrors `a, b, c` and policy B has mirrors `c, d, e`,
- the mirrors will be used in the order `a, b, c, d, e`. If the orders
- of mirror entries conflict (e.g. `a, b` vs. `b, a`) the configuration
- is not rejected but the resulting order is unspecified. Users who
- want to use a specific order of mirrors, should configure them into
- one list of mirrors using the expected order."
+ description: |-
+ imageDigestMirrors allows images referenced by image digests in pods to be
+ pulled from alternative mirrored repository locations. The image pull specification
+ provided to the pod will be compared to the source locations described in imageDigestMirrors
+ and the image may be pulled down from any of the mirrors in the list instead of the
+ specified repository allowing administrators to choose a potentially faster mirror.
+ To use mirrors to pull images using tag specification, users should configure
+ a list of mirrors using "ImageTagMirrorSet" CRD.
+
+ If the image pull specification matches the repository of "source" in multiple imagedigestmirrorset objects,
+ only the objects which define the most specific namespace match will be used.
+ For example, if there are objects using quay.io/libpod and quay.io/libpod/busybox as
+ the "source", only the objects using quay.io/libpod/busybox are going to apply
+ for pull specification quay.io/libpod/busybox.
+ Each “source” repository is treated independently; configurations for different “source”
+ repositories don’t interact.
+
+ If the "mirrors" is not specified, the image will continue to be pulled from the specified
+ repository in the pull spec.
+
+ When multiple policies are defined for the same “source” repository, the sets of defined
+ mirrors will be merged together, preserving the relative order of the mirrors, if possible.
+ For example, if policy A has mirrors `a, b, c` and policy B has mirrors `c, d, e`, the
+ mirrors will be used in the order `a, b, c, d, e`. If the orders of mirror entries conflict
+ (e.g. `a, b` vs. `b, a`) the configuration is not rejected but the resulting order is unspecified.
+ Users who want to use a specific order of mirrors, should configure them into one list of mirrors using the expected order.
items:
description: ImageDigestMirrors holds cluster-wide information about
how to handle mirrors in the registries config.
properties:
mirrorSourcePolicy:
- description: mirrorSourcePolicy defines the fallback policy
- if fails to pull image from the mirrors. If unset, the image
- will continue to be pulled from the the repository in the
- pull spec. sourcePolicy is valid configuration only when one
- or more mirrors are in the mirror list.
+ description: |-
+ mirrorSourcePolicy defines the fallback policy if fails to pull image from the mirrors.
+ If unset, the image will continue to be pulled from the the repository in the pull spec.
+ sourcePolicy is valid configuration only when one or more mirrors are in the mirror list.
enum:
- NeverContactSource
- AllowContactingSource
type: string
mirrors:
- description: 'mirrors is zero or more locations that may also
- contain the same images. No mirror will be configured if not
- specified. Images can be pulled from these mirrors only if
- they are referenced by their digests. The mirrored location
- is obtained by replacing the part of the input reference that
- matches source by the mirrors entry, e.g. for registry.redhat.io/product/repo
- reference, a (source, mirror) pair *.redhat.io, mirror.local/redhat
- causes a mirror.local/redhat/product/repo repository to be
- used. The order of mirrors in this list is treated as the
- user''s desired priority, while source is by default considered
- lower priority than all mirrors. If no mirror is specified
- or all image pulls from the mirror list fail, the image will
- continue to be pulled from the repository in the pull spec
- unless explicitly prohibited by "mirrorSourcePolicy" Other
- cluster configuration, including (but not limited to) other
- imageDigestMirrors objects, may impact the exact order mirrors
- are contacted in, or some mirrors may be contacted in parallel,
- so this should be considered a preference rather than a guarantee
- of ordering. "mirrors" uses one of the following formats:
- host[:port] host[:port]/namespace[/namespace…] host[:port]/namespace[/namespace…]/repo
- for more information about the format, see the document about
- the location field: https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table'
+ description: |-
+ mirrors is zero or more locations that may also contain the same images. No mirror will be configured if not specified.
+ Images can be pulled from these mirrors only if they are referenced by their digests.
+ The mirrored location is obtained by replacing the part of the input reference that
+ matches source by the mirrors entry, e.g. for registry.redhat.io/product/repo reference,
+ a (source, mirror) pair *.redhat.io, mirror.local/redhat causes a mirror.local/redhat/product/repo
+ repository to be used.
+ The order of mirrors in this list is treated as the user's desired priority, while source
+ is by default considered lower priority than all mirrors.
+ If no mirror is specified or all image pulls from the mirror list fail, the image will continue to be
+ pulled from the repository in the pull spec unless explicitly prohibited by "mirrorSourcePolicy"
+ Other cluster configuration, including (but not limited to) other imageDigestMirrors objects,
+ may impact the exact order mirrors are contacted in, or some mirrors may be contacted
+ in parallel, so this should be considered a preference rather than a guarantee of ordering.
+ "mirrors" uses one of the following formats:
+ host[:port]
+ host[:port]/namespace[/namespace…]
+ host[:port]/namespace[/namespace…]/repo
+ for more information about the format, see the document about the location field:
+ https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table
items:
pattern: ^((?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?)(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?$
type: string
type: array
x-kubernetes-list-type: set
source:
- description: 'source matches the repository that users refer
- to, e.g. in image pull specifications. Setting source to a
- registry hostname e.g. docker.io. quay.io, or registry.redhat.io,
- will match the image pull specification of corressponding
- registry. "source" uses one of the following formats: host[:port]
- host[:port]/namespace[/namespace…] host[:port]/namespace[/namespace…]/repo
- [*.]host for more information about the format, see the document
- about the location field: https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table'
+ description: |-
+ source matches the repository that users refer to, e.g. in image pull specifications. Setting source to a registry hostname
+ e.g. docker.io. quay.io, or registry.redhat.io, will match the image pull specification of corressponding registry.
+ "source" uses one of the following formats:
+ host[:port]
+ host[:port]/namespace[/namespace…]
+ host[:port]/namespace[/namespace…]/repo
+ [*.]host
+ for more information about the format, see the document about the location field:
+ https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table
pattern: ^\*(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+$|^((?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?)(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?$
type: string
required:
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-CustomNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-CustomNoUpgrade.crd.yaml
index 5a188f0bf4..67e097af36 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-CustomNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-CustomNoUpgrade.crd.yaml
@@ -21,24 +21,30 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Image governs policies related to imagestream imports and runtime
- configuration for external registries. It allows cluster admins to configure
- which registries OpenShift is allowed to import images from, extra CA trust
- bundles for external registries, and policies to block or allow registry
- hostnames. When exposing OpenShift's image registry to the public, this
- also lets cluster admins specify the external hostname. \n Compatibility
- level 1: Stable within a major release for a minimum of 12 months or 3 minor
- releases (whichever is longer)."
+ description: |-
+ Image governs policies related to imagestream imports and runtime configuration
+ for external registries. It allows cluster admins to configure which registries
+ OpenShift is allowed to import images from, extra CA trust bundles for external
+ registries, and policies to block or allow registry hostnames.
+ When exposing OpenShift's image registry to the public, this also lets cluster
+ admins specify the external hostname.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -46,9 +52,10 @@ spec:
description: spec holds user settable values for configuration
properties:
additionalTrustedCA:
- description: additionalTrustedCA is a reference to a ConfigMap containing
- additional CAs that should be trusted during imagestream import,
- pod image pull, build image pull, and imageregistry pullthrough.
+ description: |-
+ additionalTrustedCA is a reference to a ConfigMap containing additional CAs that
+ should be trusted during imagestream import, pod image pull, build image pull, and
+ imageregistry pullthrough.
The namespace for this config map is openshift-config.
properties:
name:
@@ -59,93 +66,90 @@ spec:
- name
type: object
allowedRegistriesForImport:
- description: allowedRegistriesForImport limits the container image
- registries that normal users may import images from. Set this list
- to the registries that you trust to contain valid Docker images
- and that you want applications to be able to import from. Users
- with permission to create Images or ImageStreamMappings via the
- API are not affected by this policy - typically only administrators
- or system integrations will have those permissions.
+ description: |-
+ allowedRegistriesForImport limits the container image registries that normal users may import
+ images from. Set this list to the registries that you trust to contain valid Docker
+ images and that you want applications to be able to import from. Users with
+ permission to create Images or ImageStreamMappings via the API are not affected by
+ this policy - typically only administrators or system integrations will have those
+ permissions.
items:
- description: RegistryLocation contains a location of the registry
- specified by the registry domain name. The domain name might include
- wildcards, like '*' or '??'.
+ description: |-
+ RegistryLocation contains a location of the registry specified by the registry domain
+ name. The domain name might include wildcards, like '*' or '??'.
properties:
domainName:
- description: domainName specifies a domain name for the registry
- In case the registry use non-standard (80 or 443) port, the
- port should be included in the domain name as well.
+ description: |-
+ domainName specifies a domain name for the registry
+ In case the registry use non-standard (80 or 443) port, the port should be included
+ in the domain name as well.
type: string
insecure:
- description: insecure indicates whether the registry is secure
- (https) or insecure (http) By default (if not specified) the
- registry is assumed as secure.
+ description: |-
+ insecure indicates whether the registry is secure (https) or insecure (http)
+ By default (if not specified) the registry is assumed as secure.
type: boolean
type: object
type: array
x-kubernetes-list-type: atomic
externalRegistryHostnames:
- description: externalRegistryHostnames provides the hostnames for
- the default external image registry. The external hostname should
- be set only when the image registry is exposed externally. The first
- value is used in 'publicDockerImageRepository' field in ImageStreams.
- The value must be in "hostname[:port]" format.
+ description: |-
+ externalRegistryHostnames provides the hostnames for the default external image
+ registry. The external hostname should be set only when the image registry
+ is exposed externally. The first value is used in 'publicDockerImageRepository'
+ field in ImageStreams. The value must be in "hostname[:port]" format.
items:
type: string
type: array
x-kubernetes-list-type: atomic
imageStreamImportMode:
- description: 'imageStreamImportMode controls the import mode behaviour
- of imagestreams. It can be set to `Legacy` or `PreserveOriginal`
- or the empty string. If this value is specified, this setting is
- applied to all newly created imagestreams which do not have the
- value set. `Legacy` indicates that the legacy behaviour should be
- used. For manifest lists, the legacy behaviour will discard the
- manifest list and import a single sub-manifest. In this case, the
- platform is chosen in the following order of priority: 1. tag annotations;
- 2. control plane arch/os; 3. linux/amd64; 4. the first manifest
- in the list. `PreserveOriginal` indicates that the original manifest
- will be preserved. For manifest lists, the manifest list and all
- its sub-manifests will be imported. When empty, the behaviour will
- be decided based on the payload type advertised by the ClusterVersion
- status, i.e single arch payload implies the import mode is Legacy
- and multi payload implies PreserveOriginal.'
+ description: |-
+ imageStreamImportMode controls the import mode behaviour of imagestreams.
+ It can be set to `Legacy` or `PreserveOriginal` or the empty string. If this value
+ is specified, this setting is applied to all newly created imagestreams which do not have the
+ value set. `Legacy` indicates that the legacy behaviour should be used.
+ For manifest lists, the legacy behaviour will discard the manifest list and import a single
+ sub-manifest. In this case, the platform is chosen in the following order of priority:
+ 1. tag annotations; 2. control plane arch/os; 3. linux/amd64; 4. the first manifest in the list.
+ `PreserveOriginal` indicates that the original manifest will be preserved. For manifest lists,
+ the manifest list and all its sub-manifests will be imported. When empty, the behaviour will be
+ decided based on the payload type advertised by the ClusterVersion status, i.e single arch payload
+ implies the import mode is Legacy and multi payload implies PreserveOriginal.
enum:
- ""
- Legacy
- PreserveOriginal
type: string
registrySources:
- description: registrySources contains configuration that determines
- how the container runtime should treat individual registries when
- accessing images for builds+pods. (e.g. whether or not to allow
- insecure access). It does not contain configuration for the internal
- cluster registry.
+ description: |-
+ registrySources contains configuration that determines how the container runtime
+ should treat individual registries when accessing images for builds+pods. (e.g.
+ whether or not to allow insecure access). It does not contain configuration for the
+ internal cluster registry.
properties:
allowedRegistries:
- description: "allowedRegistries are the only registries permitted
- for image pull and push actions. All other registries are denied.
- \n Only one of BlockedRegistries or AllowedRegistries may be
- set."
+ description: |-
+ allowedRegistries are the only registries permitted for image pull and push actions. All other registries are denied.
+
+ Only one of BlockedRegistries or AllowedRegistries may be set.
items:
type: string
type: array
x-kubernetes-list-type: atomic
blockedRegistries:
- description: "blockedRegistries cannot be used for image pull
- and push actions. All other registries are permitted. \n Only
- one of BlockedRegistries or AllowedRegistries may be set."
+ description: |-
+ blockedRegistries cannot be used for image pull and push actions. All other registries are permitted.
+
+ Only one of BlockedRegistries or AllowedRegistries may be set.
items:
type: string
type: array
x-kubernetes-list-type: atomic
containerRuntimeSearchRegistries:
- description: 'containerRuntimeSearchRegistries are registries
- that will be searched when pulling images that do not have fully
- qualified domains in their pull specs. Registries will be searched
- in the order provided in the list. Note: this search list only
- works with the container runtime, i.e CRI-O. Will NOT work with
- builds or imagestream imports.'
+ description: |-
+ containerRuntimeSearchRegistries are registries that will be searched when pulling images that do not have fully qualified
+ domains in their pull specs. Registries will be searched in the order provided in the list.
+ Note: this search list only works with the container runtime, i.e CRI-O. Will NOT work with builds or imagestream imports.
format: hostname
items:
type: string
@@ -166,40 +170,38 @@ spec:
be overridden.
properties:
externalRegistryHostnames:
- description: externalRegistryHostnames provides the hostnames for
- the default external image registry. The external hostname should
- be set only when the image registry is exposed externally. The first
- value is used in 'publicDockerImageRepository' field in ImageStreams.
- The value must be in "hostname[:port]" format.
+ description: |-
+ externalRegistryHostnames provides the hostnames for the default external image
+ registry. The external hostname should be set only when the image registry
+ is exposed externally. The first value is used in 'publicDockerImageRepository'
+ field in ImageStreams. The value must be in "hostname[:port]" format.
items:
type: string
type: array
x-kubernetes-list-type: atomic
imageStreamImportMode:
- description: 'imageStreamImportMode controls the import mode behaviour
- of imagestreams. It can be `Legacy` or `PreserveOriginal`. `Legacy`
- indicates that the legacy behaviour should be used. For manifest
- lists, the legacy behaviour will discard the manifest list and import
- a single sub-manifest. In this case, the platform is chosen in the
- following order of priority: 1. tag annotations; 2. control plane
- arch/os; 3. linux/amd64; 4. the first manifest in the list. `PreserveOriginal`
- indicates that the original manifest will be preserved. For manifest
- lists, the manifest list and all its sub-manifests will be imported.
- This value will be reconciled based on either the spec value or
- if no spec value is specified, the image registry operator would
- look at the ClusterVersion status to determine the payload type
- and set the import mode accordingly, i.e single arch payload implies
- the import mode is Legacy and multi payload implies PreserveOriginal.'
+ description: |-
+ imageStreamImportMode controls the import mode behaviour of imagestreams. It can be
+ `Legacy` or `PreserveOriginal`. `Legacy` indicates that the legacy behaviour should be used.
+ For manifest lists, the legacy behaviour will discard the manifest list and import a single
+ sub-manifest. In this case, the platform is chosen in the following order of priority:
+ 1. tag annotations; 2. control plane arch/os; 3. linux/amd64; 4. the first manifest in the list.
+ `PreserveOriginal` indicates that the original manifest will be preserved. For manifest lists,
+ the manifest list and all its sub-manifests will be imported. This value will be reconciled based
+ on either the spec value or if no spec value is specified, the image registry operator would look
+ at the ClusterVersion status to determine the payload type and set the import mode accordingly,
+ i.e single arch payload implies the import mode is Legacy and multi payload implies PreserveOriginal.
enum:
- ""
- Legacy
- PreserveOriginal
type: string
internalRegistryHostname:
- description: internalRegistryHostname sets the hostname for the default
- internal image registry. The value must be in "hostname[:port]"
- format. This value is set by the image registry operator which controls
- the internal registry hostname.
+ description: |-
+ internalRegistryHostname sets the hostname for the default internal image
+ registry. The value must be in "hostname[:port]" format.
+ This value is set by the image registry operator which controls the internal registry
+ hostname.
type: string
type: object
required:
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-Default.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-Default.crd.yaml
index 0b62838dee..a622c7d37f 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-Default.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-Default.crd.yaml
@@ -21,24 +21,30 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Image governs policies related to imagestream imports and runtime
- configuration for external registries. It allows cluster admins to configure
- which registries OpenShift is allowed to import images from, extra CA trust
- bundles for external registries, and policies to block or allow registry
- hostnames. When exposing OpenShift's image registry to the public, this
- also lets cluster admins specify the external hostname. \n Compatibility
- level 1: Stable within a major release for a minimum of 12 months or 3 minor
- releases (whichever is longer)."
+ description: |-
+ Image governs policies related to imagestream imports and runtime configuration
+ for external registries. It allows cluster admins to configure which registries
+ OpenShift is allowed to import images from, extra CA trust bundles for external
+ registries, and policies to block or allow registry hostnames.
+ When exposing OpenShift's image registry to the public, this also lets cluster
+ admins specify the external hostname.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -46,9 +52,10 @@ spec:
description: spec holds user settable values for configuration
properties:
additionalTrustedCA:
- description: additionalTrustedCA is a reference to a ConfigMap containing
- additional CAs that should be trusted during imagestream import,
- pod image pull, build image pull, and imageregistry pullthrough.
+ description: |-
+ additionalTrustedCA is a reference to a ConfigMap containing additional CAs that
+ should be trusted during imagestream import, pod image pull, build image pull, and
+ imageregistry pullthrough.
The namespace for this config map is openshift-config.
properties:
name:
@@ -59,72 +66,72 @@ spec:
- name
type: object
allowedRegistriesForImport:
- description: allowedRegistriesForImport limits the container image
- registries that normal users may import images from. Set this list
- to the registries that you trust to contain valid Docker images
- and that you want applications to be able to import from. Users
- with permission to create Images or ImageStreamMappings via the
- API are not affected by this policy - typically only administrators
- or system integrations will have those permissions.
+ description: |-
+ allowedRegistriesForImport limits the container image registries that normal users may import
+ images from. Set this list to the registries that you trust to contain valid Docker
+ images and that you want applications to be able to import from. Users with
+ permission to create Images or ImageStreamMappings via the API are not affected by
+ this policy - typically only administrators or system integrations will have those
+ permissions.
items:
- description: RegistryLocation contains a location of the registry
- specified by the registry domain name. The domain name might include
- wildcards, like '*' or '??'.
+ description: |-
+ RegistryLocation contains a location of the registry specified by the registry domain
+ name. The domain name might include wildcards, like '*' or '??'.
properties:
domainName:
- description: domainName specifies a domain name for the registry
- In case the registry use non-standard (80 or 443) port, the
- port should be included in the domain name as well.
+ description: |-
+ domainName specifies a domain name for the registry
+ In case the registry use non-standard (80 or 443) port, the port should be included
+ in the domain name as well.
type: string
insecure:
- description: insecure indicates whether the registry is secure
- (https) or insecure (http) By default (if not specified) the
- registry is assumed as secure.
+ description: |-
+ insecure indicates whether the registry is secure (https) or insecure (http)
+ By default (if not specified) the registry is assumed as secure.
type: boolean
type: object
type: array
x-kubernetes-list-type: atomic
externalRegistryHostnames:
- description: externalRegistryHostnames provides the hostnames for
- the default external image registry. The external hostname should
- be set only when the image registry is exposed externally. The first
- value is used in 'publicDockerImageRepository' field in ImageStreams.
- The value must be in "hostname[:port]" format.
+ description: |-
+ externalRegistryHostnames provides the hostnames for the default external image
+ registry. The external hostname should be set only when the image registry
+ is exposed externally. The first value is used in 'publicDockerImageRepository'
+ field in ImageStreams. The value must be in "hostname[:port]" format.
items:
type: string
type: array
x-kubernetes-list-type: atomic
registrySources:
- description: registrySources contains configuration that determines
- how the container runtime should treat individual registries when
- accessing images for builds+pods. (e.g. whether or not to allow
- insecure access). It does not contain configuration for the internal
- cluster registry.
+ description: |-
+ registrySources contains configuration that determines how the container runtime
+ should treat individual registries when accessing images for builds+pods. (e.g.
+ whether or not to allow insecure access). It does not contain configuration for the
+ internal cluster registry.
properties:
allowedRegistries:
- description: "allowedRegistries are the only registries permitted
- for image pull and push actions. All other registries are denied.
- \n Only one of BlockedRegistries or AllowedRegistries may be
- set."
+ description: |-
+ allowedRegistries are the only registries permitted for image pull and push actions. All other registries are denied.
+
+ Only one of BlockedRegistries or AllowedRegistries may be set.
items:
type: string
type: array
x-kubernetes-list-type: atomic
blockedRegistries:
- description: "blockedRegistries cannot be used for image pull
- and push actions. All other registries are permitted. \n Only
- one of BlockedRegistries or AllowedRegistries may be set."
+ description: |-
+ blockedRegistries cannot be used for image pull and push actions. All other registries are permitted.
+
+ Only one of BlockedRegistries or AllowedRegistries may be set.
items:
type: string
type: array
x-kubernetes-list-type: atomic
containerRuntimeSearchRegistries:
- description: 'containerRuntimeSearchRegistries are registries
- that will be searched when pulling images that do not have fully
- qualified domains in their pull specs. Registries will be searched
- in the order provided in the list. Note: this search list only
- works with the container runtime, i.e CRI-O. Will NOT work with
- builds or imagestream imports.'
+ description: |-
+ containerRuntimeSearchRegistries are registries that will be searched when pulling images that do not have fully qualified
+ domains in their pull specs. Registries will be searched in the order provided in the list.
+ Note: this search list only works with the container runtime, i.e CRI-O. Will NOT work with builds or imagestream imports.
format: hostname
items:
type: string
@@ -145,20 +152,21 @@ spec:
be overridden.
properties:
externalRegistryHostnames:
- description: externalRegistryHostnames provides the hostnames for
- the default external image registry. The external hostname should
- be set only when the image registry is exposed externally. The first
- value is used in 'publicDockerImageRepository' field in ImageStreams.
- The value must be in "hostname[:port]" format.
+ description: |-
+ externalRegistryHostnames provides the hostnames for the default external image
+ registry. The external hostname should be set only when the image registry
+ is exposed externally. The first value is used in 'publicDockerImageRepository'
+ field in ImageStreams. The value must be in "hostname[:port]" format.
items:
type: string
type: array
x-kubernetes-list-type: atomic
internalRegistryHostname:
- description: internalRegistryHostname sets the hostname for the default
- internal image registry. The value must be in "hostname[:port]"
- format. This value is set by the image registry operator which controls
- the internal registry hostname.
+ description: |-
+ internalRegistryHostname sets the hostname for the default internal image
+ registry. The value must be in "hostname[:port]" format.
+ This value is set by the image registry operator which controls the internal registry
+ hostname.
type: string
type: object
required:
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-DevPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-DevPreviewNoUpgrade.crd.yaml
index dcd2e2f8e3..89ad329c74 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-DevPreviewNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-DevPreviewNoUpgrade.crd.yaml
@@ -21,24 +21,30 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Image governs policies related to imagestream imports and runtime
- configuration for external registries. It allows cluster admins to configure
- which registries OpenShift is allowed to import images from, extra CA trust
- bundles for external registries, and policies to block or allow registry
- hostnames. When exposing OpenShift's image registry to the public, this
- also lets cluster admins specify the external hostname. \n Compatibility
- level 1: Stable within a major release for a minimum of 12 months or 3 minor
- releases (whichever is longer)."
+ description: |-
+ Image governs policies related to imagestream imports and runtime configuration
+ for external registries. It allows cluster admins to configure which registries
+ OpenShift is allowed to import images from, extra CA trust bundles for external
+ registries, and policies to block or allow registry hostnames.
+ When exposing OpenShift's image registry to the public, this also lets cluster
+ admins specify the external hostname.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -46,9 +52,10 @@ spec:
description: spec holds user settable values for configuration
properties:
additionalTrustedCA:
- description: additionalTrustedCA is a reference to a ConfigMap containing
- additional CAs that should be trusted during imagestream import,
- pod image pull, build image pull, and imageregistry pullthrough.
+ description: |-
+ additionalTrustedCA is a reference to a ConfigMap containing additional CAs that
+ should be trusted during imagestream import, pod image pull, build image pull, and
+ imageregistry pullthrough.
The namespace for this config map is openshift-config.
properties:
name:
@@ -59,93 +66,90 @@ spec:
- name
type: object
allowedRegistriesForImport:
- description: allowedRegistriesForImport limits the container image
- registries that normal users may import images from. Set this list
- to the registries that you trust to contain valid Docker images
- and that you want applications to be able to import from. Users
- with permission to create Images or ImageStreamMappings via the
- API are not affected by this policy - typically only administrators
- or system integrations will have those permissions.
+ description: |-
+ allowedRegistriesForImport limits the container image registries that normal users may import
+ images from. Set this list to the registries that you trust to contain valid Docker
+ images and that you want applications to be able to import from. Users with
+ permission to create Images or ImageStreamMappings via the API are not affected by
+ this policy - typically only administrators or system integrations will have those
+ permissions.
items:
- description: RegistryLocation contains a location of the registry
- specified by the registry domain name. The domain name might include
- wildcards, like '*' or '??'.
+ description: |-
+ RegistryLocation contains a location of the registry specified by the registry domain
+ name. The domain name might include wildcards, like '*' or '??'.
properties:
domainName:
- description: domainName specifies a domain name for the registry
- In case the registry use non-standard (80 or 443) port, the
- port should be included in the domain name as well.
+ description: |-
+ domainName specifies a domain name for the registry
+ In case the registry use non-standard (80 or 443) port, the port should be included
+ in the domain name as well.
type: string
insecure:
- description: insecure indicates whether the registry is secure
- (https) or insecure (http) By default (if not specified) the
- registry is assumed as secure.
+ description: |-
+ insecure indicates whether the registry is secure (https) or insecure (http)
+ By default (if not specified) the registry is assumed as secure.
type: boolean
type: object
type: array
x-kubernetes-list-type: atomic
externalRegistryHostnames:
- description: externalRegistryHostnames provides the hostnames for
- the default external image registry. The external hostname should
- be set only when the image registry is exposed externally. The first
- value is used in 'publicDockerImageRepository' field in ImageStreams.
- The value must be in "hostname[:port]" format.
+ description: |-
+ externalRegistryHostnames provides the hostnames for the default external image
+ registry. The external hostname should be set only when the image registry
+ is exposed externally. The first value is used in 'publicDockerImageRepository'
+ field in ImageStreams. The value must be in "hostname[:port]" format.
items:
type: string
type: array
x-kubernetes-list-type: atomic
imageStreamImportMode:
- description: 'imageStreamImportMode controls the import mode behaviour
- of imagestreams. It can be set to `Legacy` or `PreserveOriginal`
- or the empty string. If this value is specified, this setting is
- applied to all newly created imagestreams which do not have the
- value set. `Legacy` indicates that the legacy behaviour should be
- used. For manifest lists, the legacy behaviour will discard the
- manifest list and import a single sub-manifest. In this case, the
- platform is chosen in the following order of priority: 1. tag annotations;
- 2. control plane arch/os; 3. linux/amd64; 4. the first manifest
- in the list. `PreserveOriginal` indicates that the original manifest
- will be preserved. For manifest lists, the manifest list and all
- its sub-manifests will be imported. When empty, the behaviour will
- be decided based on the payload type advertised by the ClusterVersion
- status, i.e single arch payload implies the import mode is Legacy
- and multi payload implies PreserveOriginal.'
+ description: |-
+ imageStreamImportMode controls the import mode behaviour of imagestreams.
+ It can be set to `Legacy` or `PreserveOriginal` or the empty string. If this value
+ is specified, this setting is applied to all newly created imagestreams which do not have the
+ value set. `Legacy` indicates that the legacy behaviour should be used.
+ For manifest lists, the legacy behaviour will discard the manifest list and import a single
+ sub-manifest. In this case, the platform is chosen in the following order of priority:
+ 1. tag annotations; 2. control plane arch/os; 3. linux/amd64; 4. the first manifest in the list.
+ `PreserveOriginal` indicates that the original manifest will be preserved. For manifest lists,
+ the manifest list and all its sub-manifests will be imported. When empty, the behaviour will be
+ decided based on the payload type advertised by the ClusterVersion status, i.e single arch payload
+ implies the import mode is Legacy and multi payload implies PreserveOriginal.
enum:
- ""
- Legacy
- PreserveOriginal
type: string
registrySources:
- description: registrySources contains configuration that determines
- how the container runtime should treat individual registries when
- accessing images for builds+pods. (e.g. whether or not to allow
- insecure access). It does not contain configuration for the internal
- cluster registry.
+ description: |-
+ registrySources contains configuration that determines how the container runtime
+ should treat individual registries when accessing images for builds+pods. (e.g.
+ whether or not to allow insecure access). It does not contain configuration for the
+ internal cluster registry.
properties:
allowedRegistries:
- description: "allowedRegistries are the only registries permitted
- for image pull and push actions. All other registries are denied.
- \n Only one of BlockedRegistries or AllowedRegistries may be
- set."
+ description: |-
+ allowedRegistries are the only registries permitted for image pull and push actions. All other registries are denied.
+
+ Only one of BlockedRegistries or AllowedRegistries may be set.
items:
type: string
type: array
x-kubernetes-list-type: atomic
blockedRegistries:
- description: "blockedRegistries cannot be used for image pull
- and push actions. All other registries are permitted. \n Only
- one of BlockedRegistries or AllowedRegistries may be set."
+ description: |-
+ blockedRegistries cannot be used for image pull and push actions. All other registries are permitted.
+
+ Only one of BlockedRegistries or AllowedRegistries may be set.
items:
type: string
type: array
x-kubernetes-list-type: atomic
containerRuntimeSearchRegistries:
- description: 'containerRuntimeSearchRegistries are registries
- that will be searched when pulling images that do not have fully
- qualified domains in their pull specs. Registries will be searched
- in the order provided in the list. Note: this search list only
- works with the container runtime, i.e CRI-O. Will NOT work with
- builds or imagestream imports.'
+ description: |-
+ containerRuntimeSearchRegistries are registries that will be searched when pulling images that do not have fully qualified
+ domains in their pull specs. Registries will be searched in the order provided in the list.
+ Note: this search list only works with the container runtime, i.e CRI-O. Will NOT work with builds or imagestream imports.
format: hostname
items:
type: string
@@ -166,40 +170,38 @@ spec:
be overridden.
properties:
externalRegistryHostnames:
- description: externalRegistryHostnames provides the hostnames for
- the default external image registry. The external hostname should
- be set only when the image registry is exposed externally. The first
- value is used in 'publicDockerImageRepository' field in ImageStreams.
- The value must be in "hostname[:port]" format.
+ description: |-
+ externalRegistryHostnames provides the hostnames for the default external image
+ registry. The external hostname should be set only when the image registry
+ is exposed externally. The first value is used in 'publicDockerImageRepository'
+ field in ImageStreams. The value must be in "hostname[:port]" format.
items:
type: string
type: array
x-kubernetes-list-type: atomic
imageStreamImportMode:
- description: 'imageStreamImportMode controls the import mode behaviour
- of imagestreams. It can be `Legacy` or `PreserveOriginal`. `Legacy`
- indicates that the legacy behaviour should be used. For manifest
- lists, the legacy behaviour will discard the manifest list and import
- a single sub-manifest. In this case, the platform is chosen in the
- following order of priority: 1. tag annotations; 2. control plane
- arch/os; 3. linux/amd64; 4. the first manifest in the list. `PreserveOriginal`
- indicates that the original manifest will be preserved. For manifest
- lists, the manifest list and all its sub-manifests will be imported.
- This value will be reconciled based on either the spec value or
- if no spec value is specified, the image registry operator would
- look at the ClusterVersion status to determine the payload type
- and set the import mode accordingly, i.e single arch payload implies
- the import mode is Legacy and multi payload implies PreserveOriginal.'
+ description: |-
+ imageStreamImportMode controls the import mode behaviour of imagestreams. It can be
+ `Legacy` or `PreserveOriginal`. `Legacy` indicates that the legacy behaviour should be used.
+ For manifest lists, the legacy behaviour will discard the manifest list and import a single
+ sub-manifest. In this case, the platform is chosen in the following order of priority:
+ 1. tag annotations; 2. control plane arch/os; 3. linux/amd64; 4. the first manifest in the list.
+ `PreserveOriginal` indicates that the original manifest will be preserved. For manifest lists,
+ the manifest list and all its sub-manifests will be imported. This value will be reconciled based
+ on either the spec value or if no spec value is specified, the image registry operator would look
+ at the ClusterVersion status to determine the payload type and set the import mode accordingly,
+ i.e single arch payload implies the import mode is Legacy and multi payload implies PreserveOriginal.
enum:
- ""
- Legacy
- PreserveOriginal
type: string
internalRegistryHostname:
- description: internalRegistryHostname sets the hostname for the default
- internal image registry. The value must be in "hostname[:port]"
- format. This value is set by the image registry operator which controls
- the internal registry hostname.
+ description: |-
+ internalRegistryHostname sets the hostname for the default internal image
+ registry. The value must be in "hostname[:port]" format.
+ This value is set by the image registry operator which controls the internal registry
+ hostname.
type: string
type: object
required:
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-TechPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-TechPreviewNoUpgrade.crd.yaml
index a733a86f0f..66bebe4aa7 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-TechPreviewNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-TechPreviewNoUpgrade.crd.yaml
@@ -21,24 +21,30 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Image governs policies related to imagestream imports and runtime
- configuration for external registries. It allows cluster admins to configure
- which registries OpenShift is allowed to import images from, extra CA trust
- bundles for external registries, and policies to block or allow registry
- hostnames. When exposing OpenShift's image registry to the public, this
- also lets cluster admins specify the external hostname. \n Compatibility
- level 1: Stable within a major release for a minimum of 12 months or 3 minor
- releases (whichever is longer)."
+ description: |-
+ Image governs policies related to imagestream imports and runtime configuration
+ for external registries. It allows cluster admins to configure which registries
+ OpenShift is allowed to import images from, extra CA trust bundles for external
+ registries, and policies to block or allow registry hostnames.
+ When exposing OpenShift's image registry to the public, this also lets cluster
+ admins specify the external hostname.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -46,9 +52,10 @@ spec:
description: spec holds user settable values for configuration
properties:
additionalTrustedCA:
- description: additionalTrustedCA is a reference to a ConfigMap containing
- additional CAs that should be trusted during imagestream import,
- pod image pull, build image pull, and imageregistry pullthrough.
+ description: |-
+ additionalTrustedCA is a reference to a ConfigMap containing additional CAs that
+ should be trusted during imagestream import, pod image pull, build image pull, and
+ imageregistry pullthrough.
The namespace for this config map is openshift-config.
properties:
name:
@@ -59,93 +66,90 @@ spec:
- name
type: object
allowedRegistriesForImport:
- description: allowedRegistriesForImport limits the container image
- registries that normal users may import images from. Set this list
- to the registries that you trust to contain valid Docker images
- and that you want applications to be able to import from. Users
- with permission to create Images or ImageStreamMappings via the
- API are not affected by this policy - typically only administrators
- or system integrations will have those permissions.
+ description: |-
+ allowedRegistriesForImport limits the container image registries that normal users may import
+ images from. Set this list to the registries that you trust to contain valid Docker
+ images and that you want applications to be able to import from. Users with
+ permission to create Images or ImageStreamMappings via the API are not affected by
+ this policy - typically only administrators or system integrations will have those
+ permissions.
items:
- description: RegistryLocation contains a location of the registry
- specified by the registry domain name. The domain name might include
- wildcards, like '*' or '??'.
+ description: |-
+ RegistryLocation contains a location of the registry specified by the registry domain
+ name. The domain name might include wildcards, like '*' or '??'.
properties:
domainName:
- description: domainName specifies a domain name for the registry
- In case the registry use non-standard (80 or 443) port, the
- port should be included in the domain name as well.
+ description: |-
+ domainName specifies a domain name for the registry
+ In case the registry use non-standard (80 or 443) port, the port should be included
+ in the domain name as well.
type: string
insecure:
- description: insecure indicates whether the registry is secure
- (https) or insecure (http) By default (if not specified) the
- registry is assumed as secure.
+ description: |-
+ insecure indicates whether the registry is secure (https) or insecure (http)
+ By default (if not specified) the registry is assumed as secure.
type: boolean
type: object
type: array
x-kubernetes-list-type: atomic
externalRegistryHostnames:
- description: externalRegistryHostnames provides the hostnames for
- the default external image registry. The external hostname should
- be set only when the image registry is exposed externally. The first
- value is used in 'publicDockerImageRepository' field in ImageStreams.
- The value must be in "hostname[:port]" format.
+ description: |-
+ externalRegistryHostnames provides the hostnames for the default external image
+ registry. The external hostname should be set only when the image registry
+ is exposed externally. The first value is used in 'publicDockerImageRepository'
+ field in ImageStreams. The value must be in "hostname[:port]" format.
items:
type: string
type: array
x-kubernetes-list-type: atomic
imageStreamImportMode:
- description: 'imageStreamImportMode controls the import mode behaviour
- of imagestreams. It can be set to `Legacy` or `PreserveOriginal`
- or the empty string. If this value is specified, this setting is
- applied to all newly created imagestreams which do not have the
- value set. `Legacy` indicates that the legacy behaviour should be
- used. For manifest lists, the legacy behaviour will discard the
- manifest list and import a single sub-manifest. In this case, the
- platform is chosen in the following order of priority: 1. tag annotations;
- 2. control plane arch/os; 3. linux/amd64; 4. the first manifest
- in the list. `PreserveOriginal` indicates that the original manifest
- will be preserved. For manifest lists, the manifest list and all
- its sub-manifests will be imported. When empty, the behaviour will
- be decided based on the payload type advertised by the ClusterVersion
- status, i.e single arch payload implies the import mode is Legacy
- and multi payload implies PreserveOriginal.'
+ description: |-
+ imageStreamImportMode controls the import mode behaviour of imagestreams.
+ It can be set to `Legacy` or `PreserveOriginal` or the empty string. If this value
+ is specified, this setting is applied to all newly created imagestreams which do not have the
+ value set. `Legacy` indicates that the legacy behaviour should be used.
+ For manifest lists, the legacy behaviour will discard the manifest list and import a single
+ sub-manifest. In this case, the platform is chosen in the following order of priority:
+ 1. tag annotations; 2. control plane arch/os; 3. linux/amd64; 4. the first manifest in the list.
+ `PreserveOriginal` indicates that the original manifest will be preserved. For manifest lists,
+ the manifest list and all its sub-manifests will be imported. When empty, the behaviour will be
+ decided based on the payload type advertised by the ClusterVersion status, i.e single arch payload
+ implies the import mode is Legacy and multi payload implies PreserveOriginal.
enum:
- ""
- Legacy
- PreserveOriginal
type: string
registrySources:
- description: registrySources contains configuration that determines
- how the container runtime should treat individual registries when
- accessing images for builds+pods. (e.g. whether or not to allow
- insecure access). It does not contain configuration for the internal
- cluster registry.
+ description: |-
+ registrySources contains configuration that determines how the container runtime
+ should treat individual registries when accessing images for builds+pods. (e.g.
+ whether or not to allow insecure access). It does not contain configuration for the
+ internal cluster registry.
properties:
allowedRegistries:
- description: "allowedRegistries are the only registries permitted
- for image pull and push actions. All other registries are denied.
- \n Only one of BlockedRegistries or AllowedRegistries may be
- set."
+ description: |-
+ allowedRegistries are the only registries permitted for image pull and push actions. All other registries are denied.
+
+ Only one of BlockedRegistries or AllowedRegistries may be set.
items:
type: string
type: array
x-kubernetes-list-type: atomic
blockedRegistries:
- description: "blockedRegistries cannot be used for image pull
- and push actions. All other registries are permitted. \n Only
- one of BlockedRegistries or AllowedRegistries may be set."
+ description: |-
+ blockedRegistries cannot be used for image pull and push actions. All other registries are permitted.
+
+ Only one of BlockedRegistries or AllowedRegistries may be set.
items:
type: string
type: array
x-kubernetes-list-type: atomic
containerRuntimeSearchRegistries:
- description: 'containerRuntimeSearchRegistries are registries
- that will be searched when pulling images that do not have fully
- qualified domains in their pull specs. Registries will be searched
- in the order provided in the list. Note: this search list only
- works with the container runtime, i.e CRI-O. Will NOT work with
- builds or imagestream imports.'
+ description: |-
+ containerRuntimeSearchRegistries are registries that will be searched when pulling images that do not have fully qualified
+ domains in their pull specs. Registries will be searched in the order provided in the list.
+ Note: this search list only works with the container runtime, i.e CRI-O. Will NOT work with builds or imagestream imports.
format: hostname
items:
type: string
@@ -166,40 +170,38 @@ spec:
be overridden.
properties:
externalRegistryHostnames:
- description: externalRegistryHostnames provides the hostnames for
- the default external image registry. The external hostname should
- be set only when the image registry is exposed externally. The first
- value is used in 'publicDockerImageRepository' field in ImageStreams.
- The value must be in "hostname[:port]" format.
+ description: |-
+ externalRegistryHostnames provides the hostnames for the default external image
+ registry. The external hostname should be set only when the image registry
+ is exposed externally. The first value is used in 'publicDockerImageRepository'
+ field in ImageStreams. The value must be in "hostname[:port]" format.
items:
type: string
type: array
x-kubernetes-list-type: atomic
imageStreamImportMode:
- description: 'imageStreamImportMode controls the import mode behaviour
- of imagestreams. It can be `Legacy` or `PreserveOriginal`. `Legacy`
- indicates that the legacy behaviour should be used. For manifest
- lists, the legacy behaviour will discard the manifest list and import
- a single sub-manifest. In this case, the platform is chosen in the
- following order of priority: 1. tag annotations; 2. control plane
- arch/os; 3. linux/amd64; 4. the first manifest in the list. `PreserveOriginal`
- indicates that the original manifest will be preserved. For manifest
- lists, the manifest list and all its sub-manifests will be imported.
- This value will be reconciled based on either the spec value or
- if no spec value is specified, the image registry operator would
- look at the ClusterVersion status to determine the payload type
- and set the import mode accordingly, i.e single arch payload implies
- the import mode is Legacy and multi payload implies PreserveOriginal.'
+ description: |-
+ imageStreamImportMode controls the import mode behaviour of imagestreams. It can be
+ `Legacy` or `PreserveOriginal`. `Legacy` indicates that the legacy behaviour should be used.
+ For manifest lists, the legacy behaviour will discard the manifest list and import a single
+ sub-manifest. In this case, the platform is chosen in the following order of priority:
+ 1. tag annotations; 2. control plane arch/os; 3. linux/amd64; 4. the first manifest in the list.
+ `PreserveOriginal` indicates that the original manifest will be preserved. For manifest lists,
+ the manifest list and all its sub-manifests will be imported. This value will be reconciled based
+ on either the spec value or if no spec value is specified, the image registry operator would look
+ at the ClusterVersion status to determine the payload type and set the import mode accordingly,
+ i.e single arch payload implies the import mode is Legacy and multi payload implies PreserveOriginal.
enum:
- ""
- Legacy
- PreserveOriginal
type: string
internalRegistryHostname:
- description: internalRegistryHostname sets the hostname for the default
- internal image registry. The value must be in "hostname[:port]"
- format. This value is set by the image registry operator which controls
- the internal registry hostname.
+ description: |-
+ internalRegistryHostname sets the hostname for the default internal image
+ registry. The value must be in "hostname[:port]" format.
+ This value is set by the image registry operator which controls the internal registry
+ hostname.
type: string
type: object
required:
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagetagmirrorsets.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagetagmirrorsets.crd.yaml
index 6115cc0ee6..5593c3d953 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagetagmirrorsets.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagetagmirrorsets.crd.yaml
@@ -22,21 +22,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "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 Compatibility level 1: Stable within a major release for a minimum of
- 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ 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.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -44,87 +49,84 @@ spec:
description: spec holds user settable values for configuration
properties:
imageTagMirrors:
- description: "imageTagMirrors allows images referenced by image tags
- in pods to be pulled from alternative mirrored repository locations.
- The image pull specification provided to the pod will be compared
- to the source locations described in imageTagMirrors and the image
- may be pulled down from any of the mirrors in the list instead of
- the specified repository allowing administrators to choose a potentially
- faster mirror. To use mirrors to pull images using digest specification
- only, users should configure a list of mirrors using \"ImageDigestMirrorSet\"
- CRD. \n If the image pull specification matches the repository of
- \"source\" in multiple imagetagmirrorset objects, only the objects
- which define the most specific namespace match will be used. For
- example, if there are objects using quay.io/libpod and quay.io/libpod/busybox
- as the \"source\", only the objects using quay.io/libpod/busybox
- are going to apply for pull specification quay.io/libpod/busybox.
- Each “source” repository is treated independently; configurations
- for different “source” repositories don’t interact. \n If the \"mirrors\"
- is not specified, the image will continue to be pulled from the
- specified repository in the pull spec. \n When multiple policies
- are defined for the same “source” repository, the sets of defined
- mirrors will be merged together, preserving the relative order of
- the mirrors, if possible. For example, if policy A has mirrors `a,
- b, c` and policy B has mirrors `c, d, e`, the mirrors will be used
- in the order `a, b, c, d, e`. If the orders of mirror entries conflict
- (e.g. `a, b` vs. `b, a`) the configuration is not rejected but the
- resulting order is unspecified. Users who want to use a deterministic
- order of mirrors, should configure them into one list of mirrors
- using the expected order."
+ description: |-
+ imageTagMirrors allows images referenced by image tags in pods to be
+ pulled from alternative mirrored repository locations. The image pull specification
+ provided to the pod will be compared to the source locations described in imageTagMirrors
+ and the image may be pulled down from any of the mirrors in the list instead of the
+ specified repository allowing administrators to choose a potentially faster mirror.
+ To use mirrors to pull images using digest specification only, users should configure
+ a list of mirrors using "ImageDigestMirrorSet" CRD.
+
+ If the image pull specification matches the repository of "source" in multiple imagetagmirrorset objects,
+ only the objects which define the most specific namespace match will be used.
+ For example, if there are objects using quay.io/libpod and quay.io/libpod/busybox as
+ the "source", only the objects using quay.io/libpod/busybox are going to apply
+ for pull specification quay.io/libpod/busybox.
+ Each “source” repository is treated independently; configurations for different “source”
+ repositories don’t interact.
+
+ If the "mirrors" is not specified, the image will continue to be pulled from the specified
+ repository in the pull spec.
+
+ When multiple policies are defined for the same “source” repository, the sets of defined
+ mirrors will be merged together, preserving the relative order of the mirrors, if possible.
+ For example, if policy A has mirrors `a, b, c` and policy B has mirrors `c, d, e`, the
+ mirrors will be used in the order `a, b, c, d, e`. If the orders of mirror entries conflict
+ (e.g. `a, b` vs. `b, a`) the configuration is not rejected but the resulting order is unspecified.
+ Users who want to use a deterministic order of mirrors, should configure them into one list of mirrors using the expected order.
items:
description: ImageTagMirrors holds cluster-wide information about
how to handle mirrors in the registries config.
properties:
mirrorSourcePolicy:
- description: mirrorSourcePolicy defines the fallback policy
- if fails to pull image from the mirrors. If unset, the image
- will continue to be pulled from the repository in the pull
- spec. sourcePolicy is valid configuration only when one or
- more mirrors are in the mirror list.
+ description: |-
+ mirrorSourcePolicy defines the fallback policy if fails to pull image from the mirrors.
+ If unset, the image will continue to be pulled from the repository in the pull spec.
+ sourcePolicy is valid configuration only when one or more mirrors are in the mirror list.
enum:
- NeverContactSource
- AllowContactingSource
type: string
mirrors:
- description: 'mirrors is zero or more locations that may also
- contain the same images. No mirror will be configured if not
- specified. Images can be pulled from these mirrors only if
- they are referenced by their tags. The mirrored location is
- obtained by replacing the part of the input reference that
- matches source by the mirrors entry, e.g. for registry.redhat.io/product/repo
- reference, a (source, mirror) pair *.redhat.io, mirror.local/redhat
- causes a mirror.local/redhat/product/repo repository to be
- used. Pulling images by tag can potentially yield different
- images, depending on which endpoint we pull from. Configuring
- a list of mirrors using "ImageDigestMirrorSet" CRD and forcing
- digest-pulls for mirrors avoids that issue. The order of mirrors
- in this list is treated as the user''s desired priority, while
- source is by default considered lower priority than all mirrors.
- If no mirror is specified or all image pulls from the mirror
- list fail, the image will continue to be pulled from the repository
- in the pull spec unless explicitly prohibited by "mirrorSourcePolicy".
- Other cluster configuration, including (but not limited to)
- other imageTagMirrors objects, may impact the exact order
- mirrors are contacted in, or some mirrors may be contacted
- in parallel, so this should be considered a preference rather
- than a guarantee of ordering. "mirrors" uses one of the following
- formats: host[:port] host[:port]/namespace[/namespace…] host[:port]/namespace[/namespace…]/repo
- for more information about the format, see the document about
- the location field: https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table'
+ description: |-
+ mirrors is zero or more locations that may also contain the same images. No mirror will be configured if not specified.
+ Images can be pulled from these mirrors only if they are referenced by their tags.
+ The mirrored location is obtained by replacing the part of the input reference that
+ matches source by the mirrors entry, e.g. for registry.redhat.io/product/repo reference,
+ a (source, mirror) pair *.redhat.io, mirror.local/redhat causes a mirror.local/redhat/product/repo
+ repository to be used.
+ Pulling images by tag can potentially yield different images, depending on which endpoint we pull from.
+ Configuring a list of mirrors using "ImageDigestMirrorSet" CRD and forcing digest-pulls for mirrors avoids that issue.
+ The order of mirrors in this list is treated as the user's desired priority, while source
+ is by default considered lower priority than all mirrors.
+ If no mirror is specified or all image pulls from the mirror list fail, the image will continue to be
+ pulled from the repository in the pull spec unless explicitly prohibited by "mirrorSourcePolicy".
+ Other cluster configuration, including (but not limited to) other imageTagMirrors objects,
+ may impact the exact order mirrors are contacted in, or some mirrors may be contacted
+ in parallel, so this should be considered a preference rather than a guarantee of ordering.
+ "mirrors" uses one of the following formats:
+ host[:port]
+ host[:port]/namespace[/namespace…]
+ host[:port]/namespace[/namespace…]/repo
+ for more information about the format, see the document about the location field:
+ https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table
items:
pattern: ^((?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?)(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?$
type: string
type: array
x-kubernetes-list-type: set
source:
- description: 'source matches the repository that users refer
- to, e.g. in image pull specifications. Setting source to a
- registry hostname e.g. docker.io. quay.io, or registry.redhat.io,
- will match the image pull specification of corressponding
- registry. "source" uses one of the following formats: host[:port]
- host[:port]/namespace[/namespace…] host[:port]/namespace[/namespace…]/repo
- [*.]host for more information about the format, see the document
- about the location field: https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table'
+ description: |-
+ source matches the repository that users refer to, e.g. in image pull specifications. Setting source to a registry hostname
+ e.g. docker.io. quay.io, or registry.redhat.io, will match the image pull specification of corressponding registry.
+ "source" uses one of the following formats:
+ host[:port]
+ host[:port]/namespace[/namespace…]
+ host[:port]/namespace[/namespace…]/repo
+ [*.]host
+ for more information about the format, see the document about the location field:
+ https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#choosing-a-registry-toml-table
pattern: ^\*(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+$|^((?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?)(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?$
type: string
required:
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml
index c275154261..bf63cb5d96 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml
@@ -21,20 +21,25 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Infrastructure holds cluster-wide information about Infrastructure.
- \ The canonical name is `cluster` \n Compatibility level 1: Stable within
- a major release for a minimum of 12 months or 3 minor releases (whichever
- is longer)."
+ description: |-
+ Infrastructure holds cluster-wide information about Infrastructure. The canonical name is `cluster`
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,19 +47,19 @@ spec:
description: spec holds user settable values for configuration
properties:
cloudConfig:
- description: "cloudConfig is a reference to a ConfigMap containing
- the cloud provider configuration file. This configuration file is
- used to configure the Kubernetes cloud provider integration when
- using the built-in cloud provider integration or the external cloud
- controller manager. The namespace for this config map is openshift-config.
- \n cloudConfig should only be consumed by the kube_cloud_config
- controller. The controller is responsible for using the user configuration
- in the spec for various platforms and combining that with the user
- provided ConfigMap in this field to create a stitched kube cloud
- config. The controller generates a ConfigMap `kube-cloud-config`
- in `openshift-config-managed` namespace with the kube cloud config
- is stored in `cloud.conf` key. All the clients are expected to use
- the generated ConfigMap only."
+ description: |-
+ cloudConfig is a reference to a ConfigMap containing the cloud provider configuration file.
+ This configuration file is used to configure the Kubernetes cloud provider integration
+ when using the built-in cloud provider integration or the external cloud controller manager.
+ The namespace for this config map is openshift-config.
+
+ cloudConfig should only be consumed by the kube_cloud_config controller.
+ The controller is responsible for using the user configuration in the spec
+ for various platforms and combining that with the user provided ConfigMap in this field
+ to create a stitched kube cloud config.
+ The controller generates a ConfigMap `kube-cloud-config` in `openshift-config-managed` namespace
+ with the kube cloud config is stored in `cloud.conf` key.
+ All the clients are expected to use the generated ConfigMap only.
properties:
key:
description: Key allows pointing to a specific key/value inside
@@ -64,8 +69,9 @@ spec:
type: string
type: object
platformSpec:
- description: platformSpec holds desired information specific to the
- underlying infrastructure provider.
+ description: |-
+ platformSpec holds desired information specific to the underlying
+ infrastructure provider.
properties:
alibabaCloud:
description: AlibabaCloud contains settings specific to the Alibaba
@@ -76,24 +82,27 @@ spec:
Services infrastructure provider.
properties:
serviceEndpoints:
- description: serviceEndpoints list contains custom endpoints
- which will override default service endpoint of AWS Services.
+ description: |-
+ serviceEndpoints list contains custom endpoints which will override default
+ service endpoint of AWS Services.
There must be only one ServiceEndpoint for a service.
items:
- description: AWSServiceEndpoint store the configuration
- of a custom url to override existing defaults of AWS Services.
+ description: |-
+ AWSServiceEndpoint store the configuration of a custom url to
+ override existing defaults of AWS Services.
properties:
name:
- description: name is the name of the AWS service. The
- list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
+ description: |-
+ name is the name of the AWS service.
+ The list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
pattern: ^https://
type: string
type: object
@@ -109,17 +118,16 @@ spec:
platform.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -138,15 +146,15 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -165,10 +173,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -194,17 +202,15 @@ spec:
Metal infrastructure provider.
type: object
external:
- description: ExternalPlatformType represents generic infrastructure
- provider. Platform-specific components should be supplemented
- separately.
+ description: |-
+ ExternalPlatformType represents generic infrastructure provider.
+ Platform-specific components should be supplemented separately.
properties:
platformName:
default: Unknown
- description: PlatformName holds the arbitrary string representing
- the infrastructure provider name, expected to be set at
- the installation time. This field is solely for informational
- and reporting purposes and is not expected to be used for
- decision-making.
+ description: |-
+ PlatformName holds the arbitrary string representing the infrastructure provider name, expected to be set at the installation time.
+ This field is solely for informational and reporting purposes and is not expected to be used for decision-making.
type: string
x-kubernetes-validations:
- message: platform name cannot be changed once set
@@ -227,20 +233,19 @@ spec:
infrastructure provider.
properties:
failureDomains:
- description: failureDomains configures failure domains information
- for the Nutanix platform. When set, the failure domains
- defined here may be used to spread Machines across prism
- element clusters to improve fault tolerance of the cluster.
+ description: |-
+ failureDomains configures failure domains information for the Nutanix platform.
+ When set, the failure domains defined here may be used to spread Machines across
+ prism element clusters to improve fault tolerance of the cluster.
items:
description: NutanixFailureDomain configures failure domain
information for the Nutanix platform.
properties:
cluster:
- description: cluster is to identify the cluster (the
- Prism Element under management of the Prism Central),
- in which the Machine's VM will be created. The cluster
- identifier (uuid or name) can be obtained from the
- Prism Central console or using the prism_central API.
+ description: |-
+ cluster is to identify the cluster (the Prism Element under management of the Prism Central),
+ in which the Machine's VM will be created. The cluster identifier (uuid or name) can be obtained
+ from the Prism Central console or using the prism_central API.
properties:
name:
description: name is the resource name in the PC.
@@ -270,23 +275,21 @@ spec:
rule: 'has(self.type) && self.type == ''Name'' ? has(self.name)
: !has(self.name)'
name:
- description: name defines the unique name of a failure
- domain. Name is required and must be at most 64 characters
- in length. It must consist of only lower case alphanumeric
- characters and hyphens (-). It must start and end
- with an alphanumeric character. This value is arbitrary
- and is used to identify the failure domain within
- the platform.
+ description: |-
+ name defines the unique name of a failure domain.
+ Name is required and must be at most 64 characters in length.
+ It must consist of only lower case alphanumeric characters and hyphens (-).
+ It must start and end with an alphanumeric character.
+ This value is arbitrary and is used to identify the failure domain within the platform.
maxLength: 64
minLength: 1
pattern: '[a-z0-9]([-a-z0-9]*[a-z0-9])?'
type: string
subnets:
- description: subnets holds a list of identifiers (one
- or more) of the cluster's network subnets for the
- Machine's VM to connect to. The subnet identifiers
- (uuid or name) can be obtained from the Prism Central
- console or using the prism_central API.
+ description: |-
+ subnets holds a list of identifiers (one or more) of the cluster's network subnets
+ for the Machine's VM to connect to. The subnet identifiers (uuid or name) can be
+ obtained from the Prism Central console or using the prism_central API.
items:
description: NutanixResourceIdentifier holds the identity
of a Nutanix PC resource (cluster, image, subnet,
@@ -336,11 +339,10 @@ spec:
- name
x-kubernetes-list-type: map
prismCentral:
- description: prismCentral holds the endpoint address and port
- to access the Nutanix Prism Central. When a cluster-wide
- proxy is installed, by default, this endpoint will be accessed
- via the proxy. Should you wish for communication with this
- endpoint not to be proxied, please add the endpoint to the
+ description: |-
+ prismCentral holds the endpoint address and port to access the Nutanix Prism Central.
+ When a cluster-wide proxy is installed, by default, this endpoint will be accessed via the proxy.
+ Should you wish for communication with this endpoint not to be proxied, please add the endpoint to the
proxy spec.noProxy list.
properties:
address:
@@ -361,25 +363,22 @@ spec:
- port
type: object
prismElements:
- description: prismElements holds one or more endpoint address
- and port data to access the Nutanix Prism Elements (clusters)
- of the Nutanix Prism Central. Currently we only support
- one Prism Element (cluster) for an OpenShift cluster, where
- all the Nutanix resources (VMs, subnets, volumes, etc.)
- used in the OpenShift cluster are located. In the future,
- we may support Nutanix resources (VMs, etc.) spread over
- multiple Prism Elements (clusters) of the Prism Central.
+ description: |-
+ prismElements holds one or more endpoint address and port data to access the Nutanix
+ Prism Elements (clusters) of the Nutanix Prism Central. Currently we only support one
+ Prism Element (cluster) for an OpenShift cluster, where all the Nutanix resources (VMs, subnets, volumes, etc.)
+ used in the OpenShift cluster are located. In the future, we may support Nutanix resources (VMs, etc.)
+ spread over multiple Prism Elements (clusters) of the Prism Central.
items:
description: NutanixPrismElementEndpoint holds the name
and endpoint data for a Prism Element (cluster)
properties:
endpoint:
- description: endpoint holds the endpoint address and
- port data of the Prism Element (cluster). When a cluster-wide
- proxy is installed, by default, this endpoint will
- be accessed via the proxy. Should you wish for communication
- with this endpoint not to be proxied, please add the
- endpoint to the proxy spec.noProxy list.
+ description: |-
+ endpoint holds the endpoint address and port data of the Prism Element (cluster).
+ When a cluster-wide proxy is installed, by default, this endpoint will be accessed via the proxy.
+ Should you wish for communication with this endpoint not to be proxied, please add the endpoint to the
+ proxy spec.noProxy list.
properties:
address:
description: address is the endpoint address (DNS
@@ -399,10 +398,9 @@ spec:
- port
type: object
name:
- description: name is the name of the Prism Element (cluster).
- This value will correspond with the cluster field
- configured on other resources (eg Machines, PVCs,
- etc).
+ description: |-
+ name is the name of the Prism Element (cluster). This value will correspond with
+ the cluster field configured on other resources (eg Machines, PVCs, etc).
maxLength: 256
type: string
required:
@@ -422,17 +420,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -451,15 +448,15 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -478,10 +475,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -511,26 +508,42 @@ spec:
Systems Virtual Servers infrastructure provider.
properties:
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of a Power
- VS service.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of a Power VS service.
items:
- description: PowervsServiceEndpoint stores the configuration
- of a custom url to override existing defaults of PowerVS
- Services.
+ description: |-
+ PowervsServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of PowerVS Services.
properties:
name:
- description: name is the name of the Power VS service.
- Few of the services are IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
+ description: |-
+ name is the name of the Power VS service.
+ Few of the services are
+ IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
ResourceController - https://cloud.ibm.com/apidocs/resource-controller/resource-controller
Power Cloud - https://cloud.ibm.com/apidocs/power-cloud
- pattern: ^[a-z0-9-]+$
+ enum:
+ - CIS
+ - COS
+ - COSConfig
+ - DNSServices
+ - GlobalCatalog
+ - GlobalSearch
+ - GlobalTagging
+ - HyperProtect
+ - IAM
+ - KeyProtect
+ - Power
+ - ResourceController
+ - ResourceManager
+ - VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
format: uri
pattern: ^https://
type: string
@@ -544,16 +557,15 @@ spec:
x-kubernetes-list-type: map
type: object
type:
- description: 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.
+ description: |-
+ 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.
enum:
- ""
- AWS
@@ -578,17 +590,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -607,24 +618,26 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
failureDomains:
- description: failureDomains contains the definition of region,
- zone and the vCenter topology. If this is omitted failure
- domains (regions and zones) will not be used.
+ description: |-
+ failureDomains contains the definition of region, zone and the vCenter topology.
+ If this is omitted failure domains (regions and zones) will not be used.
items:
- description: VSpherePlatformFailureDomainSpec holds the
- region and zone failure domain and the vCenter topology
- of that failure domain.
+ description: |-
+ VSpherePlatformFailureDomainSpec holds the region and zone failure domain and
+ the vCenter topology of that failure domain.
properties:
name:
- description: name defines the arbitrary but unique name
+ description: |-
+ name defines the arbitrary but unique name
of a failure domain.
maxLength: 256
minLength: 1
type: string
region:
- description: region defines the name of a region tag
- that will be attached to a vCenter datacenter. The
- tag category in vCenter must be named openshift-region.
+ description: |-
+ region defines the name of a region tag that will
+ be attached to a vCenter datacenter. The tag
+ category in vCenter must be named openshift-region.
maxLength: 80
minLength: 1
type: string
@@ -634,7 +647,7 @@ spec:
- format: ipv6
- format: hostname
description: server is the fully-qualified domain name
- or the IP address of the vCenter server. ---
+ or the IP address of the vCenter server.
maxLength: 255
minLength: 1
type: string
@@ -643,45 +656,48 @@ spec:
using vSphere constructs
properties:
computeCluster:
- description: computeCluster the absolute path of
- the vCenter cluster in which virtual machine will
- be located. The absolute path is of the form //host/.
+ description: |-
+ computeCluster the absolute path of the vCenter cluster
+ in which virtual machine will be located.
+ The absolute path is of the form //host/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/host/.*?
type: string
datacenter:
- description: datacenter is the name of vCenter datacenter
- in which virtual machines will be located. The
- maximum length of the datacenter name is 80 characters.
+ description: |-
+ datacenter is the name of vCenter datacenter in which virtual machines will be located.
+ The maximum length of the datacenter name is 80 characters.
maxLength: 80
type: string
datastore:
- description: datastore is the absolute path of the
- datastore in which the virtual machine is located.
+ description: |-
+ datastore is the absolute path of the datastore in which the
+ virtual machine is located.
The absolute path is of the form //datastore/
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/datastore/.*?
type: string
folder:
- description: folder is the absolute path of the
- folder where virtual machines are located. The
- absolute path is of the form //vm/.
+ description: |-
+ folder is the absolute path of the folder where
+ virtual machines are located. The absolute path
+ is of the form //vm/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/vm/.*?
type: string
networks:
- description: 'networks is the list of port group
- network names within this failure domain. If feature
- gate VSphereMultiNetworks is enabled, up to 10
- network adapters may be defined. 10 is the maximum
- number of virtual network devices which may be
- attached to a VM as defined by: https://configmax.esp.vmware.com/guest?vmwareproduct=vSphere&release=vSphere%208.0&categories=1-0
- The available networks (port groups) can be listed
- using `govc ls ''network/*''` Networks should
- be in the form of an absolute path: //network/.'
+ description: |-
+ networks is the list of port group network names within this failure domain.
+ If feature gate VSphereMultiNetworks is enabled, up to 10 network adapters may be defined.
+ 10 is the maximum number of virtual network devices which may be attached to a VM as defined by:
+ https://configmax.esp.vmware.com/guest?vmwareproduct=vSphere&release=vSphere%208.0&categories=1-0
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
+ Networks should be in the form of an absolute path:
+ //network/.
items:
type: string
maxItems: 10
@@ -689,25 +705,24 @@ spec:
type: array
x-kubernetes-list-type: atomic
resourcePool:
- description: resourcePool is the absolute path of
- the resource pool where virtual machines will
- be created. The absolute path is of the form //host//Resources/.
+ description: |-
+ resourcePool is the absolute path of the resource pool where virtual machines will be
+ created. The absolute path is of the form //host//Resources/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/host/.*?/Resources.*
type: string
template:
- description: "template is the full inventory path
- of the virtual machine or template that will be
- cloned when creating new machines in this failure
- domain. The maximum length of the path is 2048
- characters. \n When omitted, the template will
- be calculated by the control plane machineset
- operator based on the region and zone defined
- in VSpherePlatformFailureDomainSpec. For example,
- for zone=zonea, region=region1, and infrastructure
- name=test, the template path would be calculated
- as //vm/test-rhcos-region1-zonea."
+ description: |-
+ template is the full inventory path of the virtual machine or template
+ that will be cloned when creating new machines in this failure domain.
+ The maximum length of the path is 2048 characters.
+
+ When omitted, the template will be calculated by the control plane
+ machineset operator based on the region and zone defined in
+ VSpherePlatformFailureDomainSpec.
+ For example, for zone=zonea, region=region1, and infrastructure name=test,
+ the template path would be calculated as //vm/test-rhcos-region1-zonea.
maxLength: 2048
minLength: 1
pattern: ^/.*?/vm/.*?
@@ -719,9 +734,10 @@ spec:
- networks
type: object
zone:
- description: zone defines the name of a zone tag that
- will be attached to a vCenter cluster. The tag category
- in vCenter must be named openshift-zone.
+ description: |-
+ zone defines the name of a zone tag that will
+ be attached to a vCenter cluster. The tag
+ category in vCenter must be named openshift-zone.
maxLength: 80
minLength: 1
type: string
@@ -737,15 +753,15 @@ spec:
- name
x-kubernetes-list-type: map
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -764,10 +780,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -783,41 +799,39 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeNetworking:
- description: 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.
+ description: |-
+ 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.
properties:
external:
description: external represents the network configuration
of the node that is externally routable.
properties:
excludeNetworkSubnetCidr:
- description: excludeNetworkSubnetCidr IP addresses
- in subnet ranges will be excluded when selecting
- the IP address from the VirtualMachine's VM for
- use in the status.addresses fields. ---
+ description: |-
+ excludeNetworkSubnetCidr IP addresses in subnet ranges will be excluded when selecting
+ the IP address from the VirtualMachine's VM for use in the status.addresses fields.
items:
format: cidr
type: string
type: array
x-kubernetes-list-type: atomic
network:
- description: network VirtualMachine's VM Network names
- that will be used to when searching for status.addresses
- fields. Note that if internal.networkSubnetCIDR
- and external.networkSubnetCIDR are not set, then
- the vNIC associated to this network must only have
- a single IP address assigned to it. The available
- networks (port groups) can be listed using `govc
- ls 'network/*'`
+ description: |-
+ network VirtualMachine's VM Network names that will be used to when searching
+ for status.addresses fields. Note that if internal.networkSubnetCIDR and
+ external.networkSubnetCIDR are not set, then the vNIC associated to this network must
+ only have a single IP address assigned to it.
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
type: string
networkSubnetCidr:
- description: networkSubnetCidr IP address on VirtualMachine's
- network interfaces included in the fields' CIDRs
- that will be used in respective status.addresses
- fields. ---
+ description: |-
+ networkSubnetCidr IP address on VirtualMachine's network interfaces included in the fields' CIDRs
+ that will be used in respective status.addresses fields.
items:
format: cidr
type: string
@@ -829,30 +843,27 @@ spec:
of the node that is routable only within the cluster.
properties:
excludeNetworkSubnetCidr:
- description: excludeNetworkSubnetCidr IP addresses
- in subnet ranges will be excluded when selecting
- the IP address from the VirtualMachine's VM for
- use in the status.addresses fields. ---
+ description: |-
+ excludeNetworkSubnetCidr IP addresses in subnet ranges will be excluded when selecting
+ the IP address from the VirtualMachine's VM for use in the status.addresses fields.
items:
format: cidr
type: string
type: array
x-kubernetes-list-type: atomic
network:
- description: network VirtualMachine's VM Network names
- that will be used to when searching for status.addresses
- fields. Note that if internal.networkSubnetCIDR
- and external.networkSubnetCIDR are not set, then
- the vNIC associated to this network must only have
- a single IP address assigned to it. The available
- networks (port groups) can be listed using `govc
- ls 'network/*'`
+ description: |-
+ network VirtualMachine's VM Network names that will be used to when searching
+ for status.addresses fields. Note that if internal.networkSubnetCIDR and
+ external.networkSubnetCIDR are not set, then the vNIC associated to this network must
+ only have a single IP address assigned to it.
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
type: string
networkSubnetCidr:
- description: networkSubnetCidr IP address on VirtualMachine's
- network interfaces included in the fields' CIDRs
- that will be used in respective status.addresses
- fields. ---
+ description: |-
+ networkSubnetCidr IP address on VirtualMachine's network interfaces included in the fields' CIDRs
+ that will be used in respective status.addresses fields.
items:
format: cidr
type: string
@@ -861,36 +872,38 @@ spec:
type: object
type: object
vcenters:
- description: vcenters holds the connection details for services
- to communicate with vCenter. Currently, only a single vCenter
- is supported, but in tech preview 3 vCenters are supported.
- Once the cluster has been installed, you are unable to change
- the current number of defined vCenters except in the case
- where the cluster has been upgraded from a version of OpenShift
- where the vsphere platform spec was not present. You may
- make modifications to the existing vCenters that are defined
- in the vcenters list in order to match with any added or
- modified failure domains. ---
+ description: |-
+ vcenters holds the connection details for services to communicate with vCenter.
+ Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
+ Once the cluster has been installed, you are unable to change the current number of defined
+ vCenters except in the case where the cluster has been upgraded from a version of OpenShift
+ where the vsphere platform spec was not present. You may make modifications to the existing
+ vCenters that are defined in the vcenters list in order to match with any added or modified
+ failure domains.
items:
- description: VSpherePlatformVCenterSpec stores the vCenter
- connection fields. This is used by the vSphere CCM.
+ description: |-
+ VSpherePlatformVCenterSpec stores the vCenter connection fields.
+ This is used by the vSphere CCM.
properties:
datacenters:
- description: The vCenter Datacenters in which the RHCOS
- vm guests are located. This field will be used by
- the Cloud Controller Manager. Each datacenter listed
- here should be used within a topology.
+ description: |-
+ The vCenter Datacenters in which the RHCOS
+ vm guests are located. This field will
+ be used by the Cloud Controller Manager.
+ Each datacenter listed here should be used within
+ a topology.
items:
type: string
minItems: 1
type: array
x-kubernetes-list-type: set
port:
- description: port is the TCP port that will be used
- to communicate to the vCenter endpoint. When omitted,
- this means the user has no opinion and it is up to
- the platform to choose a sensible default, which is
- subject to change over time.
+ description: |-
+ port is the TCP port that will be used to communicate to
+ the vCenter endpoint.
+ When omitted, this means the user has no opinion and
+ it is up to the platform to choose a sensible default,
+ which is subject to change over time.
format: int32
maximum: 32767
minimum: 1
@@ -901,7 +914,7 @@ spec:
- format: ipv6
- format: hostname
description: server is the fully-qualified domain name
- or the IP address of the vCenter server. ---
+ or the IP address of the vCenter server.
maxLength: 255
type: string
required:
@@ -936,28 +949,27 @@ spec:
be overridden.
properties:
apiServerInternalURI:
- description: apiServerInternalURL is a valid URI with scheme 'https',
- address and optionally a port (defaulting to 443). apiServerInternalURL
- can be used by components like kubelets, to contact the Kubernetes
- API server using the infrastructure provider rather than Kubernetes
- networking.
+ description: |-
+ apiServerInternalURL is a valid URI with scheme 'https',
+ address and optionally a port (defaulting to 443). apiServerInternalURL can be used by components
+ like kubelets, to contact the Kubernetes API server using the
+ infrastructure provider rather than Kubernetes networking.
type: string
apiServerURL:
- description: apiServerURL is a valid URI with scheme 'https', address
- and optionally a port (defaulting to 443). apiServerURL can be
- used by components like the web console to tell users where to find
- the Kubernetes API.
+ description: |-
+ apiServerURL is a valid URI with scheme 'https', address and
+ optionally a port (defaulting to 443). apiServerURL can be used by components like the web console
+ to tell users where to find the Kubernetes API.
type: string
controlPlaneTopology:
default: HighlyAvailable
- description: controlPlaneTopology expresses the expectations for operands
- that normally run on control nodes. The default is 'HighlyAvailable',
- which represents the behavior operators have in a "normal" cluster.
+ description: |-
+ controlPlaneTopology expresses the expectations for operands that normally run on control nodes.
+ The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
The 'SingleReplica' mode will be used in single-node deployments
- and the operators should not configure the operand for highly-available
- operation The 'External' mode indicates that the control plane is
- hosted externally to the cluster and that its components are not
- visible within the cluster.
+ and the operators should not configure the operand for highly-available operation
+ The 'External' mode indicates that the control plane is hosted externally to the cluster and that
+ its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
@@ -965,47 +977,49 @@ spec:
type: string
cpuPartitioning:
default: None
- description: cpuPartitioning expresses if CPU partitioning is a currently
- enabled feature in the cluster. CPU Partitioning means that this
- cluster can support partitioning workloads to specific CPU Sets.
- Valid values are "None" and "AllNodes". When omitted, the default
- value is "None". The default value of "None" indicates that no nodes
- will be setup with CPU partitioning. The "AllNodes" value indicates
- that all nodes have been setup with CPU partitioning, and can then
- be further configured via the PerformanceProfile API.
+ description: |-
+ cpuPartitioning expresses if CPU partitioning is a currently enabled feature in the cluster.
+ CPU Partitioning means that this cluster can support partitioning workloads to specific CPU Sets.
+ Valid values are "None" and "AllNodes". When omitted, the default value is "None".
+ The default value of "None" indicates that no nodes will be setup with CPU partitioning.
+ The "AllNodes" value indicates that all nodes have been setup with CPU partitioning,
+ and can then be further configured via the PerformanceProfile API.
enum:
- None
- AllNodes
type: string
etcdDiscoveryDomain:
- description: 'etcdDiscoveryDomain is the domain used to fetch the
- SRV records for discovering etcd servers and clients. For more info:
- https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery
- deprecated: as of 4.7, this field is no longer set or honored. It
- will be removed in a future release.'
+ description: |-
+ etcdDiscoveryDomain is the domain used to fetch the SRV records for discovering
+ etcd servers and clients.
+ For more info: https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery
+ deprecated: as of 4.7, this field is no longer set or honored. It will be removed in a future release.
type: string
infrastructureName:
- description: infrastructureName uniquely identifies a cluster with
- a human friendly name. Once set it should not be changed. Must be
- of max length 27 and must have only alphanumeric or hyphen characters.
+ description: |-
+ infrastructureName uniquely identifies a cluster with a human friendly name.
+ Once set it should not be changed. Must be of max length 27 and must have only
+ alphanumeric or hyphen characters.
type: string
infrastructureTopology:
default: HighlyAvailable
- description: 'infrastructureTopology expresses the expectations for
- infrastructure services that do not run on control plane nodes,
- usually indicated by a node selector for a `role` value other than
- `master`. The default is ''HighlyAvailable'', which represents the
- behavior operators have in a "normal" cluster. The ''SingleReplica''
- mode will be used in single-node deployments and the operators should
- not configure the operand for highly-available operation NOTE: External
- topology mode is not applicable for this field.'
+ description: |-
+ infrastructureTopology expresses the expectations for infrastructure services that do not run on control
+ plane nodes, usually indicated by a node selector for a `role` value
+ other than `master`.
+ The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
+ The 'SingleReplica' mode will be used in single-node deployments
+ and the operators should not configure the operand for highly-available operation
+ NOTE: External topology mode is not applicable for this field.
enum:
- HighlyAvailable
- SingleReplica
type: string
platform:
- description: "platform is the underlying infrastructure provider for
- the cluster. \n Deprecated: Use platformStatus.type instead."
+ description: |-
+ platform is the underlying infrastructure provider for the cluster.
+
+ Deprecated: Use platformStatus.type instead.
enum:
- ""
- AWS
@@ -1026,8 +1040,9 @@ spec:
- External
type: string
platformStatus:
- description: platformStatus holds status information specific to the
- underlying infrastructure provider.
+ description: |-
+ platformStatus holds status information specific to the underlying
+ infrastructure provider.
properties:
alibabaCloud:
description: AlibabaCloud contains settings specific to the Alibaba
@@ -1076,16 +1091,120 @@ spec:
description: AWS contains settings specific to the Amazon Web
Services infrastructure provider.
properties:
+ cloudLoadBalancerConfig:
+ default:
+ dnsType: PlatformDefault
+ description: |-
+ 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.
+ nullable: true
+ properties:
+ clusterHosted:
+ description: |-
+ clusterHosted holds the IP addresses of API, API-Int and Ingress Load
+ Balancers on Cloud Platforms. The DNS solution hosted within the cluster
+ use these IP addresses to provide resolution for API, API-Int and Ingress
+ services.
+ properties:
+ apiIntLoadBalancerIPs:
+ description: |-
+ apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Entries in the apiIntLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
+ format: ip
+ items:
+ description: IP is an IP address (for example, "10.0.0.0"
+ or "fd00::").
+ maxLength: 39
+ minLength: 1
+ type: string
+ x-kubernetes-validations:
+ - message: value must be a valid IP address
+ rule: isIP(self)
+ maxItems: 16
+ type: array
+ x-kubernetes-list-type: set
+ apiLoadBalancerIPs:
+ description: |-
+ apiLoadBalancerIPs holds Load Balancer IPs for the API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Could be empty for private clusters.
+ Entries in the apiLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
+ format: ip
+ items:
+ description: IP is an IP address (for example, "10.0.0.0"
+ or "fd00::").
+ maxLength: 39
+ minLength: 1
+ type: string
+ x-kubernetes-validations:
+ - message: value must be a valid IP address
+ rule: isIP(self)
+ maxItems: 16
+ type: array
+ x-kubernetes-list-type: set
+ ingressLoadBalancerIPs:
+ description: |-
+ ingressLoadBalancerIPs holds IPs for Ingress Load Balancers.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Entries in the ingressLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
+ format: ip
+ items:
+ description: IP is an IP address (for example, "10.0.0.0"
+ or "fd00::").
+ maxLength: 39
+ minLength: 1
+ type: string
+ x-kubernetes-validations:
+ - message: value must be a valid IP address
+ rule: isIP(self)
+ maxItems: 16
+ type: array
+ x-kubernetes-list-type: set
+ type: object
+ dnsType:
+ default: PlatformDefault
+ description: |-
+ dnsType indicates the type of DNS solution in use within the cluster. Its default value of
+ `PlatformDefault` indicates that the cluster's DNS is the default provided by the cloud platform.
+ It can be set to `ClusterHosted` to bypass the configuration of the cloud default DNS. In this mode,
+ the cluster needs to provide a self-hosted DNS solution for the cluster's installation to succeed.
+ The cluster's use of the cloud's Load Balancers is unaffected by this setting.
+ The value is immutable after it has been set at install time.
+ Currently, there is no way for the customer to add additional DNS entries into the cluster hosted DNS.
+ Enabling this functionality allows the user to start their own DNS solution outside the cluster after
+ installation is complete. The customer would be responsible for configuring this custom DNS solution,
+ and it can be run in addition to the in-cluster DNS solution.
+ enum:
+ - ClusterHosted
+ - PlatformDefault
+ type: string
+ x-kubernetes-validations:
+ - message: dnsType is immutable
+ rule: oldSelf == '' || self == oldSelf
+ type: object
+ x-kubernetes-validations:
+ - message: clusterHosted is permitted only when dnsType is
+ ClusterHosted
+ rule: 'has(self.dnsType) && self.dnsType != ''ClusterHosted''
+ ? !has(self.clusterHosted) : true'
region:
description: region holds the default AWS region for new AWS
resources created by the cluster.
type: string
resourceTags:
- description: resourceTags is a list of additional tags to
- apply to AWS resources created for the cluster. See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
- for information on tagging AWS resources. AWS supports a
- maximum of 50 tags per resource. OpenShift reserves 25 tags
- for its use, leaving 25 tags available for the user.
+ description: |-
+ resourceTags is a list of additional tags to apply to AWS resources created for the cluster.
+ See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html for information on tagging AWS resources.
+ AWS supports a maximum of 50 tags per resource. OpenShift reserves 25 tags for its use, leaving 25 tags
+ available for the user.
items:
description: AWSResourceTag is a tag to apply to AWS resources
created for the cluster.
@@ -1097,10 +1216,10 @@ spec:
pattern: ^[0-9A-Za-z_.:/=+-@]+$
type: string
value:
- description: value is the value of the tag. Some AWS
- service do not support empty values. Since tags are
- added to resources in many services, the length of
- the tag value must meet the requirements of all services.
+ description: |-
+ value is the value of the tag.
+ Some AWS service do not support empty values. Since tags are added to resources in many services, the
+ length of the tag value must meet the requirements of all services.
maxLength: 256
minLength: 1
pattern: ^[0-9A-Za-z_.:/=+-@]+$
@@ -1113,24 +1232,27 @@ spec:
type: array
x-kubernetes-list-type: atomic
serviceEndpoints:
- description: ServiceEndpoints list contains custom endpoints
- which will override default service endpoint of AWS Services.
+ description: |-
+ ServiceEndpoints list contains custom endpoints which will override default
+ service endpoint of AWS Services.
There must be only one ServiceEndpoint for a service.
items:
- description: AWSServiceEndpoint store the configuration
- of a custom url to override existing defaults of AWS Services.
+ description: |-
+ AWSServiceEndpoint store the configuration of a custom url to
+ override existing defaults of AWS Services.
properties:
name:
- description: name is the name of the AWS service. The
- list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
+ description: |-
+ name is the name of the AWS service.
+ The list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
pattern: ^https://
type: string
type: object
@@ -1146,9 +1268,10 @@ spec:
management in non-soverign clouds such as Azure Stack.
type: string
cloudName:
- description: cloudName is the name of the Azure cloud environment
- which can be used to configure the Azure SDK with the appropriate
- Azure API endpoints. If empty, the value is equal to `AzurePublicCloud`.
+ description: |-
+ cloudName is the name of the Azure cloud environment which can be used to configure the Azure SDK
+ with the appropriate Azure API endpoints.
+ If empty, the value is equal to `AzurePublicCloud`.
enum:
- ""
- AzurePublicCloud
@@ -1158,42 +1281,37 @@ spec:
- AzureStackCloud
type: string
networkResourceGroupName:
- description: networkResourceGroupName is the Resource Group
- for network resources like the Virtual Network and Subnets
- used by the cluster. If empty, the value is same as ResourceGroupName.
+ description: |-
+ networkResourceGroupName is the Resource Group for network resources like the Virtual Network and Subnets used by the cluster.
+ If empty, the value is same as ResourceGroupName.
type: string
resourceGroupName:
description: resourceGroupName is the Resource Group for new
Azure resources created for the cluster.
type: string
resourceTags:
- description: resourceTags is a list of additional tags to
- apply to Azure resources created for the cluster. See https://docs.microsoft.com/en-us/rest/api/resources/tags
- for information on tagging Azure resources. Due to limitations
- on Automation, Content Delivery Network, DNS Azure resources,
- a maximum of 15 tags may be applied. OpenShift reserves
- 5 tags for internal use, allowing 10 tags for user configuration.
+ description: |-
+ resourceTags is a list of additional tags to apply to Azure resources created for the cluster.
+ See https://docs.microsoft.com/en-us/rest/api/resources/tags for information on tagging Azure resources.
+ Due to limitations on Automation, Content Delivery Network, DNS Azure resources, a maximum of 15 tags
+ may be applied. OpenShift reserves 5 tags for internal use, allowing 10 tags for user configuration.
items:
description: AzureResourceTag is a tag to apply to Azure
resources created for the cluster.
properties:
key:
- description: key is the key part of the tag. A tag key
- can have a maximum of 128 characters and cannot be
- empty. Key must begin with a letter, end with a letter,
- number or underscore, and must contain only alphanumeric
- characters and the following special characters `_
- . -`.
+ description: |-
+ key is the key part of the tag. A tag key can have a maximum of 128 characters and cannot be empty. Key
+ must begin with a letter, end with a letter, number or underscore, and must contain only alphanumeric
+ characters and the following special characters `_ . -`.
maxLength: 128
minLength: 1
pattern: ^[a-zA-Z]([0-9A-Za-z_.-]*[0-9A-Za-z_])?$
type: string
value:
- description: 'value is the value part of the tag. A
- tag value can have a maximum of 256 characters and
- cannot be empty. Value must contain only alphanumeric
- characters and the following special characters `_
- + , - . / : ; < = > ? @`.'
+ description: |-
+ value is the value part of the tag. A tag value can have a maximum of 256 characters and cannot be empty. Value
+ must contain only alphanumeric characters and the following special characters `_ + , - . / : ; < = > ? @`.
maxLength: 256
minLength: 1
pattern: ^[0-9A-Za-z_.=+-@]+$
@@ -1219,22 +1337,21 @@ spec:
platform.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1248,17 +1365,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1279,18 +1397,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on BareMetal platform which can be a
- user-managed or openshift-managed load balancer that
- is to be used for the OpenShift API and Ingress endpoints.
- When set to OpenShiftManagedDefault the static pods
- in charge of API and Ingress traffic load-balancing
+ description: |-
+ type defines the type of load balancer used by the cluster on BareMetal platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
defined in the machine config operator will be deployed.
- When set to UserManaged these static pods will not be
- deployed and it is expected that the load balancer is
- configured out of band by the deployer. When omitted,
- this means no opinion and the platform is left to choose
- a reasonable default. The default value is OpenShiftManagedDefault.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1317,13 +1433,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for BareMetal deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ BareMetal deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
equinixMetal:
@@ -1331,19 +1447,16 @@ spec:
Metal infrastructure provider.
properties:
apiServerInternalIP:
- description: apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers.
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
type: string
ingressIP:
- description: ingressIP is an external IP which routes to the
- default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names.
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
type: string
type: object
external:
@@ -1351,23 +1464,22 @@ spec:
External infrastructure provider.
properties:
cloudControllerManager:
- description: cloudControllerManager contains settings specific
- to the external Cloud Controller Manager (a.k.a. CCM or
- CPI). When omitted, new nodes will be not tainted and no
- extra initialization from the cloud controller manager is
- expected.
+ description: |-
+ cloudControllerManager contains settings specific to the external Cloud Controller Manager (a.k.a. CCM or CPI).
+ When omitted, new nodes will be not tainted
+ and no extra initialization from the cloud controller manager is expected.
properties:
state:
- description: "state determines whether or not an external
- Cloud Controller Manager is expected to be installed
- within the cluster. https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/#running-cloud-controller-manager
- \n Valid values are \"External\", \"None\" and omitted.
- When set to \"External\", new nodes will be tainted
- as uninitialized when created, preventing them from
- running workloads until they are initialized by the
- cloud controller manager. When omitted or set to \"None\",
- new nodes will be not tainted and no extra initialization
- from the cloud controller manager is expected."
+ description: |-
+ state determines whether or not an external Cloud Controller Manager is expected to
+ be installed within the cluster.
+ https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/#running-cloud-controller-manager
+
+ Valid values are "External", "None" and omitted.
+ When set to "External", new nodes will be tainted as uninitialized when created,
+ preventing them from running workloads until they are initialized by the cloud controller manager.
+ When omitted or set to "None", new nodes will be not tainted
+ and no extra initialization from the cloud controller manager is expected.
enum:
- ""
- External
@@ -1393,27 +1505,26 @@ spec:
cloudLoadBalancerConfig:
default:
dnsType: PlatformDefault
- description: cloudLoadBalancerConfig is a union that contains
- the IP addresses of API, API-Int and Ingress Load Balancers
- created on the cloud platform. These values would not be
- populated on on-prem platforms. These Load Balancer IPs
- are used to configure the in-cluster DNS instances for API,
- API-Int and Ingress services. `dnsType` is expected to be
- set to `ClusterHosted` when these Load Balancer IP addresses
- are populated and used.
+ description: |-
+ 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.
nullable: true
properties:
clusterHosted:
- description: clusterHosted holds the IP addresses of API,
- API-Int and Ingress Load Balancers on Cloud Platforms.
- The DNS solution hosted within the cluster use these
- IP addresses to provide resolution for API, API-Int
- and Ingress services.
+ description: |-
+ clusterHosted holds the IP addresses of API, API-Int and Ingress Load
+ Balancers on Cloud Platforms. The DNS solution hosted within the cluster
+ use these IP addresses to provide resolution for API, API-Int and Ingress
+ services.
properties:
apiIntLoadBalancerIPs:
- description: apiIntLoadBalancerIPs holds Load Balancer
- IPs for the internal API service. These Load Balancer
- IP addresses can be IPv4 and/or IPv6 addresses.
+ description: |-
+ apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
Entries in the apiIntLoadBalancerIPs must be unique.
A maximum of 16 IP addresses are permitted.
format: ip
@@ -1430,12 +1541,12 @@ spec:
type: array
x-kubernetes-list-type: set
apiLoadBalancerIPs:
- description: apiLoadBalancerIPs holds Load Balancer
- IPs for the API service. These Load Balancer IP
- addresses can be IPv4 and/or IPv6 addresses. Could
- be empty for private clusters. Entries in the apiLoadBalancerIPs
- must be unique. A maximum of 16 IP addresses are
- permitted.
+ description: |-
+ apiLoadBalancerIPs holds Load Balancer IPs for the API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Could be empty for private clusters.
+ Entries in the apiLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example, "10.0.0.0"
@@ -1450,11 +1561,11 @@ spec:
type: array
x-kubernetes-list-type: set
ingressLoadBalancerIPs:
- description: ingressLoadBalancerIPs holds IPs for
- Ingress Load Balancers. These Load Balancer IP addresses
- can be IPv4 and/or IPv6 addresses. Entries in the
- ingressLoadBalancerIPs must be unique. A maximum
- of 16 IP addresses are permitted.
+ description: |-
+ ingressLoadBalancerIPs holds IPs for Ingress Load Balancers.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Entries in the ingressLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example, "10.0.0.0"
@@ -1471,23 +1582,17 @@ spec:
type: object
dnsType:
default: PlatformDefault
- description: dnsType indicates the type of DNS solution
- in use within the cluster. Its default value of `PlatformDefault`
- indicates that the cluster's DNS is the default provided
- by the cloud platform. It can be set to `ClusterHosted`
- to bypass the configuration of the cloud default DNS.
- In this mode, the cluster needs to provide a self-hosted
- DNS solution for the cluster's installation to succeed.
- The cluster's use of the cloud's Load Balancers is unaffected
- by this setting. The value is immutable after it has
- been set at install time. Currently, there is no way
- for the customer to add additional DNS entries into
- the cluster hosted DNS. Enabling this functionality
- allows the user to start their own DNS solution outside
- the cluster after installation is complete. The customer
- would be responsible for configuring this custom DNS
- solution, and it can be run in addition to the in-cluster
- DNS solution.
+ description: |-
+ dnsType indicates the type of DNS solution in use within the cluster. Its default value of
+ `PlatformDefault` indicates that the cluster's DNS is the default provided by the cloud platform.
+ It can be set to `ClusterHosted` to bypass the configuration of the cloud default DNS. In this mode,
+ the cluster needs to provide a self-hosted DNS solution for the cluster's installation to succeed.
+ The cluster's use of the cloud's Load Balancers is unaffected by this setting.
+ The value is immutable after it has been set at install time.
+ Currently, there is no way for the customer to add additional DNS entries into the cluster hosted DNS.
+ Enabling this functionality allows the user to start their own DNS solution outside the cluster after
+ installation is complete. The customer would be responsible for configuring this custom DNS solution,
+ and it can be run in addition to the in-cluster DNS solution.
enum:
- ClusterHosted
- PlatformDefault
@@ -1510,23 +1615,20 @@ spec:
created for the cluster.
type: string
resourceLabels:
- description: 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.
+ description: |-
+ 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.
items:
description: GCPResourceLabel is a label to apply to GCP
resources created for the cluster.
properties:
key:
- description: key is the key part of the label. A label
- key can have a maximum of 63 characters and cannot
- be empty. Label key must begin with a lowercase letter,
- and must contain only lowercase letters, numeric characters,
- and the following special characters `_-`. Label key
- must not have the reserved prefixes `kubernetes-io`
+ description: |-
+ key is the key part of the label. A label key can have a maximum of 63 characters and cannot be empty.
+ Label key must begin with a lowercase letter, and must contain only lowercase letters, numeric characters,
+ and the following special characters `_-`. Label key must not have the reserved prefixes `kubernetes-io`
and `openshift-io`.
maxLength: 63
minLength: 1
@@ -1537,11 +1639,9 @@ spec:
or `kubernetes-io`
rule: '!self.startsWith(''openshift-io'') && !self.startsWith(''kubernetes-io'')'
value:
- description: value is the value part of the label. A
- label value can have a maximum of 63 characters and
- cannot be empty. Value must contain only lowercase
- letters, numeric characters, and the following special
- characters `_-`.
+ description: |-
+ value is the value part of the label. A label value can have a maximum of 63 characters and cannot be empty.
+ Value must contain only lowercase letters, numeric characters, and the following special characters `_-`.
maxLength: 63
minLength: 1
pattern: ^[0-9a-z_-]{1,63}$
@@ -1560,47 +1660,41 @@ spec:
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
resourceTags:
- description: 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.
+ description: |-
+ 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.
items:
description: GCPResourceTag is a tag to apply to GCP resources
created for the cluster.
properties:
key:
- description: key is the key part of the tag. A tag key
- can have a maximum of 63 characters and cannot be
- empty. Tag key must begin and end with an alphanumeric
- character, and must contain only uppercase, lowercase
- alphanumeric characters, and the following special
- characters `._-`.
+ description: |-
+ key is the key part of the tag. A tag key can have a maximum of 63 characters and cannot be empty.
+ Tag key must begin and end with an alphanumeric character, and must contain only uppercase, lowercase
+ alphanumeric characters, and the following special characters `._-`.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z0-9]([0-9A-Za-z_.-]{0,61}[a-zA-Z0-9])?$
type: string
parentID:
- description: 'parentID is the ID of the hierarchical
- resource where the tags are defined, e.g. at the Organization
- or the Project level. To find the Organization or
- Project ID refer to the following pages: https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id,
+ description: |-
+ parentID is the ID of the hierarchical resource where the tags are defined,
+ e.g. at the Organization or the Project level. To find the Organization or Project ID refer to the following pages:
+ https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id,
https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects.
- An OrganizationID must consist of decimal numbers,
- and cannot have leading zeroes. A ProjectID must be
- 6 to 30 characters in length, can only contain lowercase
- letters, numbers, and hyphens, and must start with
- a letter, and cannot end with a hyphen.'
+ An OrganizationID must consist of decimal numbers, and cannot have leading zeroes.
+ A ProjectID must be 6 to 30 characters in length, can only contain lowercase letters, numbers,
+ and hyphens, and must start with a letter, and cannot end with a hyphen.
maxLength: 32
minLength: 1
pattern: (^[1-9][0-9]{0,31}$)|(^[a-z][a-z0-9-]{4,28}[a-z0-9]$)
type: string
value:
- description: value is the value part of the tag. A tag
- value can have a maximum of 63 characters and cannot
- be empty. Tag value must begin and end with an alphanumeric
- character, and must contain only uppercase, lowercase
- alphanumeric characters, and the following special
- characters `_-.@%=+:,*#&(){}[]` and spaces.
+ description: |-
+ value is the value part of the tag. A tag value can have a maximum of 63 characters and cannot be empty.
+ Tag value must begin and end with an alphanumeric character, and must contain only uppercase, lowercase
+ alphanumeric characters, and the following special characters `_-.@%=+:,*#&(){}[]` and spaces.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z0-9]([0-9A-Za-z_.@%=+:,*#&()\[\]{}\-\s]{0,61}[a-zA-Z0-9])?$
@@ -1632,13 +1726,14 @@ spec:
infrastructure provider.
properties:
cisInstanceCRN:
- description: CISInstanceCRN is the CRN of the Cloud Internet
- Services instance managing the DNS zone for the cluster's
- base domain
+ description: |-
+ CISInstanceCRN is the CRN of the Cloud Internet Services instance managing
+ the DNS zone for the cluster's base domain
type: string
dnsInstanceCRN:
- description: DNSInstanceCRN is the CRN of the DNS Services
- instance managing the DNS zone for the cluster's base domain
+ description: |-
+ DNSInstanceCRN is the CRN of the DNS Services instance managing the DNS zone
+ for the cluster's base domain
type: string
location:
description: Location is where the cluster has been deployed
@@ -1652,26 +1747,23 @@ spec:
IBMCloud resources created for the cluster.
type: string
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of an
- IBM Cloud service. These endpoints are consumed by components
- within the cluster to reach the respective IBM Cloud Services.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of an IBM Cloud service. These endpoints are consumed by
+ components within the cluster to reach the respective IBM Cloud Services.
items:
- description: IBMCloudServiceEndpoint stores the configuration
- of a custom url to override existing defaults of IBM Cloud
- Services.
+ description: |-
+ IBMCloudServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of IBM Cloud Services.
properties:
name:
- description: 'name is the name of the IBM Cloud service.
- Possible values are: CIS, COS, COSConfig, DNSServices,
- GlobalCatalog, GlobalSearch, GlobalTagging, HyperProtect,
- IAM, KeyProtect, ResourceController, ResourceManager,
- or VPC. For example, the IBM Cloud Private IAM service
- could be configured with the service `name` of `IAM`
- and `url` of `https://private.iam.cloud.ibm.com` Whereas
- the IBM Cloud Private VPC service for US South (Dallas)
- could be configured with the service `name` of `VPC`
- and `url` of `https://us.south.private.iaas.cloud.ibm.com`'
+ description: |-
+ name is the name of the IBM Cloud service.
+ Possible values are: CIS, COS, COSConfig, DNSServices, GlobalCatalog, GlobalSearch, GlobalTagging, HyperProtect, IAM, KeyProtect, ResourceController, ResourceManager, or VPC.
+ For example, the IBM Cloud Private IAM service could be configured with the
+ service `name` of `IAM` and `url` of `https://private.iam.cloud.ibm.com`
+ Whereas the IBM Cloud Private VPC service for US South (Dallas) could be configured
+ with the service `name` of `VPC` and `url` of `https://us.south.private.iaas.cloud.ibm.com`
enum:
- CIS
- COS
@@ -1688,10 +1780,10 @@ spec:
- VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
type: string
x-kubernetes-validations:
- message: url must be a valid absolute URL
@@ -1710,19 +1802,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers.
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
type: string
ingressIP:
- description: ingressIP is an external IP which routes to the
- default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names.
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
type: string
type: object
nutanix:
@@ -1730,22 +1819,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1759,17 +1847,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1790,18 +1879,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on Nutanix platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on Nutanix platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1816,22 +1903,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1845,21 +1931,23 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
cloudName:
- description: cloudName is the name of the desired OpenStack
- cloud in the client configuration file (`clouds.yaml`).
+ description: |-
+ cloudName is the name of the desired OpenStack cloud in the
+ client configuration file (`clouds.yaml`).
type: string
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1880,18 +1968,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on OpenStack platform which can be a
- user-managed or openshift-managed load balancer that
- is to be used for the OpenShift API and Ingress endpoints.
- When set to OpenShiftManagedDefault the static pods
- in charge of API and Ingress traffic load-balancing
+ description: |-
+ type defines the type of load balancer used by the cluster on OpenStack platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
defined in the machine config operator will be deployed.
- When set to UserManaged these static pods will not be
- deployed and it is expected that the load balancer is
- configured out of band by the deployer. When omitted,
- this means no opinion and the platform is left to choose
- a reasonable default. The default value is OpenShiftManagedDefault.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1918,13 +2004,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for OpenStack deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ OpenStack deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
ovirt:
@@ -1932,22 +2018,21 @@ spec:
provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1961,17 +2046,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1992,18 +2078,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on Ovirt platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on Ovirt platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -2022,27 +2106,26 @@ spec:
Virtual Servers infrastructure provider.
properties:
cisInstanceCRN:
- description: CISInstanceCRN is the CRN of the Cloud Internet
- Services instance managing the DNS zone for the cluster's
- base domain
+ description: |-
+ CISInstanceCRN is the CRN of the Cloud Internet Services instance managing
+ the DNS zone for the cluster's base domain
type: string
dnsInstanceCRN:
- description: DNSInstanceCRN is the CRN of the DNS Services
- instance managing the DNS zone for the cluster's base domain
+ description: |-
+ DNSInstanceCRN is the CRN of the DNS Services instance managing the DNS zone
+ for the cluster's base domain
type: string
region:
description: region holds the default Power VS region for
new Power VS resources created by the cluster.
type: string
resourceGroup:
- description: 'resourceGroup is the resource group name for
- new IBMCloud resources created for a cluster. The resource
- group specified here will be used by cluster-image-registry-operator
- to set up a COS Instance in IBMCloud for the cluster registry.
+ description: |-
+ resourceGroup is the resource group name for new IBMCloud resources created for a cluster.
+ The resource group specified here will be used by cluster-image-registry-operator to set up a COS Instance in IBMCloud for the cluster registry.
More about resource groups can be found here: https://cloud.ibm.com/docs/account?topic=account-rgs.
- When omitted, the image registry operator won''t be able
- to configure storage, which results in the image registry
- cluster operator not being in an available state.'
+ When omitted, the image registry operator won't be able to configure storage,
+ which results in the image registry cluster operator not being in an available state.
maxLength: 40
pattern: ^[a-zA-Z0-9-_ ]+$
type: string
@@ -2050,26 +2133,42 @@ spec:
- message: resourceGroup is immutable once set
rule: oldSelf == '' || self == oldSelf
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of a Power
- VS service.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of a Power VS service.
items:
- description: PowervsServiceEndpoint stores the configuration
- of a custom url to override existing defaults of PowerVS
- Services.
+ description: |-
+ PowervsServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of PowerVS Services.
properties:
name:
- description: name is the name of the Power VS service.
- Few of the services are IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
+ description: |-
+ name is the name of the Power VS service.
+ Few of the services are
+ IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
ResourceController - https://cloud.ibm.com/apidocs/resource-controller/resource-controller
Power Cloud - https://cloud.ibm.com/apidocs/power-cloud
- pattern: ^[a-z0-9-]+$
+ enum:
+ - CIS
+ - COS
+ - COSConfig
+ - DNSServices
+ - GlobalCatalog
+ - GlobalSearch
+ - GlobalTagging
+ - HyperProtect
+ - IAM
+ - KeyProtect
+ - Power
+ - ResourceController
+ - ResourceManager
+ - VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
format: uri
pattern: ^https://
type: string
@@ -2082,27 +2181,27 @@ spec:
- name
x-kubernetes-list-type: map
zone:
- description: 'zone holds the default zone for the new Power
- VS resources created by the cluster. Note: Currently only
- single-zone OCP clusters are supported'
+ description: |-
+ zone holds the default zone for the new Power VS resources created by the cluster.
+ Note: Currently only single-zone OCP clusters are supported
type: string
type: object
x-kubernetes-validations:
- message: cannot unset resourceGroup once set
rule: '!has(oldSelf.resourceGroup) || has(self.resourceGroup)'
type:
- description: "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\", \"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. \n This
- value will be synced with to the `status.platform` and `status.platformStatus.type`.
- Currently this value cannot be changed once set."
+ description: |-
+ 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", "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.
+
+ This value will be synced with to the `status.platform` and `status.platformStatus.type`.
+ Currently this value cannot be changed once set.
enum:
- ""
- AWS
@@ -2127,22 +2226,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -2156,17 +2254,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -2187,18 +2286,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on VSphere platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on VSphere platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -2225,13 +2322,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for vSphere deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ vSphere deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
type: object
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml
index 7683c07143..ea2f9f1725 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml
@@ -21,20 +21,25 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Infrastructure holds cluster-wide information about Infrastructure.
- \ The canonical name is `cluster` \n Compatibility level 1: Stable within
- a major release for a minimum of 12 months or 3 minor releases (whichever
- is longer)."
+ description: |-
+ Infrastructure holds cluster-wide information about Infrastructure. The canonical name is `cluster`
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,19 +47,19 @@ spec:
description: spec holds user settable values for configuration
properties:
cloudConfig:
- description: "cloudConfig is a reference to a ConfigMap containing
- the cloud provider configuration file. This configuration file is
- used to configure the Kubernetes cloud provider integration when
- using the built-in cloud provider integration or the external cloud
- controller manager. The namespace for this config map is openshift-config.
- \n cloudConfig should only be consumed by the kube_cloud_config
- controller. The controller is responsible for using the user configuration
- in the spec for various platforms and combining that with the user
- provided ConfigMap in this field to create a stitched kube cloud
- config. The controller generates a ConfigMap `kube-cloud-config`
- in `openshift-config-managed` namespace with the kube cloud config
- is stored in `cloud.conf` key. All the clients are expected to use
- the generated ConfigMap only."
+ description: |-
+ cloudConfig is a reference to a ConfigMap containing the cloud provider configuration file.
+ This configuration file is used to configure the Kubernetes cloud provider integration
+ when using the built-in cloud provider integration or the external cloud controller manager.
+ The namespace for this config map is openshift-config.
+
+ cloudConfig should only be consumed by the kube_cloud_config controller.
+ The controller is responsible for using the user configuration in the spec
+ for various platforms and combining that with the user provided ConfigMap in this field
+ to create a stitched kube cloud config.
+ The controller generates a ConfigMap `kube-cloud-config` in `openshift-config-managed` namespace
+ with the kube cloud config is stored in `cloud.conf` key.
+ All the clients are expected to use the generated ConfigMap only.
properties:
key:
description: Key allows pointing to a specific key/value inside
@@ -64,8 +69,9 @@ spec:
type: string
type: object
platformSpec:
- description: platformSpec holds desired information specific to the
- underlying infrastructure provider.
+ description: |-
+ platformSpec holds desired information specific to the underlying
+ infrastructure provider.
properties:
alibabaCloud:
description: AlibabaCloud contains settings specific to the Alibaba
@@ -76,24 +82,27 @@ spec:
Services infrastructure provider.
properties:
serviceEndpoints:
- description: serviceEndpoints list contains custom endpoints
- which will override default service endpoint of AWS Services.
+ description: |-
+ serviceEndpoints list contains custom endpoints which will override default
+ service endpoint of AWS Services.
There must be only one ServiceEndpoint for a service.
items:
- description: AWSServiceEndpoint store the configuration
- of a custom url to override existing defaults of AWS Services.
+ description: |-
+ AWSServiceEndpoint store the configuration of a custom url to
+ override existing defaults of AWS Services.
properties:
name:
- description: name is the name of the AWS service. The
- list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
+ description: |-
+ name is the name of the AWS service.
+ The list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
pattern: ^https://
type: string
type: object
@@ -109,17 +118,16 @@ spec:
platform.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -138,15 +146,15 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -165,10 +173,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -194,17 +202,15 @@ spec:
Metal infrastructure provider.
type: object
external:
- description: ExternalPlatformType represents generic infrastructure
- provider. Platform-specific components should be supplemented
- separately.
+ description: |-
+ ExternalPlatformType represents generic infrastructure provider.
+ Platform-specific components should be supplemented separately.
properties:
platformName:
default: Unknown
- description: PlatformName holds the arbitrary string representing
- the infrastructure provider name, expected to be set at
- the installation time. This field is solely for informational
- and reporting purposes and is not expected to be used for
- decision-making.
+ description: |-
+ PlatformName holds the arbitrary string representing the infrastructure provider name, expected to be set at the installation time.
+ This field is solely for informational and reporting purposes and is not expected to be used for decision-making.
type: string
x-kubernetes-validations:
- message: platform name cannot be changed once set
@@ -227,20 +233,19 @@ spec:
infrastructure provider.
properties:
failureDomains:
- description: failureDomains configures failure domains information
- for the Nutanix platform. When set, the failure domains
- defined here may be used to spread Machines across prism
- element clusters to improve fault tolerance of the cluster.
+ description: |-
+ failureDomains configures failure domains information for the Nutanix platform.
+ When set, the failure domains defined here may be used to spread Machines across
+ prism element clusters to improve fault tolerance of the cluster.
items:
description: NutanixFailureDomain configures failure domain
information for the Nutanix platform.
properties:
cluster:
- description: cluster is to identify the cluster (the
- Prism Element under management of the Prism Central),
- in which the Machine's VM will be created. The cluster
- identifier (uuid or name) can be obtained from the
- Prism Central console or using the prism_central API.
+ description: |-
+ cluster is to identify the cluster (the Prism Element under management of the Prism Central),
+ in which the Machine's VM will be created. The cluster identifier (uuid or name) can be obtained
+ from the Prism Central console or using the prism_central API.
properties:
name:
description: name is the resource name in the PC.
@@ -270,23 +275,21 @@ spec:
rule: 'has(self.type) && self.type == ''Name'' ? has(self.name)
: !has(self.name)'
name:
- description: name defines the unique name of a failure
- domain. Name is required and must be at most 64 characters
- in length. It must consist of only lower case alphanumeric
- characters and hyphens (-). It must start and end
- with an alphanumeric character. This value is arbitrary
- and is used to identify the failure domain within
- the platform.
+ description: |-
+ name defines the unique name of a failure domain.
+ Name is required and must be at most 64 characters in length.
+ It must consist of only lower case alphanumeric characters and hyphens (-).
+ It must start and end with an alphanumeric character.
+ This value is arbitrary and is used to identify the failure domain within the platform.
maxLength: 64
minLength: 1
pattern: '[a-z0-9]([-a-z0-9]*[a-z0-9])?'
type: string
subnets:
- description: subnets holds a list of identifiers (one
- or more) of the cluster's network subnets for the
- Machine's VM to connect to. The subnet identifiers
- (uuid or name) can be obtained from the Prism Central
- console or using the prism_central API.
+ description: |-
+ subnets holds a list of identifiers (one or more) of the cluster's network subnets
+ for the Machine's VM to connect to. The subnet identifiers (uuid or name) can be
+ obtained from the Prism Central console or using the prism_central API.
items:
description: NutanixResourceIdentifier holds the identity
of a Nutanix PC resource (cluster, image, subnet,
@@ -336,11 +339,10 @@ spec:
- name
x-kubernetes-list-type: map
prismCentral:
- description: prismCentral holds the endpoint address and port
- to access the Nutanix Prism Central. When a cluster-wide
- proxy is installed, by default, this endpoint will be accessed
- via the proxy. Should you wish for communication with this
- endpoint not to be proxied, please add the endpoint to the
+ description: |-
+ prismCentral holds the endpoint address and port to access the Nutanix Prism Central.
+ When a cluster-wide proxy is installed, by default, this endpoint will be accessed via the proxy.
+ Should you wish for communication with this endpoint not to be proxied, please add the endpoint to the
proxy spec.noProxy list.
properties:
address:
@@ -361,25 +363,22 @@ spec:
- port
type: object
prismElements:
- description: prismElements holds one or more endpoint address
- and port data to access the Nutanix Prism Elements (clusters)
- of the Nutanix Prism Central. Currently we only support
- one Prism Element (cluster) for an OpenShift cluster, where
- all the Nutanix resources (VMs, subnets, volumes, etc.)
- used in the OpenShift cluster are located. In the future,
- we may support Nutanix resources (VMs, etc.) spread over
- multiple Prism Elements (clusters) of the Prism Central.
+ description: |-
+ prismElements holds one or more endpoint address and port data to access the Nutanix
+ Prism Elements (clusters) of the Nutanix Prism Central. Currently we only support one
+ Prism Element (cluster) for an OpenShift cluster, where all the Nutanix resources (VMs, subnets, volumes, etc.)
+ used in the OpenShift cluster are located. In the future, we may support Nutanix resources (VMs, etc.)
+ spread over multiple Prism Elements (clusters) of the Prism Central.
items:
description: NutanixPrismElementEndpoint holds the name
and endpoint data for a Prism Element (cluster)
properties:
endpoint:
- description: endpoint holds the endpoint address and
- port data of the Prism Element (cluster). When a cluster-wide
- proxy is installed, by default, this endpoint will
- be accessed via the proxy. Should you wish for communication
- with this endpoint not to be proxied, please add the
- endpoint to the proxy spec.noProxy list.
+ description: |-
+ endpoint holds the endpoint address and port data of the Prism Element (cluster).
+ When a cluster-wide proxy is installed, by default, this endpoint will be accessed via the proxy.
+ Should you wish for communication with this endpoint not to be proxied, please add the endpoint to the
+ proxy spec.noProxy list.
properties:
address:
description: address is the endpoint address (DNS
@@ -399,10 +398,9 @@ spec:
- port
type: object
name:
- description: name is the name of the Prism Element (cluster).
- This value will correspond with the cluster field
- configured on other resources (eg Machines, PVCs,
- etc).
+ description: |-
+ name is the name of the Prism Element (cluster). This value will correspond with
+ the cluster field configured on other resources (eg Machines, PVCs, etc).
maxLength: 256
type: string
required:
@@ -422,17 +420,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -451,15 +448,15 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -478,10 +475,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -511,26 +508,42 @@ spec:
Systems Virtual Servers infrastructure provider.
properties:
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of a Power
- VS service.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of a Power VS service.
items:
- description: PowervsServiceEndpoint stores the configuration
- of a custom url to override existing defaults of PowerVS
- Services.
+ description: |-
+ PowervsServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of PowerVS Services.
properties:
name:
- description: name is the name of the Power VS service.
- Few of the services are IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
+ description: |-
+ name is the name of the Power VS service.
+ Few of the services are
+ IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
ResourceController - https://cloud.ibm.com/apidocs/resource-controller/resource-controller
Power Cloud - https://cloud.ibm.com/apidocs/power-cloud
- pattern: ^[a-z0-9-]+$
+ enum:
+ - CIS
+ - COS
+ - COSConfig
+ - DNSServices
+ - GlobalCatalog
+ - GlobalSearch
+ - GlobalTagging
+ - HyperProtect
+ - IAM
+ - KeyProtect
+ - Power
+ - ResourceController
+ - ResourceManager
+ - VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
format: uri
pattern: ^https://
type: string
@@ -544,16 +557,15 @@ spec:
x-kubernetes-list-type: map
type: object
type:
- description: 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.
+ description: |-
+ 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.
enum:
- ""
- AWS
@@ -578,17 +590,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -607,24 +618,26 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
failureDomains:
- description: failureDomains contains the definition of region,
- zone and the vCenter topology. If this is omitted failure
- domains (regions and zones) will not be used.
+ description: |-
+ failureDomains contains the definition of region, zone and the vCenter topology.
+ If this is omitted failure domains (regions and zones) will not be used.
items:
- description: VSpherePlatformFailureDomainSpec holds the
- region and zone failure domain and the vCenter topology
- of that failure domain.
+ description: |-
+ VSpherePlatformFailureDomainSpec holds the region and zone failure domain and
+ the vCenter topology of that failure domain.
properties:
name:
- description: name defines the arbitrary but unique name
+ description: |-
+ name defines the arbitrary but unique name
of a failure domain.
maxLength: 256
minLength: 1
type: string
region:
- description: region defines the name of a region tag
- that will be attached to a vCenter datacenter. The
- tag category in vCenter must be named openshift-region.
+ description: |-
+ region defines the name of a region tag that will
+ be attached to a vCenter datacenter. The tag
+ category in vCenter must be named openshift-region.
maxLength: 80
minLength: 1
type: string
@@ -634,7 +647,7 @@ spec:
- format: ipv6
- format: hostname
description: server is the fully-qualified domain name
- or the IP address of the vCenter server. ---
+ or the IP address of the vCenter server.
maxLength: 255
minLength: 1
type: string
@@ -643,45 +656,48 @@ spec:
using vSphere constructs
properties:
computeCluster:
- description: computeCluster the absolute path of
- the vCenter cluster in which virtual machine will
- be located. The absolute path is of the form //host/.
+ description: |-
+ computeCluster the absolute path of the vCenter cluster
+ in which virtual machine will be located.
+ The absolute path is of the form //host/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/host/.*?
type: string
datacenter:
- description: datacenter is the name of vCenter datacenter
- in which virtual machines will be located. The
- maximum length of the datacenter name is 80 characters.
+ description: |-
+ datacenter is the name of vCenter datacenter in which virtual machines will be located.
+ The maximum length of the datacenter name is 80 characters.
maxLength: 80
type: string
datastore:
- description: datastore is the absolute path of the
- datastore in which the virtual machine is located.
+ description: |-
+ datastore is the absolute path of the datastore in which the
+ virtual machine is located.
The absolute path is of the form //datastore/
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/datastore/.*?
type: string
folder:
- description: folder is the absolute path of the
- folder where virtual machines are located. The
- absolute path is of the form //vm/.
+ description: |-
+ folder is the absolute path of the folder where
+ virtual machines are located. The absolute path
+ is of the form //vm/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/vm/.*?
type: string
networks:
- description: 'networks is the list of port group
- network names within this failure domain. If feature
- gate VSphereMultiNetworks is enabled, up to 10
- network adapters may be defined. 10 is the maximum
- number of virtual network devices which may be
- attached to a VM as defined by: https://configmax.esp.vmware.com/guest?vmwareproduct=vSphere&release=vSphere%208.0&categories=1-0
- The available networks (port groups) can be listed
- using `govc ls ''network/*''` Networks should
- be in the form of an absolute path: //network/.'
+ description: |-
+ networks is the list of port group network names within this failure domain.
+ If feature gate VSphereMultiNetworks is enabled, up to 10 network adapters may be defined.
+ 10 is the maximum number of virtual network devices which may be attached to a VM as defined by:
+ https://configmax.esp.vmware.com/guest?vmwareproduct=vSphere&release=vSphere%208.0&categories=1-0
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
+ Networks should be in the form of an absolute path:
+ //network/.
items:
type: string
maxItems: 1
@@ -689,25 +705,24 @@ spec:
type: array
x-kubernetes-list-type: atomic
resourcePool:
- description: resourcePool is the absolute path of
- the resource pool where virtual machines will
- be created. The absolute path is of the form //host//Resources/.
+ description: |-
+ resourcePool is the absolute path of the resource pool where virtual machines will be
+ created. The absolute path is of the form //host//Resources/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/host/.*?/Resources.*
type: string
template:
- description: "template is the full inventory path
- of the virtual machine or template that will be
- cloned when creating new machines in this failure
- domain. The maximum length of the path is 2048
- characters. \n When omitted, the template will
- be calculated by the control plane machineset
- operator based on the region and zone defined
- in VSpherePlatformFailureDomainSpec. For example,
- for zone=zonea, region=region1, and infrastructure
- name=test, the template path would be calculated
- as //vm/test-rhcos-region1-zonea."
+ description: |-
+ template is the full inventory path of the virtual machine or template
+ that will be cloned when creating new machines in this failure domain.
+ The maximum length of the path is 2048 characters.
+
+ When omitted, the template will be calculated by the control plane
+ machineset operator based on the region and zone defined in
+ VSpherePlatformFailureDomainSpec.
+ For example, for zone=zonea, region=region1, and infrastructure name=test,
+ the template path would be calculated as //vm/test-rhcos-region1-zonea.
maxLength: 2048
minLength: 1
pattern: ^/.*?/vm/.*?
@@ -719,9 +734,10 @@ spec:
- networks
type: object
zone:
- description: zone defines the name of a zone tag that
- will be attached to a vCenter cluster. The tag category
- in vCenter must be named openshift-zone.
+ description: |-
+ zone defines the name of a zone tag that will
+ be attached to a vCenter cluster. The tag
+ category in vCenter must be named openshift-zone.
maxLength: 80
minLength: 1
type: string
@@ -737,15 +753,15 @@ spec:
- name
x-kubernetes-list-type: map
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -764,10 +780,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -783,41 +799,39 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeNetworking:
- description: 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.
+ description: |-
+ 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.
properties:
external:
description: external represents the network configuration
of the node that is externally routable.
properties:
excludeNetworkSubnetCidr:
- description: excludeNetworkSubnetCidr IP addresses
- in subnet ranges will be excluded when selecting
- the IP address from the VirtualMachine's VM for
- use in the status.addresses fields. ---
+ description: |-
+ excludeNetworkSubnetCidr IP addresses in subnet ranges will be excluded when selecting
+ the IP address from the VirtualMachine's VM for use in the status.addresses fields.
items:
format: cidr
type: string
type: array
x-kubernetes-list-type: atomic
network:
- description: network VirtualMachine's VM Network names
- that will be used to when searching for status.addresses
- fields. Note that if internal.networkSubnetCIDR
- and external.networkSubnetCIDR are not set, then
- the vNIC associated to this network must only have
- a single IP address assigned to it. The available
- networks (port groups) can be listed using `govc
- ls 'network/*'`
+ description: |-
+ network VirtualMachine's VM Network names that will be used to when searching
+ for status.addresses fields. Note that if internal.networkSubnetCIDR and
+ external.networkSubnetCIDR are not set, then the vNIC associated to this network must
+ only have a single IP address assigned to it.
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
type: string
networkSubnetCidr:
- description: networkSubnetCidr IP address on VirtualMachine's
- network interfaces included in the fields' CIDRs
- that will be used in respective status.addresses
- fields. ---
+ description: |-
+ networkSubnetCidr IP address on VirtualMachine's network interfaces included in the fields' CIDRs
+ that will be used in respective status.addresses fields.
items:
format: cidr
type: string
@@ -829,30 +843,27 @@ spec:
of the node that is routable only within the cluster.
properties:
excludeNetworkSubnetCidr:
- description: excludeNetworkSubnetCidr IP addresses
- in subnet ranges will be excluded when selecting
- the IP address from the VirtualMachine's VM for
- use in the status.addresses fields. ---
+ description: |-
+ excludeNetworkSubnetCidr IP addresses in subnet ranges will be excluded when selecting
+ the IP address from the VirtualMachine's VM for use in the status.addresses fields.
items:
format: cidr
type: string
type: array
x-kubernetes-list-type: atomic
network:
- description: network VirtualMachine's VM Network names
- that will be used to when searching for status.addresses
- fields. Note that if internal.networkSubnetCIDR
- and external.networkSubnetCIDR are not set, then
- the vNIC associated to this network must only have
- a single IP address assigned to it. The available
- networks (port groups) can be listed using `govc
- ls 'network/*'`
+ description: |-
+ network VirtualMachine's VM Network names that will be used to when searching
+ for status.addresses fields. Note that if internal.networkSubnetCIDR and
+ external.networkSubnetCIDR are not set, then the vNIC associated to this network must
+ only have a single IP address assigned to it.
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
type: string
networkSubnetCidr:
- description: networkSubnetCidr IP address on VirtualMachine's
- network interfaces included in the fields' CIDRs
- that will be used in respective status.addresses
- fields. ---
+ description: |-
+ networkSubnetCidr IP address on VirtualMachine's network interfaces included in the fields' CIDRs
+ that will be used in respective status.addresses fields.
items:
format: cidr
type: string
@@ -861,36 +872,38 @@ spec:
type: object
type: object
vcenters:
- description: vcenters holds the connection details for services
- to communicate with vCenter. Currently, only a single vCenter
- is supported, but in tech preview 3 vCenters are supported.
- Once the cluster has been installed, you are unable to change
- the current number of defined vCenters except in the case
- where the cluster has been upgraded from a version of OpenShift
- where the vsphere platform spec was not present. You may
- make modifications to the existing vCenters that are defined
- in the vcenters list in order to match with any added or
- modified failure domains. ---
+ description: |-
+ vcenters holds the connection details for services to communicate with vCenter.
+ Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
+ Once the cluster has been installed, you are unable to change the current number of defined
+ vCenters except in the case where the cluster has been upgraded from a version of OpenShift
+ where the vsphere platform spec was not present. You may make modifications to the existing
+ vCenters that are defined in the vcenters list in order to match with any added or modified
+ failure domains.
items:
- description: VSpherePlatformVCenterSpec stores the vCenter
- connection fields. This is used by the vSphere CCM.
+ description: |-
+ VSpherePlatformVCenterSpec stores the vCenter connection fields.
+ This is used by the vSphere CCM.
properties:
datacenters:
- description: The vCenter Datacenters in which the RHCOS
- vm guests are located. This field will be used by
- the Cloud Controller Manager. Each datacenter listed
- here should be used within a topology.
+ description: |-
+ The vCenter Datacenters in which the RHCOS
+ vm guests are located. This field will
+ be used by the Cloud Controller Manager.
+ Each datacenter listed here should be used within
+ a topology.
items:
type: string
minItems: 1
type: array
x-kubernetes-list-type: set
port:
- description: port is the TCP port that will be used
- to communicate to the vCenter endpoint. When omitted,
- this means the user has no opinion and it is up to
- the platform to choose a sensible default, which is
- subject to change over time.
+ description: |-
+ port is the TCP port that will be used to communicate to
+ the vCenter endpoint.
+ When omitted, this means the user has no opinion and
+ it is up to the platform to choose a sensible default,
+ which is subject to change over time.
format: int32
maximum: 32767
minimum: 1
@@ -901,7 +914,7 @@ spec:
- format: ipv6
- format: hostname
description: server is the fully-qualified domain name
- or the IP address of the vCenter server. ---
+ or the IP address of the vCenter server.
maxLength: 255
type: string
required:
@@ -936,28 +949,27 @@ spec:
be overridden.
properties:
apiServerInternalURI:
- description: apiServerInternalURL is a valid URI with scheme 'https',
- address and optionally a port (defaulting to 443). apiServerInternalURL
- can be used by components like kubelets, to contact the Kubernetes
- API server using the infrastructure provider rather than Kubernetes
- networking.
+ description: |-
+ apiServerInternalURL is a valid URI with scheme 'https',
+ address and optionally a port (defaulting to 443). apiServerInternalURL can be used by components
+ like kubelets, to contact the Kubernetes API server using the
+ infrastructure provider rather than Kubernetes networking.
type: string
apiServerURL:
- description: apiServerURL is a valid URI with scheme 'https', address
- and optionally a port (defaulting to 443). apiServerURL can be
- used by components like the web console to tell users where to find
- the Kubernetes API.
+ description: |-
+ apiServerURL is a valid URI with scheme 'https', address and
+ optionally a port (defaulting to 443). apiServerURL can be used by components like the web console
+ to tell users where to find the Kubernetes API.
type: string
controlPlaneTopology:
default: HighlyAvailable
- description: controlPlaneTopology expresses the expectations for operands
- that normally run on control nodes. The default is 'HighlyAvailable',
- which represents the behavior operators have in a "normal" cluster.
+ description: |-
+ controlPlaneTopology expresses the expectations for operands that normally run on control nodes.
+ The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
The 'SingleReplica' mode will be used in single-node deployments
- and the operators should not configure the operand for highly-available
- operation The 'External' mode indicates that the control plane is
- hosted externally to the cluster and that its components are not
- visible within the cluster.
+ and the operators should not configure the operand for highly-available operation
+ The 'External' mode indicates that the control plane is hosted externally to the cluster and that
+ its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
@@ -965,47 +977,49 @@ spec:
type: string
cpuPartitioning:
default: None
- description: cpuPartitioning expresses if CPU partitioning is a currently
- enabled feature in the cluster. CPU Partitioning means that this
- cluster can support partitioning workloads to specific CPU Sets.
- Valid values are "None" and "AllNodes". When omitted, the default
- value is "None". The default value of "None" indicates that no nodes
- will be setup with CPU partitioning. The "AllNodes" value indicates
- that all nodes have been setup with CPU partitioning, and can then
- be further configured via the PerformanceProfile API.
+ description: |-
+ cpuPartitioning expresses if CPU partitioning is a currently enabled feature in the cluster.
+ CPU Partitioning means that this cluster can support partitioning workloads to specific CPU Sets.
+ Valid values are "None" and "AllNodes". When omitted, the default value is "None".
+ The default value of "None" indicates that no nodes will be setup with CPU partitioning.
+ The "AllNodes" value indicates that all nodes have been setup with CPU partitioning,
+ and can then be further configured via the PerformanceProfile API.
enum:
- None
- AllNodes
type: string
etcdDiscoveryDomain:
- description: 'etcdDiscoveryDomain is the domain used to fetch the
- SRV records for discovering etcd servers and clients. For more info:
- https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery
- deprecated: as of 4.7, this field is no longer set or honored. It
- will be removed in a future release.'
+ description: |-
+ etcdDiscoveryDomain is the domain used to fetch the SRV records for discovering
+ etcd servers and clients.
+ For more info: https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery
+ deprecated: as of 4.7, this field is no longer set or honored. It will be removed in a future release.
type: string
infrastructureName:
- description: infrastructureName uniquely identifies a cluster with
- a human friendly name. Once set it should not be changed. Must be
- of max length 27 and must have only alphanumeric or hyphen characters.
+ description: |-
+ infrastructureName uniquely identifies a cluster with a human friendly name.
+ Once set it should not be changed. Must be of max length 27 and must have only
+ alphanumeric or hyphen characters.
type: string
infrastructureTopology:
default: HighlyAvailable
- description: 'infrastructureTopology expresses the expectations for
- infrastructure services that do not run on control plane nodes,
- usually indicated by a node selector for a `role` value other than
- `master`. The default is ''HighlyAvailable'', which represents the
- behavior operators have in a "normal" cluster. The ''SingleReplica''
- mode will be used in single-node deployments and the operators should
- not configure the operand for highly-available operation NOTE: External
- topology mode is not applicable for this field.'
+ description: |-
+ infrastructureTopology expresses the expectations for infrastructure services that do not run on control
+ plane nodes, usually indicated by a node selector for a `role` value
+ other than `master`.
+ The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
+ The 'SingleReplica' mode will be used in single-node deployments
+ and the operators should not configure the operand for highly-available operation
+ NOTE: External topology mode is not applicable for this field.
enum:
- HighlyAvailable
- SingleReplica
type: string
platform:
- description: "platform is the underlying infrastructure provider for
- the cluster. \n Deprecated: Use platformStatus.type instead."
+ description: |-
+ platform is the underlying infrastructure provider for the cluster.
+
+ Deprecated: Use platformStatus.type instead.
enum:
- ""
- AWS
@@ -1026,8 +1040,9 @@ spec:
- External
type: string
platformStatus:
- description: platformStatus holds status information specific to the
- underlying infrastructure provider.
+ description: |-
+ platformStatus holds status information specific to the underlying
+ infrastructure provider.
properties:
alibabaCloud:
description: AlibabaCloud contains settings specific to the Alibaba
@@ -1081,11 +1096,11 @@ spec:
resources created by the cluster.
type: string
resourceTags:
- description: resourceTags is a list of additional tags to
- apply to AWS resources created for the cluster. See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
- for information on tagging AWS resources. AWS supports a
- maximum of 50 tags per resource. OpenShift reserves 25 tags
- for its use, leaving 25 tags available for the user.
+ description: |-
+ resourceTags is a list of additional tags to apply to AWS resources created for the cluster.
+ See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html for information on tagging AWS resources.
+ AWS supports a maximum of 50 tags per resource. OpenShift reserves 25 tags for its use, leaving 25 tags
+ available for the user.
items:
description: AWSResourceTag is a tag to apply to AWS resources
created for the cluster.
@@ -1097,10 +1112,10 @@ spec:
pattern: ^[0-9A-Za-z_.:/=+-@]+$
type: string
value:
- description: value is the value of the tag. Some AWS
- service do not support empty values. Since tags are
- added to resources in many services, the length of
- the tag value must meet the requirements of all services.
+ description: |-
+ value is the value of the tag.
+ Some AWS service do not support empty values. Since tags are added to resources in many services, the
+ length of the tag value must meet the requirements of all services.
maxLength: 256
minLength: 1
pattern: ^[0-9A-Za-z_.:/=+-@]+$
@@ -1113,24 +1128,27 @@ spec:
type: array
x-kubernetes-list-type: atomic
serviceEndpoints:
- description: ServiceEndpoints list contains custom endpoints
- which will override default service endpoint of AWS Services.
+ description: |-
+ ServiceEndpoints list contains custom endpoints which will override default
+ service endpoint of AWS Services.
There must be only one ServiceEndpoint for a service.
items:
- description: AWSServiceEndpoint store the configuration
- of a custom url to override existing defaults of AWS Services.
+ description: |-
+ AWSServiceEndpoint store the configuration of a custom url to
+ override existing defaults of AWS Services.
properties:
name:
- description: name is the name of the AWS service. The
- list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
+ description: |-
+ name is the name of the AWS service.
+ The list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
pattern: ^https://
type: string
type: object
@@ -1146,9 +1164,10 @@ spec:
management in non-soverign clouds such as Azure Stack.
type: string
cloudName:
- description: cloudName is the name of the Azure cloud environment
- which can be used to configure the Azure SDK with the appropriate
- Azure API endpoints. If empty, the value is equal to `AzurePublicCloud`.
+ description: |-
+ cloudName is the name of the Azure cloud environment which can be used to configure the Azure SDK
+ with the appropriate Azure API endpoints.
+ If empty, the value is equal to `AzurePublicCloud`.
enum:
- ""
- AzurePublicCloud
@@ -1158,42 +1177,37 @@ spec:
- AzureStackCloud
type: string
networkResourceGroupName:
- description: networkResourceGroupName is the Resource Group
- for network resources like the Virtual Network and Subnets
- used by the cluster. If empty, the value is same as ResourceGroupName.
+ description: |-
+ networkResourceGroupName is the Resource Group for network resources like the Virtual Network and Subnets used by the cluster.
+ If empty, the value is same as ResourceGroupName.
type: string
resourceGroupName:
description: resourceGroupName is the Resource Group for new
Azure resources created for the cluster.
type: string
resourceTags:
- description: resourceTags is a list of additional tags to
- apply to Azure resources created for the cluster. See https://docs.microsoft.com/en-us/rest/api/resources/tags
- for information on tagging Azure resources. Due to limitations
- on Automation, Content Delivery Network, DNS Azure resources,
- a maximum of 15 tags may be applied. OpenShift reserves
- 5 tags for internal use, allowing 10 tags for user configuration.
+ description: |-
+ resourceTags is a list of additional tags to apply to Azure resources created for the cluster.
+ See https://docs.microsoft.com/en-us/rest/api/resources/tags for information on tagging Azure resources.
+ Due to limitations on Automation, Content Delivery Network, DNS Azure resources, a maximum of 15 tags
+ may be applied. OpenShift reserves 5 tags for internal use, allowing 10 tags for user configuration.
items:
description: AzureResourceTag is a tag to apply to Azure
resources created for the cluster.
properties:
key:
- description: key is the key part of the tag. A tag key
- can have a maximum of 128 characters and cannot be
- empty. Key must begin with a letter, end with a letter,
- number or underscore, and must contain only alphanumeric
- characters and the following special characters `_
- . -`.
+ description: |-
+ key is the key part of the tag. A tag key can have a maximum of 128 characters and cannot be empty. Key
+ must begin with a letter, end with a letter, number or underscore, and must contain only alphanumeric
+ characters and the following special characters `_ . -`.
maxLength: 128
minLength: 1
pattern: ^[a-zA-Z]([0-9A-Za-z_.-]*[0-9A-Za-z_])?$
type: string
value:
- description: 'value is the value part of the tag. A
- tag value can have a maximum of 256 characters and
- cannot be empty. Value must contain only alphanumeric
- characters and the following special characters `_
- + , - . / : ; < = > ? @`.'
+ description: |-
+ value is the value part of the tag. A tag value can have a maximum of 256 characters and cannot be empty. Value
+ must contain only alphanumeric characters and the following special characters `_ + , - . / : ; < = > ? @`.
maxLength: 256
minLength: 1
pattern: ^[0-9A-Za-z_.=+-@]+$
@@ -1219,22 +1233,21 @@ spec:
platform.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1248,17 +1261,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1279,18 +1293,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on BareMetal platform which can be a
- user-managed or openshift-managed load balancer that
- is to be used for the OpenShift API and Ingress endpoints.
- When set to OpenShiftManagedDefault the static pods
- in charge of API and Ingress traffic load-balancing
+ description: |-
+ type defines the type of load balancer used by the cluster on BareMetal platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
defined in the machine config operator will be deployed.
- When set to UserManaged these static pods will not be
- deployed and it is expected that the load balancer is
- configured out of band by the deployer. When omitted,
- this means no opinion and the platform is left to choose
- a reasonable default. The default value is OpenShiftManagedDefault.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1317,13 +1329,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for BareMetal deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ BareMetal deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
equinixMetal:
@@ -1331,19 +1343,16 @@ spec:
Metal infrastructure provider.
properties:
apiServerInternalIP:
- description: apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers.
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
type: string
ingressIP:
- description: ingressIP is an external IP which routes to the
- default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names.
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
type: string
type: object
external:
@@ -1351,23 +1360,22 @@ spec:
External infrastructure provider.
properties:
cloudControllerManager:
- description: cloudControllerManager contains settings specific
- to the external Cloud Controller Manager (a.k.a. CCM or
- CPI). When omitted, new nodes will be not tainted and no
- extra initialization from the cloud controller manager is
- expected.
+ description: |-
+ cloudControllerManager contains settings specific to the external Cloud Controller Manager (a.k.a. CCM or CPI).
+ When omitted, new nodes will be not tainted
+ and no extra initialization from the cloud controller manager is expected.
properties:
state:
- description: "state determines whether or not an external
- Cloud Controller Manager is expected to be installed
- within the cluster. https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/#running-cloud-controller-manager
- \n Valid values are \"External\", \"None\" and omitted.
- When set to \"External\", new nodes will be tainted
- as uninitialized when created, preventing them from
- running workloads until they are initialized by the
- cloud controller manager. When omitted or set to \"None\",
- new nodes will be not tainted and no extra initialization
- from the cloud controller manager is expected."
+ description: |-
+ state determines whether or not an external Cloud Controller Manager is expected to
+ be installed within the cluster.
+ https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/#running-cloud-controller-manager
+
+ Valid values are "External", "None" and omitted.
+ When set to "External", new nodes will be tainted as uninitialized when created,
+ preventing them from running workloads until they are initialized by the cloud controller manager.
+ When omitted or set to "None", new nodes will be not tainted
+ and no extra initialization from the cloud controller manager is expected.
enum:
- ""
- External
@@ -1399,23 +1407,20 @@ spec:
created for the cluster.
type: string
resourceLabels:
- description: 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.
+ description: |-
+ 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.
items:
description: GCPResourceLabel is a label to apply to GCP
resources created for the cluster.
properties:
key:
- description: key is the key part of the label. A label
- key can have a maximum of 63 characters and cannot
- be empty. Label key must begin with a lowercase letter,
- and must contain only lowercase letters, numeric characters,
- and the following special characters `_-`. Label key
- must not have the reserved prefixes `kubernetes-io`
+ description: |-
+ key is the key part of the label. A label key can have a maximum of 63 characters and cannot be empty.
+ Label key must begin with a lowercase letter, and must contain only lowercase letters, numeric characters,
+ and the following special characters `_-`. Label key must not have the reserved prefixes `kubernetes-io`
and `openshift-io`.
maxLength: 63
minLength: 1
@@ -1426,11 +1431,9 @@ spec:
or `kubernetes-io`
rule: '!self.startsWith(''openshift-io'') && !self.startsWith(''kubernetes-io'')'
value:
- description: value is the value part of the label. A
- label value can have a maximum of 63 characters and
- cannot be empty. Value must contain only lowercase
- letters, numeric characters, and the following special
- characters `_-`.
+ description: |-
+ value is the value part of the label. A label value can have a maximum of 63 characters and cannot be empty.
+ Value must contain only lowercase letters, numeric characters, and the following special characters `_-`.
maxLength: 63
minLength: 1
pattern: ^[0-9a-z_-]{1,63}$
@@ -1449,47 +1452,41 @@ spec:
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
resourceTags:
- description: 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.
+ description: |-
+ 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.
items:
description: GCPResourceTag is a tag to apply to GCP resources
created for the cluster.
properties:
key:
- description: key is the key part of the tag. A tag key
- can have a maximum of 63 characters and cannot be
- empty. Tag key must begin and end with an alphanumeric
- character, and must contain only uppercase, lowercase
- alphanumeric characters, and the following special
- characters `._-`.
+ description: |-
+ key is the key part of the tag. A tag key can have a maximum of 63 characters and cannot be empty.
+ Tag key must begin and end with an alphanumeric character, and must contain only uppercase, lowercase
+ alphanumeric characters, and the following special characters `._-`.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z0-9]([0-9A-Za-z_.-]{0,61}[a-zA-Z0-9])?$
type: string
parentID:
- description: 'parentID is the ID of the hierarchical
- resource where the tags are defined, e.g. at the Organization
- or the Project level. To find the Organization or
- Project ID refer to the following pages: https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id,
+ description: |-
+ parentID is the ID of the hierarchical resource where the tags are defined,
+ e.g. at the Organization or the Project level. To find the Organization or Project ID refer to the following pages:
+ https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id,
https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects.
- An OrganizationID must consist of decimal numbers,
- and cannot have leading zeroes. A ProjectID must be
- 6 to 30 characters in length, can only contain lowercase
- letters, numbers, and hyphens, and must start with
- a letter, and cannot end with a hyphen.'
+ An OrganizationID must consist of decimal numbers, and cannot have leading zeroes.
+ A ProjectID must be 6 to 30 characters in length, can only contain lowercase letters, numbers,
+ and hyphens, and must start with a letter, and cannot end with a hyphen.
maxLength: 32
minLength: 1
pattern: (^[1-9][0-9]{0,31}$)|(^[a-z][a-z0-9-]{4,28}[a-z0-9]$)
type: string
value:
- description: value is the value part of the tag. A tag
- value can have a maximum of 63 characters and cannot
- be empty. Tag value must begin and end with an alphanumeric
- character, and must contain only uppercase, lowercase
- alphanumeric characters, and the following special
- characters `_-.@%=+:,*#&(){}[]` and spaces.
+ description: |-
+ value is the value part of the tag. A tag value can have a maximum of 63 characters and cannot be empty.
+ Tag value must begin and end with an alphanumeric character, and must contain only uppercase, lowercase
+ alphanumeric characters, and the following special characters `_-.@%=+:,*#&(){}[]` and spaces.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z0-9]([0-9A-Za-z_.@%=+:,*#&()\[\]{}\-\s]{0,61}[a-zA-Z0-9])?$
@@ -1521,13 +1518,14 @@ spec:
infrastructure provider.
properties:
cisInstanceCRN:
- description: CISInstanceCRN is the CRN of the Cloud Internet
- Services instance managing the DNS zone for the cluster's
- base domain
+ description: |-
+ CISInstanceCRN is the CRN of the Cloud Internet Services instance managing
+ the DNS zone for the cluster's base domain
type: string
dnsInstanceCRN:
- description: DNSInstanceCRN is the CRN of the DNS Services
- instance managing the DNS zone for the cluster's base domain
+ description: |-
+ DNSInstanceCRN is the CRN of the DNS Services instance managing the DNS zone
+ for the cluster's base domain
type: string
location:
description: Location is where the cluster has been deployed
@@ -1541,26 +1539,23 @@ spec:
IBMCloud resources created for the cluster.
type: string
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of an
- IBM Cloud service. These endpoints are consumed by components
- within the cluster to reach the respective IBM Cloud Services.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of an IBM Cloud service. These endpoints are consumed by
+ components within the cluster to reach the respective IBM Cloud Services.
items:
- description: IBMCloudServiceEndpoint stores the configuration
- of a custom url to override existing defaults of IBM Cloud
- Services.
+ description: |-
+ IBMCloudServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of IBM Cloud Services.
properties:
name:
- description: 'name is the name of the IBM Cloud service.
- Possible values are: CIS, COS, COSConfig, DNSServices,
- GlobalCatalog, GlobalSearch, GlobalTagging, HyperProtect,
- IAM, KeyProtect, ResourceController, ResourceManager,
- or VPC. For example, the IBM Cloud Private IAM service
- could be configured with the service `name` of `IAM`
- and `url` of `https://private.iam.cloud.ibm.com` Whereas
- the IBM Cloud Private VPC service for US South (Dallas)
- could be configured with the service `name` of `VPC`
- and `url` of `https://us.south.private.iaas.cloud.ibm.com`'
+ description: |-
+ name is the name of the IBM Cloud service.
+ Possible values are: CIS, COS, COSConfig, DNSServices, GlobalCatalog, GlobalSearch, GlobalTagging, HyperProtect, IAM, KeyProtect, ResourceController, ResourceManager, or VPC.
+ For example, the IBM Cloud Private IAM service could be configured with the
+ service `name` of `IAM` and `url` of `https://private.iam.cloud.ibm.com`
+ Whereas the IBM Cloud Private VPC service for US South (Dallas) could be configured
+ with the service `name` of `VPC` and `url` of `https://us.south.private.iaas.cloud.ibm.com`
enum:
- CIS
- COS
@@ -1577,10 +1572,10 @@ spec:
- VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
type: string
x-kubernetes-validations:
- message: url must be a valid absolute URL
@@ -1599,19 +1594,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers.
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
type: string
ingressIP:
- description: ingressIP is an external IP which routes to the
- default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names.
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
type: string
type: object
nutanix:
@@ -1619,22 +1611,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1648,17 +1639,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1679,18 +1671,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on Nutanix platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on Nutanix platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1705,22 +1695,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1734,21 +1723,23 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
cloudName:
- description: cloudName is the name of the desired OpenStack
- cloud in the client configuration file (`clouds.yaml`).
+ description: |-
+ cloudName is the name of the desired OpenStack cloud in the
+ client configuration file (`clouds.yaml`).
type: string
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1769,18 +1760,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on OpenStack platform which can be a
- user-managed or openshift-managed load balancer that
- is to be used for the OpenShift API and Ingress endpoints.
- When set to OpenShiftManagedDefault the static pods
- in charge of API and Ingress traffic load-balancing
+ description: |-
+ type defines the type of load balancer used by the cluster on OpenStack platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
defined in the machine config operator will be deployed.
- When set to UserManaged these static pods will not be
- deployed and it is expected that the load balancer is
- configured out of band by the deployer. When omitted,
- this means no opinion and the platform is left to choose
- a reasonable default. The default value is OpenShiftManagedDefault.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1807,13 +1796,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for OpenStack deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ OpenStack deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
ovirt:
@@ -1821,22 +1810,21 @@ spec:
provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1850,17 +1838,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1881,18 +1870,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on Ovirt platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on Ovirt platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1911,27 +1898,26 @@ spec:
Virtual Servers infrastructure provider.
properties:
cisInstanceCRN:
- description: CISInstanceCRN is the CRN of the Cloud Internet
- Services instance managing the DNS zone for the cluster's
- base domain
+ description: |-
+ CISInstanceCRN is the CRN of the Cloud Internet Services instance managing
+ the DNS zone for the cluster's base domain
type: string
dnsInstanceCRN:
- description: DNSInstanceCRN is the CRN of the DNS Services
- instance managing the DNS zone for the cluster's base domain
+ description: |-
+ DNSInstanceCRN is the CRN of the DNS Services instance managing the DNS zone
+ for the cluster's base domain
type: string
region:
description: region holds the default Power VS region for
new Power VS resources created by the cluster.
type: string
resourceGroup:
- description: 'resourceGroup is the resource group name for
- new IBMCloud resources created for a cluster. The resource
- group specified here will be used by cluster-image-registry-operator
- to set up a COS Instance in IBMCloud for the cluster registry.
+ description: |-
+ resourceGroup is the resource group name for new IBMCloud resources created for a cluster.
+ The resource group specified here will be used by cluster-image-registry-operator to set up a COS Instance in IBMCloud for the cluster registry.
More about resource groups can be found here: https://cloud.ibm.com/docs/account?topic=account-rgs.
- When omitted, the image registry operator won''t be able
- to configure storage, which results in the image registry
- cluster operator not being in an available state.'
+ When omitted, the image registry operator won't be able to configure storage,
+ which results in the image registry cluster operator not being in an available state.
maxLength: 40
pattern: ^[a-zA-Z0-9-_ ]+$
type: string
@@ -1939,26 +1925,42 @@ spec:
- message: resourceGroup is immutable once set
rule: oldSelf == '' || self == oldSelf
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of a Power
- VS service.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of a Power VS service.
items:
- description: PowervsServiceEndpoint stores the configuration
- of a custom url to override existing defaults of PowerVS
- Services.
+ description: |-
+ PowervsServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of PowerVS Services.
properties:
name:
- description: name is the name of the Power VS service.
- Few of the services are IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
+ description: |-
+ name is the name of the Power VS service.
+ Few of the services are
+ IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
ResourceController - https://cloud.ibm.com/apidocs/resource-controller/resource-controller
Power Cloud - https://cloud.ibm.com/apidocs/power-cloud
- pattern: ^[a-z0-9-]+$
+ enum:
+ - CIS
+ - COS
+ - COSConfig
+ - DNSServices
+ - GlobalCatalog
+ - GlobalSearch
+ - GlobalTagging
+ - HyperProtect
+ - IAM
+ - KeyProtect
+ - Power
+ - ResourceController
+ - ResourceManager
+ - VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
format: uri
pattern: ^https://
type: string
@@ -1971,27 +1973,27 @@ spec:
- name
x-kubernetes-list-type: map
zone:
- description: 'zone holds the default zone for the new Power
- VS resources created by the cluster. Note: Currently only
- single-zone OCP clusters are supported'
+ description: |-
+ zone holds the default zone for the new Power VS resources created by the cluster.
+ Note: Currently only single-zone OCP clusters are supported
type: string
type: object
x-kubernetes-validations:
- message: cannot unset resourceGroup once set
rule: '!has(oldSelf.resourceGroup) || has(self.resourceGroup)'
type:
- description: "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\", \"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. \n This
- value will be synced with to the `status.platform` and `status.platformStatus.type`.
- Currently this value cannot be changed once set."
+ description: |-
+ 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", "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.
+
+ This value will be synced with to the `status.platform` and `status.platformStatus.type`.
+ Currently this value cannot be changed once set.
enum:
- ""
- AWS
@@ -2016,22 +2018,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -2045,17 +2046,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -2076,18 +2078,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on VSphere platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on VSphere platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -2114,13 +2114,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for vSphere deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ vSphere deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
type: object
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml
index a3aae4734b..7d365b50f2 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml
@@ -21,20 +21,25 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Infrastructure holds cluster-wide information about Infrastructure.
- \ The canonical name is `cluster` \n Compatibility level 1: Stable within
- a major release for a minimum of 12 months or 3 minor releases (whichever
- is longer)."
+ description: |-
+ Infrastructure holds cluster-wide information about Infrastructure. The canonical name is `cluster`
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,19 +47,19 @@ spec:
description: spec holds user settable values for configuration
properties:
cloudConfig:
- description: "cloudConfig is a reference to a ConfigMap containing
- the cloud provider configuration file. This configuration file is
- used to configure the Kubernetes cloud provider integration when
- using the built-in cloud provider integration or the external cloud
- controller manager. The namespace for this config map is openshift-config.
- \n cloudConfig should only be consumed by the kube_cloud_config
- controller. The controller is responsible for using the user configuration
- in the spec for various platforms and combining that with the user
- provided ConfigMap in this field to create a stitched kube cloud
- config. The controller generates a ConfigMap `kube-cloud-config`
- in `openshift-config-managed` namespace with the kube cloud config
- is stored in `cloud.conf` key. All the clients are expected to use
- the generated ConfigMap only."
+ description: |-
+ cloudConfig is a reference to a ConfigMap containing the cloud provider configuration file.
+ This configuration file is used to configure the Kubernetes cloud provider integration
+ when using the built-in cloud provider integration or the external cloud controller manager.
+ The namespace for this config map is openshift-config.
+
+ cloudConfig should only be consumed by the kube_cloud_config controller.
+ The controller is responsible for using the user configuration in the spec
+ for various platforms and combining that with the user provided ConfigMap in this field
+ to create a stitched kube cloud config.
+ The controller generates a ConfigMap `kube-cloud-config` in `openshift-config-managed` namespace
+ with the kube cloud config is stored in `cloud.conf` key.
+ All the clients are expected to use the generated ConfigMap only.
properties:
key:
description: Key allows pointing to a specific key/value inside
@@ -64,8 +69,9 @@ spec:
type: string
type: object
platformSpec:
- description: platformSpec holds desired information specific to the
- underlying infrastructure provider.
+ description: |-
+ platformSpec holds desired information specific to the underlying
+ infrastructure provider.
properties:
alibabaCloud:
description: AlibabaCloud contains settings specific to the Alibaba
@@ -76,24 +82,27 @@ spec:
Services infrastructure provider.
properties:
serviceEndpoints:
- description: serviceEndpoints list contains custom endpoints
- which will override default service endpoint of AWS Services.
+ description: |-
+ serviceEndpoints list contains custom endpoints which will override default
+ service endpoint of AWS Services.
There must be only one ServiceEndpoint for a service.
items:
- description: AWSServiceEndpoint store the configuration
- of a custom url to override existing defaults of AWS Services.
+ description: |-
+ AWSServiceEndpoint store the configuration of a custom url to
+ override existing defaults of AWS Services.
properties:
name:
- description: name is the name of the AWS service. The
- list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
+ description: |-
+ name is the name of the AWS service.
+ The list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
pattern: ^https://
type: string
type: object
@@ -109,17 +118,16 @@ spec:
platform.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -138,15 +146,15 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -165,10 +173,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -194,17 +202,15 @@ spec:
Metal infrastructure provider.
type: object
external:
- description: ExternalPlatformType represents generic infrastructure
- provider. Platform-specific components should be supplemented
- separately.
+ description: |-
+ ExternalPlatformType represents generic infrastructure provider.
+ Platform-specific components should be supplemented separately.
properties:
platformName:
default: Unknown
- description: PlatformName holds the arbitrary string representing
- the infrastructure provider name, expected to be set at
- the installation time. This field is solely for informational
- and reporting purposes and is not expected to be used for
- decision-making.
+ description: |-
+ PlatformName holds the arbitrary string representing the infrastructure provider name, expected to be set at the installation time.
+ This field is solely for informational and reporting purposes and is not expected to be used for decision-making.
type: string
x-kubernetes-validations:
- message: platform name cannot be changed once set
@@ -227,20 +233,19 @@ spec:
infrastructure provider.
properties:
failureDomains:
- description: failureDomains configures failure domains information
- for the Nutanix platform. When set, the failure domains
- defined here may be used to spread Machines across prism
- element clusters to improve fault tolerance of the cluster.
+ description: |-
+ failureDomains configures failure domains information for the Nutanix platform.
+ When set, the failure domains defined here may be used to spread Machines across
+ prism element clusters to improve fault tolerance of the cluster.
items:
description: NutanixFailureDomain configures failure domain
information for the Nutanix platform.
properties:
cluster:
- description: cluster is to identify the cluster (the
- Prism Element under management of the Prism Central),
- in which the Machine's VM will be created. The cluster
- identifier (uuid or name) can be obtained from the
- Prism Central console or using the prism_central API.
+ description: |-
+ cluster is to identify the cluster (the Prism Element under management of the Prism Central),
+ in which the Machine's VM will be created. The cluster identifier (uuid or name) can be obtained
+ from the Prism Central console or using the prism_central API.
properties:
name:
description: name is the resource name in the PC.
@@ -270,23 +275,21 @@ spec:
rule: 'has(self.type) && self.type == ''Name'' ? has(self.name)
: !has(self.name)'
name:
- description: name defines the unique name of a failure
- domain. Name is required and must be at most 64 characters
- in length. It must consist of only lower case alphanumeric
- characters and hyphens (-). It must start and end
- with an alphanumeric character. This value is arbitrary
- and is used to identify the failure domain within
- the platform.
+ description: |-
+ name defines the unique name of a failure domain.
+ Name is required and must be at most 64 characters in length.
+ It must consist of only lower case alphanumeric characters and hyphens (-).
+ It must start and end with an alphanumeric character.
+ This value is arbitrary and is used to identify the failure domain within the platform.
maxLength: 64
minLength: 1
pattern: '[a-z0-9]([-a-z0-9]*[a-z0-9])?'
type: string
subnets:
- description: subnets holds a list of identifiers (one
- or more) of the cluster's network subnets for the
- Machine's VM to connect to. The subnet identifiers
- (uuid or name) can be obtained from the Prism Central
- console or using the prism_central API.
+ description: |-
+ subnets holds a list of identifiers (one or more) of the cluster's network subnets
+ for the Machine's VM to connect to. The subnet identifiers (uuid or name) can be
+ obtained from the Prism Central console or using the prism_central API.
items:
description: NutanixResourceIdentifier holds the identity
of a Nutanix PC resource (cluster, image, subnet,
@@ -336,11 +339,10 @@ spec:
- name
x-kubernetes-list-type: map
prismCentral:
- description: prismCentral holds the endpoint address and port
- to access the Nutanix Prism Central. When a cluster-wide
- proxy is installed, by default, this endpoint will be accessed
- via the proxy. Should you wish for communication with this
- endpoint not to be proxied, please add the endpoint to the
+ description: |-
+ prismCentral holds the endpoint address and port to access the Nutanix Prism Central.
+ When a cluster-wide proxy is installed, by default, this endpoint will be accessed via the proxy.
+ Should you wish for communication with this endpoint not to be proxied, please add the endpoint to the
proxy spec.noProxy list.
properties:
address:
@@ -361,25 +363,22 @@ spec:
- port
type: object
prismElements:
- description: prismElements holds one or more endpoint address
- and port data to access the Nutanix Prism Elements (clusters)
- of the Nutanix Prism Central. Currently we only support
- one Prism Element (cluster) for an OpenShift cluster, where
- all the Nutanix resources (VMs, subnets, volumes, etc.)
- used in the OpenShift cluster are located. In the future,
- we may support Nutanix resources (VMs, etc.) spread over
- multiple Prism Elements (clusters) of the Prism Central.
+ description: |-
+ prismElements holds one or more endpoint address and port data to access the Nutanix
+ Prism Elements (clusters) of the Nutanix Prism Central. Currently we only support one
+ Prism Element (cluster) for an OpenShift cluster, where all the Nutanix resources (VMs, subnets, volumes, etc.)
+ used in the OpenShift cluster are located. In the future, we may support Nutanix resources (VMs, etc.)
+ spread over multiple Prism Elements (clusters) of the Prism Central.
items:
description: NutanixPrismElementEndpoint holds the name
and endpoint data for a Prism Element (cluster)
properties:
endpoint:
- description: endpoint holds the endpoint address and
- port data of the Prism Element (cluster). When a cluster-wide
- proxy is installed, by default, this endpoint will
- be accessed via the proxy. Should you wish for communication
- with this endpoint not to be proxied, please add the
- endpoint to the proxy spec.noProxy list.
+ description: |-
+ endpoint holds the endpoint address and port data of the Prism Element (cluster).
+ When a cluster-wide proxy is installed, by default, this endpoint will be accessed via the proxy.
+ Should you wish for communication with this endpoint not to be proxied, please add the endpoint to the
+ proxy spec.noProxy list.
properties:
address:
description: address is the endpoint address (DNS
@@ -399,10 +398,9 @@ spec:
- port
type: object
name:
- description: name is the name of the Prism Element (cluster).
- This value will correspond with the cluster field
- configured on other resources (eg Machines, PVCs,
- etc).
+ description: |-
+ name is the name of the Prism Element (cluster). This value will correspond with
+ the cluster field configured on other resources (eg Machines, PVCs, etc).
maxLength: 256
type: string
required:
@@ -422,17 +420,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -451,15 +448,15 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -478,10 +475,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -511,26 +508,42 @@ spec:
Systems Virtual Servers infrastructure provider.
properties:
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of a Power
- VS service.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of a Power VS service.
items:
- description: PowervsServiceEndpoint stores the configuration
- of a custom url to override existing defaults of PowerVS
- Services.
+ description: |-
+ PowervsServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of PowerVS Services.
properties:
name:
- description: name is the name of the Power VS service.
- Few of the services are IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
+ description: |-
+ name is the name of the Power VS service.
+ Few of the services are
+ IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
ResourceController - https://cloud.ibm.com/apidocs/resource-controller/resource-controller
Power Cloud - https://cloud.ibm.com/apidocs/power-cloud
- pattern: ^[a-z0-9-]+$
+ enum:
+ - CIS
+ - COS
+ - COSConfig
+ - DNSServices
+ - GlobalCatalog
+ - GlobalSearch
+ - GlobalTagging
+ - HyperProtect
+ - IAM
+ - KeyProtect
+ - Power
+ - ResourceController
+ - ResourceManager
+ - VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
format: uri
pattern: ^https://
type: string
@@ -544,16 +557,15 @@ spec:
x-kubernetes-list-type: map
type: object
type:
- description: 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.
+ description: |-
+ 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.
enum:
- ""
- AWS
@@ -578,17 +590,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -607,24 +618,26 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
failureDomains:
- description: failureDomains contains the definition of region,
- zone and the vCenter topology. If this is omitted failure
- domains (regions and zones) will not be used.
+ description: |-
+ failureDomains contains the definition of region, zone and the vCenter topology.
+ If this is omitted failure domains (regions and zones) will not be used.
items:
- description: VSpherePlatformFailureDomainSpec holds the
- region and zone failure domain and the vCenter topology
- of that failure domain.
+ description: |-
+ VSpherePlatformFailureDomainSpec holds the region and zone failure domain and
+ the vCenter topology of that failure domain.
properties:
name:
- description: name defines the arbitrary but unique name
+ description: |-
+ name defines the arbitrary but unique name
of a failure domain.
maxLength: 256
minLength: 1
type: string
region:
- description: region defines the name of a region tag
- that will be attached to a vCenter datacenter. The
- tag category in vCenter must be named openshift-region.
+ description: |-
+ region defines the name of a region tag that will
+ be attached to a vCenter datacenter. The tag
+ category in vCenter must be named openshift-region.
maxLength: 80
minLength: 1
type: string
@@ -634,7 +647,7 @@ spec:
- format: ipv6
- format: hostname
description: server is the fully-qualified domain name
- or the IP address of the vCenter server. ---
+ or the IP address of the vCenter server.
maxLength: 255
minLength: 1
type: string
@@ -643,45 +656,48 @@ spec:
using vSphere constructs
properties:
computeCluster:
- description: computeCluster the absolute path of
- the vCenter cluster in which virtual machine will
- be located. The absolute path is of the form //host/.
+ description: |-
+ computeCluster the absolute path of the vCenter cluster
+ in which virtual machine will be located.
+ The absolute path is of the form //host/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/host/.*?
type: string
datacenter:
- description: datacenter is the name of vCenter datacenter
- in which virtual machines will be located. The
- maximum length of the datacenter name is 80 characters.
+ description: |-
+ datacenter is the name of vCenter datacenter in which virtual machines will be located.
+ The maximum length of the datacenter name is 80 characters.
maxLength: 80
type: string
datastore:
- description: datastore is the absolute path of the
- datastore in which the virtual machine is located.
+ description: |-
+ datastore is the absolute path of the datastore in which the
+ virtual machine is located.
The absolute path is of the form //datastore/
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/datastore/.*?
type: string
folder:
- description: folder is the absolute path of the
- folder where virtual machines are located. The
- absolute path is of the form //vm/.
+ description: |-
+ folder is the absolute path of the folder where
+ virtual machines are located. The absolute path
+ is of the form //vm/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/vm/.*?
type: string
networks:
- description: 'networks is the list of port group
- network names within this failure domain. If feature
- gate VSphereMultiNetworks is enabled, up to 10
- network adapters may be defined. 10 is the maximum
- number of virtual network devices which may be
- attached to a VM as defined by: https://configmax.esp.vmware.com/guest?vmwareproduct=vSphere&release=vSphere%208.0&categories=1-0
- The available networks (port groups) can be listed
- using `govc ls ''network/*''` Networks should
- be in the form of an absolute path: //network/.'
+ description: |-
+ networks is the list of port group network names within this failure domain.
+ If feature gate VSphereMultiNetworks is enabled, up to 10 network adapters may be defined.
+ 10 is the maximum number of virtual network devices which may be attached to a VM as defined by:
+ https://configmax.esp.vmware.com/guest?vmwareproduct=vSphere&release=vSphere%208.0&categories=1-0
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
+ Networks should be in the form of an absolute path:
+ //network/.
items:
type: string
maxItems: 10
@@ -689,25 +705,24 @@ spec:
type: array
x-kubernetes-list-type: atomic
resourcePool:
- description: resourcePool is the absolute path of
- the resource pool where virtual machines will
- be created. The absolute path is of the form //host//Resources/.
+ description: |-
+ resourcePool is the absolute path of the resource pool where virtual machines will be
+ created. The absolute path is of the form //host//Resources/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/host/.*?/Resources.*
type: string
template:
- description: "template is the full inventory path
- of the virtual machine or template that will be
- cloned when creating new machines in this failure
- domain. The maximum length of the path is 2048
- characters. \n When omitted, the template will
- be calculated by the control plane machineset
- operator based on the region and zone defined
- in VSpherePlatformFailureDomainSpec. For example,
- for zone=zonea, region=region1, and infrastructure
- name=test, the template path would be calculated
- as //vm/test-rhcos-region1-zonea."
+ description: |-
+ template is the full inventory path of the virtual machine or template
+ that will be cloned when creating new machines in this failure domain.
+ The maximum length of the path is 2048 characters.
+
+ When omitted, the template will be calculated by the control plane
+ machineset operator based on the region and zone defined in
+ VSpherePlatformFailureDomainSpec.
+ For example, for zone=zonea, region=region1, and infrastructure name=test,
+ the template path would be calculated as //vm/test-rhcos-region1-zonea.
maxLength: 2048
minLength: 1
pattern: ^/.*?/vm/.*?
@@ -719,9 +734,10 @@ spec:
- networks
type: object
zone:
- description: zone defines the name of a zone tag that
- will be attached to a vCenter cluster. The tag category
- in vCenter must be named openshift-zone.
+ description: |-
+ zone defines the name of a zone tag that will
+ be attached to a vCenter cluster. The tag
+ category in vCenter must be named openshift-zone.
maxLength: 80
minLength: 1
type: string
@@ -737,15 +753,15 @@ spec:
- name
x-kubernetes-list-type: map
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -764,10 +780,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -783,41 +799,39 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeNetworking:
- description: 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.
+ description: |-
+ 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.
properties:
external:
description: external represents the network configuration
of the node that is externally routable.
properties:
excludeNetworkSubnetCidr:
- description: excludeNetworkSubnetCidr IP addresses
- in subnet ranges will be excluded when selecting
- the IP address from the VirtualMachine's VM for
- use in the status.addresses fields. ---
+ description: |-
+ excludeNetworkSubnetCidr IP addresses in subnet ranges will be excluded when selecting
+ the IP address from the VirtualMachine's VM for use in the status.addresses fields.
items:
format: cidr
type: string
type: array
x-kubernetes-list-type: atomic
network:
- description: network VirtualMachine's VM Network names
- that will be used to when searching for status.addresses
- fields. Note that if internal.networkSubnetCIDR
- and external.networkSubnetCIDR are not set, then
- the vNIC associated to this network must only have
- a single IP address assigned to it. The available
- networks (port groups) can be listed using `govc
- ls 'network/*'`
+ description: |-
+ network VirtualMachine's VM Network names that will be used to when searching
+ for status.addresses fields. Note that if internal.networkSubnetCIDR and
+ external.networkSubnetCIDR are not set, then the vNIC associated to this network must
+ only have a single IP address assigned to it.
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
type: string
networkSubnetCidr:
- description: networkSubnetCidr IP address on VirtualMachine's
- network interfaces included in the fields' CIDRs
- that will be used in respective status.addresses
- fields. ---
+ description: |-
+ networkSubnetCidr IP address on VirtualMachine's network interfaces included in the fields' CIDRs
+ that will be used in respective status.addresses fields.
items:
format: cidr
type: string
@@ -829,30 +843,27 @@ spec:
of the node that is routable only within the cluster.
properties:
excludeNetworkSubnetCidr:
- description: excludeNetworkSubnetCidr IP addresses
- in subnet ranges will be excluded when selecting
- the IP address from the VirtualMachine's VM for
- use in the status.addresses fields. ---
+ description: |-
+ excludeNetworkSubnetCidr IP addresses in subnet ranges will be excluded when selecting
+ the IP address from the VirtualMachine's VM for use in the status.addresses fields.
items:
format: cidr
type: string
type: array
x-kubernetes-list-type: atomic
network:
- description: network VirtualMachine's VM Network names
- that will be used to when searching for status.addresses
- fields. Note that if internal.networkSubnetCIDR
- and external.networkSubnetCIDR are not set, then
- the vNIC associated to this network must only have
- a single IP address assigned to it. The available
- networks (port groups) can be listed using `govc
- ls 'network/*'`
+ description: |-
+ network VirtualMachine's VM Network names that will be used to when searching
+ for status.addresses fields. Note that if internal.networkSubnetCIDR and
+ external.networkSubnetCIDR are not set, then the vNIC associated to this network must
+ only have a single IP address assigned to it.
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
type: string
networkSubnetCidr:
- description: networkSubnetCidr IP address on VirtualMachine's
- network interfaces included in the fields' CIDRs
- that will be used in respective status.addresses
- fields. ---
+ description: |-
+ networkSubnetCidr IP address on VirtualMachine's network interfaces included in the fields' CIDRs
+ that will be used in respective status.addresses fields.
items:
format: cidr
type: string
@@ -861,36 +872,38 @@ spec:
type: object
type: object
vcenters:
- description: vcenters holds the connection details for services
- to communicate with vCenter. Currently, only a single vCenter
- is supported, but in tech preview 3 vCenters are supported.
- Once the cluster has been installed, you are unable to change
- the current number of defined vCenters except in the case
- where the cluster has been upgraded from a version of OpenShift
- where the vsphere platform spec was not present. You may
- make modifications to the existing vCenters that are defined
- in the vcenters list in order to match with any added or
- modified failure domains. ---
+ description: |-
+ vcenters holds the connection details for services to communicate with vCenter.
+ Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
+ Once the cluster has been installed, you are unable to change the current number of defined
+ vCenters except in the case where the cluster has been upgraded from a version of OpenShift
+ where the vsphere platform spec was not present. You may make modifications to the existing
+ vCenters that are defined in the vcenters list in order to match with any added or modified
+ failure domains.
items:
- description: VSpherePlatformVCenterSpec stores the vCenter
- connection fields. This is used by the vSphere CCM.
+ description: |-
+ VSpherePlatformVCenterSpec stores the vCenter connection fields.
+ This is used by the vSphere CCM.
properties:
datacenters:
- description: The vCenter Datacenters in which the RHCOS
- vm guests are located. This field will be used by
- the Cloud Controller Manager. Each datacenter listed
- here should be used within a topology.
+ description: |-
+ The vCenter Datacenters in which the RHCOS
+ vm guests are located. This field will
+ be used by the Cloud Controller Manager.
+ Each datacenter listed here should be used within
+ a topology.
items:
type: string
minItems: 1
type: array
x-kubernetes-list-type: set
port:
- description: port is the TCP port that will be used
- to communicate to the vCenter endpoint. When omitted,
- this means the user has no opinion and it is up to
- the platform to choose a sensible default, which is
- subject to change over time.
+ description: |-
+ port is the TCP port that will be used to communicate to
+ the vCenter endpoint.
+ When omitted, this means the user has no opinion and
+ it is up to the platform to choose a sensible default,
+ which is subject to change over time.
format: int32
maximum: 32767
minimum: 1
@@ -901,7 +914,7 @@ spec:
- format: ipv6
- format: hostname
description: server is the fully-qualified domain name
- or the IP address of the vCenter server. ---
+ or the IP address of the vCenter server.
maxLength: 255
type: string
required:
@@ -936,28 +949,27 @@ spec:
be overridden.
properties:
apiServerInternalURI:
- description: apiServerInternalURL is a valid URI with scheme 'https',
- address and optionally a port (defaulting to 443). apiServerInternalURL
- can be used by components like kubelets, to contact the Kubernetes
- API server using the infrastructure provider rather than Kubernetes
- networking.
+ description: |-
+ apiServerInternalURL is a valid URI with scheme 'https',
+ address and optionally a port (defaulting to 443). apiServerInternalURL can be used by components
+ like kubelets, to contact the Kubernetes API server using the
+ infrastructure provider rather than Kubernetes networking.
type: string
apiServerURL:
- description: apiServerURL is a valid URI with scheme 'https', address
- and optionally a port (defaulting to 443). apiServerURL can be
- used by components like the web console to tell users where to find
- the Kubernetes API.
+ description: |-
+ apiServerURL is a valid URI with scheme 'https', address and
+ optionally a port (defaulting to 443). apiServerURL can be used by components like the web console
+ to tell users where to find the Kubernetes API.
type: string
controlPlaneTopology:
default: HighlyAvailable
- description: controlPlaneTopology expresses the expectations for operands
- that normally run on control nodes. The default is 'HighlyAvailable',
- which represents the behavior operators have in a "normal" cluster.
+ description: |-
+ controlPlaneTopology expresses the expectations for operands that normally run on control nodes.
+ The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
The 'SingleReplica' mode will be used in single-node deployments
- and the operators should not configure the operand for highly-available
- operation The 'External' mode indicates that the control plane is
- hosted externally to the cluster and that its components are not
- visible within the cluster.
+ and the operators should not configure the operand for highly-available operation
+ The 'External' mode indicates that the control plane is hosted externally to the cluster and that
+ its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
@@ -965,47 +977,49 @@ spec:
type: string
cpuPartitioning:
default: None
- description: cpuPartitioning expresses if CPU partitioning is a currently
- enabled feature in the cluster. CPU Partitioning means that this
- cluster can support partitioning workloads to specific CPU Sets.
- Valid values are "None" and "AllNodes". When omitted, the default
- value is "None". The default value of "None" indicates that no nodes
- will be setup with CPU partitioning. The "AllNodes" value indicates
- that all nodes have been setup with CPU partitioning, and can then
- be further configured via the PerformanceProfile API.
+ description: |-
+ cpuPartitioning expresses if CPU partitioning is a currently enabled feature in the cluster.
+ CPU Partitioning means that this cluster can support partitioning workloads to specific CPU Sets.
+ Valid values are "None" and "AllNodes". When omitted, the default value is "None".
+ The default value of "None" indicates that no nodes will be setup with CPU partitioning.
+ The "AllNodes" value indicates that all nodes have been setup with CPU partitioning,
+ and can then be further configured via the PerformanceProfile API.
enum:
- None
- AllNodes
type: string
etcdDiscoveryDomain:
- description: 'etcdDiscoveryDomain is the domain used to fetch the
- SRV records for discovering etcd servers and clients. For more info:
- https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery
- deprecated: as of 4.7, this field is no longer set or honored. It
- will be removed in a future release.'
+ description: |-
+ etcdDiscoveryDomain is the domain used to fetch the SRV records for discovering
+ etcd servers and clients.
+ For more info: https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery
+ deprecated: as of 4.7, this field is no longer set or honored. It will be removed in a future release.
type: string
infrastructureName:
- description: infrastructureName uniquely identifies a cluster with
- a human friendly name. Once set it should not be changed. Must be
- of max length 27 and must have only alphanumeric or hyphen characters.
+ description: |-
+ infrastructureName uniquely identifies a cluster with a human friendly name.
+ Once set it should not be changed. Must be of max length 27 and must have only
+ alphanumeric or hyphen characters.
type: string
infrastructureTopology:
default: HighlyAvailable
- description: 'infrastructureTopology expresses the expectations for
- infrastructure services that do not run on control plane nodes,
- usually indicated by a node selector for a `role` value other than
- `master`. The default is ''HighlyAvailable'', which represents the
- behavior operators have in a "normal" cluster. The ''SingleReplica''
- mode will be used in single-node deployments and the operators should
- not configure the operand for highly-available operation NOTE: External
- topology mode is not applicable for this field.'
+ description: |-
+ infrastructureTopology expresses the expectations for infrastructure services that do not run on control
+ plane nodes, usually indicated by a node selector for a `role` value
+ other than `master`.
+ The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
+ The 'SingleReplica' mode will be used in single-node deployments
+ and the operators should not configure the operand for highly-available operation
+ NOTE: External topology mode is not applicable for this field.
enum:
- HighlyAvailable
- SingleReplica
type: string
platform:
- description: "platform is the underlying infrastructure provider for
- the cluster. \n Deprecated: Use platformStatus.type instead."
+ description: |-
+ platform is the underlying infrastructure provider for the cluster.
+
+ Deprecated: Use platformStatus.type instead.
enum:
- ""
- AWS
@@ -1026,8 +1040,9 @@ spec:
- External
type: string
platformStatus:
- description: platformStatus holds status information specific to the
- underlying infrastructure provider.
+ description: |-
+ platformStatus holds status information specific to the underlying
+ infrastructure provider.
properties:
alibabaCloud:
description: AlibabaCloud contains settings specific to the Alibaba
@@ -1076,16 +1091,120 @@ spec:
description: AWS contains settings specific to the Amazon Web
Services infrastructure provider.
properties:
+ cloudLoadBalancerConfig:
+ default:
+ dnsType: PlatformDefault
+ description: |-
+ 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.
+ nullable: true
+ properties:
+ clusterHosted:
+ description: |-
+ clusterHosted holds the IP addresses of API, API-Int and Ingress Load
+ Balancers on Cloud Platforms. The DNS solution hosted within the cluster
+ use these IP addresses to provide resolution for API, API-Int and Ingress
+ services.
+ properties:
+ apiIntLoadBalancerIPs:
+ description: |-
+ apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Entries in the apiIntLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
+ format: ip
+ items:
+ description: IP is an IP address (for example, "10.0.0.0"
+ or "fd00::").
+ maxLength: 39
+ minLength: 1
+ type: string
+ x-kubernetes-validations:
+ - message: value must be a valid IP address
+ rule: isIP(self)
+ maxItems: 16
+ type: array
+ x-kubernetes-list-type: set
+ apiLoadBalancerIPs:
+ description: |-
+ apiLoadBalancerIPs holds Load Balancer IPs for the API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Could be empty for private clusters.
+ Entries in the apiLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
+ format: ip
+ items:
+ description: IP is an IP address (for example, "10.0.0.0"
+ or "fd00::").
+ maxLength: 39
+ minLength: 1
+ type: string
+ x-kubernetes-validations:
+ - message: value must be a valid IP address
+ rule: isIP(self)
+ maxItems: 16
+ type: array
+ x-kubernetes-list-type: set
+ ingressLoadBalancerIPs:
+ description: |-
+ ingressLoadBalancerIPs holds IPs for Ingress Load Balancers.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Entries in the ingressLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
+ format: ip
+ items:
+ description: IP is an IP address (for example, "10.0.0.0"
+ or "fd00::").
+ maxLength: 39
+ minLength: 1
+ type: string
+ x-kubernetes-validations:
+ - message: value must be a valid IP address
+ rule: isIP(self)
+ maxItems: 16
+ type: array
+ x-kubernetes-list-type: set
+ type: object
+ dnsType:
+ default: PlatformDefault
+ description: |-
+ dnsType indicates the type of DNS solution in use within the cluster. Its default value of
+ `PlatformDefault` indicates that the cluster's DNS is the default provided by the cloud platform.
+ It can be set to `ClusterHosted` to bypass the configuration of the cloud default DNS. In this mode,
+ the cluster needs to provide a self-hosted DNS solution for the cluster's installation to succeed.
+ The cluster's use of the cloud's Load Balancers is unaffected by this setting.
+ The value is immutable after it has been set at install time.
+ Currently, there is no way for the customer to add additional DNS entries into the cluster hosted DNS.
+ Enabling this functionality allows the user to start their own DNS solution outside the cluster after
+ installation is complete. The customer would be responsible for configuring this custom DNS solution,
+ and it can be run in addition to the in-cluster DNS solution.
+ enum:
+ - ClusterHosted
+ - PlatformDefault
+ type: string
+ x-kubernetes-validations:
+ - message: dnsType is immutable
+ rule: oldSelf == '' || self == oldSelf
+ type: object
+ x-kubernetes-validations:
+ - message: clusterHosted is permitted only when dnsType is
+ ClusterHosted
+ rule: 'has(self.dnsType) && self.dnsType != ''ClusterHosted''
+ ? !has(self.clusterHosted) : true'
region:
description: region holds the default AWS region for new AWS
resources created by the cluster.
type: string
resourceTags:
- description: resourceTags is a list of additional tags to
- apply to AWS resources created for the cluster. See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
- for information on tagging AWS resources. AWS supports a
- maximum of 50 tags per resource. OpenShift reserves 25 tags
- for its use, leaving 25 tags available for the user.
+ description: |-
+ resourceTags is a list of additional tags to apply to AWS resources created for the cluster.
+ See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html for information on tagging AWS resources.
+ AWS supports a maximum of 50 tags per resource. OpenShift reserves 25 tags for its use, leaving 25 tags
+ available for the user.
items:
description: AWSResourceTag is a tag to apply to AWS resources
created for the cluster.
@@ -1097,10 +1216,10 @@ spec:
pattern: ^[0-9A-Za-z_.:/=+-@]+$
type: string
value:
- description: value is the value of the tag. Some AWS
- service do not support empty values. Since tags are
- added to resources in many services, the length of
- the tag value must meet the requirements of all services.
+ description: |-
+ value is the value of the tag.
+ Some AWS service do not support empty values. Since tags are added to resources in many services, the
+ length of the tag value must meet the requirements of all services.
maxLength: 256
minLength: 1
pattern: ^[0-9A-Za-z_.:/=+-@]+$
@@ -1113,24 +1232,27 @@ spec:
type: array
x-kubernetes-list-type: atomic
serviceEndpoints:
- description: ServiceEndpoints list contains custom endpoints
- which will override default service endpoint of AWS Services.
+ description: |-
+ ServiceEndpoints list contains custom endpoints which will override default
+ service endpoint of AWS Services.
There must be only one ServiceEndpoint for a service.
items:
- description: AWSServiceEndpoint store the configuration
- of a custom url to override existing defaults of AWS Services.
+ description: |-
+ AWSServiceEndpoint store the configuration of a custom url to
+ override existing defaults of AWS Services.
properties:
name:
- description: name is the name of the AWS service. The
- list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
+ description: |-
+ name is the name of the AWS service.
+ The list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
pattern: ^https://
type: string
type: object
@@ -1146,9 +1268,10 @@ spec:
management in non-soverign clouds such as Azure Stack.
type: string
cloudName:
- description: cloudName is the name of the Azure cloud environment
- which can be used to configure the Azure SDK with the appropriate
- Azure API endpoints. If empty, the value is equal to `AzurePublicCloud`.
+ description: |-
+ cloudName is the name of the Azure cloud environment which can be used to configure the Azure SDK
+ with the appropriate Azure API endpoints.
+ If empty, the value is equal to `AzurePublicCloud`.
enum:
- ""
- AzurePublicCloud
@@ -1158,42 +1281,37 @@ spec:
- AzureStackCloud
type: string
networkResourceGroupName:
- description: networkResourceGroupName is the Resource Group
- for network resources like the Virtual Network and Subnets
- used by the cluster. If empty, the value is same as ResourceGroupName.
+ description: |-
+ networkResourceGroupName is the Resource Group for network resources like the Virtual Network and Subnets used by the cluster.
+ If empty, the value is same as ResourceGroupName.
type: string
resourceGroupName:
description: resourceGroupName is the Resource Group for new
Azure resources created for the cluster.
type: string
resourceTags:
- description: resourceTags is a list of additional tags to
- apply to Azure resources created for the cluster. See https://docs.microsoft.com/en-us/rest/api/resources/tags
- for information on tagging Azure resources. Due to limitations
- on Automation, Content Delivery Network, DNS Azure resources,
- a maximum of 15 tags may be applied. OpenShift reserves
- 5 tags for internal use, allowing 10 tags for user configuration.
+ description: |-
+ resourceTags is a list of additional tags to apply to Azure resources created for the cluster.
+ See https://docs.microsoft.com/en-us/rest/api/resources/tags for information on tagging Azure resources.
+ Due to limitations on Automation, Content Delivery Network, DNS Azure resources, a maximum of 15 tags
+ may be applied. OpenShift reserves 5 tags for internal use, allowing 10 tags for user configuration.
items:
description: AzureResourceTag is a tag to apply to Azure
resources created for the cluster.
properties:
key:
- description: key is the key part of the tag. A tag key
- can have a maximum of 128 characters and cannot be
- empty. Key must begin with a letter, end with a letter,
- number or underscore, and must contain only alphanumeric
- characters and the following special characters `_
- . -`.
+ description: |-
+ key is the key part of the tag. A tag key can have a maximum of 128 characters and cannot be empty. Key
+ must begin with a letter, end with a letter, number or underscore, and must contain only alphanumeric
+ characters and the following special characters `_ . -`.
maxLength: 128
minLength: 1
pattern: ^[a-zA-Z]([0-9A-Za-z_.-]*[0-9A-Za-z_])?$
type: string
value:
- description: 'value is the value part of the tag. A
- tag value can have a maximum of 256 characters and
- cannot be empty. Value must contain only alphanumeric
- characters and the following special characters `_
- + , - . / : ; < = > ? @`.'
+ description: |-
+ value is the value part of the tag. A tag value can have a maximum of 256 characters and cannot be empty. Value
+ must contain only alphanumeric characters and the following special characters `_ + , - . / : ; < = > ? @`.
maxLength: 256
minLength: 1
pattern: ^[0-9A-Za-z_.=+-@]+$
@@ -1219,22 +1337,21 @@ spec:
platform.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1248,17 +1365,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1279,18 +1397,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on BareMetal platform which can be a
- user-managed or openshift-managed load balancer that
- is to be used for the OpenShift API and Ingress endpoints.
- When set to OpenShiftManagedDefault the static pods
- in charge of API and Ingress traffic load-balancing
+ description: |-
+ type defines the type of load balancer used by the cluster on BareMetal platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
defined in the machine config operator will be deployed.
- When set to UserManaged these static pods will not be
- deployed and it is expected that the load balancer is
- configured out of band by the deployer. When omitted,
- this means no opinion and the platform is left to choose
- a reasonable default. The default value is OpenShiftManagedDefault.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1317,13 +1433,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for BareMetal deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ BareMetal deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
equinixMetal:
@@ -1331,19 +1447,16 @@ spec:
Metal infrastructure provider.
properties:
apiServerInternalIP:
- description: apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers.
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
type: string
ingressIP:
- description: ingressIP is an external IP which routes to the
- default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names.
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
type: string
type: object
external:
@@ -1351,23 +1464,22 @@ spec:
External infrastructure provider.
properties:
cloudControllerManager:
- description: cloudControllerManager contains settings specific
- to the external Cloud Controller Manager (a.k.a. CCM or
- CPI). When omitted, new nodes will be not tainted and no
- extra initialization from the cloud controller manager is
- expected.
+ description: |-
+ cloudControllerManager contains settings specific to the external Cloud Controller Manager (a.k.a. CCM or CPI).
+ When omitted, new nodes will be not tainted
+ and no extra initialization from the cloud controller manager is expected.
properties:
state:
- description: "state determines whether or not an external
- Cloud Controller Manager is expected to be installed
- within the cluster. https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/#running-cloud-controller-manager
- \n Valid values are \"External\", \"None\" and omitted.
- When set to \"External\", new nodes will be tainted
- as uninitialized when created, preventing them from
- running workloads until they are initialized by the
- cloud controller manager. When omitted or set to \"None\",
- new nodes will be not tainted and no extra initialization
- from the cloud controller manager is expected."
+ description: |-
+ state determines whether or not an external Cloud Controller Manager is expected to
+ be installed within the cluster.
+ https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/#running-cloud-controller-manager
+
+ Valid values are "External", "None" and omitted.
+ When set to "External", new nodes will be tainted as uninitialized when created,
+ preventing them from running workloads until they are initialized by the cloud controller manager.
+ When omitted or set to "None", new nodes will be not tainted
+ and no extra initialization from the cloud controller manager is expected.
enum:
- ""
- External
@@ -1393,27 +1505,26 @@ spec:
cloudLoadBalancerConfig:
default:
dnsType: PlatformDefault
- description: cloudLoadBalancerConfig is a union that contains
- the IP addresses of API, API-Int and Ingress Load Balancers
- created on the cloud platform. These values would not be
- populated on on-prem platforms. These Load Balancer IPs
- are used to configure the in-cluster DNS instances for API,
- API-Int and Ingress services. `dnsType` is expected to be
- set to `ClusterHosted` when these Load Balancer IP addresses
- are populated and used.
+ description: |-
+ 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.
nullable: true
properties:
clusterHosted:
- description: clusterHosted holds the IP addresses of API,
- API-Int and Ingress Load Balancers on Cloud Platforms.
- The DNS solution hosted within the cluster use these
- IP addresses to provide resolution for API, API-Int
- and Ingress services.
+ description: |-
+ clusterHosted holds the IP addresses of API, API-Int and Ingress Load
+ Balancers on Cloud Platforms. The DNS solution hosted within the cluster
+ use these IP addresses to provide resolution for API, API-Int and Ingress
+ services.
properties:
apiIntLoadBalancerIPs:
- description: apiIntLoadBalancerIPs holds Load Balancer
- IPs for the internal API service. These Load Balancer
- IP addresses can be IPv4 and/or IPv6 addresses.
+ description: |-
+ apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
Entries in the apiIntLoadBalancerIPs must be unique.
A maximum of 16 IP addresses are permitted.
format: ip
@@ -1430,12 +1541,12 @@ spec:
type: array
x-kubernetes-list-type: set
apiLoadBalancerIPs:
- description: apiLoadBalancerIPs holds Load Balancer
- IPs for the API service. These Load Balancer IP
- addresses can be IPv4 and/or IPv6 addresses. Could
- be empty for private clusters. Entries in the apiLoadBalancerIPs
- must be unique. A maximum of 16 IP addresses are
- permitted.
+ description: |-
+ apiLoadBalancerIPs holds Load Balancer IPs for the API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Could be empty for private clusters.
+ Entries in the apiLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example, "10.0.0.0"
@@ -1450,11 +1561,11 @@ spec:
type: array
x-kubernetes-list-type: set
ingressLoadBalancerIPs:
- description: ingressLoadBalancerIPs holds IPs for
- Ingress Load Balancers. These Load Balancer IP addresses
- can be IPv4 and/or IPv6 addresses. Entries in the
- ingressLoadBalancerIPs must be unique. A maximum
- of 16 IP addresses are permitted.
+ description: |-
+ ingressLoadBalancerIPs holds IPs for Ingress Load Balancers.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Entries in the ingressLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example, "10.0.0.0"
@@ -1471,23 +1582,17 @@ spec:
type: object
dnsType:
default: PlatformDefault
- description: dnsType indicates the type of DNS solution
- in use within the cluster. Its default value of `PlatformDefault`
- indicates that the cluster's DNS is the default provided
- by the cloud platform. It can be set to `ClusterHosted`
- to bypass the configuration of the cloud default DNS.
- In this mode, the cluster needs to provide a self-hosted
- DNS solution for the cluster's installation to succeed.
- The cluster's use of the cloud's Load Balancers is unaffected
- by this setting. The value is immutable after it has
- been set at install time. Currently, there is no way
- for the customer to add additional DNS entries into
- the cluster hosted DNS. Enabling this functionality
- allows the user to start their own DNS solution outside
- the cluster after installation is complete. The customer
- would be responsible for configuring this custom DNS
- solution, and it can be run in addition to the in-cluster
- DNS solution.
+ description: |-
+ dnsType indicates the type of DNS solution in use within the cluster. Its default value of
+ `PlatformDefault` indicates that the cluster's DNS is the default provided by the cloud platform.
+ It can be set to `ClusterHosted` to bypass the configuration of the cloud default DNS. In this mode,
+ the cluster needs to provide a self-hosted DNS solution for the cluster's installation to succeed.
+ The cluster's use of the cloud's Load Balancers is unaffected by this setting.
+ The value is immutable after it has been set at install time.
+ Currently, there is no way for the customer to add additional DNS entries into the cluster hosted DNS.
+ Enabling this functionality allows the user to start their own DNS solution outside the cluster after
+ installation is complete. The customer would be responsible for configuring this custom DNS solution,
+ and it can be run in addition to the in-cluster DNS solution.
enum:
- ClusterHosted
- PlatformDefault
@@ -1510,23 +1615,20 @@ spec:
created for the cluster.
type: string
resourceLabels:
- description: 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.
+ description: |-
+ 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.
items:
description: GCPResourceLabel is a label to apply to GCP
resources created for the cluster.
properties:
key:
- description: key is the key part of the label. A label
- key can have a maximum of 63 characters and cannot
- be empty. Label key must begin with a lowercase letter,
- and must contain only lowercase letters, numeric characters,
- and the following special characters `_-`. Label key
- must not have the reserved prefixes `kubernetes-io`
+ description: |-
+ key is the key part of the label. A label key can have a maximum of 63 characters and cannot be empty.
+ Label key must begin with a lowercase letter, and must contain only lowercase letters, numeric characters,
+ and the following special characters `_-`. Label key must not have the reserved prefixes `kubernetes-io`
and `openshift-io`.
maxLength: 63
minLength: 1
@@ -1537,11 +1639,9 @@ spec:
or `kubernetes-io`
rule: '!self.startsWith(''openshift-io'') && !self.startsWith(''kubernetes-io'')'
value:
- description: value is the value part of the label. A
- label value can have a maximum of 63 characters and
- cannot be empty. Value must contain only lowercase
- letters, numeric characters, and the following special
- characters `_-`.
+ description: |-
+ value is the value part of the label. A label value can have a maximum of 63 characters and cannot be empty.
+ Value must contain only lowercase letters, numeric characters, and the following special characters `_-`.
maxLength: 63
minLength: 1
pattern: ^[0-9a-z_-]{1,63}$
@@ -1560,47 +1660,41 @@ spec:
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
resourceTags:
- description: 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.
+ description: |-
+ 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.
items:
description: GCPResourceTag is a tag to apply to GCP resources
created for the cluster.
properties:
key:
- description: key is the key part of the tag. A tag key
- can have a maximum of 63 characters and cannot be
- empty. Tag key must begin and end with an alphanumeric
- character, and must contain only uppercase, lowercase
- alphanumeric characters, and the following special
- characters `._-`.
+ description: |-
+ key is the key part of the tag. A tag key can have a maximum of 63 characters and cannot be empty.
+ Tag key must begin and end with an alphanumeric character, and must contain only uppercase, lowercase
+ alphanumeric characters, and the following special characters `._-`.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z0-9]([0-9A-Za-z_.-]{0,61}[a-zA-Z0-9])?$
type: string
parentID:
- description: 'parentID is the ID of the hierarchical
- resource where the tags are defined, e.g. at the Organization
- or the Project level. To find the Organization or
- Project ID refer to the following pages: https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id,
+ description: |-
+ parentID is the ID of the hierarchical resource where the tags are defined,
+ e.g. at the Organization or the Project level. To find the Organization or Project ID refer to the following pages:
+ https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id,
https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects.
- An OrganizationID must consist of decimal numbers,
- and cannot have leading zeroes. A ProjectID must be
- 6 to 30 characters in length, can only contain lowercase
- letters, numbers, and hyphens, and must start with
- a letter, and cannot end with a hyphen.'
+ An OrganizationID must consist of decimal numbers, and cannot have leading zeroes.
+ A ProjectID must be 6 to 30 characters in length, can only contain lowercase letters, numbers,
+ and hyphens, and must start with a letter, and cannot end with a hyphen.
maxLength: 32
minLength: 1
pattern: (^[1-9][0-9]{0,31}$)|(^[a-z][a-z0-9-]{4,28}[a-z0-9]$)
type: string
value:
- description: value is the value part of the tag. A tag
- value can have a maximum of 63 characters and cannot
- be empty. Tag value must begin and end with an alphanumeric
- character, and must contain only uppercase, lowercase
- alphanumeric characters, and the following special
- characters `_-.@%=+:,*#&(){}[]` and spaces.
+ description: |-
+ value is the value part of the tag. A tag value can have a maximum of 63 characters and cannot be empty.
+ Tag value must begin and end with an alphanumeric character, and must contain only uppercase, lowercase
+ alphanumeric characters, and the following special characters `_-.@%=+:,*#&(){}[]` and spaces.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z0-9]([0-9A-Za-z_.@%=+:,*#&()\[\]{}\-\s]{0,61}[a-zA-Z0-9])?$
@@ -1632,13 +1726,14 @@ spec:
infrastructure provider.
properties:
cisInstanceCRN:
- description: CISInstanceCRN is the CRN of the Cloud Internet
- Services instance managing the DNS zone for the cluster's
- base domain
+ description: |-
+ CISInstanceCRN is the CRN of the Cloud Internet Services instance managing
+ the DNS zone for the cluster's base domain
type: string
dnsInstanceCRN:
- description: DNSInstanceCRN is the CRN of the DNS Services
- instance managing the DNS zone for the cluster's base domain
+ description: |-
+ DNSInstanceCRN is the CRN of the DNS Services instance managing the DNS zone
+ for the cluster's base domain
type: string
location:
description: Location is where the cluster has been deployed
@@ -1652,26 +1747,23 @@ spec:
IBMCloud resources created for the cluster.
type: string
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of an
- IBM Cloud service. These endpoints are consumed by components
- within the cluster to reach the respective IBM Cloud Services.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of an IBM Cloud service. These endpoints are consumed by
+ components within the cluster to reach the respective IBM Cloud Services.
items:
- description: IBMCloudServiceEndpoint stores the configuration
- of a custom url to override existing defaults of IBM Cloud
- Services.
+ description: |-
+ IBMCloudServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of IBM Cloud Services.
properties:
name:
- description: 'name is the name of the IBM Cloud service.
- Possible values are: CIS, COS, COSConfig, DNSServices,
- GlobalCatalog, GlobalSearch, GlobalTagging, HyperProtect,
- IAM, KeyProtect, ResourceController, ResourceManager,
- or VPC. For example, the IBM Cloud Private IAM service
- could be configured with the service `name` of `IAM`
- and `url` of `https://private.iam.cloud.ibm.com` Whereas
- the IBM Cloud Private VPC service for US South (Dallas)
- could be configured with the service `name` of `VPC`
- and `url` of `https://us.south.private.iaas.cloud.ibm.com`'
+ description: |-
+ name is the name of the IBM Cloud service.
+ Possible values are: CIS, COS, COSConfig, DNSServices, GlobalCatalog, GlobalSearch, GlobalTagging, HyperProtect, IAM, KeyProtect, ResourceController, ResourceManager, or VPC.
+ For example, the IBM Cloud Private IAM service could be configured with the
+ service `name` of `IAM` and `url` of `https://private.iam.cloud.ibm.com`
+ Whereas the IBM Cloud Private VPC service for US South (Dallas) could be configured
+ with the service `name` of `VPC` and `url` of `https://us.south.private.iaas.cloud.ibm.com`
enum:
- CIS
- COS
@@ -1688,10 +1780,10 @@ spec:
- VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
type: string
x-kubernetes-validations:
- message: url must be a valid absolute URL
@@ -1710,19 +1802,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers.
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
type: string
ingressIP:
- description: ingressIP is an external IP which routes to the
- default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names.
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
type: string
type: object
nutanix:
@@ -1730,22 +1819,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1759,17 +1847,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1790,18 +1879,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on Nutanix platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on Nutanix platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1816,22 +1903,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1845,21 +1931,23 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
cloudName:
- description: cloudName is the name of the desired OpenStack
- cloud in the client configuration file (`clouds.yaml`).
+ description: |-
+ cloudName is the name of the desired OpenStack cloud in the
+ client configuration file (`clouds.yaml`).
type: string
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1880,18 +1968,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on OpenStack platform which can be a
- user-managed or openshift-managed load balancer that
- is to be used for the OpenShift API and Ingress endpoints.
- When set to OpenShiftManagedDefault the static pods
- in charge of API and Ingress traffic load-balancing
+ description: |-
+ type defines the type of load balancer used by the cluster on OpenStack platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
defined in the machine config operator will be deployed.
- When set to UserManaged these static pods will not be
- deployed and it is expected that the load balancer is
- configured out of band by the deployer. When omitted,
- this means no opinion and the platform is left to choose
- a reasonable default. The default value is OpenShiftManagedDefault.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1918,13 +2004,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for OpenStack deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ OpenStack deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
ovirt:
@@ -1932,22 +2018,21 @@ spec:
provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1961,17 +2046,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1992,18 +2078,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on Ovirt platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on Ovirt platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -2022,27 +2106,26 @@ spec:
Virtual Servers infrastructure provider.
properties:
cisInstanceCRN:
- description: CISInstanceCRN is the CRN of the Cloud Internet
- Services instance managing the DNS zone for the cluster's
- base domain
+ description: |-
+ CISInstanceCRN is the CRN of the Cloud Internet Services instance managing
+ the DNS zone for the cluster's base domain
type: string
dnsInstanceCRN:
- description: DNSInstanceCRN is the CRN of the DNS Services
- instance managing the DNS zone for the cluster's base domain
+ description: |-
+ DNSInstanceCRN is the CRN of the DNS Services instance managing the DNS zone
+ for the cluster's base domain
type: string
region:
description: region holds the default Power VS region for
new Power VS resources created by the cluster.
type: string
resourceGroup:
- description: 'resourceGroup is the resource group name for
- new IBMCloud resources created for a cluster. The resource
- group specified here will be used by cluster-image-registry-operator
- to set up a COS Instance in IBMCloud for the cluster registry.
+ description: |-
+ resourceGroup is the resource group name for new IBMCloud resources created for a cluster.
+ The resource group specified here will be used by cluster-image-registry-operator to set up a COS Instance in IBMCloud for the cluster registry.
More about resource groups can be found here: https://cloud.ibm.com/docs/account?topic=account-rgs.
- When omitted, the image registry operator won''t be able
- to configure storage, which results in the image registry
- cluster operator not being in an available state.'
+ When omitted, the image registry operator won't be able to configure storage,
+ which results in the image registry cluster operator not being in an available state.
maxLength: 40
pattern: ^[a-zA-Z0-9-_ ]+$
type: string
@@ -2050,26 +2133,42 @@ spec:
- message: resourceGroup is immutable once set
rule: oldSelf == '' || self == oldSelf
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of a Power
- VS service.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of a Power VS service.
items:
- description: PowervsServiceEndpoint stores the configuration
- of a custom url to override existing defaults of PowerVS
- Services.
+ description: |-
+ PowervsServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of PowerVS Services.
properties:
name:
- description: name is the name of the Power VS service.
- Few of the services are IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
+ description: |-
+ name is the name of the Power VS service.
+ Few of the services are
+ IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
ResourceController - https://cloud.ibm.com/apidocs/resource-controller/resource-controller
Power Cloud - https://cloud.ibm.com/apidocs/power-cloud
- pattern: ^[a-z0-9-]+$
+ enum:
+ - CIS
+ - COS
+ - COSConfig
+ - DNSServices
+ - GlobalCatalog
+ - GlobalSearch
+ - GlobalTagging
+ - HyperProtect
+ - IAM
+ - KeyProtect
+ - Power
+ - ResourceController
+ - ResourceManager
+ - VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
format: uri
pattern: ^https://
type: string
@@ -2082,27 +2181,27 @@ spec:
- name
x-kubernetes-list-type: map
zone:
- description: 'zone holds the default zone for the new Power
- VS resources created by the cluster. Note: Currently only
- single-zone OCP clusters are supported'
+ description: |-
+ zone holds the default zone for the new Power VS resources created by the cluster.
+ Note: Currently only single-zone OCP clusters are supported
type: string
type: object
x-kubernetes-validations:
- message: cannot unset resourceGroup once set
rule: '!has(oldSelf.resourceGroup) || has(self.resourceGroup)'
type:
- description: "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\", \"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. \n This
- value will be synced with to the `status.platform` and `status.platformStatus.type`.
- Currently this value cannot be changed once set."
+ description: |-
+ 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", "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.
+
+ This value will be synced with to the `status.platform` and `status.platformStatus.type`.
+ Currently this value cannot be changed once set.
enum:
- ""
- AWS
@@ -2127,22 +2226,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -2156,17 +2254,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -2187,18 +2286,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on VSphere platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on VSphere platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -2225,13 +2322,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for vSphere deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ vSphere deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
type: object
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml
index 2f933db798..14e969175d 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml
@@ -21,20 +21,25 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Infrastructure holds cluster-wide information about Infrastructure.
- \ The canonical name is `cluster` \n Compatibility level 1: Stable within
- a major release for a minimum of 12 months or 3 minor releases (whichever
- is longer)."
+ description: |-
+ Infrastructure holds cluster-wide information about Infrastructure. The canonical name is `cluster`
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,19 +47,19 @@ spec:
description: spec holds user settable values for configuration
properties:
cloudConfig:
- description: "cloudConfig is a reference to a ConfigMap containing
- the cloud provider configuration file. This configuration file is
- used to configure the Kubernetes cloud provider integration when
- using the built-in cloud provider integration or the external cloud
- controller manager. The namespace for this config map is openshift-config.
- \n cloudConfig should only be consumed by the kube_cloud_config
- controller. The controller is responsible for using the user configuration
- in the spec for various platforms and combining that with the user
- provided ConfigMap in this field to create a stitched kube cloud
- config. The controller generates a ConfigMap `kube-cloud-config`
- in `openshift-config-managed` namespace with the kube cloud config
- is stored in `cloud.conf` key. All the clients are expected to use
- the generated ConfigMap only."
+ description: |-
+ cloudConfig is a reference to a ConfigMap containing the cloud provider configuration file.
+ This configuration file is used to configure the Kubernetes cloud provider integration
+ when using the built-in cloud provider integration or the external cloud controller manager.
+ The namespace for this config map is openshift-config.
+
+ cloudConfig should only be consumed by the kube_cloud_config controller.
+ The controller is responsible for using the user configuration in the spec
+ for various platforms and combining that with the user provided ConfigMap in this field
+ to create a stitched kube cloud config.
+ The controller generates a ConfigMap `kube-cloud-config` in `openshift-config-managed` namespace
+ with the kube cloud config is stored in `cloud.conf` key.
+ All the clients are expected to use the generated ConfigMap only.
properties:
key:
description: Key allows pointing to a specific key/value inside
@@ -64,8 +69,9 @@ spec:
type: string
type: object
platformSpec:
- description: platformSpec holds desired information specific to the
- underlying infrastructure provider.
+ description: |-
+ platformSpec holds desired information specific to the underlying
+ infrastructure provider.
properties:
alibabaCloud:
description: AlibabaCloud contains settings specific to the Alibaba
@@ -76,24 +82,27 @@ spec:
Services infrastructure provider.
properties:
serviceEndpoints:
- description: serviceEndpoints list contains custom endpoints
- which will override default service endpoint of AWS Services.
+ description: |-
+ serviceEndpoints list contains custom endpoints which will override default
+ service endpoint of AWS Services.
There must be only one ServiceEndpoint for a service.
items:
- description: AWSServiceEndpoint store the configuration
- of a custom url to override existing defaults of AWS Services.
+ description: |-
+ AWSServiceEndpoint store the configuration of a custom url to
+ override existing defaults of AWS Services.
properties:
name:
- description: name is the name of the AWS service. The
- list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
+ description: |-
+ name is the name of the AWS service.
+ The list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
pattern: ^https://
type: string
type: object
@@ -109,17 +118,16 @@ spec:
platform.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -138,15 +146,15 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -165,10 +173,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -194,17 +202,15 @@ spec:
Metal infrastructure provider.
type: object
external:
- description: ExternalPlatformType represents generic infrastructure
- provider. Platform-specific components should be supplemented
- separately.
+ description: |-
+ ExternalPlatformType represents generic infrastructure provider.
+ Platform-specific components should be supplemented separately.
properties:
platformName:
default: Unknown
- description: PlatformName holds the arbitrary string representing
- the infrastructure provider name, expected to be set at
- the installation time. This field is solely for informational
- and reporting purposes and is not expected to be used for
- decision-making.
+ description: |-
+ PlatformName holds the arbitrary string representing the infrastructure provider name, expected to be set at the installation time.
+ This field is solely for informational and reporting purposes and is not expected to be used for decision-making.
type: string
x-kubernetes-validations:
- message: platform name cannot be changed once set
@@ -227,20 +233,19 @@ spec:
infrastructure provider.
properties:
failureDomains:
- description: failureDomains configures failure domains information
- for the Nutanix platform. When set, the failure domains
- defined here may be used to spread Machines across prism
- element clusters to improve fault tolerance of the cluster.
+ description: |-
+ failureDomains configures failure domains information for the Nutanix platform.
+ When set, the failure domains defined here may be used to spread Machines across
+ prism element clusters to improve fault tolerance of the cluster.
items:
description: NutanixFailureDomain configures failure domain
information for the Nutanix platform.
properties:
cluster:
- description: cluster is to identify the cluster (the
- Prism Element under management of the Prism Central),
- in which the Machine's VM will be created. The cluster
- identifier (uuid or name) can be obtained from the
- Prism Central console or using the prism_central API.
+ description: |-
+ cluster is to identify the cluster (the Prism Element under management of the Prism Central),
+ in which the Machine's VM will be created. The cluster identifier (uuid or name) can be obtained
+ from the Prism Central console or using the prism_central API.
properties:
name:
description: name is the resource name in the PC.
@@ -270,23 +275,21 @@ spec:
rule: 'has(self.type) && self.type == ''Name'' ? has(self.name)
: !has(self.name)'
name:
- description: name defines the unique name of a failure
- domain. Name is required and must be at most 64 characters
- in length. It must consist of only lower case alphanumeric
- characters and hyphens (-). It must start and end
- with an alphanumeric character. This value is arbitrary
- and is used to identify the failure domain within
- the platform.
+ description: |-
+ name defines the unique name of a failure domain.
+ Name is required and must be at most 64 characters in length.
+ It must consist of only lower case alphanumeric characters and hyphens (-).
+ It must start and end with an alphanumeric character.
+ This value is arbitrary and is used to identify the failure domain within the platform.
maxLength: 64
minLength: 1
pattern: '[a-z0-9]([-a-z0-9]*[a-z0-9])?'
type: string
subnets:
- description: subnets holds a list of identifiers (one
- or more) of the cluster's network subnets for the
- Machine's VM to connect to. The subnet identifiers
- (uuid or name) can be obtained from the Prism Central
- console or using the prism_central API.
+ description: |-
+ subnets holds a list of identifiers (one or more) of the cluster's network subnets
+ for the Machine's VM to connect to. The subnet identifiers (uuid or name) can be
+ obtained from the Prism Central console or using the prism_central API.
items:
description: NutanixResourceIdentifier holds the identity
of a Nutanix PC resource (cluster, image, subnet,
@@ -336,11 +339,10 @@ spec:
- name
x-kubernetes-list-type: map
prismCentral:
- description: prismCentral holds the endpoint address and port
- to access the Nutanix Prism Central. When a cluster-wide
- proxy is installed, by default, this endpoint will be accessed
- via the proxy. Should you wish for communication with this
- endpoint not to be proxied, please add the endpoint to the
+ description: |-
+ prismCentral holds the endpoint address and port to access the Nutanix Prism Central.
+ When a cluster-wide proxy is installed, by default, this endpoint will be accessed via the proxy.
+ Should you wish for communication with this endpoint not to be proxied, please add the endpoint to the
proxy spec.noProxy list.
properties:
address:
@@ -361,25 +363,22 @@ spec:
- port
type: object
prismElements:
- description: prismElements holds one or more endpoint address
- and port data to access the Nutanix Prism Elements (clusters)
- of the Nutanix Prism Central. Currently we only support
- one Prism Element (cluster) for an OpenShift cluster, where
- all the Nutanix resources (VMs, subnets, volumes, etc.)
- used in the OpenShift cluster are located. In the future,
- we may support Nutanix resources (VMs, etc.) spread over
- multiple Prism Elements (clusters) of the Prism Central.
+ description: |-
+ prismElements holds one or more endpoint address and port data to access the Nutanix
+ Prism Elements (clusters) of the Nutanix Prism Central. Currently we only support one
+ Prism Element (cluster) for an OpenShift cluster, where all the Nutanix resources (VMs, subnets, volumes, etc.)
+ used in the OpenShift cluster are located. In the future, we may support Nutanix resources (VMs, etc.)
+ spread over multiple Prism Elements (clusters) of the Prism Central.
items:
description: NutanixPrismElementEndpoint holds the name
and endpoint data for a Prism Element (cluster)
properties:
endpoint:
- description: endpoint holds the endpoint address and
- port data of the Prism Element (cluster). When a cluster-wide
- proxy is installed, by default, this endpoint will
- be accessed via the proxy. Should you wish for communication
- with this endpoint not to be proxied, please add the
- endpoint to the proxy spec.noProxy list.
+ description: |-
+ endpoint holds the endpoint address and port data of the Prism Element (cluster).
+ When a cluster-wide proxy is installed, by default, this endpoint will be accessed via the proxy.
+ Should you wish for communication with this endpoint not to be proxied, please add the endpoint to the
+ proxy spec.noProxy list.
properties:
address:
description: address is the endpoint address (DNS
@@ -399,10 +398,9 @@ spec:
- port
type: object
name:
- description: name is the name of the Prism Element (cluster).
- This value will correspond with the cluster field
- configured on other resources (eg Machines, PVCs,
- etc).
+ description: |-
+ name is the name of the Prism Element (cluster). This value will correspond with
+ the cluster field configured on other resources (eg Machines, PVCs, etc).
maxLength: 256
type: string
required:
@@ -422,17 +420,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -451,15 +448,15 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -478,10 +475,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -511,26 +508,42 @@ spec:
Systems Virtual Servers infrastructure provider.
properties:
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of a Power
- VS service.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of a Power VS service.
items:
- description: PowervsServiceEndpoint stores the configuration
- of a custom url to override existing defaults of PowerVS
- Services.
+ description: |-
+ PowervsServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of PowerVS Services.
properties:
name:
- description: name is the name of the Power VS service.
- Few of the services are IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
+ description: |-
+ name is the name of the Power VS service.
+ Few of the services are
+ IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
ResourceController - https://cloud.ibm.com/apidocs/resource-controller/resource-controller
Power Cloud - https://cloud.ibm.com/apidocs/power-cloud
- pattern: ^[a-z0-9-]+$
+ enum:
+ - CIS
+ - COS
+ - COSConfig
+ - DNSServices
+ - GlobalCatalog
+ - GlobalSearch
+ - GlobalTagging
+ - HyperProtect
+ - IAM
+ - KeyProtect
+ - Power
+ - ResourceController
+ - ResourceManager
+ - VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
format: uri
pattern: ^https://
type: string
@@ -544,16 +557,15 @@ spec:
x-kubernetes-list-type: map
type: object
type:
- description: 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.
+ description: |-
+ 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.
enum:
- ""
- AWS
@@ -578,17 +590,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IP addresses,
- one from IPv4 family and one from IPv6. In single stack
- clusters a single IP address is expected. When omitted,
- values from the status.apiServerInternalIPs will be used.
- Once set, the list cannot be completely removed (but its
- second entry can).
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.apiServerInternalIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -607,24 +618,26 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
failureDomains:
- description: failureDomains contains the definition of region,
- zone and the vCenter topology. If this is omitted failure
- domains (regions and zones) will not be used.
+ description: |-
+ failureDomains contains the definition of region, zone and the vCenter topology.
+ If this is omitted failure domains (regions and zones) will not be used.
items:
- description: VSpherePlatformFailureDomainSpec holds the
- region and zone failure domain and the vCenter topology
- of that failure domain.
+ description: |-
+ VSpherePlatformFailureDomainSpec holds the region and zone failure domain and
+ the vCenter topology of that failure domain.
properties:
name:
- description: name defines the arbitrary but unique name
+ description: |-
+ name defines the arbitrary but unique name
of a failure domain.
maxLength: 256
minLength: 1
type: string
region:
- description: region defines the name of a region tag
- that will be attached to a vCenter datacenter. The
- tag category in vCenter must be named openshift-region.
+ description: |-
+ region defines the name of a region tag that will
+ be attached to a vCenter datacenter. The tag
+ category in vCenter must be named openshift-region.
maxLength: 80
minLength: 1
type: string
@@ -634,7 +647,7 @@ spec:
- format: ipv6
- format: hostname
description: server is the fully-qualified domain name
- or the IP address of the vCenter server. ---
+ or the IP address of the vCenter server.
maxLength: 255
minLength: 1
type: string
@@ -643,45 +656,48 @@ spec:
using vSphere constructs
properties:
computeCluster:
- description: computeCluster the absolute path of
- the vCenter cluster in which virtual machine will
- be located. The absolute path is of the form //host/.
+ description: |-
+ computeCluster the absolute path of the vCenter cluster
+ in which virtual machine will be located.
+ The absolute path is of the form //host/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/host/.*?
type: string
datacenter:
- description: datacenter is the name of vCenter datacenter
- in which virtual machines will be located. The
- maximum length of the datacenter name is 80 characters.
+ description: |-
+ datacenter is the name of vCenter datacenter in which virtual machines will be located.
+ The maximum length of the datacenter name is 80 characters.
maxLength: 80
type: string
datastore:
- description: datastore is the absolute path of the
- datastore in which the virtual machine is located.
+ description: |-
+ datastore is the absolute path of the datastore in which the
+ virtual machine is located.
The absolute path is of the form //datastore/
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/datastore/.*?
type: string
folder:
- description: folder is the absolute path of the
- folder where virtual machines are located. The
- absolute path is of the form //vm/.
+ description: |-
+ folder is the absolute path of the folder where
+ virtual machines are located. The absolute path
+ is of the form //vm/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/vm/.*?
type: string
networks:
- description: 'networks is the list of port group
- network names within this failure domain. If feature
- gate VSphereMultiNetworks is enabled, up to 10
- network adapters may be defined. 10 is the maximum
- number of virtual network devices which may be
- attached to a VM as defined by: https://configmax.esp.vmware.com/guest?vmwareproduct=vSphere&release=vSphere%208.0&categories=1-0
- The available networks (port groups) can be listed
- using `govc ls ''network/*''` Networks should
- be in the form of an absolute path: //network/.'
+ description: |-
+ networks is the list of port group network names within this failure domain.
+ If feature gate VSphereMultiNetworks is enabled, up to 10 network adapters may be defined.
+ 10 is the maximum number of virtual network devices which may be attached to a VM as defined by:
+ https://configmax.esp.vmware.com/guest?vmwareproduct=vSphere&release=vSphere%208.0&categories=1-0
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
+ Networks should be in the form of an absolute path:
+ //network/.
items:
type: string
maxItems: 10
@@ -689,25 +705,24 @@ spec:
type: array
x-kubernetes-list-type: atomic
resourcePool:
- description: resourcePool is the absolute path of
- the resource pool where virtual machines will
- be created. The absolute path is of the form //host//Resources/.
+ description: |-
+ resourcePool is the absolute path of the resource pool where virtual machines will be
+ created. The absolute path is of the form //host//Resources/.
The maximum length of the path is 2048 characters.
maxLength: 2048
pattern: ^/.*?/host/.*?/Resources.*
type: string
template:
- description: "template is the full inventory path
- of the virtual machine or template that will be
- cloned when creating new machines in this failure
- domain. The maximum length of the path is 2048
- characters. \n When omitted, the template will
- be calculated by the control plane machineset
- operator based on the region and zone defined
- in VSpherePlatformFailureDomainSpec. For example,
- for zone=zonea, region=region1, and infrastructure
- name=test, the template path would be calculated
- as //vm/test-rhcos-region1-zonea."
+ description: |-
+ template is the full inventory path of the virtual machine or template
+ that will be cloned when creating new machines in this failure domain.
+ The maximum length of the path is 2048 characters.
+
+ When omitted, the template will be calculated by the control plane
+ machineset operator based on the region and zone defined in
+ VSpherePlatformFailureDomainSpec.
+ For example, for zone=zonea, region=region1, and infrastructure name=test,
+ the template path would be calculated as //vm/test-rhcos-region1-zonea.
maxLength: 2048
minLength: 1
pattern: ^/.*?/vm/.*?
@@ -719,9 +734,10 @@ spec:
- networks
type: object
zone:
- description: zone defines the name of a zone tag that
- will be attached to a vCenter cluster. The tag category
- in vCenter must be named openshift-zone.
+ description: |-
+ zone defines the name of a zone tag that will
+ be attached to a vCenter cluster. The tag
+ category in vCenter must be named openshift-zone.
maxLength: 80
minLength: 1
type: string
@@ -737,15 +753,15 @@ spec:
- name
x-kubernetes-list-type: map
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IP
- addresses, one from IPv4 family and one from IPv6. In single
- stack clusters a single IP address is expected. When omitted,
- values from the status.ingressIPs will be used. Once set,
- the list cannot be completely removed (but its second entry
- can).
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names.
+ In dual stack clusters this list contains two IP addresses, one from IPv4
+ family and one from IPv6.
+ In single stack clusters a single IP address is expected.
+ When omitted, values from the status.ingressIPs will be used.
+ Once set, the list cannot be completely removed (but its second entry can).
items:
description: IP is an IP address (for example, "10.0.0.0"
or "fd00::").
@@ -764,10 +780,10 @@ spec:
rule: 'size(self) == 2 && isIP(self[0]) && isIP(self[1])
? ip(self[0]).family() != ip(self[1]).family() : true'
machineNetworks:
- description: machineNetworks are IP networks used to connect
- all the OpenShift cluster nodes. Each network is provided
- in the CIDR format and should be IPv4 or IPv6, for example
- "10.0.0.0/8" or "fd00::/8".
+ description: |-
+ machineNetworks are IP networks used to connect all the OpenShift cluster
+ nodes. Each network is provided in the CIDR format and should be IPv4 or IPv6,
+ for example "10.0.0.0/8" or "fd00::/8".
items:
description: CIDR is an IP address range in CIDR notation
(for example, "10.0.0.0/8" or "fd00::/8").
@@ -783,41 +799,39 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeNetworking:
- description: 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.
+ description: |-
+ 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.
properties:
external:
description: external represents the network configuration
of the node that is externally routable.
properties:
excludeNetworkSubnetCidr:
- description: excludeNetworkSubnetCidr IP addresses
- in subnet ranges will be excluded when selecting
- the IP address from the VirtualMachine's VM for
- use in the status.addresses fields. ---
+ description: |-
+ excludeNetworkSubnetCidr IP addresses in subnet ranges will be excluded when selecting
+ the IP address from the VirtualMachine's VM for use in the status.addresses fields.
items:
format: cidr
type: string
type: array
x-kubernetes-list-type: atomic
network:
- description: network VirtualMachine's VM Network names
- that will be used to when searching for status.addresses
- fields. Note that if internal.networkSubnetCIDR
- and external.networkSubnetCIDR are not set, then
- the vNIC associated to this network must only have
- a single IP address assigned to it. The available
- networks (port groups) can be listed using `govc
- ls 'network/*'`
+ description: |-
+ network VirtualMachine's VM Network names that will be used to when searching
+ for status.addresses fields. Note that if internal.networkSubnetCIDR and
+ external.networkSubnetCIDR are not set, then the vNIC associated to this network must
+ only have a single IP address assigned to it.
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
type: string
networkSubnetCidr:
- description: networkSubnetCidr IP address on VirtualMachine's
- network interfaces included in the fields' CIDRs
- that will be used in respective status.addresses
- fields. ---
+ description: |-
+ networkSubnetCidr IP address on VirtualMachine's network interfaces included in the fields' CIDRs
+ that will be used in respective status.addresses fields.
items:
format: cidr
type: string
@@ -829,30 +843,27 @@ spec:
of the node that is routable only within the cluster.
properties:
excludeNetworkSubnetCidr:
- description: excludeNetworkSubnetCidr IP addresses
- in subnet ranges will be excluded when selecting
- the IP address from the VirtualMachine's VM for
- use in the status.addresses fields. ---
+ description: |-
+ excludeNetworkSubnetCidr IP addresses in subnet ranges will be excluded when selecting
+ the IP address from the VirtualMachine's VM for use in the status.addresses fields.
items:
format: cidr
type: string
type: array
x-kubernetes-list-type: atomic
network:
- description: network VirtualMachine's VM Network names
- that will be used to when searching for status.addresses
- fields. Note that if internal.networkSubnetCIDR
- and external.networkSubnetCIDR are not set, then
- the vNIC associated to this network must only have
- a single IP address assigned to it. The available
- networks (port groups) can be listed using `govc
- ls 'network/*'`
+ description: |-
+ network VirtualMachine's VM Network names that will be used to when searching
+ for status.addresses fields. Note that if internal.networkSubnetCIDR and
+ external.networkSubnetCIDR are not set, then the vNIC associated to this network must
+ only have a single IP address assigned to it.
+ The available networks (port groups) can be listed using
+ `govc ls 'network/*'`
type: string
networkSubnetCidr:
- description: networkSubnetCidr IP address on VirtualMachine's
- network interfaces included in the fields' CIDRs
- that will be used in respective status.addresses
- fields. ---
+ description: |-
+ networkSubnetCidr IP address on VirtualMachine's network interfaces included in the fields' CIDRs
+ that will be used in respective status.addresses fields.
items:
format: cidr
type: string
@@ -861,36 +872,38 @@ spec:
type: object
type: object
vcenters:
- description: vcenters holds the connection details for services
- to communicate with vCenter. Currently, only a single vCenter
- is supported, but in tech preview 3 vCenters are supported.
- Once the cluster has been installed, you are unable to change
- the current number of defined vCenters except in the case
- where the cluster has been upgraded from a version of OpenShift
- where the vsphere platform spec was not present. You may
- make modifications to the existing vCenters that are defined
- in the vcenters list in order to match with any added or
- modified failure domains. ---
+ description: |-
+ vcenters holds the connection details for services to communicate with vCenter.
+ Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
+ Once the cluster has been installed, you are unable to change the current number of defined
+ vCenters except in the case where the cluster has been upgraded from a version of OpenShift
+ where the vsphere platform spec was not present. You may make modifications to the existing
+ vCenters that are defined in the vcenters list in order to match with any added or modified
+ failure domains.
items:
- description: VSpherePlatformVCenterSpec stores the vCenter
- connection fields. This is used by the vSphere CCM.
+ description: |-
+ VSpherePlatformVCenterSpec stores the vCenter connection fields.
+ This is used by the vSphere CCM.
properties:
datacenters:
- description: The vCenter Datacenters in which the RHCOS
- vm guests are located. This field will be used by
- the Cloud Controller Manager. Each datacenter listed
- here should be used within a topology.
+ description: |-
+ The vCenter Datacenters in which the RHCOS
+ vm guests are located. This field will
+ be used by the Cloud Controller Manager.
+ Each datacenter listed here should be used within
+ a topology.
items:
type: string
minItems: 1
type: array
x-kubernetes-list-type: set
port:
- description: port is the TCP port that will be used
- to communicate to the vCenter endpoint. When omitted,
- this means the user has no opinion and it is up to
- the platform to choose a sensible default, which is
- subject to change over time.
+ description: |-
+ port is the TCP port that will be used to communicate to
+ the vCenter endpoint.
+ When omitted, this means the user has no opinion and
+ it is up to the platform to choose a sensible default,
+ which is subject to change over time.
format: int32
maximum: 32767
minimum: 1
@@ -901,7 +914,7 @@ spec:
- format: ipv6
- format: hostname
description: server is the fully-qualified domain name
- or the IP address of the vCenter server. ---
+ or the IP address of the vCenter server.
maxLength: 255
type: string
required:
@@ -936,28 +949,27 @@ spec:
be overridden.
properties:
apiServerInternalURI:
- description: apiServerInternalURL is a valid URI with scheme 'https',
- address and optionally a port (defaulting to 443). apiServerInternalURL
- can be used by components like kubelets, to contact the Kubernetes
- API server using the infrastructure provider rather than Kubernetes
- networking.
+ description: |-
+ apiServerInternalURL is a valid URI with scheme 'https',
+ address and optionally a port (defaulting to 443). apiServerInternalURL can be used by components
+ like kubelets, to contact the Kubernetes API server using the
+ infrastructure provider rather than Kubernetes networking.
type: string
apiServerURL:
- description: apiServerURL is a valid URI with scheme 'https', address
- and optionally a port (defaulting to 443). apiServerURL can be
- used by components like the web console to tell users where to find
- the Kubernetes API.
+ description: |-
+ apiServerURL is a valid URI with scheme 'https', address and
+ optionally a port (defaulting to 443). apiServerURL can be used by components like the web console
+ to tell users where to find the Kubernetes API.
type: string
controlPlaneTopology:
default: HighlyAvailable
- description: controlPlaneTopology expresses the expectations for operands
- that normally run on control nodes. The default is 'HighlyAvailable',
- which represents the behavior operators have in a "normal" cluster.
+ description: |-
+ controlPlaneTopology expresses the expectations for operands that normally run on control nodes.
+ The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
The 'SingleReplica' mode will be used in single-node deployments
- and the operators should not configure the operand for highly-available
- operation The 'External' mode indicates that the control plane is
- hosted externally to the cluster and that its components are not
- visible within the cluster.
+ and the operators should not configure the operand for highly-available operation
+ The 'External' mode indicates that the control plane is hosted externally to the cluster and that
+ its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
@@ -965,47 +977,49 @@ spec:
type: string
cpuPartitioning:
default: None
- description: cpuPartitioning expresses if CPU partitioning is a currently
- enabled feature in the cluster. CPU Partitioning means that this
- cluster can support partitioning workloads to specific CPU Sets.
- Valid values are "None" and "AllNodes". When omitted, the default
- value is "None". The default value of "None" indicates that no nodes
- will be setup with CPU partitioning. The "AllNodes" value indicates
- that all nodes have been setup with CPU partitioning, and can then
- be further configured via the PerformanceProfile API.
+ description: |-
+ cpuPartitioning expresses if CPU partitioning is a currently enabled feature in the cluster.
+ CPU Partitioning means that this cluster can support partitioning workloads to specific CPU Sets.
+ Valid values are "None" and "AllNodes". When omitted, the default value is "None".
+ The default value of "None" indicates that no nodes will be setup with CPU partitioning.
+ The "AllNodes" value indicates that all nodes have been setup with CPU partitioning,
+ and can then be further configured via the PerformanceProfile API.
enum:
- None
- AllNodes
type: string
etcdDiscoveryDomain:
- description: 'etcdDiscoveryDomain is the domain used to fetch the
- SRV records for discovering etcd servers and clients. For more info:
- https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery
- deprecated: as of 4.7, this field is no longer set or honored. It
- will be removed in a future release.'
+ description: |-
+ etcdDiscoveryDomain is the domain used to fetch the SRV records for discovering
+ etcd servers and clients.
+ For more info: https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery
+ deprecated: as of 4.7, this field is no longer set or honored. It will be removed in a future release.
type: string
infrastructureName:
- description: infrastructureName uniquely identifies a cluster with
- a human friendly name. Once set it should not be changed. Must be
- of max length 27 and must have only alphanumeric or hyphen characters.
+ description: |-
+ infrastructureName uniquely identifies a cluster with a human friendly name.
+ Once set it should not be changed. Must be of max length 27 and must have only
+ alphanumeric or hyphen characters.
type: string
infrastructureTopology:
default: HighlyAvailable
- description: 'infrastructureTopology expresses the expectations for
- infrastructure services that do not run on control plane nodes,
- usually indicated by a node selector for a `role` value other than
- `master`. The default is ''HighlyAvailable'', which represents the
- behavior operators have in a "normal" cluster. The ''SingleReplica''
- mode will be used in single-node deployments and the operators should
- not configure the operand for highly-available operation NOTE: External
- topology mode is not applicable for this field.'
+ description: |-
+ infrastructureTopology expresses the expectations for infrastructure services that do not run on control
+ plane nodes, usually indicated by a node selector for a `role` value
+ other than `master`.
+ The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
+ The 'SingleReplica' mode will be used in single-node deployments
+ and the operators should not configure the operand for highly-available operation
+ NOTE: External topology mode is not applicable for this field.
enum:
- HighlyAvailable
- SingleReplica
type: string
platform:
- description: "platform is the underlying infrastructure provider for
- the cluster. \n Deprecated: Use platformStatus.type instead."
+ description: |-
+ platform is the underlying infrastructure provider for the cluster.
+
+ Deprecated: Use platformStatus.type instead.
enum:
- ""
- AWS
@@ -1026,8 +1040,9 @@ spec:
- External
type: string
platformStatus:
- description: platformStatus holds status information specific to the
- underlying infrastructure provider.
+ description: |-
+ platformStatus holds status information specific to the underlying
+ infrastructure provider.
properties:
alibabaCloud:
description: AlibabaCloud contains settings specific to the Alibaba
@@ -1076,16 +1091,120 @@ spec:
description: AWS contains settings specific to the Amazon Web
Services infrastructure provider.
properties:
+ cloudLoadBalancerConfig:
+ default:
+ dnsType: PlatformDefault
+ description: |-
+ 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.
+ nullable: true
+ properties:
+ clusterHosted:
+ description: |-
+ clusterHosted holds the IP addresses of API, API-Int and Ingress Load
+ Balancers on Cloud Platforms. The DNS solution hosted within the cluster
+ use these IP addresses to provide resolution for API, API-Int and Ingress
+ services.
+ properties:
+ apiIntLoadBalancerIPs:
+ description: |-
+ apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Entries in the apiIntLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
+ format: ip
+ items:
+ description: IP is an IP address (for example, "10.0.0.0"
+ or "fd00::").
+ maxLength: 39
+ minLength: 1
+ type: string
+ x-kubernetes-validations:
+ - message: value must be a valid IP address
+ rule: isIP(self)
+ maxItems: 16
+ type: array
+ x-kubernetes-list-type: set
+ apiLoadBalancerIPs:
+ description: |-
+ apiLoadBalancerIPs holds Load Balancer IPs for the API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Could be empty for private clusters.
+ Entries in the apiLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
+ format: ip
+ items:
+ description: IP is an IP address (for example, "10.0.0.0"
+ or "fd00::").
+ maxLength: 39
+ minLength: 1
+ type: string
+ x-kubernetes-validations:
+ - message: value must be a valid IP address
+ rule: isIP(self)
+ maxItems: 16
+ type: array
+ x-kubernetes-list-type: set
+ ingressLoadBalancerIPs:
+ description: |-
+ ingressLoadBalancerIPs holds IPs for Ingress Load Balancers.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Entries in the ingressLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
+ format: ip
+ items:
+ description: IP is an IP address (for example, "10.0.0.0"
+ or "fd00::").
+ maxLength: 39
+ minLength: 1
+ type: string
+ x-kubernetes-validations:
+ - message: value must be a valid IP address
+ rule: isIP(self)
+ maxItems: 16
+ type: array
+ x-kubernetes-list-type: set
+ type: object
+ dnsType:
+ default: PlatformDefault
+ description: |-
+ dnsType indicates the type of DNS solution in use within the cluster. Its default value of
+ `PlatformDefault` indicates that the cluster's DNS is the default provided by the cloud platform.
+ It can be set to `ClusterHosted` to bypass the configuration of the cloud default DNS. In this mode,
+ the cluster needs to provide a self-hosted DNS solution for the cluster's installation to succeed.
+ The cluster's use of the cloud's Load Balancers is unaffected by this setting.
+ The value is immutable after it has been set at install time.
+ Currently, there is no way for the customer to add additional DNS entries into the cluster hosted DNS.
+ Enabling this functionality allows the user to start their own DNS solution outside the cluster after
+ installation is complete. The customer would be responsible for configuring this custom DNS solution,
+ and it can be run in addition to the in-cluster DNS solution.
+ enum:
+ - ClusterHosted
+ - PlatformDefault
+ type: string
+ x-kubernetes-validations:
+ - message: dnsType is immutable
+ rule: oldSelf == '' || self == oldSelf
+ type: object
+ x-kubernetes-validations:
+ - message: clusterHosted is permitted only when dnsType is
+ ClusterHosted
+ rule: 'has(self.dnsType) && self.dnsType != ''ClusterHosted''
+ ? !has(self.clusterHosted) : true'
region:
description: region holds the default AWS region for new AWS
resources created by the cluster.
type: string
resourceTags:
- description: resourceTags is a list of additional tags to
- apply to AWS resources created for the cluster. See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
- for information on tagging AWS resources. AWS supports a
- maximum of 50 tags per resource. OpenShift reserves 25 tags
- for its use, leaving 25 tags available for the user.
+ description: |-
+ resourceTags is a list of additional tags to apply to AWS resources created for the cluster.
+ See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html for information on tagging AWS resources.
+ AWS supports a maximum of 50 tags per resource. OpenShift reserves 25 tags for its use, leaving 25 tags
+ available for the user.
items:
description: AWSResourceTag is a tag to apply to AWS resources
created for the cluster.
@@ -1097,10 +1216,10 @@ spec:
pattern: ^[0-9A-Za-z_.:/=+-@]+$
type: string
value:
- description: value is the value of the tag. Some AWS
- service do not support empty values. Since tags are
- added to resources in many services, the length of
- the tag value must meet the requirements of all services.
+ description: |-
+ value is the value of the tag.
+ Some AWS service do not support empty values. Since tags are added to resources in many services, the
+ length of the tag value must meet the requirements of all services.
maxLength: 256
minLength: 1
pattern: ^[0-9A-Za-z_.:/=+-@]+$
@@ -1113,24 +1232,27 @@ spec:
type: array
x-kubernetes-list-type: atomic
serviceEndpoints:
- description: ServiceEndpoints list contains custom endpoints
- which will override default service endpoint of AWS Services.
+ description: |-
+ ServiceEndpoints list contains custom endpoints which will override default
+ service endpoint of AWS Services.
There must be only one ServiceEndpoint for a service.
items:
- description: AWSServiceEndpoint store the configuration
- of a custom url to override existing defaults of AWS Services.
+ description: |-
+ AWSServiceEndpoint store the configuration of a custom url to
+ override existing defaults of AWS Services.
properties:
name:
- description: name is the name of the AWS service. The
- list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
+ description: |-
+ name is the name of the AWS service.
+ The list of all the service names can be found at https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html
This must be provided and cannot be empty.
pattern: ^[a-z0-9-]+$
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
pattern: ^https://
type: string
type: object
@@ -1146,9 +1268,10 @@ spec:
management in non-soverign clouds such as Azure Stack.
type: string
cloudName:
- description: cloudName is the name of the Azure cloud environment
- which can be used to configure the Azure SDK with the appropriate
- Azure API endpoints. If empty, the value is equal to `AzurePublicCloud`.
+ description: |-
+ cloudName is the name of the Azure cloud environment which can be used to configure the Azure SDK
+ with the appropriate Azure API endpoints.
+ If empty, the value is equal to `AzurePublicCloud`.
enum:
- ""
- AzurePublicCloud
@@ -1158,42 +1281,37 @@ spec:
- AzureStackCloud
type: string
networkResourceGroupName:
- description: networkResourceGroupName is the Resource Group
- for network resources like the Virtual Network and Subnets
- used by the cluster. If empty, the value is same as ResourceGroupName.
+ description: |-
+ networkResourceGroupName is the Resource Group for network resources like the Virtual Network and Subnets used by the cluster.
+ If empty, the value is same as ResourceGroupName.
type: string
resourceGroupName:
description: resourceGroupName is the Resource Group for new
Azure resources created for the cluster.
type: string
resourceTags:
- description: resourceTags is a list of additional tags to
- apply to Azure resources created for the cluster. See https://docs.microsoft.com/en-us/rest/api/resources/tags
- for information on tagging Azure resources. Due to limitations
- on Automation, Content Delivery Network, DNS Azure resources,
- a maximum of 15 tags may be applied. OpenShift reserves
- 5 tags for internal use, allowing 10 tags for user configuration.
+ description: |-
+ resourceTags is a list of additional tags to apply to Azure resources created for the cluster.
+ See https://docs.microsoft.com/en-us/rest/api/resources/tags for information on tagging Azure resources.
+ Due to limitations on Automation, Content Delivery Network, DNS Azure resources, a maximum of 15 tags
+ may be applied. OpenShift reserves 5 tags for internal use, allowing 10 tags for user configuration.
items:
description: AzureResourceTag is a tag to apply to Azure
resources created for the cluster.
properties:
key:
- description: key is the key part of the tag. A tag key
- can have a maximum of 128 characters and cannot be
- empty. Key must begin with a letter, end with a letter,
- number or underscore, and must contain only alphanumeric
- characters and the following special characters `_
- . -`.
+ description: |-
+ key is the key part of the tag. A tag key can have a maximum of 128 characters and cannot be empty. Key
+ must begin with a letter, end with a letter, number or underscore, and must contain only alphanumeric
+ characters and the following special characters `_ . -`.
maxLength: 128
minLength: 1
pattern: ^[a-zA-Z]([0-9A-Za-z_.-]*[0-9A-Za-z_])?$
type: string
value:
- description: 'value is the value part of the tag. A
- tag value can have a maximum of 256 characters and
- cannot be empty. Value must contain only alphanumeric
- characters and the following special characters `_
- + , - . / : ; < = > ? @`.'
+ description: |-
+ value is the value part of the tag. A tag value can have a maximum of 256 characters and cannot be empty. Value
+ must contain only alphanumeric characters and the following special characters `_ + , - . / : ; < = > ? @`.
maxLength: 256
minLength: 1
pattern: ^[0-9A-Za-z_.=+-@]+$
@@ -1219,22 +1337,21 @@ spec:
platform.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1248,17 +1365,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1279,18 +1397,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on BareMetal platform which can be a
- user-managed or openshift-managed load balancer that
- is to be used for the OpenShift API and Ingress endpoints.
- When set to OpenShiftManagedDefault the static pods
- in charge of API and Ingress traffic load-balancing
+ description: |-
+ type defines the type of load balancer used by the cluster on BareMetal platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
defined in the machine config operator will be deployed.
- When set to UserManaged these static pods will not be
- deployed and it is expected that the load balancer is
- configured out of band by the deployer. When omitted,
- this means no opinion and the platform is left to choose
- a reasonable default. The default value is OpenShiftManagedDefault.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1317,13 +1433,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for BareMetal deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ BareMetal deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
equinixMetal:
@@ -1331,19 +1447,16 @@ spec:
Metal infrastructure provider.
properties:
apiServerInternalIP:
- description: apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers.
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
type: string
ingressIP:
- description: ingressIP is an external IP which routes to the
- default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names.
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
type: string
type: object
external:
@@ -1351,23 +1464,22 @@ spec:
External infrastructure provider.
properties:
cloudControllerManager:
- description: cloudControllerManager contains settings specific
- to the external Cloud Controller Manager (a.k.a. CCM or
- CPI). When omitted, new nodes will be not tainted and no
- extra initialization from the cloud controller manager is
- expected.
+ description: |-
+ cloudControllerManager contains settings specific to the external Cloud Controller Manager (a.k.a. CCM or CPI).
+ When omitted, new nodes will be not tainted
+ and no extra initialization from the cloud controller manager is expected.
properties:
state:
- description: "state determines whether or not an external
- Cloud Controller Manager is expected to be installed
- within the cluster. https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/#running-cloud-controller-manager
- \n Valid values are \"External\", \"None\" and omitted.
- When set to \"External\", new nodes will be tainted
- as uninitialized when created, preventing them from
- running workloads until they are initialized by the
- cloud controller manager. When omitted or set to \"None\",
- new nodes will be not tainted and no extra initialization
- from the cloud controller manager is expected."
+ description: |-
+ state determines whether or not an external Cloud Controller Manager is expected to
+ be installed within the cluster.
+ https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/#running-cloud-controller-manager
+
+ Valid values are "External", "None" and omitted.
+ When set to "External", new nodes will be tainted as uninitialized when created,
+ preventing them from running workloads until they are initialized by the cloud controller manager.
+ When omitted or set to "None", new nodes will be not tainted
+ and no extra initialization from the cloud controller manager is expected.
enum:
- ""
- External
@@ -1393,27 +1505,26 @@ spec:
cloudLoadBalancerConfig:
default:
dnsType: PlatformDefault
- description: cloudLoadBalancerConfig is a union that contains
- the IP addresses of API, API-Int and Ingress Load Balancers
- created on the cloud platform. These values would not be
- populated on on-prem platforms. These Load Balancer IPs
- are used to configure the in-cluster DNS instances for API,
- API-Int and Ingress services. `dnsType` is expected to be
- set to `ClusterHosted` when these Load Balancer IP addresses
- are populated and used.
+ description: |-
+ 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.
nullable: true
properties:
clusterHosted:
- description: clusterHosted holds the IP addresses of API,
- API-Int and Ingress Load Balancers on Cloud Platforms.
- The DNS solution hosted within the cluster use these
- IP addresses to provide resolution for API, API-Int
- and Ingress services.
+ description: |-
+ clusterHosted holds the IP addresses of API, API-Int and Ingress Load
+ Balancers on Cloud Platforms. The DNS solution hosted within the cluster
+ use these IP addresses to provide resolution for API, API-Int and Ingress
+ services.
properties:
apiIntLoadBalancerIPs:
- description: apiIntLoadBalancerIPs holds Load Balancer
- IPs for the internal API service. These Load Balancer
- IP addresses can be IPv4 and/or IPv6 addresses.
+ description: |-
+ apiIntLoadBalancerIPs holds Load Balancer IPs for the internal API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
Entries in the apiIntLoadBalancerIPs must be unique.
A maximum of 16 IP addresses are permitted.
format: ip
@@ -1430,12 +1541,12 @@ spec:
type: array
x-kubernetes-list-type: set
apiLoadBalancerIPs:
- description: apiLoadBalancerIPs holds Load Balancer
- IPs for the API service. These Load Balancer IP
- addresses can be IPv4 and/or IPv6 addresses. Could
- be empty for private clusters. Entries in the apiLoadBalancerIPs
- must be unique. A maximum of 16 IP addresses are
- permitted.
+ description: |-
+ apiLoadBalancerIPs holds Load Balancer IPs for the API service.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Could be empty for private clusters.
+ Entries in the apiLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example, "10.0.0.0"
@@ -1450,11 +1561,11 @@ spec:
type: array
x-kubernetes-list-type: set
ingressLoadBalancerIPs:
- description: ingressLoadBalancerIPs holds IPs for
- Ingress Load Balancers. These Load Balancer IP addresses
- can be IPv4 and/or IPv6 addresses. Entries in the
- ingressLoadBalancerIPs must be unique. A maximum
- of 16 IP addresses are permitted.
+ description: |-
+ ingressLoadBalancerIPs holds IPs for Ingress Load Balancers.
+ These Load Balancer IP addresses can be IPv4 and/or IPv6 addresses.
+ Entries in the ingressLoadBalancerIPs must be unique.
+ A maximum of 16 IP addresses are permitted.
format: ip
items:
description: IP is an IP address (for example, "10.0.0.0"
@@ -1471,23 +1582,17 @@ spec:
type: object
dnsType:
default: PlatformDefault
- description: dnsType indicates the type of DNS solution
- in use within the cluster. Its default value of `PlatformDefault`
- indicates that the cluster's DNS is the default provided
- by the cloud platform. It can be set to `ClusterHosted`
- to bypass the configuration of the cloud default DNS.
- In this mode, the cluster needs to provide a self-hosted
- DNS solution for the cluster's installation to succeed.
- The cluster's use of the cloud's Load Balancers is unaffected
- by this setting. The value is immutable after it has
- been set at install time. Currently, there is no way
- for the customer to add additional DNS entries into
- the cluster hosted DNS. Enabling this functionality
- allows the user to start their own DNS solution outside
- the cluster after installation is complete. The customer
- would be responsible for configuring this custom DNS
- solution, and it can be run in addition to the in-cluster
- DNS solution.
+ description: |-
+ dnsType indicates the type of DNS solution in use within the cluster. Its default value of
+ `PlatformDefault` indicates that the cluster's DNS is the default provided by the cloud platform.
+ It can be set to `ClusterHosted` to bypass the configuration of the cloud default DNS. In this mode,
+ the cluster needs to provide a self-hosted DNS solution for the cluster's installation to succeed.
+ The cluster's use of the cloud's Load Balancers is unaffected by this setting.
+ The value is immutable after it has been set at install time.
+ Currently, there is no way for the customer to add additional DNS entries into the cluster hosted DNS.
+ Enabling this functionality allows the user to start their own DNS solution outside the cluster after
+ installation is complete. The customer would be responsible for configuring this custom DNS solution,
+ and it can be run in addition to the in-cluster DNS solution.
enum:
- ClusterHosted
- PlatformDefault
@@ -1510,23 +1615,20 @@ spec:
created for the cluster.
type: string
resourceLabels:
- description: 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.
+ description: |-
+ 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.
items:
description: GCPResourceLabel is a label to apply to GCP
resources created for the cluster.
properties:
key:
- description: key is the key part of the label. A label
- key can have a maximum of 63 characters and cannot
- be empty. Label key must begin with a lowercase letter,
- and must contain only lowercase letters, numeric characters,
- and the following special characters `_-`. Label key
- must not have the reserved prefixes `kubernetes-io`
+ description: |-
+ key is the key part of the label. A label key can have a maximum of 63 characters and cannot be empty.
+ Label key must begin with a lowercase letter, and must contain only lowercase letters, numeric characters,
+ and the following special characters `_-`. Label key must not have the reserved prefixes `kubernetes-io`
and `openshift-io`.
maxLength: 63
minLength: 1
@@ -1537,11 +1639,9 @@ spec:
or `kubernetes-io`
rule: '!self.startsWith(''openshift-io'') && !self.startsWith(''kubernetes-io'')'
value:
- description: value is the value part of the label. A
- label value can have a maximum of 63 characters and
- cannot be empty. Value must contain only lowercase
- letters, numeric characters, and the following special
- characters `_-`.
+ description: |-
+ value is the value part of the label. A label value can have a maximum of 63 characters and cannot be empty.
+ Value must contain only lowercase letters, numeric characters, and the following special characters `_-`.
maxLength: 63
minLength: 1
pattern: ^[0-9a-z_-]{1,63}$
@@ -1560,47 +1660,41 @@ spec:
during installation
rule: self.all(x, x in oldSelf) && oldSelf.all(x, x in self)
resourceTags:
- description: 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.
+ description: |-
+ 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.
items:
description: GCPResourceTag is a tag to apply to GCP resources
created for the cluster.
properties:
key:
- description: key is the key part of the tag. A tag key
- can have a maximum of 63 characters and cannot be
- empty. Tag key must begin and end with an alphanumeric
- character, and must contain only uppercase, lowercase
- alphanumeric characters, and the following special
- characters `._-`.
+ description: |-
+ key is the key part of the tag. A tag key can have a maximum of 63 characters and cannot be empty.
+ Tag key must begin and end with an alphanumeric character, and must contain only uppercase, lowercase
+ alphanumeric characters, and the following special characters `._-`.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z0-9]([0-9A-Za-z_.-]{0,61}[a-zA-Z0-9])?$
type: string
parentID:
- description: 'parentID is the ID of the hierarchical
- resource where the tags are defined, e.g. at the Organization
- or the Project level. To find the Organization or
- Project ID refer to the following pages: https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id,
+ description: |-
+ parentID is the ID of the hierarchical resource where the tags are defined,
+ e.g. at the Organization or the Project level. To find the Organization or Project ID refer to the following pages:
+ https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id,
https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects.
- An OrganizationID must consist of decimal numbers,
- and cannot have leading zeroes. A ProjectID must be
- 6 to 30 characters in length, can only contain lowercase
- letters, numbers, and hyphens, and must start with
- a letter, and cannot end with a hyphen.'
+ An OrganizationID must consist of decimal numbers, and cannot have leading zeroes.
+ A ProjectID must be 6 to 30 characters in length, can only contain lowercase letters, numbers,
+ and hyphens, and must start with a letter, and cannot end with a hyphen.
maxLength: 32
minLength: 1
pattern: (^[1-9][0-9]{0,31}$)|(^[a-z][a-z0-9-]{4,28}[a-z0-9]$)
type: string
value:
- description: value is the value part of the tag. A tag
- value can have a maximum of 63 characters and cannot
- be empty. Tag value must begin and end with an alphanumeric
- character, and must contain only uppercase, lowercase
- alphanumeric characters, and the following special
- characters `_-.@%=+:,*#&(){}[]` and spaces.
+ description: |-
+ value is the value part of the tag. A tag value can have a maximum of 63 characters and cannot be empty.
+ Tag value must begin and end with an alphanumeric character, and must contain only uppercase, lowercase
+ alphanumeric characters, and the following special characters `_-.@%=+:,*#&(){}[]` and spaces.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z0-9]([0-9A-Za-z_.@%=+:,*#&()\[\]{}\-\s]{0,61}[a-zA-Z0-9])?$
@@ -1632,13 +1726,14 @@ spec:
infrastructure provider.
properties:
cisInstanceCRN:
- description: CISInstanceCRN is the CRN of the Cloud Internet
- Services instance managing the DNS zone for the cluster's
- base domain
+ description: |-
+ CISInstanceCRN is the CRN of the Cloud Internet Services instance managing
+ the DNS zone for the cluster's base domain
type: string
dnsInstanceCRN:
- description: DNSInstanceCRN is the CRN of the DNS Services
- instance managing the DNS zone for the cluster's base domain
+ description: |-
+ DNSInstanceCRN is the CRN of the DNS Services instance managing the DNS zone
+ for the cluster's base domain
type: string
location:
description: Location is where the cluster has been deployed
@@ -1652,26 +1747,23 @@ spec:
IBMCloud resources created for the cluster.
type: string
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of an
- IBM Cloud service. These endpoints are consumed by components
- within the cluster to reach the respective IBM Cloud Services.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of an IBM Cloud service. These endpoints are consumed by
+ components within the cluster to reach the respective IBM Cloud Services.
items:
- description: IBMCloudServiceEndpoint stores the configuration
- of a custom url to override existing defaults of IBM Cloud
- Services.
+ description: |-
+ IBMCloudServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of IBM Cloud Services.
properties:
name:
- description: 'name is the name of the IBM Cloud service.
- Possible values are: CIS, COS, COSConfig, DNSServices,
- GlobalCatalog, GlobalSearch, GlobalTagging, HyperProtect,
- IAM, KeyProtect, ResourceController, ResourceManager,
- or VPC. For example, the IBM Cloud Private IAM service
- could be configured with the service `name` of `IAM`
- and `url` of `https://private.iam.cloud.ibm.com` Whereas
- the IBM Cloud Private VPC service for US South (Dallas)
- could be configured with the service `name` of `VPC`
- and `url` of `https://us.south.private.iaas.cloud.ibm.com`'
+ description: |-
+ name is the name of the IBM Cloud service.
+ Possible values are: CIS, COS, COSConfig, DNSServices, GlobalCatalog, GlobalSearch, GlobalTagging, HyperProtect, IAM, KeyProtect, ResourceController, ResourceManager, or VPC.
+ For example, the IBM Cloud Private IAM service could be configured with the
+ service `name` of `IAM` and `url` of `https://private.iam.cloud.ibm.com`
+ Whereas the IBM Cloud Private VPC service for US South (Dallas) could be configured
+ with the service `name` of `VPC` and `url` of `https://us.south.private.iaas.cloud.ibm.com`
enum:
- CIS
- COS
@@ -1688,10 +1780,10 @@ spec:
- VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
type: string
x-kubernetes-validations:
- message: url must be a valid absolute URL
@@ -1710,19 +1802,16 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers.
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
type: string
ingressIP:
- description: ingressIP is an external IP which routes to the
- default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names.
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
type: string
type: object
nutanix:
@@ -1730,22 +1819,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1759,17 +1847,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1790,18 +1879,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on Nutanix platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on Nutanix platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1816,22 +1903,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1845,21 +1931,23 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
cloudName:
- description: cloudName is the name of the desired OpenStack
- cloud in the client configuration file (`clouds.yaml`).
+ description: |-
+ cloudName is the name of the desired OpenStack cloud in the
+ client configuration file (`clouds.yaml`).
type: string
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1880,18 +1968,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on OpenStack platform which can be a
- user-managed or openshift-managed load balancer that
- is to be used for the OpenShift API and Ingress endpoints.
- When set to OpenShiftManagedDefault the static pods
- in charge of API and Ingress traffic load-balancing
+ description: |-
+ type defines the type of load balancer used by the cluster on OpenStack platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
defined in the machine config operator will be deployed.
- When set to UserManaged these static pods will not be
- deployed and it is expected that the load balancer is
- configured out of band by the deployer. When omitted,
- this means no opinion and the platform is left to choose
- a reasonable default. The default value is OpenShiftManagedDefault.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -1918,13 +2004,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for OpenStack deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ OpenStack deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
ovirt:
@@ -1932,22 +2018,21 @@ spec:
provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1961,17 +2046,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -1992,18 +2078,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on Ovirt platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on Ovirt platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -2022,27 +2106,26 @@ spec:
Virtual Servers infrastructure provider.
properties:
cisInstanceCRN:
- description: CISInstanceCRN is the CRN of the Cloud Internet
- Services instance managing the DNS zone for the cluster's
- base domain
+ description: |-
+ CISInstanceCRN is the CRN of the Cloud Internet Services instance managing
+ the DNS zone for the cluster's base domain
type: string
dnsInstanceCRN:
- description: DNSInstanceCRN is the CRN of the DNS Services
- instance managing the DNS zone for the cluster's base domain
+ description: |-
+ DNSInstanceCRN is the CRN of the DNS Services instance managing the DNS zone
+ for the cluster's base domain
type: string
region:
description: region holds the default Power VS region for
new Power VS resources created by the cluster.
type: string
resourceGroup:
- description: 'resourceGroup is the resource group name for
- new IBMCloud resources created for a cluster. The resource
- group specified here will be used by cluster-image-registry-operator
- to set up a COS Instance in IBMCloud for the cluster registry.
+ description: |-
+ resourceGroup is the resource group name for new IBMCloud resources created for a cluster.
+ The resource group specified here will be used by cluster-image-registry-operator to set up a COS Instance in IBMCloud for the cluster registry.
More about resource groups can be found here: https://cloud.ibm.com/docs/account?topic=account-rgs.
- When omitted, the image registry operator won''t be able
- to configure storage, which results in the image registry
- cluster operator not being in an available state.'
+ When omitted, the image registry operator won't be able to configure storage,
+ which results in the image registry cluster operator not being in an available state.
maxLength: 40
pattern: ^[a-zA-Z0-9-_ ]+$
type: string
@@ -2050,26 +2133,42 @@ spec:
- message: resourceGroup is immutable once set
rule: oldSelf == '' || self == oldSelf
serviceEndpoints:
- description: serviceEndpoints is a list of custom endpoints
- which will override the default service endpoints of a Power
- VS service.
+ description: |-
+ serviceEndpoints is a list of custom endpoints which will override the default
+ service endpoints of a Power VS service.
items:
- description: PowervsServiceEndpoint stores the configuration
- of a custom url to override existing defaults of PowerVS
- Services.
+ description: |-
+ PowervsServiceEndpoint stores the configuration of a custom url to
+ override existing defaults of PowerVS Services.
properties:
name:
- description: name is the name of the Power VS service.
- Few of the services are IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
+ description: |-
+ name is the name of the Power VS service.
+ Few of the services are
+ IAM - https://cloud.ibm.com/apidocs/iam-identity-token-api
ResourceController - https://cloud.ibm.com/apidocs/resource-controller/resource-controller
Power Cloud - https://cloud.ibm.com/apidocs/power-cloud
- pattern: ^[a-z0-9-]+$
+ enum:
+ - CIS
+ - COS
+ - COSConfig
+ - DNSServices
+ - GlobalCatalog
+ - GlobalSearch
+ - GlobalTagging
+ - HyperProtect
+ - IAM
+ - KeyProtect
+ - Power
+ - ResourceController
+ - ResourceManager
+ - VPC
type: string
url:
- description: url is fully qualified URI with scheme
- https, that overrides the default generated endpoint
- for a client. This must be provided and cannot be
- empty.
+ description: |-
+ url is fully qualified URI with scheme https, that overrides the default generated
+ endpoint for a client.
+ This must be provided and cannot be empty.
format: uri
pattern: ^https://
type: string
@@ -2082,27 +2181,27 @@ spec:
- name
x-kubernetes-list-type: map
zone:
- description: 'zone holds the default zone for the new Power
- VS resources created by the cluster. Note: Currently only
- single-zone OCP clusters are supported'
+ description: |-
+ zone holds the default zone for the new Power VS resources created by the cluster.
+ Note: Currently only single-zone OCP clusters are supported
type: string
type: object
x-kubernetes-validations:
- message: cannot unset resourceGroup once set
rule: '!has(oldSelf.resourceGroup) || has(self.resourceGroup)'
type:
- description: "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\", \"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. \n This
- value will be synced with to the `status.platform` and `status.platformStatus.type`.
- Currently this value cannot be changed once set."
+ description: |-
+ 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", "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.
+
+ This value will be synced with to the `status.platform` and `status.platformStatus.type`.
+ Currently this value cannot be changed once set.
enum:
- ""
- AWS
@@ -2127,22 +2226,21 @@ spec:
infrastructure provider.
properties:
apiServerInternalIP:
- description: "apiServerInternalIP is an IP address to contact
- the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. It is the IP that the
- Infrastructure.status.apiServerInternalURI points to. It
- is the IP for a self-hosted load balancer in front of the
- API servers. \n Deprecated: Use APIServerInternalIPs instead."
+ description: |-
+ apiServerInternalIP is an IP address to contact the Kubernetes API server that can be used
+ by components inside the cluster, like kubelets using the infrastructure rather
+ than Kubernetes networking. It is the IP that the Infrastructure.status.apiServerInternalURI
+ points to. It is the IP for a self-hosted load balancer in front of the API servers.
+
+ Deprecated: Use APIServerInternalIPs instead.
type: string
apiServerInternalIPs:
- description: apiServerInternalIPs are the IP addresses to
- contact the Kubernetes API server that can be used by components
- inside the cluster, like kubelets using the infrastructure
- rather than Kubernetes networking. These are the IPs for
- a self-hosted load balancer in front of the API servers.
- In dual stack clusters this list contains two IPs otherwise
- only one.
+ description: |-
+ apiServerInternalIPs are the IP addresses to contact the Kubernetes API
+ server that can be used by components inside the cluster, like kubelets
+ using the infrastructure rather than Kubernetes networking. These are the
+ IPs for a self-hosted load balancer in front of the API servers. In dual
+ stack clusters this list contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -2156,17 +2254,18 @@ spec:
&& isIP(self[1]) ? ip(self[0]).family() != ip(self[1]).family()
: true)'
ingressIP:
- description: "ingressIP is an external IP which routes to
- the default ingress controller. The IP is a suitable target
- of a wildcard DNS record used to resolve default route host
- names. \n Deprecated: Use IngressIPs instead."
+ description: |-
+ ingressIP is an external IP which routes to the default ingress controller.
+ The IP is a suitable target of a wildcard DNS record used to resolve default route host names.
+
+ Deprecated: Use IngressIPs instead.
type: string
ingressIPs:
- description: ingressIPs are the external IPs which route to
- the default ingress controller. The IPs are suitable targets
- of a wildcard DNS record used to resolve default route host
- names. In dual stack clusters this list contains two IPs
- otherwise only one.
+ description: |-
+ ingressIPs are the external IPs which route to the default ingress
+ controller. The IPs are suitable targets of a wildcard DNS record used to
+ resolve default route host names. In dual stack clusters this list
+ contains two IPs otherwise only one.
format: ip
items:
type: string
@@ -2187,18 +2286,16 @@ spec:
properties:
type:
default: OpenShiftManagedDefault
- description: type defines the type of load balancer used
- by the cluster on VSphere platform which can be a user-managed
- or openshift-managed load balancer that is to be used
- for the OpenShift API and Ingress endpoints. When set
- to OpenShiftManagedDefault the static pods in charge
- of API and Ingress traffic load-balancing defined in
- the machine config operator will be deployed. When set
- to UserManaged these static pods will not be deployed
- and it is expected that the load balancer is configured
- out of band by the deployer. When omitted, this means
- no opinion and the platform is left to choose a reasonable
- default. The default value is OpenShiftManagedDefault.
+ description: |-
+ type defines the type of load balancer used by the cluster on VSphere platform
+ which can be a user-managed or openshift-managed load balancer
+ that is to be used for the OpenShift API and Ingress endpoints.
+ When set to OpenShiftManagedDefault the static pods in charge of API and Ingress traffic load-balancing
+ defined in the machine config operator will be deployed.
+ When set to UserManaged these static pods will not be deployed and it is expected that
+ the load balancer is configured out of band by the deployer.
+ When omitted, this means no opinion and the platform is left to choose a reasonable default.
+ The default value is OpenShiftManagedDefault.
enum:
- OpenShiftManagedDefault
- UserManaged
@@ -2225,13 +2322,13 @@ spec:
x-kubernetes-validations:
- rule: self.all(x, self.exists_one(y, x == y))
nodeDNSIP:
- description: nodeDNSIP is the IP address for the internal
- DNS used by the nodes. Unlike the one managed by the DNS
- operator, `NodeDNSIP` provides name resolution for the nodes
- themselves. There is no DNS-as-a-service for vSphere deployments.
- In order to minimize necessary changes to the datacenter
- DNS, a DNS service is hosted as a static pod to serve those
- hostnames to the nodes in the cluster.
+ description: |-
+ nodeDNSIP is the IP address for the internal DNS used by the
+ nodes. Unlike the one managed by the DNS operator, `NodeDNSIP`
+ provides name resolution for the nodes themselves. There is no DNS-as-a-service for
+ vSphere deployments. In order to minimize necessary changes to the
+ datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
+ to the nodes in the cluster.
type: string
type: object
type: object
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses.crd.yaml
index b102ecad73..34f2c0a823 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses.crd.yaml
@@ -20,20 +20,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Ingress holds cluster-wide information about ingress, including
- the default ingress domain used for routes. The canonical name is `cluster`.
- \n Compatibility level 1: Stable within a major release for a minimum of
- 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Ingress holds cluster-wide information about ingress, including the default ingress domain
+ used for routes. The canonical name is `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -41,22 +47,25 @@ spec:
description: spec holds user settable values for configuration
properties:
appsDomain:
- description: appsDomain is an optional domain to use instead of the
- one specified in the domain field when a Route is created without
- specifying an explicit host. If appsDomain is nonempty, this value
- is used to generate default host values for Route. Unlike domain,
- appsDomain may be modified after installation. This assumes a new
- ingresscontroller has been setup with a wildcard certificate.
+ description: |-
+ appsDomain is an optional domain to use instead of the one specified
+ in the domain field when a Route is created without specifying an explicit
+ host. If appsDomain is nonempty, this value is used to generate default
+ host values for Route. Unlike domain, appsDomain may be modified after
+ installation.
+ This assumes a new ingresscontroller has been setup with a wildcard
+ certificate.
type: string
componentRoutes:
- description: "componentRoutes is an optional list of routes that are
- managed by OpenShift components that a cluster-admin is able to
- configure the hostname and serving certificate for. The namespace
- and name of each route in this list should match an existing entry
- in the status.componentRoutes list. \n To determine the set of configurable
- Routes, look at namespace and name of entries in the .status.componentRoutes
- list, where participating operators write the status of configurable
- routes."
+ description: |-
+ componentRoutes is an optional list of routes that are managed by OpenShift components
+ that a cluster-admin is able to configure the hostname and serving certificate for.
+ The namespace and name of each route in this list should match an existing entry in the
+ status.componentRoutes list.
+
+ To determine the set of configurable Routes, look at namespace and name of entries in the
+ .status.componentRoutes list, where participating operators write the status of
+ configurable routes.
items:
description: ComponentRouteSpec allows for configuration of a route's
hostname and serving certificate.
@@ -67,30 +76,30 @@ spec:
pattern: ^([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})$|^(([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})[\.]){0,}([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})$
type: string
name:
- description: "name is the logical name of the route to customize.
- \n The namespace and name of this componentRoute must match
- a corresponding entry in the list of status.componentRoutes
- if the route is to be customized."
+ description: |-
+ name is the logical name of the route to customize.
+
+ The namespace and name of this componentRoute must match a corresponding
+ entry in the list of status.componentRoutes if the route is to be customized.
maxLength: 256
minLength: 1
type: string
namespace:
- description: "namespace is the namespace of the route to customize.
- \n The namespace and name of this componentRoute must match
- a corresponding entry in the list of status.componentRoutes
- if the route is to be customized."
+ description: |-
+ namespace is the namespace of the route to customize.
+
+ The namespace and name of this componentRoute must match a corresponding
+ entry in the list of status.componentRoutes if the route is to be customized.
maxLength: 63
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
servingCertKeyPairSecret:
- description: servingCertKeyPairSecret is a reference to a secret
- of type `kubernetes.io/tls` in the openshift-config namespace.
- The serving cert/key pair must match and will be used by the
- operator to fulfill the intent of serving with this name.
- If the custom hostname uses the default routing suffix of
- the cluster, the Secret specification for a serving certificate
- will not be needed.
+ description: |-
+ servingCertKeyPairSecret is a reference to a secret of type `kubernetes.io/tls` in the openshift-config namespace.
+ The serving cert/key pair must match and will be used by the operator to fulfill the intent of serving with this name.
+ If the custom hostname uses the default routing suffix of the cluster,
+ the Secret specification for a serving certificate will not be needed.
properties:
name:
description: name is the metadata.name of the referenced
@@ -110,43 +119,49 @@ spec:
- name
x-kubernetes-list-type: map
domain:
- description: "domain is used to generate a default host name for a
- route when the route's host name is empty. The generated host name
- will follow this pattern: \"..\".
- \n It is also used as the default wildcard domain suffix for ingress.
- The default ingresscontroller domain will follow this pattern: \"*.\".
- \n Once set, changing domain is not currently supported."
+ description: |-
+ domain is used to generate a default host name for a route when the
+ route's host name is empty. The generated host name will follow this
+ pattern: "..".
+
+ It is also used as the default wildcard domain suffix for ingress. The
+ default ingresscontroller domain will follow this pattern: "*.".
+
+ Once set, changing domain is not currently supported.
type: string
loadBalancer:
- description: loadBalancer contains the load balancer details in general
- which are not only specific to the underlying infrastructure provider
- of the current cluster and are required for Ingress Controller to
- work on OpenShift.
+ description: |-
+ loadBalancer contains the load balancer details in general which are not only specific to the underlying infrastructure
+ provider of the current cluster and are required for Ingress Controller to work on OpenShift.
properties:
platform:
- description: platform holds configuration specific to the underlying
- infrastructure provider for the ingress load balancers. 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.
+ description: |-
+ platform holds configuration specific to the underlying
+ infrastructure provider for the ingress load balancers.
+ 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.
properties:
aws:
description: aws contains settings specific to the Amazon
Web Services infrastructure provider.
properties:
type:
- description: "type allows user to set a load balancer
- type. When this field is set the default ingresscontroller
- will get created using the specified LBType. If this
- field is not set then the default ingress controller
- of LBType Classic will be created. Valid values are:
- \n * \"Classic\": A Classic Load Balancer that makes
- routing decisions at either the transport layer (TCP/SSL)
- or the application layer (HTTP/HTTPS). See the following
- for additional details: \n https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#clb
- \n * \"NLB\": A Network Load Balancer that makes routing
- decisions at the transport layer (TCP/SSL). See the
- following for additional details: \n https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#nlb"
+ description: |-
+ type allows user to set a load balancer type.
+ When this field is set the default ingresscontroller will get created using the specified LBType.
+ If this field is not set then the default ingress controller of LBType Classic will be created.
+ Valid values are:
+
+ * "Classic": A Classic Load Balancer that makes routing decisions at either
+ the transport layer (TCP/SSL) or the application layer (HTTP/HTTPS). See
+ the following for additional details:
+
+ https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#clb
+
+ * "NLB": A Network Load Balancer that makes routing decisions at the
+ transport layer (TCP/SSL). See the following for additional details:
+
+ https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#nlb
enum:
- NLB
- Classic
@@ -155,13 +170,12 @@ spec:
- type
type: object
type:
- description: type is the underlying infrastructure provider
- for the cluster. 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.
+ description: |-
+ type is the underlying infrastructure provider for the cluster.
+ 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.
enum:
- ""
- AWS
@@ -184,118 +198,112 @@ spec:
type: object
type: object
requiredHSTSPolicies:
- description: "requiredHSTSPolicies specifies HSTS policies that are
- required to be set on newly created or updated routes matching
- the domainPattern/s and namespaceSelector/s that are specified in
- the policy. Each requiredHSTSPolicy must have at least a domainPattern
- and a maxAge to validate a route HSTS Policy route annotation, and
- affect route admission. \n A candidate route is checked for HSTS
- Policies if it has the HSTS Policy route annotation: \"haproxy.router.openshift.io/hsts_header\"
+ description: |-
+ requiredHSTSPolicies specifies HSTS policies that are required to be set on newly created or updated routes
+ matching the domainPattern/s and namespaceSelector/s that are specified in the policy.
+ Each requiredHSTSPolicy must have at least a domainPattern and a maxAge to validate a route HSTS Policy route
+ annotation, and affect route admission.
+
+ A candidate route is checked for HSTS Policies if it has the HSTS Policy route annotation:
+ "haproxy.router.openshift.io/hsts_header"
E.g. haproxy.router.openshift.io/hsts_header: max-age=31536000;preload;includeSubDomains
- \n - For each candidate route, if it matches a requiredHSTSPolicy
- domainPattern and optional namespaceSelector, then the maxAge, preloadPolicy,
- and includeSubdomainsPolicy must be valid to be admitted. Otherwise,
- the route is rejected. - The first match, by domainPattern and optional
- namespaceSelector, in the ordering of the RequiredHSTSPolicies determines
- the route's admission status. - If the candidate route doesn't match
- any requiredHSTSPolicy domainPattern and optional namespaceSelector,
- then it may use any HSTS Policy annotation. \n The HSTS policy configuration
- may be changed after routes have already been created. An update
- to a previously admitted route may then fail if the updated route
- does not conform to the updated HSTS policy configuration. However,
- changing the HSTS policy configuration will not cause a route that
- is already admitted to stop working. \n Note that if there are no
- RequiredHSTSPolicies, any HSTS Policy annotation on the route is
- valid."
+
+ - For each candidate route, if it matches a requiredHSTSPolicy domainPattern and optional namespaceSelector,
+ then the maxAge, preloadPolicy, and includeSubdomainsPolicy must be valid to be admitted. Otherwise, the route
+ is rejected.
+ - The first match, by domainPattern and optional namespaceSelector, in the ordering of the RequiredHSTSPolicies
+ determines the route's admission status.
+ - If the candidate route doesn't match any requiredHSTSPolicy domainPattern and optional namespaceSelector,
+ then it may use any HSTS Policy annotation.
+
+ The HSTS policy configuration may be changed after routes have already been created. An update to a previously
+ admitted route may then fail if the updated route does not conform to the updated HSTS policy configuration.
+ However, changing the HSTS policy configuration will not cause a route that is already admitted to stop working.
+
+ Note that if there are no RequiredHSTSPolicies, any HSTS Policy annotation on the route is valid.
items:
properties:
domainPatterns:
- description: "domainPatterns is a list of domains for which
- the desired HSTS annotations are required. If domainPatterns
- is specified and a route is created with a spec.host matching
- one of the domains, the route must specify the HSTS Policy
- components described in the matching RequiredHSTSPolicy. \n
- The use of wildcards is allowed like this: *.foo.com matches
- everything under foo.com. foo.com only matches foo.com, so
- to cover foo.com and everything under it, you must specify
- *both*."
+ description: |-
+ domainPatterns is a list of domains for which the desired HSTS annotations are required.
+ If domainPatterns is specified and a route is created with a spec.host matching one of the domains,
+ the route must specify the HSTS Policy components described in the matching RequiredHSTSPolicy.
+
+ The use of wildcards is allowed like this: *.foo.com matches everything under foo.com.
+ foo.com only matches foo.com, so to cover foo.com and everything under it, you must specify *both*.
items:
type: string
minItems: 1
type: array
includeSubDomainsPolicy:
- description: 'includeSubDomainsPolicy means the HSTS Policy
- should apply to any subdomains of the host''s domain name. Thus,
- for the host bar.foo.com, if includeSubDomainsPolicy was set
- to RequireIncludeSubDomains: - the host app.bar.foo.com would
- inherit the HSTS Policy of bar.foo.com - the host bar.foo.com
- would inherit the HSTS Policy of bar.foo.com - the host foo.com
- would NOT inherit the HSTS Policy of bar.foo.com - the host
- def.foo.com would NOT inherit the HSTS Policy of bar.foo.com'
+ description: |-
+ includeSubDomainsPolicy means the HSTS Policy should apply to any subdomains of the host's
+ domain name. Thus, for the host bar.foo.com, if includeSubDomainsPolicy was set to RequireIncludeSubDomains:
+ - the host app.bar.foo.com would inherit the HSTS Policy of bar.foo.com
+ - the host bar.foo.com would inherit the HSTS Policy of bar.foo.com
+ - the host foo.com would NOT inherit the HSTS Policy of bar.foo.com
+ - the host def.foo.com would NOT inherit the HSTS Policy of bar.foo.com
enum:
- RequireIncludeSubDomains
- RequireNoIncludeSubDomains
- NoOpinion
type: string
maxAge:
- description: maxAge is the delta time range in seconds during
- which hosts are regarded as HSTS hosts. If set to 0, it negates
- the effect, and hosts are removed as HSTS hosts. If set to
- 0 and includeSubdomains is specified, all subdomains of the
- host are also removed as HSTS hosts. maxAge is a time-to-live
- value, and if this policy is not refreshed on a client, the
- HSTS policy will eventually expire on that client.
+ description: |-
+ maxAge is the delta time range in seconds during which hosts are regarded as HSTS hosts.
+ If set to 0, it negates the effect, and hosts are removed as HSTS hosts.
+ If set to 0 and includeSubdomains is specified, all subdomains of the host are also removed as HSTS hosts.
+ maxAge is a time-to-live value, and if this policy is not refreshed on a client, the HSTS
+ policy will eventually expire on that client.
properties:
largestMaxAge:
- description: The largest allowed value (in seconds) of the
- RequiredHSTSPolicy max-age This value can be left unspecified,
- in which case no upper limit is enforced.
+ description: |-
+ The largest allowed value (in seconds) of the RequiredHSTSPolicy max-age
+ This value can be left unspecified, in which case no upper limit is enforced.
format: int32
maximum: 2147483647
minimum: 0
type: integer
smallestMaxAge:
- description: The smallest allowed value (in seconds) of
- the RequiredHSTSPolicy max-age Setting max-age=0 allows
- the deletion of an existing HSTS header from a host. This
- is a necessary tool for administrators to quickly correct
- mistakes. This value can be left unspecified, in which
- case no lower limit is enforced.
+ description: |-
+ The smallest allowed value (in seconds) of the RequiredHSTSPolicy max-age
+ Setting max-age=0 allows the deletion of an existing HSTS header from a host. This is a necessary
+ tool for administrators to quickly correct mistakes.
+ This value can be left unspecified, in which case no lower limit is enforced.
format: int32
maximum: 2147483647
minimum: 0
type: integer
type: object
namespaceSelector:
- description: namespaceSelector specifies a label selector such
- that the policy applies only to those routes that are in namespaces
- with labels that match the selector, and are in one of the
- DomainPatterns. Defaults to the empty LabelSelector, which
- matches everything.
+ description: |-
+ namespaceSelector specifies a label selector such that the policy applies only to those routes that
+ are in namespaces with labels that match the selector, and are in one of the DomainPatterns.
+ Defaults to the empty LabelSelector, which matches everything.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
- description: A label selector requirement is a selector
- that contains values, a key, and an operator that relates
- the key and values.
+ description: |-
+ A label selector requirement is a selector that contains values, a key, and an operator that
+ relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
- description: operator represents a key's relationship
- to a set of values. Valid operators are In, NotIn,
- Exists and DoesNotExist.
+ description: |-
+ operator represents a key's relationship to a set of values.
+ Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
- description: values is an array of string values.
- If the operator is In or NotIn, the values array
- must be non-empty. If the operator is Exists or
- DoesNotExist, the values array must be empty. This
- array is replaced during a strategic merge patch.
+ description: |-
+ values is an array of string values. If the operator is In or NotIn,
+ the values array must be non-empty. If the operator is Exists or DoesNotExist,
+ the values array must be empty. This array is replaced during a strategic
+ merge patch.
items:
type: string
type: array
@@ -309,18 +317,17 @@ spec:
matchLabels:
additionalProperties:
type: string
- description: matchLabels is a map of {key,value} pairs.
- A single {key,value} in the matchLabels map is equivalent
- to an element of matchExpressions, whose key field is
- "key", the operator is "In", and the values array contains
- only "value". The requirements are ANDed.
+ description: |-
+ matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
+ map is equivalent to an element of matchExpressions, whose key field is "key", the
+ operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
preloadPolicy:
- description: preloadPolicy directs the client to include hosts
- in its host preload list so that it never needs to do an initial
- load to get the HSTS header (note that this is not defined
+ description: |-
+ preloadPolicy directs the client to include hosts in its host preload list so that
+ it never needs to do an initial load to get the HSTS header (note that this is not defined
in RFC 6797 and is therefore client implementation-dependent).
enum:
- RequirePreload
@@ -337,67 +344,58 @@ spec:
be overridden.
properties:
componentRoutes:
- description: componentRoutes is where participating operators place
- the current route status for routes whose hostnames and serving
- certificates can be customized by the cluster-admin.
+ description: |-
+ componentRoutes is where participating operators place the current route status for routes whose
+ hostnames and serving certificates can be customized by the cluster-admin.
items:
description: ComponentRouteStatus contains information allowing
configuration of a route's hostname and serving certificate.
properties:
conditions:
- description: "conditions are used to communicate the state of
- the componentRoutes entry. \n Supported conditions include
- Available, Degraded and Progressing. \n If available is true,
- the content served by the route can be accessed by users.
- This includes cases where a default may continue to serve
- content while the customized route specified by the cluster-admin
- is being configured. \n If Degraded is true, that means something
- has gone wrong trying to handle the componentRoutes entry.
- The currentHostnames field may or may not be in effect. \n
- If Progressing is true, that means the component is taking
- some action related to the componentRoutes entry."
+ description: |-
+ conditions are used to communicate the state of the componentRoutes entry.
+
+ Supported conditions include Available, Degraded and Progressing.
+
+ If available is true, the content served by the route can be accessed by users. This includes cases
+ where a default may continue to serve content while the customized route specified by the cluster-admin
+ is being configured.
+
+ If Degraded is true, that means something has gone wrong trying to handle the componentRoutes entry.
+ The currentHostnames field may or may not be in effect.
+
+ If Progressing is true, that means the component is taking some action related to the componentRoutes entry.
items:
- description: "Condition contains details for one aspect of
- the current state of this API Resource. --- This struct
- is intended for direct use as an array at the field path
- .status.conditions. For example, \n type FooStatus struct{
- // Represents the observations of a foo's current state.
- // Known .status.conditions.type are: \"Available\", \"Progressing\",
- and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields
- }"
+ description: Condition contains details for one aspect of
+ the current state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should
- be when the underlying condition changed. If that is
- not known, then using the time when the API field changed
- is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance,
- if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the
- current state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier
- indicating the reason for the condition's last transition.
- Producers of specific condition types may define expected
- values and meanings for this field, and whether the
- values are considered a guaranteed API. The value should
- be a CamelCase string. This field may not be empty.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
@@ -412,11 +410,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across
- resources like Available, but because arbitrary conditions
- can be useful (see .node.status.conditions), the ability
- to deconflict is important. The regex it matches is
- (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -445,10 +438,9 @@ spec:
maxItems: 5
type: array
currentHostnames:
- description: currentHostnames is the list of current names used
- by the route. Typically, this list should consist of a single
- hostname, but if multiple hostnames are supported by the route
- the operator may write multiple entries to this list.
+ description: |-
+ currentHostnames is the list of current names used by the route. Typically, this list should consist of a single
+ hostname, but if multiple hostnames are supported by the route the operator may write multiple entries to this list.
items:
description: Hostname is a host name as defined by RFC-1123.
pattern: ^([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})$|^(([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})[\.]){0,}([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})$
@@ -461,21 +453,22 @@ spec:
pattern: ^([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})$|^(([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})[\.]){0,}([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})$
type: string
name:
- description: "name is the logical name of the route to customize.
- It does not have to be the actual name of a route resource
- but it cannot be renamed. \n The namespace and name of this
- componentRoute must match a corresponding entry in the list
- of spec.componentRoutes if the route is to be customized."
+ description: |-
+ name is the logical name of the route to customize. It does not have to be the actual name of a route resource
+ but it cannot be renamed.
+
+ The namespace and name of this componentRoute must match a corresponding
+ entry in the list of spec.componentRoutes if the route is to be customized.
maxLength: 256
minLength: 1
type: string
namespace:
- description: "namespace is the namespace of the route to customize.
- It must be a real namespace. Using an actual namespace ensures
- that no two components will conflict and the same component
- can be installed multiple times. \n The namespace and name
- of this componentRoute must match a corresponding entry in
- the list of spec.componentRoutes if the route is to be customized."
+ description: |-
+ namespace is the namespace of the route to customize. It must be a real namespace. Using an actual namespace
+ ensures that no two components will conflict and the same component can be installed multiple times.
+
+ The namespace and name of this componentRoute must match a corresponding
+ entry in the list of spec.componentRoutes if the route is to be customized.
maxLength: 63
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
@@ -519,14 +512,19 @@ spec:
- name
x-kubernetes-list-type: map
defaultPlacement:
- description: "defaultPlacement is set at installation time to control
- which nodes will host the ingress router pods by default. The options
- are control-plane nodes or worker nodes. \n This field works by
- dictating how the Cluster Ingress Operator will consider unset replicas
- and nodePlacement fields in IngressController resources when creating
- the corresponding Deployments. \n See the documentation for the
- IngressController replicas and nodePlacement fields for more information.
- \n When omitted, the default value is Workers"
+ description: |-
+ defaultPlacement is set at installation time to control which
+ nodes will host the ingress router pods by default. The options are
+ control-plane nodes or worker nodes.
+
+ This field works by dictating how the Cluster Ingress Operator will
+ consider unset replicas and nodePlacement fields in IngressController
+ resources when creating the corresponding Deployments.
+
+ See the documentation for the IngressController replicas and nodePlacement
+ fields for more information.
+
+ When omitted, the default value is Workers
enum:
- ControlPlane
- Workers
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks.crd.yaml
index 04e14d9f22..49db650d7a 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks.crd.yaml
@@ -20,46 +20,52 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Network holds cluster-wide information about Network. The canonical
- name is `cluster`. It is used to configure the desired network configuration,
- such as: IP address pools for services/pod IPs, network plugin, etc. Please
- view network.spec for an explanation on what applies when configuring this
- resource. \n Compatibility level 1: Stable within a major release for a
- minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Network holds cluster-wide information about Network. The canonical name is `cluster`. It is used to configure the desired network configuration, such as: IP address pools for services/pod IPs, network plugin, etc.
+ Please view network.spec for an explanation on what applies when configuring this resource.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
- description: spec holds user settable values for configuration. 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.
+ description: |-
+ spec holds user settable values for configuration.
+ 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.
properties:
clusterNetwork:
- description: IP address pool to use for pod IPs. This field is immutable
- after installation.
+ description: |-
+ IP address pool to use for pod IPs.
+ This field is immutable after installation.
items:
- description: ClusterNetworkEntry is a contiguous block of IP addresses
- from which pod IPs are allocated.
+ description: |-
+ ClusterNetworkEntry is a contiguous block of IP addresses from which pod IPs
+ are allocated.
properties:
cidr:
description: The complete block for pod IPs.
type: string
hostPrefix:
- description: The size (prefix) of block to allocate to each
- node. If this field is not used by the plugin, it can be left
- unset.
+ description: |-
+ The size (prefix) of block to allocate to each node. If this
+ field is not used by the plugin, it can be left unset.
format: int32
minimum: 0
type: integer
@@ -67,26 +73,28 @@ spec:
type: array
x-kubernetes-list-type: atomic
externalIP:
- description: externalIP defines configuration for controllers that
- affect Service.ExternalIP. If nil, then ExternalIP is not allowed
- to be set.
+ description: |-
+ externalIP defines configuration for controllers that
+ affect Service.ExternalIP. If nil, then ExternalIP is
+ not allowed to be set.
properties:
autoAssignCIDRs:
- description: autoAssignCIDRs is a list of CIDRs from which to
- automatically assign Service.ExternalIP. These are assigned
- when the service is of type LoadBalancer. In general, this is
- only useful for bare-metal clusters. In Openshift 3.x, this
- was misleadingly called "IngressIPs". Automatically assigned
- External IPs are not affected by any ExternalIPPolicy rules.
+ description: |-
+ autoAssignCIDRs is a list of CIDRs from which to automatically assign
+ Service.ExternalIP. These are assigned when the service is of type
+ LoadBalancer. In general, this is only useful for bare-metal clusters.
+ In Openshift 3.x, this was misleadingly called "IngressIPs".
+ Automatically assigned External IPs are not affected by any
+ ExternalIPPolicy rules.
Currently, only one entry may be provided.
items:
type: string
type: array
x-kubernetes-list-type: atomic
policy:
- description: policy is a set of restrictions applied to the ExternalIP
- field. If nil or empty, then ExternalIP is not allowed to be
- set.
+ description: |-
+ policy is a set of restrictions applied to the ExternalIP field.
+ If nil or empty, then ExternalIP is not allowed to be set.
properties:
allowedCIDRs:
description: allowedCIDRs is the list of allowed CIDRs.
@@ -95,8 +103,9 @@ spec:
type: array
x-kubernetes-list-type: atomic
rejectedCIDRs:
- description: rejectedCIDRs is the list of disallowed CIDRs.
- These take precedence over allowedCIDRs.
+ description: |-
+ rejectedCIDRs is the list of disallowed CIDRs. These take precedence
+ over allowedCIDRs.
items:
type: string
type: array
@@ -104,142 +113,145 @@ spec:
type: object
type: object
networkDiagnostics:
- description: "networkDiagnostics defines network diagnostics configuration.
- \n Takes precedence over spec.disableNetworkDiagnostics in network.operator.openshift.io.
- If networkDiagnostics is not specified or is empty, and the spec.disableNetworkDiagnostics
- flag in network.operator.openshift.io is set to true, the network
- diagnostics feature will be disabled."
+ description: |-
+ networkDiagnostics defines network diagnostics configuration.
+
+ Takes precedence over spec.disableNetworkDiagnostics in network.operator.openshift.io.
+ If networkDiagnostics is not specified or is empty,
+ and the spec.disableNetworkDiagnostics flag in network.operator.openshift.io is set to true,
+ the network diagnostics feature will be disabled.
properties:
mode:
- description: "mode controls the network diagnostics mode \n 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 All."
+ description: |-
+ mode controls the network diagnostics mode
+
+ 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 All.
enum:
- ""
- All
- Disabled
type: string
sourcePlacement:
- description: "sourcePlacement controls the scheduling of network
- diagnostics source deployment \n See NetworkDiagnosticsSourcePlacement
- for more details about default values."
+ description: |-
+ sourcePlacement controls the scheduling of network diagnostics source deployment
+
+ See NetworkDiagnosticsSourcePlacement for more details about default values.
properties:
nodeSelector:
additionalProperties:
type: string
- description: "nodeSelector is the node selector applied to
- network diagnostics components \n 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 `kubernetes.io/os: linux`."
+ description: |-
+ nodeSelector is the node selector applied to network diagnostics components
+
+ 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 `kubernetes.io/os: linux`.
type: object
tolerations:
- description: "tolerations is a list of tolerations applied
- to network diagnostics components \n 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 an empty list."
+ description: |-
+ tolerations is a list of tolerations applied to network diagnostics components
+
+ 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 an empty list.
items:
- description: The pod this Toleration is attached to tolerates
- any taint that matches the triple using
- the matching operator .
+ description: |-
+ The pod this Toleration is attached to tolerates any taint that matches
+ the triple using the matching operator .
properties:
effect:
- description: Effect indicates the taint effect to match.
- Empty means match all taint effects. When specified,
- allowed values are NoSchedule, PreferNoSchedule and
- NoExecute.
+ description: |-
+ Effect indicates the taint effect to match. Empty means match all taint effects.
+ When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
- description: 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.
+ description: |-
+ 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.
type: string
operator:
- description: 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.
+ description: |-
+ 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.
type: string
tolerationSeconds:
- description: 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.
+ description: |-
+ 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.
format: int64
type: integer
value:
- description: Value is the taint value the toleration
- matches to. If the operator is Exists, the value should
- be empty, otherwise just a regular string.
+ description: |-
+ Value is the taint value the toleration matches to.
+ If the operator is Exists, the value should be empty, otherwise just a regular string.
type: string
type: object
type: array
x-kubernetes-list-type: atomic
type: object
targetPlacement:
- description: "targetPlacement controls the scheduling of network
- diagnostics target daemonset \n See NetworkDiagnosticsTargetPlacement
- for more details about default values."
+ description: |-
+ targetPlacement controls the scheduling of network diagnostics target daemonset
+
+ See NetworkDiagnosticsTargetPlacement for more details about default values.
properties:
nodeSelector:
additionalProperties:
type: string
- description: "nodeSelector is the node selector applied to
- network diagnostics components \n 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 `kubernetes.io/os: linux`."
+ description: |-
+ nodeSelector is the node selector applied to network diagnostics components
+
+ 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 `kubernetes.io/os: linux`.
type: object
tolerations:
- description: "tolerations is a list of tolerations applied
- to network diagnostics components \n 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 `- operator: \"Exists\"`
- which means that all taints are tolerated."
+ description: |-
+ tolerations is a list of tolerations applied to network diagnostics components
+
+ 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 `- operator: "Exists"` which means that all taints are tolerated.
items:
- description: The pod this Toleration is attached to tolerates
- any taint that matches the triple using
- the matching operator .
+ description: |-
+ The pod this Toleration is attached to tolerates any taint that matches
+ the triple using the matching operator .
properties:
effect:
- description: Effect indicates the taint effect to match.
- Empty means match all taint effects. When specified,
- allowed values are NoSchedule, PreferNoSchedule and
- NoExecute.
+ description: |-
+ Effect indicates the taint effect to match. Empty means match all taint effects.
+ When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
- description: 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.
+ description: |-
+ 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.
type: string
operator:
- description: 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.
+ description: |-
+ 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.
type: string
tolerationSeconds:
- description: 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.
+ description: |-
+ 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.
format: int64
type: integer
value:
- description: Value is the taint value the toleration
- matches to. If the operator is Exists, the value should
- be empty, otherwise just a regular string.
+ description: |-
+ Value is the taint value the toleration matches to.
+ If the operator is Exists, the value should be empty, otherwise just a regular string.
type: string
type: object
type: array
@@ -247,25 +259,31 @@ spec:
type: object
type: object
networkType:
- description: 'NetworkType is the plugin that is to be deployed (e.g.
- OVNKubernetes). This should match a value that the cluster-network-operator
- understands, or else no networking will be installed. Currently
- supported values are: - OVNKubernetes This field is immutable after
- installation.'
+ description: |-
+ NetworkType is the plugin that is to be deployed (e.g. OVNKubernetes).
+ This should match a value that the cluster-network-operator understands,
+ or else no networking will be installed.
+ Currently supported values are:
+ - OVNKubernetes
+ This field is immutable after installation.
type: string
serviceNetwork:
- description: IP address pool for services. Currently, we only support
- a single entry here. This field is immutable after installation.
+ description: |-
+ IP address pool for services.
+ Currently, we only support a single entry here.
+ This field is immutable after installation.
items:
type: string
type: array
x-kubernetes-list-type: atomic
serviceNodePortRange:
- description: The port range allowed for Services of type NodePort.
- If not specified, the default of 30000-32767 will be used. Such
- Services without a NodePort specified will have one automatically
- allocated from this range. This parameter can be updated after the
- cluster is installed.
+ description: |-
+ The port range allowed for Services of type NodePort.
+ If not specified, the default of 30000-32767 will be used.
+ Such Services without a NodePort specified will have one
+ automatically allocated from this range.
+ This parameter can be updated after the cluster is
+ installed.
pattern: ^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])-([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$
type: string
type: object
@@ -282,16 +300,17 @@ spec:
clusterNetwork:
description: IP address pool to use for pod IPs.
items:
- description: ClusterNetworkEntry is a contiguous block of IP addresses
- from which pod IPs are allocated.
+ description: |-
+ ClusterNetworkEntry is a contiguous block of IP addresses from which pod IPs
+ are allocated.
properties:
cidr:
description: The complete block for pod IPs.
type: string
hostPrefix:
- description: The size (prefix) of block to allocate to each
- node. If this field is not used by the plugin, it can be left
- unset.
+ description: |-
+ The size (prefix) of block to allocate to each node. If this
+ field is not used by the plugin, it can be left unset.
format: int32
minimum: 0
type: integer
@@ -302,46 +321,39 @@ spec:
description: ClusterNetworkMTU is the MTU for inter-pod networking.
type: integer
conditions:
- description: 'conditions represents the observations of a network.config
- current state. Known .status.conditions.type are: "NetworkDiagnosticsAvailable"'
+ description: |-
+ conditions represents the observations of a network.config current state.
+ Known .status.conditions.type are: "NetworkDiagnosticsAvailable"
items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource. --- This struct is intended for direct
- use as an array at the field path .status.conditions. For example,
- \n type FooStatus struct{ // Represents the observations of a
- foo's current state. // Known .status.conditions.type are: \"Available\",
- \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
properties:
lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should be when
- the underlying condition changed. If that is not known, then
- using the time when the API field changed is acceptable.
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance, if .metadata.generation
- is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the current
- state of the instance.
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
- description: reason contains a programmatic identifier indicating
- the reason for the condition's last transition. Producers
- of specific condition types may define expected values and
- meanings for this field, and whether the values are considered
- a guaranteed API. The value should be a CamelCase string.
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
@@ -356,10 +368,6 @@ spec:
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across resources
- like Available, but because arbitrary conditions can be useful
- (see .node.status.conditions), the ability to deconflict is
- important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
@@ -412,17 +420,19 @@ spec:
type: object
type: object
networkType:
- description: 'NetworkType is the target plugin that is being deployed.
- DEPRECATED: network type migration is no longer supported, so
- this should always be unset.'
+ description: |-
+ NetworkType is the target plugin that is being deployed.
+ DEPRECATED: network type migration is no longer supported,
+ so this should always be unset.
type: string
type: object
networkType:
description: NetworkType is the plugin that is deployed (e.g. OVNKubernetes).
type: string
serviceNetwork:
- description: IP address pool for services. Currently, we only support
- a single entry here.
+ description: |-
+ IP address pool for services.
+ Currently, we only support a single entry here.
items:
type: string
type: array
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-CustomNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-CustomNoUpgrade.crd.yaml
new file mode 100644
index 0000000000..469400577a
--- /dev/null
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-CustomNoUpgrade.crd.yaml
@@ -0,0 +1,158 @@
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ api-approved.openshift.io: https://github.com/openshift/api/pull/1107
+ api.openshift.io/merged-by-featuregates: "true"
+ include.release.openshift.io/ibm-cloud-managed: "true"
+ include.release.openshift.io/self-managed-high-availability: "true"
+ release.openshift.io/bootstrap-required: "true"
+ release.openshift.io/feature-set: CustomNoUpgrade
+ name: nodes.config.openshift.io
+spec:
+ group: config.openshift.io
+ names:
+ kind: Node
+ listKind: NodeList
+ plural: nodes
+ singular: node
+ scope: Cluster
+ versions:
+ - name: v1
+ schema:
+ openAPIV3Schema:
+ description: |-
+ Node holds cluster-wide information about node specific features.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
+ properties:
+ apiVersion:
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
+ type: string
+ kind:
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: spec holds user settable values for configuration
+ properties:
+ cgroupMode:
+ description: CgroupMode determines the cgroups version on the node
+ enum:
+ - v1
+ - v2
+ - ""
+ type: string
+ minimumKubeletVersion:
+ description: |-
+ minimumKubeletVersion is the lowest version of a kubelet that can join the cluster.
+ Specifically, the apiserver will deny most authorization requests of kubelets that are older
+ than the specified version, only allowing the kubelet to get and update its node object, and perform
+ subjectaccessreviews.
+ This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads,
+ and will eventually be marked as not ready.
+ Its max length is 8, so maximum version allowed is either "9.999.99" or "99.99.99".
+ Since the kubelet reports the version of the kubernetes release, not Openshift, this field references
+ the underlying kubernetes version this version of Openshift is based off of.
+ In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then
+ they should set the minimumKubeletVersion to 1.30.0.
+ When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version.
+ Thus, a kubelet with version "1.0.0-ec.0" will be compatible with minimumKubeletVersion "1.0.0" or earlier.
+ maxLength: 8
+ type: string
+ x-kubernetes-validations:
+ - message: minmumKubeletVersion must be in a semver compatible format
+ of x.y.z, or empty
+ rule: self == "" || self.matches('^[0-9]*.[0-9]*.[0-9]*$')
+ workerLatencyProfile:
+ description: |-
+ WorkerLatencyProfile determins the how fast the kubelet is updating
+ the status and corresponding reaction of the cluster
+ enum:
+ - Default
+ - MediumUpdateAverageReaction
+ - LowUpdateSlowReaction
+ type: string
+ type: object
+ status:
+ description: status holds observed values.
+ properties:
+ conditions:
+ description: conditions contain the details and the current state
+ of the nodes.config object
+ items:
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
+ properties:
+ lastTransitionTime:
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
+ format: date-time
+ type: string
+ message:
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
+ maxLength: 32768
+ type: string
+ observedGeneration:
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
+ format: int64
+ minimum: 0
+ type: integer
+ reason:
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
+ maxLength: 1024
+ minLength: 1
+ pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
+ type: string
+ status:
+ description: status of the condition, one of True, False, Unknown.
+ enum:
+ - "True"
+ - "False"
+ - Unknown
+ type: string
+ type:
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
+ maxLength: 316
+ pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
+ type: string
+ required:
+ - lastTransitionTime
+ - message
+ - reason
+ - status
+ - type
+ type: object
+ type: array
+ x-kubernetes-list-map-keys:
+ - type
+ x-kubernetes-list-type: map
+ type: object
+ required:
+ - spec
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-Default.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-Default.crd.yaml
new file mode 100644
index 0000000000..b79a394c6e
--- /dev/null
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-Default.crd.yaml
@@ -0,0 +1,137 @@
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ api-approved.openshift.io: https://github.com/openshift/api/pull/1107
+ api.openshift.io/merged-by-featuregates: "true"
+ include.release.openshift.io/ibm-cloud-managed: "true"
+ include.release.openshift.io/self-managed-high-availability: "true"
+ release.openshift.io/bootstrap-required: "true"
+ release.openshift.io/feature-set: Default
+ name: nodes.config.openshift.io
+spec:
+ group: config.openshift.io
+ names:
+ kind: Node
+ listKind: NodeList
+ plural: nodes
+ singular: node
+ scope: Cluster
+ versions:
+ - name: v1
+ schema:
+ openAPIV3Schema:
+ description: |-
+ Node holds cluster-wide information about node specific features.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
+ properties:
+ apiVersion:
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
+ type: string
+ kind:
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: spec holds user settable values for configuration
+ properties:
+ cgroupMode:
+ description: CgroupMode determines the cgroups version on the node
+ enum:
+ - v1
+ - v2
+ - ""
+ type: string
+ workerLatencyProfile:
+ description: |-
+ WorkerLatencyProfile determins the how fast the kubelet is updating
+ the status and corresponding reaction of the cluster
+ enum:
+ - Default
+ - MediumUpdateAverageReaction
+ - LowUpdateSlowReaction
+ type: string
+ type: object
+ status:
+ description: status holds observed values.
+ properties:
+ conditions:
+ description: conditions contain the details and the current state
+ of the nodes.config object
+ items:
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
+ properties:
+ lastTransitionTime:
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
+ format: date-time
+ type: string
+ message:
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
+ maxLength: 32768
+ type: string
+ observedGeneration:
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
+ format: int64
+ minimum: 0
+ type: integer
+ reason:
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
+ maxLength: 1024
+ minLength: 1
+ pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
+ type: string
+ status:
+ description: status of the condition, one of True, False, Unknown.
+ enum:
+ - "True"
+ - "False"
+ - Unknown
+ type: string
+ type:
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
+ maxLength: 316
+ pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
+ type: string
+ required:
+ - lastTransitionTime
+ - message
+ - reason
+ - status
+ - type
+ type: object
+ type: array
+ x-kubernetes-list-map-keys:
+ - type
+ x-kubernetes-list-type: map
+ type: object
+ required:
+ - spec
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-DevPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-DevPreviewNoUpgrade.crd.yaml
new file mode 100644
index 0000000000..99b124d572
--- /dev/null
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-DevPreviewNoUpgrade.crd.yaml
@@ -0,0 +1,158 @@
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ api-approved.openshift.io: https://github.com/openshift/api/pull/1107
+ api.openshift.io/merged-by-featuregates: "true"
+ include.release.openshift.io/ibm-cloud-managed: "true"
+ include.release.openshift.io/self-managed-high-availability: "true"
+ release.openshift.io/bootstrap-required: "true"
+ release.openshift.io/feature-set: DevPreviewNoUpgrade
+ name: nodes.config.openshift.io
+spec:
+ group: config.openshift.io
+ names:
+ kind: Node
+ listKind: NodeList
+ plural: nodes
+ singular: node
+ scope: Cluster
+ versions:
+ - name: v1
+ schema:
+ openAPIV3Schema:
+ description: |-
+ Node holds cluster-wide information about node specific features.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
+ properties:
+ apiVersion:
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
+ type: string
+ kind:
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: spec holds user settable values for configuration
+ properties:
+ cgroupMode:
+ description: CgroupMode determines the cgroups version on the node
+ enum:
+ - v1
+ - v2
+ - ""
+ type: string
+ minimumKubeletVersion:
+ description: |-
+ minimumKubeletVersion is the lowest version of a kubelet that can join the cluster.
+ Specifically, the apiserver will deny most authorization requests of kubelets that are older
+ than the specified version, only allowing the kubelet to get and update its node object, and perform
+ subjectaccessreviews.
+ This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads,
+ and will eventually be marked as not ready.
+ Its max length is 8, so maximum version allowed is either "9.999.99" or "99.99.99".
+ Since the kubelet reports the version of the kubernetes release, not Openshift, this field references
+ the underlying kubernetes version this version of Openshift is based off of.
+ In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then
+ they should set the minimumKubeletVersion to 1.30.0.
+ When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version.
+ Thus, a kubelet with version "1.0.0-ec.0" will be compatible with minimumKubeletVersion "1.0.0" or earlier.
+ maxLength: 8
+ type: string
+ x-kubernetes-validations:
+ - message: minmumKubeletVersion must be in a semver compatible format
+ of x.y.z, or empty
+ rule: self == "" || self.matches('^[0-9]*.[0-9]*.[0-9]*$')
+ workerLatencyProfile:
+ description: |-
+ WorkerLatencyProfile determins the how fast the kubelet is updating
+ the status and corresponding reaction of the cluster
+ enum:
+ - Default
+ - MediumUpdateAverageReaction
+ - LowUpdateSlowReaction
+ type: string
+ type: object
+ status:
+ description: status holds observed values.
+ properties:
+ conditions:
+ description: conditions contain the details and the current state
+ of the nodes.config object
+ items:
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
+ properties:
+ lastTransitionTime:
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
+ format: date-time
+ type: string
+ message:
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
+ maxLength: 32768
+ type: string
+ observedGeneration:
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
+ format: int64
+ minimum: 0
+ type: integer
+ reason:
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
+ maxLength: 1024
+ minLength: 1
+ pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
+ type: string
+ status:
+ description: status of the condition, one of True, False, Unknown.
+ enum:
+ - "True"
+ - "False"
+ - Unknown
+ type: string
+ type:
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
+ maxLength: 316
+ pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
+ type: string
+ required:
+ - lastTransitionTime
+ - message
+ - reason
+ - status
+ - type
+ type: object
+ type: array
+ x-kubernetes-list-map-keys:
+ - type
+ x-kubernetes-list-type: map
+ type: object
+ required:
+ - spec
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-TechPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-TechPreviewNoUpgrade.crd.yaml
new file mode 100644
index 0000000000..8db838df77
--- /dev/null
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-TechPreviewNoUpgrade.crd.yaml
@@ -0,0 +1,158 @@
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ api-approved.openshift.io: https://github.com/openshift/api/pull/1107
+ api.openshift.io/merged-by-featuregates: "true"
+ include.release.openshift.io/ibm-cloud-managed: "true"
+ include.release.openshift.io/self-managed-high-availability: "true"
+ release.openshift.io/bootstrap-required: "true"
+ release.openshift.io/feature-set: TechPreviewNoUpgrade
+ name: nodes.config.openshift.io
+spec:
+ group: config.openshift.io
+ names:
+ kind: Node
+ listKind: NodeList
+ plural: nodes
+ singular: node
+ scope: Cluster
+ versions:
+ - name: v1
+ schema:
+ openAPIV3Schema:
+ description: |-
+ Node holds cluster-wide information about node specific features.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
+ properties:
+ apiVersion:
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
+ type: string
+ kind:
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: spec holds user settable values for configuration
+ properties:
+ cgroupMode:
+ description: CgroupMode determines the cgroups version on the node
+ enum:
+ - v1
+ - v2
+ - ""
+ type: string
+ minimumKubeletVersion:
+ description: |-
+ minimumKubeletVersion is the lowest version of a kubelet that can join the cluster.
+ Specifically, the apiserver will deny most authorization requests of kubelets that are older
+ than the specified version, only allowing the kubelet to get and update its node object, and perform
+ subjectaccessreviews.
+ This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads,
+ and will eventually be marked as not ready.
+ Its max length is 8, so maximum version allowed is either "9.999.99" or "99.99.99".
+ Since the kubelet reports the version of the kubernetes release, not Openshift, this field references
+ the underlying kubernetes version this version of Openshift is based off of.
+ In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then
+ they should set the minimumKubeletVersion to 1.30.0.
+ When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version.
+ Thus, a kubelet with version "1.0.0-ec.0" will be compatible with minimumKubeletVersion "1.0.0" or earlier.
+ maxLength: 8
+ type: string
+ x-kubernetes-validations:
+ - message: minmumKubeletVersion must be in a semver compatible format
+ of x.y.z, or empty
+ rule: self == "" || self.matches('^[0-9]*.[0-9]*.[0-9]*$')
+ workerLatencyProfile:
+ description: |-
+ WorkerLatencyProfile determins the how fast the kubelet is updating
+ the status and corresponding reaction of the cluster
+ enum:
+ - Default
+ - MediumUpdateAverageReaction
+ - LowUpdateSlowReaction
+ type: string
+ type: object
+ status:
+ description: status holds observed values.
+ properties:
+ conditions:
+ description: conditions contain the details and the current state
+ of the nodes.config object
+ items:
+ description: Condition contains details for one aspect of the current
+ state of this API Resource.
+ properties:
+ lastTransitionTime:
+ description: |-
+ lastTransitionTime is the last time the condition transitioned from one status to another.
+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
+ format: date-time
+ type: string
+ message:
+ description: |-
+ message is a human readable message indicating details about the transition.
+ This may be an empty string.
+ maxLength: 32768
+ type: string
+ observedGeneration:
+ description: |-
+ observedGeneration represents the .metadata.generation that the condition was set based upon.
+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
+ with respect to the current state of the instance.
+ format: int64
+ minimum: 0
+ type: integer
+ reason:
+ description: |-
+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
+ Producers of specific condition types may define expected values and meanings for this field,
+ and whether the values are considered a guaranteed API.
+ The value should be a CamelCase string.
+ This field may not be empty.
+ maxLength: 1024
+ minLength: 1
+ pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
+ type: string
+ status:
+ description: status of the condition, one of True, False, Unknown.
+ enum:
+ - "True"
+ - "False"
+ - Unknown
+ type: string
+ type:
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
+ maxLength: 316
+ pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
+ type: string
+ required:
+ - lastTransitionTime
+ - message
+ - reason
+ - status
+ - type
+ type: object
+ type: array
+ x-kubernetes-list-map-keys:
+ - type
+ x-kubernetes-list-type: map
+ type: object
+ required:
+ - spec
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes.crd.yaml
deleted file mode 100644
index fdde91e74d..0000000000
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes.crd.yaml
+++ /dev/null
@@ -1,141 +0,0 @@
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- api-approved.openshift.io: https://github.com/openshift/api/pull/1107
- api.openshift.io/merged-by-featuregates: "true"
- include.release.openshift.io/ibm-cloud-managed: "true"
- include.release.openshift.io/self-managed-high-availability: "true"
- release.openshift.io/bootstrap-required: "true"
- name: nodes.config.openshift.io
-spec:
- group: config.openshift.io
- names:
- kind: Node
- listKind: NodeList
- plural: nodes
- singular: node
- scope: Cluster
- versions:
- - name: v1
- schema:
- openAPIV3Schema:
- description: "Node holds cluster-wide information about node specific features.
- \n Compatibility level 1: Stable within a major release for a minimum of
- 12 months or 3 minor releases (whichever is longer)."
- properties:
- apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
- type: string
- kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
- type: string
- metadata:
- type: object
- spec:
- description: spec holds user settable values for configuration
- properties:
- cgroupMode:
- description: CgroupMode determines the cgroups version on the node
- enum:
- - v1
- - v2
- - ""
- type: string
- workerLatencyProfile:
- description: WorkerLatencyProfile determins the how fast the kubelet
- is updating the status and corresponding reaction of the cluster
- enum:
- - Default
- - MediumUpdateAverageReaction
- - LowUpdateSlowReaction
- type: string
- type: object
- status:
- description: status holds observed values.
- properties:
- conditions:
- description: conditions contain the details and the current state
- of the nodes.config object
- items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource. --- This struct is intended for direct
- use as an array at the field path .status.conditions. For example,
- \n type FooStatus struct{ // Represents the observations of a
- foo's current state. // Known .status.conditions.type are: \"Available\",
- \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
- properties:
- lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should be when
- the underlying condition changed. If that is not known, then
- using the time when the API field changed is acceptable.
- format: date-time
- type: string
- message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
- maxLength: 32768
- type: string
- observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance, if .metadata.generation
- is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the current
- state of the instance.
- format: int64
- minimum: 0
- type: integer
- reason:
- description: reason contains a programmatic identifier indicating
- the reason for the condition's last transition. Producers
- of specific condition types may define expected values and
- meanings for this field, and whether the values are considered
- a guaranteed API. The value should be a CamelCase string.
- This field may not be empty.
- maxLength: 1024
- minLength: 1
- pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
- type: string
- status:
- description: status of the condition, one of True, False, Unknown.
- enum:
- - "True"
- - "False"
- - Unknown
- type: string
- type:
- description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across resources
- like Available, but because arbitrary conditions can be useful
- (see .node.status.conditions), the ability to deconflict is
- important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
- maxLength: 316
- pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
- type: string
- required:
- - lastTransitionTime
- - message
- - reason
- - status
- - type
- type: object
- type: array
- x-kubernetes-list-map-keys:
- - type
- x-kubernetes-list-type: map
- type: object
- required:
- - spec
- type: object
- served: true
- storage: true
- subresources:
- status: {}
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_oauths.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_oauths.crd.yaml
index dcce4d3afc..a84df309c1 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_oauths.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_oauths.crd.yaml
@@ -20,22 +20,27 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "OAuth holds cluster-wide information about OAuth. The canonical
- name is `cluster`. It is used to configure the integrated OAuth server.
- This configuration is only honored when the top level Authentication config
- has type set to IntegratedOAuth. \n Compatibility level 1: Stable within
- a major release for a minimum of 12 months or 3 minor releases (whichever
- is longer)."
+ description: |-
+ OAuth holds cluster-wide information about OAuth. The canonical name is `cluster`.
+ It is used to configure the integrated OAuth server.
+ This configuration is only honored when the top level Authentication config has type set to IntegratedOAuth.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -43,9 +48,9 @@ spec:
description: spec holds user settable values for configuration
properties:
identityProviders:
- description: identityProviders is an ordered list of ways for a user
- to identify themselves. When this list is empty, no identities are
- provisioned for users.
+ description: |-
+ identityProviders is an ordered list of ways for a user to identify themselves.
+ When this list is empty, no identities are provisioned for users.
items:
description: IdentityProvider provides identities for users authenticating
using credentials
@@ -55,15 +60,14 @@ spec:
BasicAuth IdP
properties:
ca:
- description: ca is an optional reference to a config map
- by name containing the PEM-encoded CA bundle. It is used
- as a trust anchor to validate the TLS certificate presented
- by the remote server. The key "ca.crt" is used to locate
- the data. If specified and the config map or expected
- key is not found, the identity provider is not honored.
- If the specified ca data is not valid, the identity provider
- is not honored. If empty, the default system roots are
- used. The namespace for this config map is openshift-config.
+ description: |-
+ ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
+ It is used as a trust anchor to validate the TLS certificate presented by the remote server.
+ The key "ca.crt" is used to locate the data.
+ If specified and the config map or expected key is not found, the identity provider is not honored.
+ If the specified ca data is not valid, the identity provider is not honored.
+ If empty, the default system roots are used.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -73,13 +77,12 @@ spec:
- name
type: object
tlsClientCert:
- description: tlsClientCert is an optional reference to a
- secret by name that contains the PEM-encoded TLS client
- certificate to present when connecting to the server.
- The key "tls.crt" is used to locate the data. If specified
- and the secret or expected key is not found, the identity
- provider is not honored. If the specified certificate
- data is not valid, the identity provider is not honored.
+ description: |-
+ tlsClientCert is an optional reference to a secret by name that contains the
+ PEM-encoded TLS client certificate to present when connecting to the server.
+ The key "tls.crt" is used to locate the data.
+ If specified and the secret or expected key is not found, the identity provider is not honored.
+ If the specified certificate data is not valid, the identity provider is not honored.
The namespace for this secret is openshift-config.
properties:
name:
@@ -90,13 +93,12 @@ spec:
- name
type: object
tlsClientKey:
- description: tlsClientKey is an optional reference to a
- secret by name that contains the PEM-encoded TLS private
- key for the client certificate referenced in tlsClientCert.
- The key "tls.key" is used to locate the data. If specified
- and the secret or expected key is not found, the identity
- provider is not honored. If the specified certificate
- data is not valid, the identity provider is not honored.
+ description: |-
+ tlsClientKey is an optional reference to a secret by name that contains the
+ PEM-encoded TLS private key for the client certificate referenced in tlsClientCert.
+ The key "tls.key" is used to locate the data.
+ If specified and the secret or expected key is not found, the identity provider is not honored.
+ If the specified certificate data is not valid, the identity provider is not honored.
The namespace for this secret is openshift-config.
properties:
name:
@@ -115,17 +117,15 @@ spec:
credentials
properties:
ca:
- description: ca is an optional reference to a config map
- by name containing the PEM-encoded CA bundle. It is used
- as a trust anchor to validate the TLS certificate presented
- by the remote server. The key "ca.crt" is used to locate
- the data. If specified and the config map or expected
- key is not found, the identity provider is not honored.
- If the specified ca data is not valid, the identity provider
- is not honored. If empty, the default system roots are
- used. This can only be configured when hostname is set
- to a non-empty value. The namespace for this config map
- is openshift-config.
+ description: |-
+ ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
+ It is used as a trust anchor to validate the TLS certificate presented by the remote server.
+ The key "ca.crt" is used to locate the data.
+ If specified and the config map or expected key is not found, the identity provider is not honored.
+ If the specified ca data is not valid, the identity provider is not honored.
+ If empty, the default system roots are used.
+ This can only be configured when hostname is set to a non-empty value.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -138,11 +138,11 @@ spec:
description: clientID is the oauth client ID
type: string
clientSecret:
- description: clientSecret is a required reference to the
- secret by name containing the oauth client secret. The
- key "clientSecret" is used to locate the data. If the
- secret or expected key is not found, the identity provider
- is not honored. The namespace for this secret is openshift-config.
+ description: |-
+ clientSecret is a required reference to the secret by name containing the oauth client secret.
+ The key "clientSecret" is used to locate the data.
+ If the secret or expected key is not found, the identity provider is not honored.
+ The namespace for this secret is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -152,10 +152,10 @@ spec:
- name
type: object
hostname:
- description: hostname is the optional domain (e.g. "mycompany.com")
- for use with a hosted instance of GitHub Enterprise. It
- must match the GitHub Enterprise settings value configured
- at /setup/settings#hostname.
+ description: |-
+ hostname is the optional domain (e.g. "mycompany.com") for use with a hosted instance of
+ GitHub Enterprise.
+ It must match the GitHub Enterprise settings value configured at /setup/settings#hostname.
type: string
organizations:
description: organizations optionally restricts which organizations
@@ -175,15 +175,14 @@ spec:
credentials
properties:
ca:
- description: ca is an optional reference to a config map
- by name containing the PEM-encoded CA bundle. It is used
- as a trust anchor to validate the TLS certificate presented
- by the remote server. The key "ca.crt" is used to locate
- the data. If specified and the config map or expected
- key is not found, the identity provider is not honored.
- If the specified ca data is not valid, the identity provider
- is not honored. If empty, the default system roots are
- used. The namespace for this config map is openshift-config.
+ description: |-
+ ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
+ It is used as a trust anchor to validate the TLS certificate presented by the remote server.
+ The key "ca.crt" is used to locate the data.
+ If specified and the config map or expected key is not found, the identity provider is not honored.
+ If the specified ca data is not valid, the identity provider is not honored.
+ If empty, the default system roots are used.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -196,11 +195,11 @@ spec:
description: clientID is the oauth client ID
type: string
clientSecret:
- description: clientSecret is a required reference to the
- secret by name containing the oauth client secret. The
- key "clientSecret" is used to locate the data. If the
- secret or expected key is not found, the identity provider
- is not honored. The namespace for this secret is openshift-config.
+ description: |-
+ clientSecret is a required reference to the secret by name containing the oauth client secret.
+ The key "clientSecret" is used to locate the data.
+ If the secret or expected key is not found, the identity provider is not honored.
+ The namespace for this secret is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -221,11 +220,11 @@ spec:
description: clientID is the oauth client ID
type: string
clientSecret:
- description: clientSecret is a required reference to the
- secret by name containing the oauth client secret. The
- key "clientSecret" is used to locate the data. If the
- secret or expected key is not found, the identity provider
- is not honored. The namespace for this secret is openshift-config.
+ description: |-
+ clientSecret is a required reference to the secret by name containing the oauth client secret.
+ The key "clientSecret" is used to locate the data.
+ If the secret or expected key is not found, the identity provider is not honored.
+ The namespace for this secret is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -244,13 +243,12 @@ spec:
file to validate credentials
properties:
fileData:
- description: fileData is a required reference to a secret
- by name containing the data to use as the htpasswd file.
- The key "htpasswd" is used to locate the data. If the
- secret or expected key is not found, the identity provider
- is not honored. If the specified htpasswd data is not
- valid, the identity provider is not honored. The namespace
- for this secret is openshift-config.
+ description: |-
+ fileData is a required reference to a secret by name containing the data to use as the htpasswd file.
+ The key "htpasswd" is used to locate the data.
+ If the secret or expected key is not found, the identity provider is not honored.
+ If the specified htpasswd data is not valid, the identity provider is not honored.
+ The namespace for this secret is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -265,15 +263,14 @@ spec:
password credentials
properties:
ca:
- description: ca is an optional reference to a config map
- by name containing the PEM-encoded CA bundle. It is used
- as a trust anchor to validate the TLS certificate presented
- by the remote server. The key "ca.crt" is used to locate
- the data. If specified and the config map or expected
- key is not found, the identity provider is not honored.
- If the specified ca data is not valid, the identity provider
- is not honored. If empty, the default system roots are
- used. The namespace for this config map is openshift-config.
+ description: |-
+ ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
+ It is used as a trust anchor to validate the TLS certificate presented by the remote server.
+ The key "ca.crt" is used to locate the data.
+ If specified and the config map or expected key is not found, the identity provider is not honored.
+ If the specified ca data is not valid, the identity provider is not honored.
+ If empty, the default system roots are used.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -286,13 +283,12 @@ spec:
description: domainName is required for keystone v3
type: string
tlsClientCert:
- description: tlsClientCert is an optional reference to a
- secret by name that contains the PEM-encoded TLS client
- certificate to present when connecting to the server.
- The key "tls.crt" is used to locate the data. If specified
- and the secret or expected key is not found, the identity
- provider is not honored. If the specified certificate
- data is not valid, the identity provider is not honored.
+ description: |-
+ tlsClientCert is an optional reference to a secret by name that contains the
+ PEM-encoded TLS client certificate to present when connecting to the server.
+ The key "tls.crt" is used to locate the data.
+ If specified and the secret or expected key is not found, the identity provider is not honored.
+ If the specified certificate data is not valid, the identity provider is not honored.
The namespace for this secret is openshift-config.
properties:
name:
@@ -303,13 +299,12 @@ spec:
- name
type: object
tlsClientKey:
- description: tlsClientKey is an optional reference to a
- secret by name that contains the PEM-encoded TLS private
- key for the client certificate referenced in tlsClientCert.
- The key "tls.key" is used to locate the data. If specified
- and the secret or expected key is not found, the identity
- provider is not honored. If the specified certificate
- data is not valid, the identity provider is not honored.
+ description: |-
+ tlsClientKey is an optional reference to a secret by name that contains the
+ PEM-encoded TLS private key for the client certificate referenced in tlsClientCert.
+ The key "tls.key" is used to locate the data.
+ If specified and the secret or expected key is not found, the identity provider is not honored.
+ If the specified certificate data is not valid, the identity provider is not honored.
The namespace for this secret is openshift-config.
properties:
name:
@@ -330,32 +325,32 @@ spec:
description: attributes maps LDAP attributes to identities
properties:
email:
- description: email is the list of attributes whose values
- should be used as the email address. Optional. If
- unspecified, no email is set for the identity
+ description: |-
+ email is the list of attributes whose values should be used as the email address. Optional.
+ If unspecified, no email is set for the identity
items:
type: string
type: array
id:
- description: id is the list of attributes whose values
- should be used as the user ID. Required. First non-empty
- attribute is used. At least one attribute is required.
- If none of the listed attribute have a value, authentication
- fails. LDAP standard identity attribute is "dn"
+ description: |-
+ id is the list of attributes whose values should be used as the user ID. Required.
+ First non-empty attribute is used. At least one attribute is required. If none of the listed
+ attribute have a value, authentication fails.
+ LDAP standard identity attribute is "dn"
items:
type: string
type: array
name:
- description: name is the list of attributes whose values
- should be used as the display name. Optional. If unspecified,
- no display name is set for the identity LDAP standard
- display name attribute is "cn"
+ description: |-
+ name is the list of attributes whose values should be used as the display name. Optional.
+ If unspecified, no display name is set for the identity
+ LDAP standard display name attribute is "cn"
items:
type: string
type: array
preferredUsername:
- description: preferredUsername is the list of attributes
- whose values should be used as the preferred username.
+ description: |-
+ preferredUsername is the list of attributes whose values should be used as the preferred username.
LDAP standard login attribute is "uid"
items:
type: string
@@ -366,12 +361,12 @@ spec:
the search phase.
type: string
bindPassword:
- description: bindPassword is an optional reference to a
- secret by name containing a password to bind with during
- the search phase. The key "bindPassword" is used to locate
- the data. If specified and the secret or expected key
- is not found, the identity provider is not honored. The
- namespace for this secret is openshift-config.
+ description: |-
+ bindPassword is an optional reference to a secret by name
+ containing a password to bind with during the search phase.
+ The key "bindPassword" is used to locate the data.
+ If specified and the secret or expected key is not found, the identity provider is not honored.
+ The namespace for this secret is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -381,15 +376,14 @@ spec:
- name
type: object
ca:
- description: ca is an optional reference to a config map
- by name containing the PEM-encoded CA bundle. It is used
- as a trust anchor to validate the TLS certificate presented
- by the remote server. The key "ca.crt" is used to locate
- the data. If specified and the config map or expected
- key is not found, the identity provider is not honored.
- If the specified ca data is not valid, the identity provider
- is not honored. If empty, the default system roots are
- used. The namespace for this config map is openshift-config.
+ description: |-
+ ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
+ It is used as a trust anchor to validate the TLS certificate presented by the remote server.
+ The key "ca.crt" is used to locate the data.
+ If specified and the config map or expected key is not found, the identity provider is not honored.
+ If the specified ca data is not valid, the identity provider is not honored.
+ If empty, the default system roots are used.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -399,45 +393,45 @@ spec:
- name
type: object
insecure:
- description: 'insecure, if true, indicates the connection
- should not use TLS WARNING: Should not be set to `true`
- with the URL scheme "ldaps://" as "ldaps://" URLs always
- attempt to connect using TLS, even when `insecure` is
- set to `true` When `true`, "ldap://" URLS connect insecurely.
- When `false`, "ldap://" URLs are upgraded to a TLS connection
- using StartTLS as specified in https://tools.ietf.org/html/rfc2830.'
+ description: |-
+ insecure, if true, indicates the connection should not use TLS
+ WARNING: Should not be set to `true` with the URL scheme "ldaps://" as "ldaps://" URLs always
+ attempt to connect using TLS, even when `insecure` is set to `true`
+ When `true`, "ldap://" URLS connect insecurely. When `false`, "ldap://" URLs are upgraded to
+ a TLS connection using StartTLS as specified in https://tools.ietf.org/html/rfc2830.
type: boolean
url:
- description: 'url is an RFC 2255 URL which specifies the
- LDAP search parameters to use. The syntax of the URL is:
- ldap://host:port/basedn?attribute?scope?filter'
+ description: |-
+ url is an RFC 2255 URL which specifies the LDAP search parameters to use.
+ The syntax of the URL is:
+ ldap://host:port/basedn?attribute?scope?filter
type: string
type: object
mappingMethod:
- description: mappingMethod determines how identities from this
- provider are mapped to users Defaults to "claim"
+ description: |-
+ mappingMethod determines how identities from this provider are mapped to users
+ Defaults to "claim"
type: string
name:
- description: 'name is used to qualify the identities returned
- by this provider. - It MUST be unique and not shared by any
- other identity provider used - It MUST be a valid path segment:
- name cannot equal "." or ".." or contain "/" or "%" or ":"
- Ref: https://godoc.org/github.com/openshift/origin/pkg/user/apis/user/validation#ValidateIdentityProviderName'
+ description: |-
+ name is used to qualify the identities returned by this provider.
+ - It MUST be unique and not shared by any other identity provider used
+ - It MUST be a valid path segment: name cannot equal "." or ".." or contain "/" or "%" or ":"
+ Ref: https://godoc.org/github.com/openshift/origin/pkg/user/apis/user/validation#ValidateIdentityProviderName
type: string
openID:
description: openID enables user authentication using OpenID
credentials
properties:
ca:
- description: ca is an optional reference to a config map
- by name containing the PEM-encoded CA bundle. It is used
- as a trust anchor to validate the TLS certificate presented
- by the remote server. The key "ca.crt" is used to locate
- the data. If specified and the config map or expected
- key is not found, the identity provider is not honored.
- If the specified ca data is not valid, the identity provider
- is not honored. If empty, the default system roots are
- used. The namespace for this config map is openshift-config.
+ description: |-
+ ca is an optional reference to a config map by name containing the PEM-encoded CA bundle.
+ It is used as a trust anchor to validate the TLS certificate presented by the remote server.
+ The key "ca.crt" is used to locate the data.
+ If specified and the config map or expected key is not found, the identity provider is not honored.
+ If the specified ca data is not valid, the identity provider is not honored.
+ If empty, the default system roots are used.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -450,39 +444,38 @@ spec:
description: claims mappings
properties:
email:
- description: email is the list of claims whose values
- should be used as the email address. Optional. If
- unspecified, no email is set for the identity
+ description: |-
+ email is the list of claims whose values should be used as the email address. Optional.
+ If unspecified, no email is set for the identity
items:
type: string
type: array
x-kubernetes-list-type: atomic
groups:
- description: groups is the list of claims value of which
- should be used to synchronize groups from the OIDC
- provider to OpenShift for the user. If multiple claims
- are specified, the first one with a non-empty value
- is used.
+ description: |-
+ groups is the list of claims value of which should be used to synchronize groups
+ from the OIDC provider to OpenShift for the user.
+ If multiple claims are specified, the first one with a non-empty value is used.
items:
- description: OpenIDClaim represents a claim retrieved
- from an OpenID provider's tokens or userInfo responses
+ description: |-
+ OpenIDClaim represents a claim retrieved from an OpenID provider's tokens or userInfo
+ responses
minLength: 1
type: string
type: array
x-kubernetes-list-type: atomic
name:
- description: name is the list of claims whose values
- should be used as the display name. Optional. If unspecified,
- no display name is set for the identity
+ description: |-
+ name is the list of claims whose values should be used as the display name. Optional.
+ If unspecified, no display name is set for the identity
items:
type: string
type: array
x-kubernetes-list-type: atomic
preferredUsername:
- description: preferredUsername is the list of claims
- whose values should be used as the preferred username.
- If unspecified, the preferred username is determined
- from the value of the sub claim
+ description: |-
+ preferredUsername is the list of claims whose values should be used as the preferred username.
+ If unspecified, the preferred username is determined from the value of the sub claim
items:
type: string
type: array
@@ -492,11 +485,11 @@ spec:
description: clientID is the oauth client ID
type: string
clientSecret:
- description: clientSecret is a required reference to the
- secret by name containing the oauth client secret. The
- key "clientSecret" is used to locate the data. If the
- secret or expected key is not found, the identity provider
- is not honored. The namespace for this secret is openshift-config.
+ description: |-
+ clientSecret is a required reference to the secret by name containing the oauth client secret.
+ The key "clientSecret" is used to locate the data.
+ If the secret or expected key is not found, the identity provider is not honored.
+ The namespace for this secret is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -518,9 +511,9 @@ spec:
type: string
type: array
issuer:
- description: issuer is the URL that the OpenID Provider
- asserts as its Issuer Identifier. It must use the https
- scheme with no query or fragment component.
+ description: |-
+ issuer is the URL that the OpenID Provider asserts as its Issuer Identifier.
+ It must use the https scheme with no query or fragment component.
type: string
type: object
requestHeader:
@@ -528,16 +521,14 @@ spec:
request header credentials
properties:
ca:
- description: ca is a required reference to a config map
- by name containing the PEM-encoded CA bundle. It is used
- as a trust anchor to validate the TLS certificate presented
- by the remote server. Specifically, it allows verification
- of incoming requests to prevent header spoofing. The key
- "ca.crt" is used to locate the data. If the config map
- or expected key is not found, the identity provider is
- not honored. If the specified ca data is not valid, the
- identity provider is not honored. The namespace for this
- config map is openshift-config.
+ description: |-
+ ca is a required reference to a config map by name containing the PEM-encoded CA bundle.
+ It is used as a trust anchor to validate the TLS certificate presented by the remote server.
+ Specifically, it allows verification of incoming requests to prevent header spoofing.
+ The key "ca.crt" is used to locate the data.
+ If the config map or expected key is not found, the identity provider is not honored.
+ If the specified ca data is not valid, the identity provider is not honored.
+ The namespace for this config map is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced
@@ -547,18 +538,20 @@ spec:
- name
type: object
challengeURL:
- description: challengeURL is a URL to redirect unauthenticated
- /authorize requests to Unauthenticated requests from OAuth
- clients which expect WWW-Authenticate challenges will
- be redirected here. ${url} is replaced with the current
- URL, escaped to be safe in a query parameter https://www.example.com/sso-login?then=${url}
- ${query} is replaced with the current query string https://www.example.com/auth-proxy/oauth/authorize?${query}
+ description: |-
+ challengeURL is a URL to redirect unauthenticated /authorize requests to
+ Unauthenticated requests from OAuth clients which expect WWW-Authenticate challenges will be
+ redirected here.
+ ${url} is replaced with the current URL, escaped to be safe in a query parameter
+ https://www.example.com/sso-login?then=${url}
+ ${query} is replaced with the current query string
+ https://www.example.com/auth-proxy/oauth/authorize?${query}
Required when challenge is set to true.
type: string
clientCommonNames:
- description: clientCommonNames is an optional list of common
- names to require a match from. If empty, any client certificate
- validated against the clientCA bundle is considered authoritative.
+ description: |-
+ clientCommonNames is an optional list of common names to require a match from. If empty, any
+ client certificate validated against the clientCA bundle is considered authoritative.
items:
type: string
type: array
@@ -575,12 +568,13 @@ spec:
type: string
type: array
loginURL:
- description: loginURL is a URL to redirect unauthenticated
- /authorize requests to Unauthenticated requests from OAuth
- clients which expect interactive logins will be redirected
- here ${url} is replaced with the current URL, escaped
- to be safe in a query parameter https://www.example.com/sso-login?then=${url}
- ${query} is replaced with the current query string https://www.example.com/auth-proxy/oauth/authorize?${query}
+ description: |-
+ loginURL is a URL to redirect unauthenticated /authorize requests to
+ Unauthenticated requests from OAuth clients which expect interactive logins will be redirected here
+ ${url} is replaced with the current URL, escaped to be safe in a query parameter
+ https://www.example.com/sso-login?then=${url}
+ ${query} is replaced with the current query string
+ https://www.example.com/auth-proxy/oauth/authorize?${query}
Required when login is set to true.
type: string
nameHeaders:
@@ -608,14 +602,14 @@ spec:
page.
properties:
error:
- description: error is the name of a secret that specifies a go
- template to use to render error pages during the authentication
- or grant flow. The key "errors.html" is used to locate the template
- data. If specified and the secret or expected key is not found,
- the default error page is used. If the specified template is
- not valid, the default error page is used. If unspecified, the
- default error page is used. The namespace for this secret is
- openshift-config.
+ description: |-
+ error is the name of a secret that specifies a go template to use to render error pages
+ during the authentication or grant flow.
+ The key "errors.html" is used to locate the template data.
+ If specified and the secret or expected key is not found, the default error page is used.
+ If the specified template is not valid, the default error page is used.
+ If unspecified, the default error page is used.
+ The namespace for this secret is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced secret
@@ -624,13 +618,13 @@ spec:
- name
type: object
login:
- description: login is the name of a secret that specifies a go
- template to use to render the login page. The key "login.html"
- is used to locate the template data. If specified and the secret
- or expected key is not found, the default login page is used.
- If the specified template is not valid, the default login page
- is used. If unspecified, the default login page is used. The
- namespace for this secret is openshift-config.
+ description: |-
+ login is the name of a secret that specifies a go template to use to render the login page.
+ The key "login.html" is used to locate the template data.
+ If specified and the secret or expected key is not found, the default login page is used.
+ If the specified template is not valid, the default login page is used.
+ If unspecified, the default login page is used.
+ The namespace for this secret is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced secret
@@ -639,14 +633,14 @@ spec:
- name
type: object
providerSelection:
- description: providerSelection is the name of a secret that specifies
- a go template to use to render the provider selection page.
+ description: |-
+ providerSelection is the name of a secret that specifies a go template to use to render
+ the provider selection page.
The key "providers.html" is used to locate the template data.
- If specified and the secret or expected key is not found, the
- default provider selection page is used. If the specified template
- is not valid, the default provider selection page is used. If
- unspecified, the default provider selection page is used. The
- namespace for this secret is openshift-config.
+ If specified and the secret or expected key is not found, the default provider selection page is used.
+ If the specified template is not valid, the default provider selection page is used.
+ If unspecified, the default provider selection page is used.
+ The namespace for this secret is openshift-config.
properties:
name:
description: name is the metadata.name of the referenced secret
@@ -660,19 +654,20 @@ spec:
tokens
properties:
accessTokenInactivityTimeout:
- description: "accessTokenInactivityTimeout defines the token inactivity
- timeout for tokens granted by any client. The value represents
- the maximum amount of time that can occur between consecutive
- uses of the token. Tokens become invalid if they are not used
- within this temporal window. The user will need to acquire a
- new token to regain access once a token times out. Takes valid
- time duration string such as \"5m\", \"1.5h\" or \"2h45m\".
- The minimum allowed value for duration is 300s (5 minutes).
- If the timeout is configured per client, then that value takes
- precedence. If the timeout value is not specified and the client
- does not override the value, then tokens are valid until their
- lifetime. \n WARNING: existing tokens' timeout will not be affected
- (lowered) by changing this value"
+ description: |-
+ accessTokenInactivityTimeout defines the token inactivity timeout
+ for tokens granted by any client.
+ The value represents the maximum amount of time that can occur between
+ consecutive uses of the token. Tokens become invalid if they are not
+ used within this temporal window. The user will need to acquire a new
+ token to regain access once a token times out. Takes valid time
+ duration string such as "5m", "1.5h" or "2h45m". The minimum allowed
+ value for duration is 300s (5 minutes). If the timeout is configured
+ per client, then that value takes precedence. If the timeout value is
+ not specified and the client does not override the value, then tokens
+ are valid until their lifetime.
+
+ WARNING: existing tokens' timeout will not be affected (lowered) by changing this value
type: string
accessTokenInactivityTimeoutSeconds:
description: 'accessTokenInactivityTimeoutSeconds - DEPRECATED:
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_projects.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_projects.crd.yaml
index 2698a1f459..9f6614fa6b 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_projects.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_projects.crd.yaml
@@ -20,19 +20,25 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Project holds cluster-wide information about Project. The canonical
- name is `cluster` \n Compatibility level 1: Stable within a major release
- for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Project holds cluster-wide information about Project. The canonical name is `cluster`
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -45,10 +51,10 @@ spec:
endpoint
type: string
projectRequestTemplate:
- description: projectRequestTemplate is the template to use for creating
- projects in response to projectrequest. This must point to a template
- in 'openshift-config' namespace. It is optional. If it is not specified,
- a default template is used.
+ description: |-
+ projectRequestTemplate is the template to use for creating projects in response to projectrequest.
+ This must point to a template in 'openshift-config' namespace. It is optional.
+ If it is not specified, a default template is used.
properties:
name:
description: name is the metadata.name of the referenced project
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-CustomNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-CustomNoUpgrade.crd.yaml
index 75f82a9255..f557085f8f 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-CustomNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-CustomNoUpgrade.crd.yaml
@@ -21,20 +21,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Scheduler holds cluster-wide config information to run the Kubernetes
- Scheduler and influence its placement decisions. The canonical name for
- this config is `cluster`. \n Compatibility level 1: Stable within a major
- release for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Scheduler holds cluster-wide config information to run the Kubernetes Scheduler
+ and influence its placement decisions. The canonical name for this config is `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,41 +48,46 @@ spec:
description: spec holds user settable values for configuration
properties:
defaultNodeSelector:
- description: '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.'
+ description: |-
+ 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.
type: string
mastersSchedulable:
- description: '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.'
+ description: |-
+ 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.
type: boolean
policy:
- description: '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.'
+ description: |-
+ 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.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -86,10 +97,12 @@ spec:
- name
type: object
profile:
- description: "profile sets which scheduling profile should be set
- in order to configure scheduling decisions for new pods. \n Valid
- values are \"LowNodeUtilization\", \"HighNodeUtilization\", \"NoScoring\"
- Defaults to \"LowNodeUtilization\""
+ description: |-
+ profile sets which scheduling profile should be set in order to configure scheduling
+ decisions for new pods.
+
+ Valid values are "LowNodeUtilization", "HighNodeUtilization", "NoScoring"
+ Defaults to "LowNodeUtilization"
enum:
- ""
- LowNodeUtilization
@@ -101,16 +114,15 @@ spec:
the default behavior of existing scheduler profiles.
properties:
dynamicResourceAllocation:
- description: dynamicResourceAllocation allows to enable or disable
- dynamic resource allocation within the scheduler. Dynamic resource
- allocation is an API for requesting and sharing resources between
- pods and containers inside a pod. Third-party resource drivers
- are responsible for tracking and allocating resources. Different
- kinds of resources support arbitrary parameters for defining
- requirements and initialization. Valid values are Enabled, Disabled
- and omitted. When 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 Disabled.
+ description: |-
+ dynamicResourceAllocation allows to enable or disable dynamic resource allocation within the scheduler.
+ Dynamic resource allocation is an API for requesting and sharing resources between pods and containers inside a pod.
+ Third-party resource drivers are responsible for tracking and allocating resources.
+ Different kinds of resources support arbitrary parameters for defining requirements and initialization.
+ Valid values are Enabled, Disabled and omitted.
+ When 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 Disabled.
enum:
- ""
- Enabled
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-Default.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-Default.crd.yaml
index 30967909ab..cbfff13ab7 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-Default.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-Default.crd.yaml
@@ -21,20 +21,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Scheduler holds cluster-wide config information to run the Kubernetes
- Scheduler and influence its placement decisions. The canonical name for
- this config is `cluster`. \n Compatibility level 1: Stable within a major
- release for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Scheduler holds cluster-wide config information to run the Kubernetes Scheduler
+ and influence its placement decisions. The canonical name for this config is `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,41 +48,46 @@ spec:
description: spec holds user settable values for configuration
properties:
defaultNodeSelector:
- description: '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.'
+ description: |-
+ 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.
type: string
mastersSchedulable:
- description: '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.'
+ description: |-
+ 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.
type: boolean
policy:
- description: '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.'
+ description: |-
+ 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.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -86,10 +97,12 @@ spec:
- name
type: object
profile:
- description: "profile sets which scheduling profile should be set
- in order to configure scheduling decisions for new pods. \n Valid
- values are \"LowNodeUtilization\", \"HighNodeUtilization\", \"NoScoring\"
- Defaults to \"LowNodeUtilization\""
+ description: |-
+ profile sets which scheduling profile should be set in order to configure scheduling
+ decisions for new pods.
+
+ Valid values are "LowNodeUtilization", "HighNodeUtilization", "NoScoring"
+ Defaults to "LowNodeUtilization"
enum:
- ""
- LowNodeUtilization
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-DevPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-DevPreviewNoUpgrade.crd.yaml
index ae30602566..39aae9eced 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-DevPreviewNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-DevPreviewNoUpgrade.crd.yaml
@@ -21,20 +21,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Scheduler holds cluster-wide config information to run the Kubernetes
- Scheduler and influence its placement decisions. The canonical name for
- this config is `cluster`. \n Compatibility level 1: Stable within a major
- release for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Scheduler holds cluster-wide config information to run the Kubernetes Scheduler
+ and influence its placement decisions. The canonical name for this config is `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,41 +48,46 @@ spec:
description: spec holds user settable values for configuration
properties:
defaultNodeSelector:
- description: '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.'
+ description: |-
+ 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.
type: string
mastersSchedulable:
- description: '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.'
+ description: |-
+ 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.
type: boolean
policy:
- description: '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.'
+ description: |-
+ 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.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -86,10 +97,12 @@ spec:
- name
type: object
profile:
- description: "profile sets which scheduling profile should be set
- in order to configure scheduling decisions for new pods. \n Valid
- values are \"LowNodeUtilization\", \"HighNodeUtilization\", \"NoScoring\"
- Defaults to \"LowNodeUtilization\""
+ description: |-
+ profile sets which scheduling profile should be set in order to configure scheduling
+ decisions for new pods.
+
+ Valid values are "LowNodeUtilization", "HighNodeUtilization", "NoScoring"
+ Defaults to "LowNodeUtilization"
enum:
- ""
- LowNodeUtilization
@@ -101,16 +114,15 @@ spec:
the default behavior of existing scheduler profiles.
properties:
dynamicResourceAllocation:
- description: dynamicResourceAllocation allows to enable or disable
- dynamic resource allocation within the scheduler. Dynamic resource
- allocation is an API for requesting and sharing resources between
- pods and containers inside a pod. Third-party resource drivers
- are responsible for tracking and allocating resources. Different
- kinds of resources support arbitrary parameters for defining
- requirements and initialization. Valid values are Enabled, Disabled
- and omitted. When 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 Disabled.
+ description: |-
+ dynamicResourceAllocation allows to enable or disable dynamic resource allocation within the scheduler.
+ Dynamic resource allocation is an API for requesting and sharing resources between pods and containers inside a pod.
+ Third-party resource drivers are responsible for tracking and allocating resources.
+ Different kinds of resources support arbitrary parameters for defining requirements and initialization.
+ Valid values are Enabled, Disabled and omitted.
+ When 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 Disabled.
enum:
- ""
- Enabled
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-TechPreviewNoUpgrade.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-TechPreviewNoUpgrade.crd.yaml
index 5aa43ed419..34b79b3f1f 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-TechPreviewNoUpgrade.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-TechPreviewNoUpgrade.crd.yaml
@@ -21,20 +21,26 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Scheduler holds cluster-wide config information to run the Kubernetes
- Scheduler and influence its placement decisions. The canonical name for
- this config is `cluster`. \n Compatibility level 1: Stable within a major
- release for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Scheduler holds cluster-wide config information to run the Kubernetes Scheduler
+ and influence its placement decisions. The canonical name for this config is `cluster`.
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -42,41 +48,46 @@ spec:
description: spec holds user settable values for configuration
properties:
defaultNodeSelector:
- description: '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.'
+ description: |-
+ 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.
type: string
mastersSchedulable:
- description: '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.'
+ description: |-
+ 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.
type: boolean
policy:
- description: '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.'
+ description: |-
+ 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.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -86,10 +97,12 @@ spec:
- name
type: object
profile:
- description: "profile sets which scheduling profile should be set
- in order to configure scheduling decisions for new pods. \n Valid
- values are \"LowNodeUtilization\", \"HighNodeUtilization\", \"NoScoring\"
- Defaults to \"LowNodeUtilization\""
+ description: |-
+ profile sets which scheduling profile should be set in order to configure scheduling
+ decisions for new pods.
+
+ Valid values are "LowNodeUtilization", "HighNodeUtilization", "NoScoring"
+ Defaults to "LowNodeUtilization"
enum:
- ""
- LowNodeUtilization
@@ -101,16 +114,15 @@ spec:
the default behavior of existing scheduler profiles.
properties:
dynamicResourceAllocation:
- description: dynamicResourceAllocation allows to enable or disable
- dynamic resource allocation within the scheduler. Dynamic resource
- allocation is an API for requesting and sharing resources between
- pods and containers inside a pod. Third-party resource drivers
- are responsible for tracking and allocating resources. Different
- kinds of resources support arbitrary parameters for defining
- requirements and initialization. Valid values are Enabled, Disabled
- and omitted. When 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 Disabled.
+ description: |-
+ dynamicResourceAllocation allows to enable or disable dynamic resource allocation within the scheduler.
+ Dynamic resource allocation is an API for requesting and sharing resources between pods and containers inside a pod.
+ Third-party resource drivers are responsible for tracking and allocating resources.
+ Different kinds of resources support arbitrary parameters for defining requirements and initialization.
+ Valid values are Enabled, Disabled and omitted.
+ When 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 Disabled.
enum:
- ""
- Enabled
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_openshift-controller-manager_01_builds.crd.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_openshift-controller-manager_01_builds.crd.yaml
index 7de589bf1b..34ca783627 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_openshift-controller-manager_01_builds.crd.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_openshift-controller-manager_01_builds.crd.yaml
@@ -20,21 +20,28 @@ spec:
- name: v1
schema:
openAPIV3Schema:
- description: "Build configures the behavior of OpenShift builds for the entire
- cluster. This includes default settings that can be overridden in BuildConfig
- objects, and overrides which are applied to all builds. \n The canonical
- name is \"cluster\" \n Compatibility level 1: Stable within a major release
- for a minimum of 12 months or 3 minor releases (whichever is longer)."
+ description: |-
+ Build configures the behavior of OpenShift builds for the entire cluster.
+ This includes default settings that can be overridden in BuildConfig objects, and overrides which are applied to all builds.
+
+ The canonical name is "cluster"
+
+ Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
properties:
apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ description: |-
+ APIVersion defines the versioned schema of this representation of an object.
+ Servers should convert recognized schemas to the latest internal value, and
+ may reject unrecognized values.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ description: |-
+ Kind is a string value representing the REST resource this object represents.
+ Servers may infer this from the endpoint the client submits requests to.
+ Cannot be updated.
+ In CamelCase.
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -43,11 +50,13 @@ spec:
configuration
properties:
additionalTrustedCA:
- description: "AdditionalTrustedCA is a reference to a ConfigMap containing
- additional CAs that should be trusted for image pushes and pulls
- during builds. The namespace for this config map is openshift-config.
- \n DEPRECATED: Additional CAs for image pull and push should be
- set on image.config.openshift.io/cluster instead."
+ description: |-
+ AdditionalTrustedCA is a reference to a ConfigMap containing additional CAs that
+ should be trusted for image pushes and pulls during builds.
+ The namespace for this config map is openshift-config.
+
+ DEPRECATED: Additional CAs for image pull and push should be set on
+ image.config.openshift.io/cluster instead.
properties:
name:
description: name is the metadata.name of the referenced config
@@ -60,11 +69,12 @@ spec:
description: BuildDefaults controls the default information for Builds
properties:
defaultProxy:
- description: "DefaultProxy contains the default proxy settings
- for all build operations, including image pull/push and source
- download. \n Values can be overrode by setting the `HTTP_PROXY`,
- `HTTPS_PROXY`, and `NO_PROXY` environment variables in the build
- config's strategy."
+ description: |-
+ DefaultProxy contains the default proxy settings for all build operations, including image pull/push
+ and source download.
+
+ Values can be overrode by setting the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables
+ in the build config's strategy.
properties:
httpProxy:
description: httpProxy is the URL of the proxy for HTTP requests. Empty
@@ -76,9 +86,9 @@ spec:
var.
type: string
noProxy:
- description: noProxy is a comma-separated list of hostnames
- and/or CIDRs and/or IPs for which the proxy should not be
- used. Empty means unset and will not result in an env var.
+ description: |-
+ noProxy is a comma-separated list of hostnames and/or CIDRs and/or IPs for which the proxy should not be used.
+ Empty means unset and will not result in an env var.
type: string
readinessEndpoints:
description: readinessEndpoints is a list of endpoints used
@@ -87,22 +97,30 @@ spec:
type: string
type: array
trustedCA:
- description: "trustedCA is a reference to a ConfigMap containing
- a CA certificate bundle. The trustedCA field should only
- be consumed by a proxy validator. The validator is responsible
- for reading the certificate bundle from the required key
- \"ca-bundle.crt\", merging it with the system default trust
- bundle, and writing the merged trust bundle to a ConfigMap
- named \"trusted-ca-bundle\" in the \"openshift-config-managed\"
- namespace. Clients that expect to make proxy connections
- must use the trusted-ca-bundle for all HTTPS requests to
- the proxy, and may use the trusted-ca-bundle for non-proxy
- HTTPS requests as well. \n The namespace for the ConfigMap
- referenced by trustedCA is \"openshift-config\". Here is
- an example ConfigMap (in yaml): \n apiVersion: v1 kind:
- ConfigMap metadata: name: user-ca-bundle namespace: openshift-config
- data: ca-bundle.crt: | -----BEGIN CERTIFICATE----- Custom
- CA certificate bundle. -----END CERTIFICATE-----"
+ description: |-
+ trustedCA is a reference to a ConfigMap containing a CA certificate bundle.
+ The trustedCA field should only be consumed by a proxy validator. The
+ validator is responsible for reading the certificate bundle from the required
+ key "ca-bundle.crt", merging it with the system default trust bundle,
+ and writing the merged trust bundle to a ConfigMap named "trusted-ca-bundle"
+ in the "openshift-config-managed" namespace. Clients that expect to make
+ proxy connections must use the trusted-ca-bundle for all HTTPS requests to
+ the proxy, and may use the trusted-ca-bundle for non-proxy HTTPS requests as
+ well.
+
+ The namespace for the ConfigMap referenced by trustedCA is
+ "openshift-config". Here is an example ConfigMap (in yaml):
+
+ apiVersion: v1
+ kind: ConfigMap
+ metadata:
+ name: user-ca-bundle
+ namespace: openshift-config
+ data:
+ ca-bundle.crt: |
+ -----BEGIN CERTIFICATE-----
+ Custom CA certificate bundle.
+ -----END CERTIFICATE-----
properties:
name:
description: name is the metadata.name of the referenced
@@ -113,9 +131,9 @@ spec:
type: object
type: object
env:
- description: Env is a set of default environment variables that
- will be applied to the build if the specified variables do not
- exist on the build
+ description: |-
+ Env is a set of default environment variables that will be applied to the
+ build if the specified variables do not exist on the build
items:
description: EnvVar represents an environment variable present
in a Container.
@@ -125,15 +143,16 @@ spec:
C_IDENTIFIER.
type: string
value:
- description: 'Variable references $(VAR_NAME) are expanded
- using the previously defined environment variables in
- the container and any service environment variables. If
- a variable cannot be resolved, the reference in the input
- string will be unchanged. Double $$ are reduced to a single
- $, which allows for escaping the $(VAR_NAME) syntax: i.e.
+ description: |-
+ Variable references $(VAR_NAME) are expanded
+ using the previously defined environment variables in the container and
+ any service environment variables. If a variable cannot be resolved,
+ the reference in the input string will be unchanged. Double $$ are reduced
+ to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
"$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
- Escaped references will never be expanded, regardless
- of whether the variable exists or not. Defaults to "".'
+ Escaped references will never be expanded, regardless of whether the variable
+ exists or not.
+ Defaults to "".
type: string
valueFrom:
description: Source for the environment variable's value.
@@ -147,14 +166,12 @@ spec:
type: string
name:
default: ""
- description: 'Name of the referent. This field is
- effectively required, but due to backwards compatibility
- is allowed to be empty. Instances of this type
- with an empty value here are almost certainly
- wrong. TODO: Add other useful fields. apiVersion,
- kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen
- doesn''t need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.'
+ description: |-
+ Name of the referent.
+ This field is effectively required, but due to backwards compatibility is
+ allowed to be empty. Instances of this type with an empty value here are
+ almost certainly wrong.
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the ConfigMap or its
@@ -165,11 +182,9 @@ spec:
type: object
x-kubernetes-map-type: atomic
fieldRef:
- description: 'Selects a field of the pod: supports metadata.name,
- metadata.namespace, `metadata.labels['''']`,
- `metadata.annotations['''']`, spec.nodeName,
- spec.serviceAccountName, status.hostIP, status.podIP,
- status.podIPs.'
+ description: |-
+ Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`,
+ spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
properties:
apiVersion:
description: Version of the schema the FieldPath
@@ -184,10 +199,9 @@ spec:
type: object
x-kubernetes-map-type: atomic
resourceFieldRef:
- description: 'Selects a resource of the container: only
- resources limits and requests (limits.cpu, limits.memory,
- limits.ephemeral-storage, requests.cpu, requests.memory
- and requests.ephemeral-storage) are currently supported.'
+ description: |-
+ Selects a resource of the container: only resources limits and requests
+ (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
properties:
containerName:
description: 'Container name: required for volumes,
@@ -218,14 +232,12 @@ spec:
type: string
name:
default: ""
- description: 'Name of the referent. This field is
- effectively required, but due to backwards compatibility
- is allowed to be empty. Instances of this type
- with an empty value here are almost certainly
- wrong. TODO: Add other useful fields. apiVersion,
- kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- TODO: Drop `kubebuilder:default` when controller-gen
- doesn''t need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.'
+ description: |-
+ Name of the referent.
+ This field is effectively required, but due to backwards compatibility is
+ allowed to be empty. Instances of this type with an empty value here are
+ almost certainly wrong.
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret or its key
@@ -241,10 +253,11 @@ spec:
type: object
type: array
gitProxy:
- description: "GitProxy contains the proxy settings for git operations
- only. If set, this will override any Proxy settings for all
- git commands, such as git clone. \n Values that are not set
- here will be inherited from DefaultProxy."
+ description: |-
+ GitProxy contains the proxy settings for git operations only. If set, this will override
+ any Proxy settings for all git commands, such as git clone.
+
+ Values that are not set here will be inherited from DefaultProxy.
properties:
httpProxy:
description: httpProxy is the URL of the proxy for HTTP requests. Empty
@@ -256,9 +269,9 @@ spec:
var.
type: string
noProxy:
- description: noProxy is a comma-separated list of hostnames
- and/or CIDRs and/or IPs for which the proxy should not be
- used. Empty means unset and will not result in an env var.
+ description: |-
+ noProxy is a comma-separated list of hostnames and/or CIDRs and/or IPs for which the proxy should not be used.
+ Empty means unset and will not result in an env var.
type: string
readinessEndpoints:
description: readinessEndpoints is a list of endpoints used
@@ -267,22 +280,30 @@ spec:
type: string
type: array
trustedCA:
- description: "trustedCA is a reference to a ConfigMap containing
- a CA certificate bundle. The trustedCA field should only
- be consumed by a proxy validator. The validator is responsible
- for reading the certificate bundle from the required key
- \"ca-bundle.crt\", merging it with the system default trust
- bundle, and writing the merged trust bundle to a ConfigMap
- named \"trusted-ca-bundle\" in the \"openshift-config-managed\"
- namespace. Clients that expect to make proxy connections
- must use the trusted-ca-bundle for all HTTPS requests to
- the proxy, and may use the trusted-ca-bundle for non-proxy
- HTTPS requests as well. \n The namespace for the ConfigMap
- referenced by trustedCA is \"openshift-config\". Here is
- an example ConfigMap (in yaml): \n apiVersion: v1 kind:
- ConfigMap metadata: name: user-ca-bundle namespace: openshift-config
- data: ca-bundle.crt: | -----BEGIN CERTIFICATE----- Custom
- CA certificate bundle. -----END CERTIFICATE-----"
+ description: |-
+ trustedCA is a reference to a ConfigMap containing a CA certificate bundle.
+ The trustedCA field should only be consumed by a proxy validator. The
+ validator is responsible for reading the certificate bundle from the required
+ key "ca-bundle.crt", merging it with the system default trust bundle,
+ and writing the merged trust bundle to a ConfigMap named "trusted-ca-bundle"
+ in the "openshift-config-managed" namespace. Clients that expect to make
+ proxy connections must use the trusted-ca-bundle for all HTTPS requests to
+ the proxy, and may use the trusted-ca-bundle for non-proxy HTTPS requests as
+ well.
+
+ The namespace for the ConfigMap referenced by trustedCA is
+ "openshift-config". Here is an example ConfigMap (in yaml):
+
+ apiVersion: v1
+ kind: ConfigMap
+ metadata:
+ name: user-ca-bundle
+ namespace: openshift-config
+ data:
+ ca-bundle.crt: |
+ -----BEGIN CERTIFICATE-----
+ Custom CA certificate bundle.
+ -----END CERTIFICATE-----
properties:
name:
description: name is the metadata.name of the referenced
@@ -293,9 +314,10 @@ spec:
type: object
type: object
imageLabels:
- description: ImageLabels is a list of docker labels that are applied
- to the resulting image. User can override a default label by
- providing a label with the same name in their Build/BuildConfig.
+ description: |-
+ ImageLabels is a list of docker labels that are applied to the resulting image.
+ User can override a default label by providing a label with the same name in their
+ Build/BuildConfig.
items:
properties:
name:
@@ -312,19 +334,28 @@ spec:
the build.
properties:
claims:
- description: "Claims lists the names of resources, defined
- in spec.resourceClaims, that are used by this container.
- \n This is an alpha field and requires enabling the DynamicResourceAllocation
- feature gate. \n This field is immutable. It can only be
- set for containers."
+ description: |-
+ Claims lists the names of resources, defined in spec.resourceClaims,
+ that are used by this container.
+
+ This is an alpha field and requires enabling the
+ DynamicResourceAllocation feature gate.
+
+ This field is immutable. It can only be set for containers.
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
- description: Name must match the name of one entry in
- pod.spec.resourceClaims of the Pod where this field
- is used. It makes that resource available inside a
- container.
+ description: |-
+ Name must match the name of one entry in pod.spec.resourceClaims of
+ the Pod where this field is used. It makes that resource available
+ inside a container.
+ type: string
+ request:
+ description: |-
+ Request is the name chosen for a request in the referenced claim.
+ If empty, everything from the claim is made available, otherwise
+ only the result of this request.
type: string
required:
- name
@@ -340,8 +371,9 @@ spec:
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
- description: 'Limits describes the maximum amount of compute
- resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
+ description: |-
+ Limits describes the maximum amount of compute resources allowed.
+ More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
type: object
requests:
additionalProperties:
@@ -350,11 +382,11 @@ spec:
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
- description: 'Requests describes the minimum amount of compute
- resources required. If Requests is omitted for a container,
- it defaults to Limits if that is explicitly specified, otherwise
- to an implementation-defined value. Requests cannot exceed
- Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
+ description: |-
+ Requests describes the minimum amount of compute resources required.
+ If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
+ otherwise to an implementation-defined value. Requests cannot exceed Limits.
+ More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
type: object
type: object
type: object
@@ -362,16 +394,17 @@ spec:
description: BuildOverrides controls override settings for builds
properties:
forcePull:
- description: ForcePull overrides, if set, the equivalent value
- in the builds, i.e. false disables force pull for all builds,
- true enables force pull for all builds, independently of what
- each build specifies itself
+ description: |-
+ ForcePull overrides, if set, the equivalent value in the builds,
+ i.e. false disables force pull for all builds,
+ true enables force pull for all builds,
+ independently of what each build specifies itself
type: boolean
imageLabels:
- description: ImageLabels is a list of docker labels that are applied
- to the resulting image. If user provided a label in their Build/BuildConfig
- with the same name as one in this list, the user's label will
- be overwritten.
+ description: |-
+ ImageLabels is a list of docker labels that are applied to the resulting image.
+ If user provided a label in their Build/BuildConfig with the same name as one in this
+ list, the user's label will be overwritten.
items:
properties:
name:
@@ -390,44 +423,43 @@ spec:
the build pod to fit on a node
type: object
tolerations:
- description: Tolerations is a list of Tolerations that will override
- any existing tolerations set on a build pod.
+ description: |-
+ Tolerations is a list of Tolerations that will override any existing
+ tolerations set on a build pod.
items:
- description: The pod this Toleration is attached to tolerates
- any taint that matches the triple using
- the matching operator .
+ description: |-
+ The pod this Toleration is attached to tolerates any taint that matches
+ the triple using the matching operator .
properties:
effect:
- description: Effect indicates the taint effect to match.
- Empty means match all taint effects. When specified, allowed
- values are NoSchedule, PreferNoSchedule and NoExecute.
+ description: |-
+ Effect indicates the taint effect to match. Empty means match all taint effects.
+ When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
- description: 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.
+ description: |-
+ 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.
type: string
operator:
- description: 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.
+ description: |-
+ 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.
type: string
tolerationSeconds:
- description: 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.
+ description: |-
+ 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.
format: int64
type: integer
value:
- description: Value is the taint value the toleration matches
- to. If the operator is Exists, the value should be empty,
- otherwise just a regular string.
+ description: |-
+ Value is the taint value the toleration matches to.
+ If the operator is Exists, the value should be empty, otherwise just a regular string.
type: string
type: object
type: array
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go
index 0693469984..1b7fa44aad 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go
@@ -245,6 +245,11 @@ func (in *AWSPlatformStatus) DeepCopyInto(out *AWSPlatformStatus) {
*out = make([]AWSResourceTag, len(*in))
copy(*out, *in)
}
+ if in.CloudLoadBalancerConfig != nil {
+ in, out := &in.CloudLoadBalancerConfig, &out.CloudLoadBalancerConfig
+ *out = new(CloudLoadBalancerConfig)
+ (*in).DeepCopyInto(*out)
+ }
return
}
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml
index fa5dd4e31d..abfea5eaf0 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml
@@ -310,6 +310,7 @@ infrastructures.config.openshift.io:
Capability: ""
Category: ""
FeatureGates:
+ - AWSClusterHostedDNS
- BareMetalLoadBalancer
- GCPClusterHostedDNS
- GCPLabelsTags
@@ -382,7 +383,8 @@ nodes.config.openshift.io:
CRDName: nodes.config.openshift.io
Capability: ""
Category: ""
- FeatureGates: []
+ FeatureGates:
+ - MinimumKubeletVersion
FilenameOperatorName: config-operator
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_10"
diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go
index c580bd8342..145a7e4c04 100644
--- a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go
+++ b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go
@@ -1184,10 +1184,11 @@ func (AWSPlatformSpec) SwaggerDoc() map[string]string {
}
var map_AWSPlatformStatus = map[string]string{
- "": "AWSPlatformStatus holds the current status of the Amazon Web Services infrastructure provider.",
- "region": "region holds the default AWS region for new AWS resources created by the cluster.",
- "serviceEndpoints": "ServiceEndpoints list contains custom endpoints which will override default service endpoint of AWS Services. There must be only one ServiceEndpoint for a service.",
- "resourceTags": "resourceTags is a list of additional tags to apply to AWS resources created for the cluster. See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html for information on tagging AWS resources. AWS supports a maximum of 50 tags per resource. OpenShift reserves 25 tags for its use, leaving 25 tags available for the user.",
+ "": "AWSPlatformStatus holds the current status of the Amazon Web Services infrastructure provider.",
+ "region": "region holds the default AWS region for new AWS resources created by the cluster.",
+ "serviceEndpoints": "ServiceEndpoints list contains custom endpoints which will override default service endpoint of AWS Services. There must be only one ServiceEndpoint for a service.",
+ "resourceTags": "resourceTags is a list of additional tags to apply to AWS resources created for the cluster. See https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html for information on tagging AWS resources. AWS supports a maximum of 50 tags per resource. OpenShift reserves 25 tags for its use, leaving 25 tags available for the user.",
+ "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.",
}
func (AWSPlatformStatus) SwaggerDoc() map[string]string {
@@ -1389,7 +1390,7 @@ var map_GCPPlatformStatus = map[string]string{
"region": "region holds the region for new GCP resources created for the cluster.",
"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 is a union that contains the IP addresses of API, API-Int and Ingress Load Balancers created on the cloud platform. These values would not be populated on on-prem platforms. These Load Balancer IPs are used to configure the in-cluster DNS instances for API, API-Int and Ingress services. `dnsType` is expected to be set to `ClusterHosted` when these Load Balancer IP addresses are populated and used.",
+ "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.",
}
func (GCPPlatformStatus) SwaggerDoc() map[string]string {
@@ -2087,8 +2088,9 @@ func (NodeList) SwaggerDoc() map[string]string {
}
var map_NodeSpec = map[string]string{
- "cgroupMode": "CgroupMode determines the cgroups version on the node",
- "workerLatencyProfile": "WorkerLatencyProfile determins the how fast the kubelet is updating the status and corresponding reaction of the cluster",
+ "cgroupMode": "CgroupMode determines the cgroups version on the node",
+ "workerLatencyProfile": "WorkerLatencyProfile determins the how fast the kubelet is updating the status and corresponding reaction of the cluster",
+ "minimumKubeletVersion": "minimumKubeletVersion is the lowest version of a kubelet that can join the cluster. Specifically, the apiserver will deny most authorization requests of kubelets that are older than the specified version, only allowing the kubelet to get and update its node object, and perform subjectaccessreviews. This means any kubelet that attempts to join the cluster will not be able to run any assigned workloads, and will eventually be marked as not ready. Its max length is 8, so maximum version allowed is either \"9.999.99\" or \"99.99.99\". Since the kubelet reports the version of the kubernetes release, not Openshift, this field references the underlying kubernetes version this version of Openshift is based off of. In other words: if an admin wishes to ensure no nodes run an older version than Openshift 4.17, then they should set the minimumKubeletVersion to 1.30.0. When comparing versions, the kubelet's version is stripped of any contents outside of major.minor.patch version. Thus, a kubelet with version \"1.0.0-ec.0\" will be compatible with minimumKubeletVersion \"1.0.0\" or earlier.",
}
func (NodeSpec) SwaggerDoc() map[string]string {
diff --git a/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_image_policy.go b/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_image_policy.go
index e3670f03e8..14650fd48f 100644
--- a/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_image_policy.go
+++ b/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_image_policy.go
@@ -41,6 +41,7 @@ type ClusterImagePolicySpec struct {
// 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
// +kubebuilder:validation:Required
diff --git a/vendor/github.com/openshift/api/config/v1alpha1/types_image_policy.go b/vendor/github.com/openshift/api/config/v1alpha1/types_image_policy.go
index 7031110ff1..a177ddb0d6 100644
--- a/vendor/github.com/openshift/api/config/v1alpha1/types_image_policy.go
+++ b/vendor/github.com/openshift/api/config/v1alpha1/types_image_policy.go
@@ -40,6 +40,7 @@ type ImagePolicySpec struct {
// 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
// +kubebuilder:validation:Required
diff --git a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go
index 9da086efc5..55468f38da 100644
--- a/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go
+++ b/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go
@@ -102,7 +102,7 @@ func (ClusterImagePolicyList) SwaggerDoc() map[string]string {
var map_ClusterImagePolicySpec = map[string]string{
"": "CLusterImagePolicySpec is the specification of the ClusterImagePolicy custom resource.",
- "scopes": "scopes 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. 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. 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",
+ "scopes": "scopes 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. 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",
"policy": "policy contains configuration to allow scopes to be verified, and defines how images not matching the verification policy will be treated.",
}
@@ -151,7 +151,7 @@ func (ImagePolicyList) SwaggerDoc() map[string]string {
var map_ImagePolicySpec = map[string]string{
"": "ImagePolicySpec is the specification of the ImagePolicy CRD.",
- "scopes": "scopes 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. 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. 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",
+ "scopes": "scopes 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. 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",
"policy": "policy contains configuration to allow scopes to be verified, and defines how images not matching the verification policy will be treated.",
}
diff --git a/vendor/github.com/openshift/api/features/features.go b/vendor/github.com/openshift/api/features/features.go
index 7f49623954..f127d8ffb9 100644
--- a/vendor/github.com/openshift/api/features/features.go
+++ b/vendor/github.com/openshift/api/features/features.go
@@ -36,10 +36,19 @@ func AllFeatureSets() map[ClusterProfileName]map[configv1.FeatureSet]*FeatureGat
var (
allFeatureGates = map[ClusterProfileName]map[configv1.FeatureSet]*FeatureGateEnabledDisabled{}
+ FeatureGateConsolePluginCSP = newFeatureGate("ConsolePluginContentSecurityPolicy").
+ reportProblemsToJiraComponent("Management Console").
+ contactPerson("jhadvig").
+ productScope(ocpSpecific).
+ enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
+ enhancementPR("https://github.com/openshift/enhancements/pull/1706").
+ mustRegister()
+
FeatureGateServiceAccountTokenNodeBinding = newFeatureGate("ServiceAccountTokenNodeBinding").
reportProblemsToJiraComponent("apiserver-auth").
contactPerson("stlaz").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/4193").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -47,6 +56,7 @@ var (
reportProblemsToJiraComponent("kube-apiserver").
contactPerson("benluddy").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/3488").
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -54,6 +64,7 @@ var (
reportProblemsToJiraComponent("Routing").
contactPerson("miciah").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade).
mustRegister()
@@ -61,6 +72,7 @@ var (
reportProblemsToJiraComponent("Networking / router").
contactPerson("miheer").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -68,6 +80,7 @@ var (
reportProblemsToJiraComponent("auth").
contactPerson("ibihim").
productScope(ocpSpecific).
+ enhancementPR("https://github.com/openshift/enhancements/pull/899").
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -75,6 +88,7 @@ var (
reportProblemsToJiraComponent("builds").
contactPerson("adkaplan").
productScope(ocpSpecific).
+ enhancementPR("https://github.com/openshift/enhancements/pull/1056").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -82,6 +96,7 @@ var (
reportProblemsToJiraComponent("builds").
contactPerson("adkaplan").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -89,6 +104,7 @@ var (
reportProblemsToJiraComponent("node").
contactPerson("ehashman").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/2400").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -96,6 +112,7 @@ var (
reportProblemsToJiraComponent("openstack").
contactPerson("egarcia").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -103,6 +120,7 @@ var (
reportProblemsToJiraComponent("insights").
contactPerson("tremes").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -110,6 +128,7 @@ var (
reportProblemsToJiraComponent("insights").
contactPerson("jmesnil").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -117,6 +136,7 @@ var (
reportProblemsToJiraComponent("scheduling").
contactPerson("jchaloup").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/4381").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -124,6 +144,7 @@ var (
reportProblemsToJiraComponent("cloud-credential-operator").
contactPerson("abutcher").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -131,6 +152,7 @@ var (
reportProblemsToJiraComponent("apps").
contactPerson("atiratree").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/961").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -138,12 +160,14 @@ var (
reportProblemsToJiraComponent("node").
contactPerson("sairameshv").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/3386").
mustRegister()
FeatureGatePrivateHostedZoneAWS = newFeatureGate("PrivateHostedZoneAWS").
reportProblemsToJiraComponent("Routing").
contactPerson("miciah").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -151,6 +175,7 @@ var (
reportProblemsToJiraComponent("node").
contactPerson("sgrunert").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -158,6 +183,7 @@ var (
reportProblemsToJiraComponent("Installer").
contactPerson("bhb").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -165,6 +191,7 @@ var (
reportProblemsToJiraComponent("cloud-provider").
contactPerson("jspeed").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -172,6 +199,7 @@ var (
reportProblemsToJiraComponent("machine-config-operator/platform-baremetal").
contactPerson("mkowalsk").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/3705").
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -179,6 +207,7 @@ var (
reportProblemsToJiraComponent("splat").
contactPerson("vr4manta").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -186,6 +215,7 @@ var (
reportProblemsToJiraComponent("splat").
contactPerson("rvanderp3").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -193,6 +223,7 @@ var (
reportProblemsToJiraComponent("router").
contactPerson("thejasn").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -200,6 +231,7 @@ var (
reportProblemsToJiraComponent("Networking/ovn-kubernetes").
contactPerson("tssurya").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -207,6 +239,7 @@ var (
reportProblemsToJiraComponent("Networking/ovn-kubernetes").
contactPerson("tssurya").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -214,6 +247,7 @@ var (
reportProblemsToJiraComponent("Networking/cluster-network-operator").
contactPerson("jcaamano").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -221,6 +255,7 @@ var (
reportProblemsToJiraComponent("Networking/ovn-kubernetes").
contactPerson("jcaamano").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -228,6 +263,7 @@ var (
reportProblemsToJiraComponent("Networking/ovn-kubernetes").
contactPerson("pliu").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -235,6 +271,7 @@ var (
reportProblemsToJiraComponent("Networking/cluster-network-operator").
contactPerson("kyrtapz").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -242,6 +279,7 @@ var (
reportProblemsToJiraComponent("Networking").
contactPerson("npinaeva").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -249,6 +287,7 @@ var (
reportProblemsToJiraComponent("etcd").
contactPerson("hasbro17").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -256,6 +295,7 @@ var (
reportProblemsToJiraComponent("etcd").
contactPerson("hasbro17").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -263,6 +303,7 @@ var (
reportProblemsToJiraComponent("etcd").
contactPerson("hasbro17").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -270,12 +311,14 @@ var (
reportProblemsToJiraComponent("ecoproject").
contactPerson("msluiter").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
mustRegister()
FeatureGateDNSNameResolver = newFeatureGate("DNSNameResolver").
reportProblemsToJiraComponent("dns").
contactPerson("miciah").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -283,6 +326,7 @@ var (
reportProblemsToJiraComponent("splat").
contactPerson("rvanderp3").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -290,6 +334,7 @@ var (
reportProblemsToJiraComponent("MachineConfigOperator").
contactPerson("cdoern").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -297,19 +342,22 @@ var (
reportProblemsToJiraComponent("Installer").
contactPerson("vincepri").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
mustRegister()
- FeatureGateMetricsServer = newFeatureGate("MetricsServer").
- reportProblemsToJiraComponent("Monitoring").
- contactPerson("slashpai").
+ FeatureGateGCPClusterHostedDNS = newFeatureGate("GCPClusterHostedDNS").
+ reportProblemsToJiraComponent("Installer").
+ contactPerson("barbacbd").
productScope(ocpSpecific).
- enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
+ enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
- FeatureGateGCPClusterHostedDNS = newFeatureGate("GCPClusterHostedDNS").
+ FeatureGateAWSClusterHostedDNS = newFeatureGate("AWSClusterHostedDNS").
reportProblemsToJiraComponent("Installer").
contactPerson("barbacbd").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -317,6 +365,7 @@ var (
reportProblemsToJiraComponent("NodeTuningOperator").
contactPerson("titzhak").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -324,6 +373,7 @@ var (
reportProblemsToJiraComponent("MachineConfigOperator").
contactPerson("djoshy").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -331,13 +381,15 @@ var (
reportProblemsToJiraComponent("MachineConfigOperator").
contactPerson("djoshy").
productScope(ocpSpecific).
- enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
+ enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
FeatureGateDisableKubeletCloudCredentialProviders = newFeatureGate("DisableKubeletCloudCredentialProviders").
reportProblemsToJiraComponent("cloud-provider").
contactPerson("jspeed").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/2395").
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -345,6 +397,7 @@ var (
reportProblemsToJiraComponent("MachineConfigOperator").
contactPerson("dkhater").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -352,6 +405,7 @@ var (
reportProblemsToJiraComponent("MachineConfigOperator").
contactPerson("inesqyx").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -359,6 +413,7 @@ var (
reportProblemsToJiraComponent("Cluster Version Operator").
contactPerson("lmohanty").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -366,6 +421,7 @@ var (
reportProblemsToJiraComponent("kube-apiserver").
contactPerson("dgrisonnet").
productScope(kubernetes).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -373,6 +429,7 @@ var (
reportProblemsToJiraComponent("MachineConfigOperator").
contactPerson("jhernand").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -380,6 +437,7 @@ var (
reportProblemsToJiraComponent("Cluster Version Operator").
contactPerson("pmuller").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -387,13 +445,23 @@ var (
reportProblemsToJiraComponent("kube-apiserver").
contactPerson("akashem").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/4006").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
+ FeatureGateVolumeAttributesClass = newFeatureGate("VolumeAttributesClass").
+ reportProblemsToJiraComponent("Storage / Kubernetes External Components").
+ contactPerson("dfajmon").
+ productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/3751").
+ enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
+ mustRegister()
+
FeatureGateVolumeGroupSnapshot = newFeatureGate("VolumeGroupSnapshot").
reportProblemsToJiraComponent("Storage / Kubernetes External Components").
contactPerson("fbertina").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/3476").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -401,6 +469,7 @@ var (
reportProblemsToJiraComponent("authentication").
contactPerson("liouk").
productScope(ocpSpecific).
+ enhancementPR("https://github.com/openshift/enhancements/pull/1596").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
enableForClusterProfile(Hypershift, configv1.Default, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -409,6 +478,7 @@ var (
reportProblemsToJiraComponent("cluster-config").
contactPerson("deads").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -416,6 +486,7 @@ var (
reportProblemsToJiraComponent("olm").
contactPerson("joe").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -423,6 +494,7 @@ var (
reportProblemsToJiraComponent("olm").
contactPerson("joe").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -430,6 +502,7 @@ var (
reportProblemsToJiraComponent("insights").
contactPerson("tremes").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -437,6 +510,7 @@ var (
reportProblemsToJiraComponent("metal").
contactPerson("EmilienM").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -444,6 +518,7 @@ var (
reportProblemsToJiraComponent("insights").
contactPerson("tremes").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -451,6 +526,7 @@ var (
reportProblemsToJiraComponent("MachineConfigOperator").
contactPerson("jerzhang").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -458,6 +534,7 @@ var (
reportProblemsToJiraComponent("Monitoring").
contactPerson("rexagod").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -465,6 +542,7 @@ var (
reportProblemsToJiraComponent("Storage / Kubernetes External Components").
contactPerson("rbednar").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -472,12 +550,14 @@ var (
reportProblemsToJiraComponent("Installer").
contactPerson("cjschaef").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
mustRegister()
FeatureGateChunkSizeMiB = newFeatureGate("ChunkSizeMiB").
reportProblemsToJiraComponent("Image Registry").
contactPerson("flavianmissi").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -485,12 +565,14 @@ var (
reportProblemsToJiraComponent("OCPCLOUD").
contactPerson("jspeed").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
mustRegister()
FeatureGatePersistentIPsForVirtualization = newFeatureGate("PersistentIPsForVirtualization").
reportProblemsToJiraComponent("CNV Network").
contactPerson("mduarted").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -498,6 +580,7 @@ var (
reportProblemsToJiraComponent("Monitoring").
contactPerson("marioferh").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -505,6 +588,7 @@ var (
reportProblemsToJiraComponent("Installer").
contactPerson("r4f4").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -512,12 +596,14 @@ var (
reportProblemsToJiraComponent("Installer").
contactPerson("r4f4").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
mustRegister()
FeatureGateMultiArchInstallGCP = newFeatureGate("MultiArchInstallGCP").
reportProblemsToJiraComponent("Installer").
contactPerson("r4f4").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -525,6 +611,7 @@ var (
reportProblemsToJiraComponent("Routing").
contactPerson("miciah").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -532,6 +619,7 @@ var (
reportProblemsToJiraComponent("Storage / Kubernetes External Components").
contactPerson("fbertina").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -539,6 +627,7 @@ var (
reportProblemsToJiraComponent("Multi-Arch").
contactPerson("psundara").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -546,6 +635,7 @@ var (
reportProblemsToJiraComponent("Node").
contactPerson("haircommander").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/127").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -553,6 +643,7 @@ var (
reportProblemsToJiraComponent("Node").
contactPerson("haircommander").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/127").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -560,6 +651,7 @@ var (
reportProblemsToJiraComponent("Node").
contactPerson("haircommander").
productScope(kubernetes).
+ enhancementPR("https://github.com/kubernetes/enhancements/issues/4265").
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
@@ -567,6 +659,23 @@ var (
reportProblemsToJiraComponent("SPLAT").
contactPerson("rvanderp").
productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
+
+ FeatureGateIngressControllerDynamicConfigurationManager = newFeatureGate("IngressControllerDynamicConfigurationManager").
+ reportProblemsToJiraComponent("Networking/router").
+ contactPerson("miciah").
+ productScope(ocpSpecific).
+ enhancementPR(legacyFeatureGateWithoutEnhancement).
+ enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
+ mustRegister()
+
+ FeatureGateMinimumKubeletVersion = newFeatureGate("MinimumKubeletVersion").
+ reportProblemsToJiraComponent("Node").
+ contactPerson("haircommander").
+ productScope(ocpSpecific).
+ enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
+ enhancementPR("https://github.com/openshift/enhancements/pull/1697").
+ mustRegister()
)
diff --git a/vendor/github.com/openshift/api/features/legacyfeaturegates.go b/vendor/github.com/openshift/api/features/legacyfeaturegates.go
new file mode 100644
index 0000000000..06e1600e0d
--- /dev/null
+++ b/vendor/github.com/openshift/api/features/legacyfeaturegates.go
@@ -0,0 +1,129 @@
+package features
+
+import "k8s.io/apimachinery/pkg/util/sets"
+
+var legacyFeatureGates = sets.New(
+ "AWSClusterHostedDNS",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "AWSEFSDriverVolumeMetrics",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "AdditionalRoutingCapabilities",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "AdminNetworkPolicy",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "AlibabaPlatform",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "AutomatedEtcdBackup",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "AzureWorkloadIdentity",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "BareMetalLoadBalancer",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "BootcNodeManagement",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "BuildCSIVolumes",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "ChunkSizeMiB",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "ClusterAPIInstall",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "ClusterAPIInstallIBMCloud",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "ClusterMonitoringConfig",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "DNSNameResolver",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "EtcdBackendQuota",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "Example",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "GCPClusterHostedDNS",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "GCPLabelsTags",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "GatewayAPI",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "HardwareSpeed",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "ImageStreamImportMode",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "IngressControllerDynamicConfigurationManager",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "IngressControllerLBSubnetsAWS",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "InsightsConfig",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "InsightsConfigAPI",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "InsightsOnDemandDataGather",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "InsightsRuntimeExtractor",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "KMSv1",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "MachineAPIMigration",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "MachineAPIOperatorDisableMachineHealthCheckController",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "MachineAPIProviderOpenStack",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "MachineConfigNodes",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "ManagedBootImages",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "ManagedBootImagesAWS",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "MetricsCollectionProfiles",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "MixedCPUsAllocation",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "MultiArchInstallAWS",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "MultiArchInstallAzure",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "MultiArchInstallGCP",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "NetworkDiagnosticsConfig",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "NetworkLiveMigration",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "NetworkSegmentation",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "NewOLM",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "NodeDisruptionPolicy",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "OVNObservability",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "OnClusterBuild",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "PersistentIPsForVirtualization",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "PinnedImages",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "PlatformOperators",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "PrivateHostedZoneAWS",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "RouteAdvertisements",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "RouteExternalCertificate",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "SetEIPForNLBIngressController",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "SignatureStores",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "SigstoreImageVerification",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "UpgradeStatus",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "VSphereControlPlaneMachineSet",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "VSphereDriverConfiguration",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "VSphereMultiNetworks",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "VSphereMultiVCenters",
+ // never add to this list, if you think you have an exception ask @deads2k
+ "VSphereStaticIPs",
+)
diff --git a/vendor/github.com/openshift/api/features/util.go b/vendor/github.com/openshift/api/features/util.go
index d8d8e94a0e..59bb7bff40 100644
--- a/vendor/github.com/openshift/api/features/util.go
+++ b/vendor/github.com/openshift/api/features/util.go
@@ -3,6 +3,8 @@ package features
import (
"fmt"
configv1 "github.com/openshift/api/config/v1"
+ "net/url"
+ "strings"
)
// FeatureGateDescription is a golang-only interface used to contains details for a feature gate.
@@ -18,6 +20,8 @@ type FeatureGateDescription struct {
ResponsiblePerson string
// OwningProduct is the product that owns the lifecycle of the gate.
OwningProduct OwningProduct
+ // EnhancementPR is the PR for the enhancement.
+ EnhancementPR string
}
type FeatureGateEnabledDisabled struct {
@@ -45,10 +49,15 @@ type featureGateBuilder struct {
owningJiraComponent string
responsiblePerson string
owningProduct OwningProduct
+ enhancementPRURL string
statusByClusterProfileByFeatureSet map[ClusterProfileName]map[configv1.FeatureSet]bool
}
+const (
+ legacyFeatureGateWithoutEnhancement = "FeatureGate predates 4.18"
+)
+
// newFeatureGate featuregate are disabled in every FeatureSet and selectively enabled
func newFeatureGate(name string) *featureGateBuilder {
b := &featureGateBuilder{
@@ -80,6 +89,11 @@ func (b *featureGateBuilder) productScope(owningProduct OwningProduct) *featureG
return b
}
+func (b *featureGateBuilder) enhancementPR(url string) *featureGateBuilder {
+ b.enhancementPRURL = url
+ return b
+}
+
func (b *featureGateBuilder) enableIn(featureSets ...configv1.FeatureSet) *featureGateBuilder {
for clusterProfile := range b.statusByClusterProfileByFeatureSet {
for _, featureSet := range featureSets {
@@ -109,6 +123,22 @@ func (b *featureGateBuilder) register() (configv1.FeatureGateName, error) {
if len(b.owningProduct) == 0 {
return "", fmt.Errorf("missing owningProduct")
}
+ _, enhancementPRErr := url.Parse(b.enhancementPRURL)
+ switch {
+ case b.enhancementPRURL == legacyFeatureGateWithoutEnhancement:
+ if !legacyFeatureGates.Has(b.name) {
+ return "", fmt.Errorf("FeatureGate/%s is a new feature gate, not an existing one. It must have an enhancementPR with GA Graduation Criteria like https://github.com/openshift/enhancements/pull/#### or https://github.com/kubernetes/enhancements/issues/####", b.name)
+ }
+
+ case len(b.enhancementPRURL) == 0:
+ return "", fmt.Errorf("FeatureGate/%s is missing an enhancementPR with GA Graduation Criteria like https://github.com/openshift/enhancements/pull/#### or https://github.com/kubernetes/enhancements/issues/####", b.name)
+
+ case !strings.HasPrefix(b.enhancementPRURL, "https://github.com/openshift/enhancements/pull/") && !strings.HasPrefix(b.enhancementPRURL, "https://github.com/kubernetes/enhancements/issues/"):
+ return "", fmt.Errorf("FeatureGate/%s enhancementPR format is incorrect; must be like https://github.com/openshift/enhancements/pull/#### or https://github.com/kubernetes/enhancements/issues/####", b.name)
+
+ case enhancementPRErr != nil:
+ return "", fmt.Errorf("FeatureGate/%s is enhancementPR is invalid: %w", b.name, enhancementPRErr)
+ }
featureGateName := configv1.FeatureGateName(b.name)
description := FeatureGateDescription{
@@ -118,6 +148,7 @@ func (b *featureGateBuilder) register() (configv1.FeatureGateName, error) {
OwningJiraComponent: b.owningJiraComponent,
ResponsiblePerson: b.responsiblePerson,
OwningProduct: b.owningProduct,
+ EnhancementPR: b.enhancementPRURL,
}
// statusByClusterProfileByFeatureSet is initialized by constructor to be false for every combination
diff --git a/vendor/github.com/openshift/api/image/v1/generated.proto b/vendor/github.com/openshift/api/image/v1/generated.proto
index 0b7ae71822..6b5f24cb21 100644
--- a/vendor/github.com/openshift/api/image/v1/generated.proto
+++ b/vendor/github.com/openshift/api/image/v1/generated.proto
@@ -45,7 +45,7 @@ message DockerImageReference {
message Image {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// DockerImageReference is the string that can be used to pull this image.
optional string dockerImageReference = 2;
@@ -53,7 +53,7 @@ message Image {
// DockerImageMetadata contains metadata about this image
// +patchStrategy=replace
// +kubebuilder:pruning:PreserveUnknownFields
- optional k8s.io.apimachinery.pkg.runtime.RawExtension dockerImageMetadata = 3;
+ optional .k8s.io.apimachinery.pkg.runtime.RawExtension dockerImageMetadata = 3;
// DockerImageMetadataVersion conveys the version of the object, which if empty defaults to "1.0"
optional string dockerImageMetadataVersion = 4;
@@ -115,10 +115,10 @@ message ImageBlobReferences {
// ImageImportSpec describes a request to import a specific image.
message ImageImportSpec {
// From is the source of an image to import; only kind DockerImage is allowed
- optional k8s.io.api.core.v1.ObjectReference from = 1;
+ optional .k8s.io.api.core.v1.ObjectReference from = 1;
// To is a tag in the current image stream to assign the imported image to, if name is not specified the default tag from from.name will be used
- optional k8s.io.api.core.v1.LocalObjectReference to = 2;
+ optional .k8s.io.api.core.v1.LocalObjectReference to = 2;
// ImportPolicy is the policy controlling how the image is imported
optional TagImportPolicy importPolicy = 3;
@@ -133,7 +133,7 @@ message ImageImportSpec {
// ImageImportStatus describes the result of an image import.
message ImageImportStatus {
// Status is the status of the image import, including errors encountered while retrieving the image
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 1;
// Image is the metadata of that image, if the image was located
optional Image image = 2;
@@ -174,7 +174,7 @@ message ImageLayerData {
message ImageList {
// metadata is the standard list's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of images
repeated Image items = 2;
@@ -226,7 +226,7 @@ message ImageManifest {
message ImageSignature {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Required: Describes a type of stored blob.
optional string type = 2;
@@ -247,7 +247,7 @@ message ImageSignature {
map signedClaims = 6;
// If specified, it is the time of signature's creation.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time created = 7;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time created = 7;
// If specified, it holds information about an issuer of signing certificate or key (a person or entity
// who signed the signing certificate or key).
@@ -278,7 +278,7 @@ message ImageSignature {
message ImageStream {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec describes the desired state of this stream
// +optional
@@ -307,7 +307,7 @@ message ImageStream {
message ImageStreamImage {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Image associated with the ImageStream and image name.
optional Image image = 2;
@@ -327,7 +327,7 @@ message ImageStreamImage {
message ImageStreamImport {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec is a description of the images that the user wishes to import
optional ImageStreamImportSpec spec = 2;
@@ -370,7 +370,7 @@ message ImageStreamImportStatus {
message ImageStreamLayers {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// blobs is a map of blob name to metadata about the blob.
map blobs = 2;
@@ -387,7 +387,7 @@ message ImageStreamLayers {
message ImageStreamList {
// metadata is the standard list's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of imageStreams
repeated ImageStream items = 2;
@@ -407,7 +407,7 @@ message ImageStreamList {
message ImageStreamMapping {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Image is a container image.
optional Image image = 2;
@@ -464,7 +464,7 @@ message ImageStreamStatus {
message ImageStreamTag {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// tag is the spec tag associated with this image stream tag, and it may be null
// if only pushes have occurred to this image stream.
@@ -494,7 +494,7 @@ message ImageStreamTag {
message ImageStreamTagList {
// metadata is the standard list's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of image stream tags
repeated ImageStreamTag items = 2;
@@ -514,7 +514,7 @@ message ImageStreamTagList {
message ImageTag {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec is the spec tag associated with this image stream tag, and it may be null
// if only pushes have occurred to this image stream.
@@ -541,7 +541,7 @@ message ImageTag {
message ImageTagList {
// metadata is the standard list's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of image stream tags
repeated ImageTag items = 2;
@@ -562,7 +562,7 @@ message NamedTagEventList {
// RepositoryImportSpec describes a request to import images from a container image repository.
message RepositoryImportSpec {
// From is the source for the image repository to import; only kind DockerImage and a name of a container image repository is allowed
- optional k8s.io.api.core.v1.ObjectReference from = 1;
+ optional .k8s.io.api.core.v1.ObjectReference from = 1;
// ImportPolicy is the policy controlling how the image is imported
optional TagImportPolicy importPolicy = 2;
@@ -577,7 +577,7 @@ message RepositoryImportSpec {
// RepositoryImportStatus describes the result of an image repository import
message RepositoryImportStatus {
// Status reflects whether any failure occurred during import
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Status status = 1;
// Images is a list of images successfully retrieved by the import of the repository.
repeated ImageImportStatus images = 2;
@@ -593,11 +593,11 @@ message SecretList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
// +optional
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is a list of secret objects.
// More info: https://kubernetes.io/docs/concepts/configuration/secret
- repeated k8s.io.api.core.v1.Secret items = 2;
+ repeated .k8s.io.api.core.v1.Secret items = 2;
}
// SignatureCondition describes an image signature condition of particular kind at particular probe time.
@@ -609,10 +609,10 @@ message SignatureCondition {
optional string status = 2;
// Last time the condition was checked.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3;
// Last time the condition transit from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
// (brief) reason for the condition's last transition.
optional string reason = 5;
@@ -649,7 +649,7 @@ message SignatureSubject {
// TagEvent is used by ImageStreamStatus to keep a historical record of images associated with a tag.
message TagEvent {
// Created holds the time the TagEvent was created
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time created = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time created = 1;
// DockerImageReference is the string that can be used to pull this image
optional string dockerImageReference = 2;
@@ -670,7 +670,7 @@ message TagEventCondition {
optional string status = 2;
// LastTransitionTIme is the time the condition transitioned from one status to another.
- optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
// Reason is a brief machine readable explanation for the condition's last transition.
optional string reason = 4;
@@ -706,7 +706,7 @@ message TagReference {
// Optional; if specified, a reference to another image that this tag should point to. Valid values
// are ImageStreamTag, ImageStreamImage, and DockerImage. ImageStreamTag references
// can only reference a tag within this same ImageStream.
- optional k8s.io.api.core.v1.ObjectReference from = 3;
+ optional .k8s.io.api.core.v1.ObjectReference from = 3;
// Reference states if the tag will be imported. Default value is false, which means the tag will
// be imported.
diff --git a/vendor/github.com/openshift/api/operator/v1/types.go b/vendor/github.com/openshift/api/operator/v1/types.go
index 19bc5a359b..f04b6846ae 100644
--- a/vendor/github.com/openshift/api/operator/v1/types.go
+++ b/vendor/github.com/openshift/api/operator/v1/types.go
@@ -127,8 +127,17 @@ type OperatorStatus struct {
// readyReplicas indicates how many replicas are ready and at the desired state
ReadyReplicas int32 `json:"readyReplicas"`
+ // latestAvailableRevision is the deploymentID of the most recent deployment
+ // +optional
+ // +kubebuilder:validation:XValidation:rule="self >= oldSelf",message="must only increase"
+ LatestAvailableRevision int32 `json:"latestAvailableRevision,omitempty"`
+
// generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.
- // +listType=atomic
+ // +listType=map
+ // +listMapKey=group
+ // +listMapKey=resource
+ // +listMapKey=namespace
+ // +listMapKey=name
// +optional
Generations []GenerationStatus `json:"generations,omitempty"`
}
@@ -136,15 +145,29 @@ type OperatorStatus struct {
// GenerationStatus keeps track of the generation for a given resource so that decisions about forced updates can be made.
type GenerationStatus struct {
// group is the group of the thing you're tracking
+ // +kubebuilder:validation:Required
Group string `json:"group"`
+
// resource is the resource type of the thing you're tracking
+ // +kubebuilder:validation:Required
Resource string `json:"resource"`
+
// namespace is where the thing you're tracking is
+ // +kubebuilder:validation:Required
Namespace string `json:"namespace"`
+
// name is the name of the thing you're tracking
+ // +kubebuilder:validation:Required
Name string `json:"name"`
+
+ // TODO: Add validation for lastGeneration. The value for this field should generally increase, except when the associated
+ // resource has been deleted and re-created. To accurately validate this field, we should introduce a new UID field and only
+ // enforce an increasing value in lastGeneration when the UID remains unchanged. A change in the UID indicates that the resource
+ // was re-created, allowing the lastGeneration value to reset or decrease.
+
// lastGeneration is the last generation of the workload controller involved
LastGeneration int64 `json:"lastGeneration"`
+
// hash is an optional field set for resources without generation that are content sensitive like secrets and configmaps
Hash string `json:"hash"`
}
@@ -165,12 +188,34 @@ var (
// OperatorCondition is just the standard condition fields.
type OperatorCondition struct {
+ // type of condition in CamelCase or in foo.example.com/CamelCase.
+ // ---
+ // Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
+ // useful (see .node.status.conditions), the ability to deconflict is important.
+ // The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ // +required
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
+ // +kubebuilder:validation:MaxLength=316
+ Type string `json:"type" protobuf:"bytes,1,opt,name=type"`
+
+ // status of the condition, one of True, False, Unknown.
+ // +required
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:Enum=True;False;Unknown
+ Status ConditionStatus `json:"status"`
+
+ // lastTransitionTime is the last time the condition transitioned from one status to another.
+ // This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
+ // +required
// +kubebuilder:validation:Required
- Type string `json:"type"`
- Status ConditionStatus `json:"status"`
- LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
- Reason string `json:"reason,omitempty"`
- Message string `json:"message,omitempty"`
+ // +kubebuilder:validation:Type=string
+ // +kubebuilder:validation:Format=date-time
+ LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
+
+ Reason string `json:"reason,omitempty"`
+
+ Message string `json:"message,omitempty"`
}
type ConditionStatus string
@@ -203,10 +248,6 @@ type StaticPodOperatorSpec struct {
type StaticPodOperatorStatus struct {
OperatorStatus `json:",inline"`
- // latestAvailableRevision is the deploymentID of the most recent deployment
- // +optional
- LatestAvailableRevision int32 `json:"latestAvailableRevision,omitempty"`
-
// latestAvailableRevisionReason describe the detailed reason for the most recent deployment
// +optional
LatestAvailableRevisionReason string `json:"latestAvailableRevisionReason,omitempty"`
diff --git a/vendor/github.com/openshift/api/operator/v1/types_ingress.go b/vendor/github.com/openshift/api/operator/v1/types_ingress.go
index 51970cea99..1f56643456 100644
--- a/vendor/github.com/openshift/api/operator/v1/types_ingress.go
+++ b/vendor/github.com/openshift/api/operator/v1/types_ingress.go
@@ -392,6 +392,7 @@ type CIDR string
// LoadBalancerStrategy holds parameters for a load balancer.
// +openshift:validation:FeatureGateAwareXValidation:featureGate=SetEIPForNLBIngressController,rule="!has(self.scope) || self.scope != 'Internal' || !has(self.providerParameters) || !has(self.providerParameters.aws) || !has(self.providerParameters.aws.networkLoadBalancer) || !has(self.providerParameters.aws.networkLoadBalancer.eipAllocations)",message="eipAllocations are forbidden when the scope is Internal."
+// +kubebuilder:validation:XValidation:rule=`!has(self.scope) || self.scope != 'Internal' || !has(self.providerParameters) || !has(self.providerParameters.openstack) || !has(self.providerParameters.openstack.floatingIP) || self.providerParameters.openstack.floatingIP == ""`,message="cannot specify a floating ip when scope is internal"
type LoadBalancerStrategy struct {
// scope indicates the scope at which the load balancer is exposed.
// Possible values are "External" and "Internal".
@@ -455,6 +456,7 @@ const (
// ProviderLoadBalancerParameters holds desired load balancer information
// specific to the underlying infrastructure provider.
+// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'OpenStack' ? true : !has(self.openstack)",message="openstack is not permitted when type is not OpenStack"
// +union
type ProviderLoadBalancerParameters struct {
// type is the underlying infrastructure provider for the load balancer.
@@ -492,6 +494,15 @@ type ProviderLoadBalancerParameters struct {
//
// +optional
IBM *IBMLoadBalancerParameters `json:"ibm,omitempty"`
+
+ // openstack provides configuration settings that are specific to OpenStack
+ // load balancers.
+ //
+ // If empty, defaults will be applied. See specific openstack fields for
+ // details about their defaults.
+ //
+ // +optional
+ OpenStack *OpenStackLoadBalancerParameters `json:"openstack,omitempty"`
}
// LoadBalancerProviderType is the underlying infrastructure provider for the
@@ -665,6 +676,33 @@ type IBMLoadBalancerParameters struct {
Protocol IngressControllerProtocol `json:"protocol,omitempty"`
}
+// OpenStackLoadBalancerParameters provides configuration settings that are
+// specific to OpenStack load balancers.
+type OpenStackLoadBalancerParameters struct {
+ // loadBalancerIP is tombstoned since the field was replaced by floatingIP.
+ // LoadBalancerIP string `json:"loadBalancerIP,omitempty"`
+
+ // floatingIP specifies the IP address that the load balancer will use.
+ // When not specified, an IP address will be assigned randomly by the OpenStack cloud provider.
+ // When specified, the floating IP has to be pre-created. If the
+ // specified value is not a floating IP or is already claimed, the
+ // OpenStack cloud provider won't be able to provision the load
+ // balancer.
+ // This field may only be used if the IngressController has External scope.
+ // This value must be a valid IPv4 or IPv6 address.
+ // + ---
+ // + Note: this field is meant to be set by the ingress controller
+ // + to populate the `Service.Spec.LoadBalancerIP` field which has been
+ // + deprecated in Kubernetes:
+ // + https://github.com/kubernetes/kubernetes/pull/107235
+ // + However, the field is still used by cloud-provider-openstack to reconcile
+ // + the floating IP that we attach to the external load balancer.
+ //
+ // +kubebuilder:validation:XValidation:rule="isIP(self)",message="floatingIP must be a valid IPv4 or IPv6 address"
+ // +optional
+ FloatingIP string `json:"floatingIP,omitempty"`
+}
+
// AWSClassicLoadBalancerParameters holds configuration parameters for an
// AWS Classic load balancer.
type AWSClassicLoadBalancerParameters struct {
diff --git a/vendor/github.com/openshift/api/operator/v1/types_network.go b/vendor/github.com/openshift/api/operator/v1/types_network.go
index afe773192a..9b1588bc25 100644
--- a/vendor/github.com/openshift/api/operator/v1/types_network.go
+++ b/vendor/github.com/openshift/api/operator/v1/types_network.go
@@ -9,6 +9,7 @@ import (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=networks,scope=Cluster
+// +kubebuilder:subresource:status
// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/475
// +openshift:file-pattern=cvoRunLevel=0000_70,operatorName=network,operatorOrdering=01
diff --git a/vendor/github.com/openshift/api/operator/v1/types_olm.go b/vendor/github.com/openshift/api/operator/v1/types_olm.go
new file mode 100644
index 0000000000..84d7e9ea11
--- /dev/null
+++ b/vendor/github.com/openshift/api/operator/v1/types_olm.go
@@ -0,0 +1,58 @@
+package v1
+
+import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+// +genclient
+// +genclient:nonNamespaced
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// OLM provides information to configure an operator to manage the OLM controllers
+//
+// 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
+// +kubebuilder:object:root=true
+// +kubebuilder:resource:path=olms,scope=Cluster
+// +kubebuilder:subresource:status
+// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/1504
+// +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=operator-lifecycle-manager,operatorOrdering=01
+// +openshift:enable:FeatureGate=NewOLM
+// +kubebuilder:validation:XValidation:rule="self.metadata.name == 'cluster'",message="olm is a singleton, .metadata.name must be 'cluster'"
+type OLM struct {
+ metav1.TypeMeta `json:",inline"`
+
+ // metadata is the standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ metav1.ObjectMeta `json:"metadata"`
+
+ //spec holds user settable values for configuration
+ //+kubebuilder:validation:Required
+ Spec OLMSpec `json:"spec"`
+ // status holds observed values from the cluster. They may not be overridden.
+ // +optional
+ Status OLMStatus `json:"status"`
+}
+
+type OLMSpec struct {
+ OperatorSpec `json:",inline"`
+}
+
+type OLMStatus struct {
+ OperatorStatus `json:",inline"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// OLMList is a collection of items
+//
+// 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
+type OLMList struct {
+ metav1.TypeMeta `json:",inline"`
+
+ // metadata is the standard list's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
+ metav1.ListMeta `json:"metadata"`
+
+ // Items contains the items
+ Items []OLM `json:"items"`
+}
diff --git a/vendor/github.com/openshift/api/operator/v1/types_openshiftapiserver.go b/vendor/github.com/openshift/api/operator/v1/types_openshiftapiserver.go
index 3ae83e6948..cd2c8a588f 100644
--- a/vendor/github.com/openshift/api/operator/v1/types_openshiftapiserver.go
+++ b/vendor/github.com/openshift/api/operator/v1/types_openshiftapiserver.go
@@ -40,13 +40,6 @@ type OpenShiftAPIServerSpec struct {
type OpenShiftAPIServerStatus struct {
OperatorStatus `json:",inline"`
-
- // latestAvailableRevision is the latest revision used as suffix of revisioned
- // secrets like encryption-config. A new revision causes a new deployment of
- // pods.
- // +optional
- // +kubebuilder:validation:Minimum=0
- LatestAvailableRevision int32 `json:"latestAvailableRevision,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go
index fc6b94ceb2..3b984f2a61 100644
--- a/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go
+++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go
@@ -3834,6 +3834,101 @@ func (in *OAuthAPIServerStatus) DeepCopy() *OAuthAPIServerStatus {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OLM) DeepCopyInto(out *OLM) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ in.Status.DeepCopyInto(&out.Status)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OLM.
+func (in *OLM) DeepCopy() *OLM {
+ if in == nil {
+ return nil
+ }
+ out := new(OLM)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *OLM) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OLMList) DeepCopyInto(out *OLMList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]OLM, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OLMList.
+func (in *OLMList) DeepCopy() *OLMList {
+ if in == nil {
+ return nil
+ }
+ out := new(OLMList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *OLMList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OLMSpec) DeepCopyInto(out *OLMSpec) {
+ *out = *in
+ in.OperatorSpec.DeepCopyInto(&out.OperatorSpec)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OLMSpec.
+func (in *OLMSpec) DeepCopy() *OLMSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(OLMSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OLMStatus) DeepCopyInto(out *OLMStatus) {
+ *out = *in
+ in.OperatorStatus.DeepCopyInto(&out.OperatorStatus)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OLMStatus.
+func (in *OLMStatus) DeepCopy() *OLMStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(OLMStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OVNKubernetesConfig) DeepCopyInto(out *OVNKubernetesConfig) {
*out = *in
@@ -4117,6 +4212,22 @@ func (in *OpenShiftSDNConfig) DeepCopy() *OpenShiftSDNConfig {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OpenStackLoadBalancerParameters) DeepCopyInto(out *OpenStackLoadBalancerParameters) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackLoadBalancerParameters.
+func (in *OpenStackLoadBalancerParameters) DeepCopy() *OpenStackLoadBalancerParameters {
+ if in == nil {
+ return nil
+ }
+ out := new(OpenStackLoadBalancerParameters)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OperatorCondition) DeepCopyInto(out *OperatorCondition) {
*out = *in
@@ -4350,6 +4461,11 @@ func (in *ProviderLoadBalancerParameters) DeepCopyInto(out *ProviderLoadBalancer
*out = new(IBMLoadBalancerParameters)
**out = **in
}
+ if in.OpenStack != nil {
+ in, out := &in.OpenStack, &out.OpenStack
+ *out = new(OpenStackLoadBalancerParameters)
+ **out = **in
+ }
return
}
@@ -4457,12 +4573,16 @@ func (in *ResourceAttributesAccessReview) DeepCopyInto(out *ResourceAttributesAc
if in.Required != nil {
in, out := &in.Required, &out.Required
*out = make([]authorizationv1.ResourceAttributes, len(*in))
- copy(*out, *in)
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
}
if in.Missing != nil {
in, out := &in.Missing, &out.Missing
*out = make([]authorizationv1.ResourceAttributes, len(*in))
- copy(*out, *in)
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
}
return
}
diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml b/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml
index c152b0e84f..ae9a88c228 100644
--- a/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml
+++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml
@@ -336,7 +336,7 @@ networks.operator.openshift.io:
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_70"
GroupName: operator.openshift.io
- HasStatus: false
+ HasStatus: true
KindName: Network
Labels: {}
PluralName: networks
@@ -346,6 +346,29 @@ networks.operator.openshift.io:
TopLevelFeatureGates: []
Version: v1
+olms.operator.openshift.io:
+ Annotations: {}
+ ApprovedPRNumber: https://github.com/openshift/api/pull/1504
+ CRDName: olms.operator.openshift.io
+ Capability: ""
+ Category: ""
+ FeatureGates:
+ - NewOLM
+ FilenameOperatorName: operator-lifecycle-manager
+ FilenameOperatorOrdering: "01"
+ FilenameRunLevel: "0000_10"
+ GroupName: operator.openshift.io
+ HasStatus: true
+ KindName: OLM
+ Labels: {}
+ PluralName: olms
+ PrinterColumns: []
+ Scope: Cluster
+ ShortNames: null
+ TopLevelFeatureGates:
+ - NewOLM
+ Version: v1
+
openshiftapiservers.operator.openshift.io:
Annotations: {}
ApprovedPRNumber: https://github.com/openshift/api/pull/475
diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go
index 832dd01d01..3c00fe2f03 100644
--- a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go
+++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go
@@ -52,7 +52,10 @@ func (NodeStatus) SwaggerDoc() map[string]string {
}
var map_OperatorCondition = map[string]string{
- "": "OperatorCondition is just the standard condition fields.",
+ "": "OperatorCondition is just the standard condition fields.",
+ "type": "type of condition in CamelCase or in foo.example.com/CamelCase.",
+ "status": "status of the condition, one of True, False, Unknown.",
+ "lastTransitionTime": "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.",
}
func (OperatorCondition) SwaggerDoc() map[string]string {
@@ -73,11 +76,12 @@ func (OperatorSpec) SwaggerDoc() map[string]string {
}
var map_OperatorStatus = map[string]string{
- "observedGeneration": "observedGeneration is the last generation change you've dealt with",
- "conditions": "conditions is a list of conditions and their status",
- "version": "version is the level this availability applies to",
- "readyReplicas": "readyReplicas indicates how many replicas are ready and at the desired state",
- "generations": "generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.",
+ "observedGeneration": "observedGeneration is the last generation change you've dealt with",
+ "conditions": "conditions is a list of conditions and their status",
+ "version": "version is the level this availability applies to",
+ "readyReplicas": "readyReplicas indicates how many replicas are ready and at the desired state",
+ "latestAvailableRevision": "latestAvailableRevision is the deploymentID of the most recent deployment",
+ "generations": "generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.",
}
func (OperatorStatus) SwaggerDoc() map[string]string {
@@ -97,7 +101,6 @@ func (StaticPodOperatorSpec) SwaggerDoc() map[string]string {
var map_StaticPodOperatorStatus = map[string]string{
"": "StaticPodOperatorStatus is status for controllers that manage static pods. There are different needs because individual node status must be tracked.",
- "latestAvailableRevision": "latestAvailableRevision is the deploymentID of the most recent deployment",
"latestAvailableRevisionReason": "latestAvailableRevisionReason describe the detailed reason for the most recent deployment",
"nodeStatuses": "nodeStatuses track the deployment values and errors across individual nodes",
}
@@ -1121,6 +1124,15 @@ func (NodePortStrategy) SwaggerDoc() map[string]string {
return map_NodePortStrategy
}
+var map_OpenStackLoadBalancerParameters = map[string]string{
+ "": "OpenStackLoadBalancerParameters provides configuration settings that are specific to OpenStack load balancers.",
+ "floatingIP": "floatingIP specifies the IP address that the load balancer will use. When not specified, an IP address will be assigned randomly by the OpenStack cloud provider. When specified, the floating IP has to be pre-created. If the specified value is not a floating IP or is already claimed, the OpenStack cloud provider won't be able to provision the load balancer. This field may only be used if the IngressController has External scope. This value must be a valid IPv4 or IPv6 address. ",
+}
+
+func (OpenStackLoadBalancerParameters) SwaggerDoc() map[string]string {
+ return map_OpenStackLoadBalancerParameters
+}
+
var map_PrivateStrategy = map[string]string{
"": "PrivateStrategy holds parameters for the Private endpoint publishing strategy.",
"protocol": "protocol specifies whether the IngressController expects incoming connections to use plain TCP or whether the IngressController expects PROXY protocol.\n\nPROXY protocol can be used with load balancers that support it to communicate the source addresses of client connections when forwarding those connections to the IngressController. Using PROXY protocol enables the IngressController to report those source addresses instead of reporting the load balancer's address in HTTP headers and logs. Note that enabling PROXY protocol on the IngressController will cause connections to fail if you are not using a load balancer that uses PROXY protocol to forward connections to the IngressController. See http://www.haproxy.org/download/2.2/doc/proxy-protocol.txt for information about PROXY protocol.\n\nThe following values are valid for this field:\n\n* The empty string. * \"TCP\". * \"PROXY\".\n\nThe empty string specifies the default, which is TCP without PROXY protocol. Note that the default is subject to change.",
@@ -1131,11 +1143,12 @@ func (PrivateStrategy) SwaggerDoc() map[string]string {
}
var map_ProviderLoadBalancerParameters = map[string]string{
- "": "ProviderLoadBalancerParameters holds desired load balancer information specific to the underlying infrastructure provider.",
- "type": "type is the underlying infrastructure provider for the load balancer. Allowed values are \"AWS\", \"Azure\", \"BareMetal\", \"GCP\", \"IBM\", \"Nutanix\", \"OpenStack\", and \"VSphere\".",
- "aws": "aws provides configuration settings that are specific to AWS load balancers.\n\nIf empty, defaults will be applied. See specific aws fields for details about their defaults.",
- "gcp": "gcp provides configuration settings that are specific to GCP load balancers.\n\nIf empty, defaults will be applied. See specific gcp fields for details about their defaults.",
- "ibm": "ibm provides configuration settings that are specific to IBM Cloud load balancers.\n\nIf empty, defaults will be applied. See specific ibm fields for details about their defaults.",
+ "": "ProviderLoadBalancerParameters holds desired load balancer information specific to the underlying infrastructure provider.",
+ "type": "type is the underlying infrastructure provider for the load balancer. Allowed values are \"AWS\", \"Azure\", \"BareMetal\", \"GCP\", \"IBM\", \"Nutanix\", \"OpenStack\", and \"VSphere\".",
+ "aws": "aws provides configuration settings that are specific to AWS load balancers.\n\nIf empty, defaults will be applied. See specific aws fields for details about their defaults.",
+ "gcp": "gcp provides configuration settings that are specific to GCP load balancers.\n\nIf empty, defaults will be applied. See specific gcp fields for details about their defaults.",
+ "ibm": "ibm provides configuration settings that are specific to IBM Cloud load balancers.\n\nIf empty, defaults will be applied. See specific ibm fields for details about their defaults.",
+ "openstack": "openstack provides configuration settings that are specific to OpenStack load balancers.\n\nIf empty, defaults will be applied. See specific openstack fields for details about their defaults.",
}
func (ProviderLoadBalancerParameters) SwaggerDoc() map[string]string {
@@ -1883,6 +1896,27 @@ func (StaticIPAMRoutes) SwaggerDoc() map[string]string {
return map_StaticIPAMRoutes
}
+var map_OLM = map[string]string{
+ "": "OLM provides information to configure an operator to manage the OLM controllers\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",
+ "spec": "spec holds user settable values for configuration",
+ "status": "status holds observed values from the cluster. They may not be overridden.",
+}
+
+func (OLM) SwaggerDoc() map[string]string {
+ return map_OLM
+}
+
+var map_OLMList = map[string]string{
+ "": "OLMList is a collection of items\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",
+ "items": "Items contains the items",
+}
+
+func (OLMList) SwaggerDoc() map[string]string {
+ return map_OLMList
+}
+
var map_OpenShiftAPIServer = map[string]string{
"": "OpenShiftAPIServer provides information to configure an operator to manage openshift-apiserver.\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",
@@ -1904,14 +1938,6 @@ func (OpenShiftAPIServerList) SwaggerDoc() map[string]string {
return map_OpenShiftAPIServerList
}
-var map_OpenShiftAPIServerStatus = map[string]string{
- "latestAvailableRevision": "latestAvailableRevision is the latest revision used as suffix of revisioned secrets like encryption-config. A new revision causes a new deployment of pods.",
-}
-
-func (OpenShiftAPIServerStatus) SwaggerDoc() map[string]string {
- return map_OpenShiftAPIServerStatus
-}
-
var map_OpenShiftControllerManager = map[string]string{
"": "OpenShiftControllerManager provides information to configure an operator to manage openshift-controller-manager.\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",
diff --git a/vendor/github.com/openshift/api/security/v1/generated.proto b/vendor/github.com/openshift/api/security/v1/generated.proto
index 84cecdcb61..fdb879ce0d 100644
--- a/vendor/github.com/openshift/api/security/v1/generated.proto
+++ b/vendor/github.com/openshift/api/security/v1/generated.proto
@@ -46,7 +46,7 @@ message IDRange {
message PodSecurityPolicyReview {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 3;
// spec is the PodSecurityPolicy to check.
optional PodSecurityPolicyReviewSpec spec = 1;
@@ -61,7 +61,7 @@ message PodSecurityPolicyReviewSpec {
// if serviceAccountNames is empty, unless the template.spec.serviceAccountName is empty,
// in which case "default" is used.
// If serviceAccountNames is specified, template.spec.serviceAccountName is ignored.
- optional k8s.io.api.core.v1.PodTemplateSpec template = 1;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 1;
// serviceAccountNames is an optional set of ServiceAccounts to run the check with.
// If serviceAccountNames is empty, the template.spec.serviceAccountName is used,
@@ -83,7 +83,7 @@ message PodSecurityPolicyReviewStatus {
message PodSecurityPolicySelfSubjectReview {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 3;
// spec defines specification the PodSecurityPolicySelfSubjectReview.
optional PodSecurityPolicySelfSubjectReviewSpec spec = 1;
@@ -95,7 +95,7 @@ message PodSecurityPolicySelfSubjectReview {
// PodSecurityPolicySelfSubjectReviewSpec contains specification for PodSecurityPolicySelfSubjectReview.
message PodSecurityPolicySelfSubjectReviewSpec {
// template is the PodTemplateSpec to check.
- optional k8s.io.api.core.v1.PodTemplateSpec template = 1;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 1;
}
// PodSecurityPolicySubjectReview checks whether a particular user/SA tuple can create the PodTemplateSpec.
@@ -105,7 +105,7 @@ message PodSecurityPolicySelfSubjectReviewSpec {
message PodSecurityPolicySubjectReview {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 3;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 3;
// spec defines specification for the PodSecurityPolicySubjectReview.
optional PodSecurityPolicySubjectReviewSpec spec = 1;
@@ -118,7 +118,7 @@ message PodSecurityPolicySubjectReview {
message PodSecurityPolicySubjectReviewSpec {
// template is the PodTemplateSpec to check. If template.spec.serviceAccountName is empty it will not be defaulted.
// If its non-empty, it will be checked.
- optional k8s.io.api.core.v1.PodTemplateSpec template = 1;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 1;
// user is the user you're testing for.
// If you specify "user" but not "group", then is it interpreted as "What if user were not a member of any groups.
@@ -134,7 +134,7 @@ message PodSecurityPolicySubjectReviewStatus {
// allowedBy is a reference to the rule that allows the PodTemplateSpec.
// A rule can be a SecurityContextConstraint or a PodSecurityPolicy
// A `nil`, indicates that it was denied.
- optional k8s.io.api.core.v1.ObjectReference allowedBy = 1;
+ optional .k8s.io.api.core.v1.ObjectReference allowedBy = 1;
// A machine-readable description of why this operation is in the
// "Failure" status. If this value is empty there
@@ -142,7 +142,7 @@ message PodSecurityPolicySubjectReviewStatus {
optional string reason = 2;
// template is the PodTemplateSpec after the defaulting is applied.
- optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
+ optional .k8s.io.api.core.v1.PodTemplateSpec template = 3;
}
// RangeAllocation is used so we can easily expose a RangeAllocation typed for security group
@@ -152,7 +152,7 @@ message PodSecurityPolicySubjectReviewStatus {
message RangeAllocation {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// range is a string representing a unique label for a range of uids, "1000000000-2000000000/10000".
optional string range = 2;
@@ -169,7 +169,7 @@ message RangeAllocation {
message RangeAllocationList {
// metadata is the standard list's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of RangeAllocations.
repeated RangeAllocation items = 2;
@@ -197,7 +197,7 @@ message SELinuxContextStrategyOptions {
optional string type = 1;
// seLinuxOptions required to run as; required for MustRunAs
- optional k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 2;
+ optional .k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 2;
}
// SecurityContextConstraints governs the ability to make requests that affect the SecurityContext
@@ -227,7 +227,7 @@ message SELinuxContextStrategyOptions {
message SecurityContextConstraints {
// metadata is the standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Priority influences the sort order of SCCs when evaluating which SCCs to try first for
// a given pod request based on access in the Users and Groups fields. The higher the int, the
@@ -394,7 +394,7 @@ message SecurityContextConstraints {
message SecurityContextConstraintsList {
// metadata is the standard list's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
+ optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// List of security context constraints.
repeated SecurityContextConstraints items = 2;
diff --git a/vendor/github.com/openshift/api/security/v1/types.go b/vendor/github.com/openshift/api/security/v1/types.go
index 1b88f76fe5..9d0af5c8dd 100644
--- a/vendor/github.com/openshift/api/security/v1/types.go
+++ b/vendor/github.com/openshift/api/security/v1/types.go
@@ -216,6 +216,7 @@ var (
FSStorageOS FSType = "storageOS"
FSTypeCSI FSType = "csi"
FSTypeEphemeral FSType = "ephemeral"
+ FSTypeImage FSType = "image"
FSTypeAll FSType = "*"
FSTypeNone FSType = "none"
)
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/alibabacloudplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/alibabacloudplatformstatus.go
index d265d749c1..e763d14f6e 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/alibabacloudplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/alibabacloudplatformstatus.go
@@ -2,7 +2,7 @@
package v1
-// AlibabaCloudPlatformStatusApplyConfiguration represents an declarative configuration of the AlibabaCloudPlatformStatus type for use
+// AlibabaCloudPlatformStatusApplyConfiguration represents a declarative configuration of the AlibabaCloudPlatformStatus type for use
// with apply.
type AlibabaCloudPlatformStatusApplyConfiguration struct {
Region *string `json:"region,omitempty"`
@@ -10,7 +10,7 @@ type AlibabaCloudPlatformStatusApplyConfiguration struct {
ResourceTags []AlibabaCloudResourceTagApplyConfiguration `json:"resourceTags,omitempty"`
}
-// AlibabaCloudPlatformStatusApplyConfiguration constructs an declarative configuration of the AlibabaCloudPlatformStatus type for use with
+// AlibabaCloudPlatformStatusApplyConfiguration constructs a declarative configuration of the AlibabaCloudPlatformStatus type for use with
// apply.
func AlibabaCloudPlatformStatus() *AlibabaCloudPlatformStatusApplyConfiguration {
return &AlibabaCloudPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/alibabacloudresourcetag.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/alibabacloudresourcetag.go
index 7400289389..38fef6d50a 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/alibabacloudresourcetag.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/alibabacloudresourcetag.go
@@ -2,14 +2,14 @@
package v1
-// AlibabaCloudResourceTagApplyConfiguration represents an declarative configuration of the AlibabaCloudResourceTag type for use
+// AlibabaCloudResourceTagApplyConfiguration represents a declarative configuration of the AlibabaCloudResourceTag type for use
// with apply.
type AlibabaCloudResourceTagApplyConfiguration struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
}
-// AlibabaCloudResourceTagApplyConfiguration constructs an declarative configuration of the AlibabaCloudResourceTag type for use with
+// AlibabaCloudResourceTagApplyConfiguration constructs a declarative configuration of the AlibabaCloudResourceTag type for use with
// apply.
func AlibabaCloudResourceTag() *AlibabaCloudResourceTagApplyConfiguration {
return &AlibabaCloudResourceTagApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserver.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserver.go
index 582186356f..e10ae5c76f 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserver.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserver.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// APIServerApplyConfiguration represents an declarative configuration of the APIServer type for use
+// APIServerApplyConfiguration represents a declarative configuration of the APIServer type for use
// with apply.
type APIServerApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type APIServerApplyConfiguration struct {
Status *apiconfigv1.APIServerStatus `json:"status,omitempty"`
}
-// APIServer constructs an declarative configuration of the APIServer type for use with
+// APIServer constructs a declarative configuration of the APIServer type for use with
// apply.
func APIServer(name string) *APIServerApplyConfiguration {
b := &APIServerApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *APIServerApplyConfiguration) WithStatus(value apiconfigv1.APIServerStat
b.Status = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *APIServerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverencryption.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverencryption.go
index 7e5de50b59..a64f18bb4d 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverencryption.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverencryption.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// APIServerEncryptionApplyConfiguration represents an declarative configuration of the APIServerEncryption type for use
+// APIServerEncryptionApplyConfiguration represents a declarative configuration of the APIServerEncryption type for use
// with apply.
type APIServerEncryptionApplyConfiguration struct {
Type *v1.EncryptionType `json:"type,omitempty"`
}
-// APIServerEncryptionApplyConfiguration constructs an declarative configuration of the APIServerEncryption type for use with
+// APIServerEncryptionApplyConfiguration constructs a declarative configuration of the APIServerEncryption type for use with
// apply.
func APIServerEncryption() *APIServerEncryptionApplyConfiguration {
return &APIServerEncryptionApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiservernamedservingcert.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiservernamedservingcert.go
index b55943a41e..ae1f76215d 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiservernamedservingcert.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiservernamedservingcert.go
@@ -2,14 +2,14 @@
package v1
-// APIServerNamedServingCertApplyConfiguration represents an declarative configuration of the APIServerNamedServingCert type for use
+// APIServerNamedServingCertApplyConfiguration represents a declarative configuration of the APIServerNamedServingCert type for use
// with apply.
type APIServerNamedServingCertApplyConfiguration struct {
Names []string `json:"names,omitempty"`
ServingCertificate *SecretNameReferenceApplyConfiguration `json:"servingCertificate,omitempty"`
}
-// APIServerNamedServingCertApplyConfiguration constructs an declarative configuration of the APIServerNamedServingCert type for use with
+// APIServerNamedServingCertApplyConfiguration constructs a declarative configuration of the APIServerNamedServingCert type for use with
// apply.
func APIServerNamedServingCert() *APIServerNamedServingCertApplyConfiguration {
return &APIServerNamedServingCertApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverservingcerts.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverservingcerts.go
index 6a7084248c..963bea3053 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverservingcerts.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverservingcerts.go
@@ -2,13 +2,13 @@
package v1
-// APIServerServingCertsApplyConfiguration represents an declarative configuration of the APIServerServingCerts type for use
+// APIServerServingCertsApplyConfiguration represents a declarative configuration of the APIServerServingCerts type for use
// with apply.
type APIServerServingCertsApplyConfiguration struct {
NamedCertificates []APIServerNamedServingCertApplyConfiguration `json:"namedCertificates,omitempty"`
}
-// APIServerServingCertsApplyConfiguration constructs an declarative configuration of the APIServerServingCerts type for use with
+// APIServerServingCertsApplyConfiguration constructs a declarative configuration of the APIServerServingCerts type for use with
// apply.
func APIServerServingCerts() *APIServerServingCertsApplyConfiguration {
return &APIServerServingCertsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverspec.go
index 3e9eaeac05..58f4b0eece 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/apiserverspec.go
@@ -2,7 +2,7 @@
package v1
-// APIServerSpecApplyConfiguration represents an declarative configuration of the APIServerSpec type for use
+// APIServerSpecApplyConfiguration represents a declarative configuration of the APIServerSpec type for use
// with apply.
type APIServerSpecApplyConfiguration struct {
ServingCerts *APIServerServingCertsApplyConfiguration `json:"servingCerts,omitempty"`
@@ -13,7 +13,7 @@ type APIServerSpecApplyConfiguration struct {
Audit *AuditApplyConfiguration `json:"audit,omitempty"`
}
-// APIServerSpecApplyConfiguration constructs an declarative configuration of the APIServerSpec type for use with
+// APIServerSpecApplyConfiguration constructs a declarative configuration of the APIServerSpec type for use with
// apply.
func APIServerSpec() *APIServerSpecApplyConfiguration {
return &APIServerSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/audit.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/audit.go
index 8db029e26a..49b2e6c79f 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/audit.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/audit.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// AuditApplyConfiguration represents an declarative configuration of the Audit type for use
+// AuditApplyConfiguration represents a declarative configuration of the Audit type for use
// with apply.
type AuditApplyConfiguration struct {
Profile *v1.AuditProfileType `json:"profile,omitempty"`
CustomRules []AuditCustomRuleApplyConfiguration `json:"customRules,omitempty"`
}
-// AuditApplyConfiguration constructs an declarative configuration of the Audit type for use with
+// AuditApplyConfiguration constructs a declarative configuration of the Audit type for use with
// apply.
func Audit() *AuditApplyConfiguration {
return &AuditApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/auditcustomrule.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/auditcustomrule.go
index 80719443e4..838f3a22f0 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/auditcustomrule.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/auditcustomrule.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// AuditCustomRuleApplyConfiguration represents an declarative configuration of the AuditCustomRule type for use
+// AuditCustomRuleApplyConfiguration represents a declarative configuration of the AuditCustomRule type for use
// with apply.
type AuditCustomRuleApplyConfiguration struct {
Group *string `json:"group,omitempty"`
Profile *v1.AuditProfileType `json:"profile,omitempty"`
}
-// AuditCustomRuleApplyConfiguration constructs an declarative configuration of the AuditCustomRule type for use with
+// AuditCustomRuleApplyConfiguration constructs a declarative configuration of the AuditCustomRule type for use with
// apply.
func AuditCustomRule() *AuditCustomRuleApplyConfiguration {
return &AuditCustomRuleApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authentication.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authentication.go
index 5f55198562..b8fc3dfdfc 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authentication.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authentication.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// AuthenticationApplyConfiguration represents an declarative configuration of the Authentication type for use
+// AuthenticationApplyConfiguration represents a declarative configuration of the Authentication type for use
// with apply.
type AuthenticationApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type AuthenticationApplyConfiguration struct {
Status *AuthenticationStatusApplyConfiguration `json:"status,omitempty"`
}
-// Authentication constructs an declarative configuration of the Authentication type for use with
+// Authentication constructs a declarative configuration of the Authentication type for use with
// apply.
func Authentication(name string) *AuthenticationApplyConfiguration {
b := &AuthenticationApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *AuthenticationApplyConfiguration) WithStatus(value *AuthenticationStatu
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *AuthenticationApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authenticationspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authenticationspec.go
index f152d261a8..27cf2004f1 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authenticationspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authenticationspec.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// AuthenticationSpecApplyConfiguration represents an declarative configuration of the AuthenticationSpec type for use
+// AuthenticationSpecApplyConfiguration represents a declarative configuration of the AuthenticationSpec type for use
// with apply.
type AuthenticationSpecApplyConfiguration struct {
Type *v1.AuthenticationType `json:"type,omitempty"`
@@ -17,7 +17,7 @@ type AuthenticationSpecApplyConfiguration struct {
OIDCProviders []OIDCProviderApplyConfiguration `json:"oidcProviders,omitempty"`
}
-// AuthenticationSpecApplyConfiguration constructs an declarative configuration of the AuthenticationSpec type for use with
+// AuthenticationSpecApplyConfiguration constructs a declarative configuration of the AuthenticationSpec type for use with
// apply.
func AuthenticationSpec() *AuthenticationSpecApplyConfiguration {
return &AuthenticationSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authenticationstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authenticationstatus.go
index e1bb74c0c7..1539f164b4 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authenticationstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/authenticationstatus.go
@@ -2,14 +2,14 @@
package v1
-// AuthenticationStatusApplyConfiguration represents an declarative configuration of the AuthenticationStatus type for use
+// AuthenticationStatusApplyConfiguration represents a declarative configuration of the AuthenticationStatus type for use
// with apply.
type AuthenticationStatusApplyConfiguration struct {
IntegratedOAuthMetadata *ConfigMapNameReferenceApplyConfiguration `json:"integratedOAuthMetadata,omitempty"`
OIDCClients []OIDCClientStatusApplyConfiguration `json:"oidcClients,omitempty"`
}
-// AuthenticationStatusApplyConfiguration constructs an declarative configuration of the AuthenticationStatus type for use with
+// AuthenticationStatusApplyConfiguration constructs a declarative configuration of the AuthenticationStatus type for use with
// apply.
func AuthenticationStatus() *AuthenticationStatusApplyConfiguration {
return &AuthenticationStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsdnsspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsdnsspec.go
index 4f7ce43d14..8ad662e23c 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsdnsspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsdnsspec.go
@@ -2,13 +2,13 @@
package v1
-// AWSDNSSpecApplyConfiguration represents an declarative configuration of the AWSDNSSpec type for use
+// AWSDNSSpecApplyConfiguration represents a declarative configuration of the AWSDNSSpec type for use
// with apply.
type AWSDNSSpecApplyConfiguration struct {
PrivateZoneIAMRole *string `json:"privateZoneIAMRole,omitempty"`
}
-// AWSDNSSpecApplyConfiguration constructs an declarative configuration of the AWSDNSSpec type for use with
+// AWSDNSSpecApplyConfiguration constructs a declarative configuration of the AWSDNSSpec type for use with
// apply.
func AWSDNSSpec() *AWSDNSSpecApplyConfiguration {
return &AWSDNSSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsingressspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsingressspec.go
index 9a56b68baa..d7fe57934b 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsingressspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsingressspec.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// AWSIngressSpecApplyConfiguration represents an declarative configuration of the AWSIngressSpec type for use
+// AWSIngressSpecApplyConfiguration represents a declarative configuration of the AWSIngressSpec type for use
// with apply.
type AWSIngressSpecApplyConfiguration struct {
Type *v1.AWSLBType `json:"type,omitempty"`
}
-// AWSIngressSpecApplyConfiguration constructs an declarative configuration of the AWSIngressSpec type for use with
+// AWSIngressSpecApplyConfiguration constructs a declarative configuration of the AWSIngressSpec type for use with
// apply.
func AWSIngressSpec() *AWSIngressSpecApplyConfiguration {
return &AWSIngressSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsplatformspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsplatformspec.go
index b8132541f5..85361e7a2c 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsplatformspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsplatformspec.go
@@ -2,13 +2,13 @@
package v1
-// AWSPlatformSpecApplyConfiguration represents an declarative configuration of the AWSPlatformSpec type for use
+// AWSPlatformSpecApplyConfiguration represents a declarative configuration of the AWSPlatformSpec type for use
// with apply.
type AWSPlatformSpecApplyConfiguration struct {
ServiceEndpoints []AWSServiceEndpointApplyConfiguration `json:"serviceEndpoints,omitempty"`
}
-// AWSPlatformSpecApplyConfiguration constructs an declarative configuration of the AWSPlatformSpec type for use with
+// AWSPlatformSpecApplyConfiguration constructs a declarative configuration of the AWSPlatformSpec type for use with
// apply.
func AWSPlatformSpec() *AWSPlatformSpecApplyConfiguration {
return &AWSPlatformSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsplatformstatus.go
index fb317ba275..b217e5bdcd 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsplatformstatus.go
@@ -2,15 +2,16 @@
package v1
-// AWSPlatformStatusApplyConfiguration represents an declarative configuration of the AWSPlatformStatus type for use
+// AWSPlatformStatusApplyConfiguration represents a declarative configuration of the AWSPlatformStatus type for use
// with apply.
type AWSPlatformStatusApplyConfiguration struct {
- Region *string `json:"region,omitempty"`
- ServiceEndpoints []AWSServiceEndpointApplyConfiguration `json:"serviceEndpoints,omitempty"`
- ResourceTags []AWSResourceTagApplyConfiguration `json:"resourceTags,omitempty"`
+ Region *string `json:"region,omitempty"`
+ ServiceEndpoints []AWSServiceEndpointApplyConfiguration `json:"serviceEndpoints,omitempty"`
+ ResourceTags []AWSResourceTagApplyConfiguration `json:"resourceTags,omitempty"`
+ CloudLoadBalancerConfig *CloudLoadBalancerConfigApplyConfiguration `json:"cloudLoadBalancerConfig,omitempty"`
}
-// AWSPlatformStatusApplyConfiguration constructs an declarative configuration of the AWSPlatformStatus type for use with
+// AWSPlatformStatusApplyConfiguration constructs a declarative configuration of the AWSPlatformStatus type for use with
// apply.
func AWSPlatformStatus() *AWSPlatformStatusApplyConfiguration {
return &AWSPlatformStatusApplyConfiguration{}
@@ -49,3 +50,11 @@ func (b *AWSPlatformStatusApplyConfiguration) WithResourceTags(values ...*AWSRes
}
return b
}
+
+// WithCloudLoadBalancerConfig sets the CloudLoadBalancerConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CloudLoadBalancerConfig field is set to the value of the last call.
+func (b *AWSPlatformStatusApplyConfiguration) WithCloudLoadBalancerConfig(value *CloudLoadBalancerConfigApplyConfiguration) *AWSPlatformStatusApplyConfiguration {
+ b.CloudLoadBalancerConfig = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsresourcetag.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsresourcetag.go
index f9f174fc5b..766157a073 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsresourcetag.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsresourcetag.go
@@ -2,14 +2,14 @@
package v1
-// AWSResourceTagApplyConfiguration represents an declarative configuration of the AWSResourceTag type for use
+// AWSResourceTagApplyConfiguration represents a declarative configuration of the AWSResourceTag type for use
// with apply.
type AWSResourceTagApplyConfiguration struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
}
-// AWSResourceTagApplyConfiguration constructs an declarative configuration of the AWSResourceTag type for use with
+// AWSResourceTagApplyConfiguration constructs a declarative configuration of the AWSResourceTag type for use with
// apply.
func AWSResourceTag() *AWSResourceTagApplyConfiguration {
return &AWSResourceTagApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsserviceendpoint.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsserviceendpoint.go
index 169e4bb2a7..5d4f38882e 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsserviceendpoint.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsserviceendpoint.go
@@ -2,14 +2,14 @@
package v1
-// AWSServiceEndpointApplyConfiguration represents an declarative configuration of the AWSServiceEndpoint type for use
+// AWSServiceEndpointApplyConfiguration represents a declarative configuration of the AWSServiceEndpoint type for use
// with apply.
type AWSServiceEndpointApplyConfiguration struct {
Name *string `json:"name,omitempty"`
URL *string `json:"url,omitempty"`
}
-// AWSServiceEndpointApplyConfiguration constructs an declarative configuration of the AWSServiceEndpoint type for use with
+// AWSServiceEndpointApplyConfiguration constructs a declarative configuration of the AWSServiceEndpoint type for use with
// apply.
func AWSServiceEndpoint() *AWSServiceEndpointApplyConfiguration {
return &AWSServiceEndpointApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/azureplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/azureplatformstatus.go
index 52b291553c..4426747345 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/azureplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/azureplatformstatus.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// AzurePlatformStatusApplyConfiguration represents an declarative configuration of the AzurePlatformStatus type for use
+// AzurePlatformStatusApplyConfiguration represents a declarative configuration of the AzurePlatformStatus type for use
// with apply.
type AzurePlatformStatusApplyConfiguration struct {
ResourceGroupName *string `json:"resourceGroupName,omitempty"`
@@ -16,7 +16,7 @@ type AzurePlatformStatusApplyConfiguration struct {
ResourceTags []AzureResourceTagApplyConfiguration `json:"resourceTags,omitempty"`
}
-// AzurePlatformStatusApplyConfiguration constructs an declarative configuration of the AzurePlatformStatus type for use with
+// AzurePlatformStatusApplyConfiguration constructs a declarative configuration of the AzurePlatformStatus type for use with
// apply.
func AzurePlatformStatus() *AzurePlatformStatusApplyConfiguration {
return &AzurePlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/azureresourcetag.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/azureresourcetag.go
index f258f09876..980d2a1684 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/azureresourcetag.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/azureresourcetag.go
@@ -2,14 +2,14 @@
package v1
-// AzureResourceTagApplyConfiguration represents an declarative configuration of the AzureResourceTag type for use
+// AzureResourceTagApplyConfiguration represents a declarative configuration of the AzureResourceTag type for use
// with apply.
type AzureResourceTagApplyConfiguration struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
}
-// AzureResourceTagApplyConfiguration constructs an declarative configuration of the AzureResourceTag type for use with
+// AzureResourceTagApplyConfiguration constructs a declarative configuration of the AzureResourceTag type for use with
// apply.
func AzureResourceTag() *AzureResourceTagApplyConfiguration {
return &AzureResourceTagApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformloadbalancer.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformloadbalancer.go
index 7ff5dd99e7..a78284764a 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformloadbalancer.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformloadbalancer.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// BareMetalPlatformLoadBalancerApplyConfiguration represents an declarative configuration of the BareMetalPlatformLoadBalancer type for use
+// BareMetalPlatformLoadBalancerApplyConfiguration represents a declarative configuration of the BareMetalPlatformLoadBalancer type for use
// with apply.
type BareMetalPlatformLoadBalancerApplyConfiguration struct {
Type *v1.PlatformLoadBalancerType `json:"type,omitempty"`
}
-// BareMetalPlatformLoadBalancerApplyConfiguration constructs an declarative configuration of the BareMetalPlatformLoadBalancer type for use with
+// BareMetalPlatformLoadBalancerApplyConfiguration constructs a declarative configuration of the BareMetalPlatformLoadBalancer type for use with
// apply.
func BareMetalPlatformLoadBalancer() *BareMetalPlatformLoadBalancerApplyConfiguration {
return &BareMetalPlatformLoadBalancerApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformspec.go
index d96c5330b5..3140b55481 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformspec.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// BareMetalPlatformSpecApplyConfiguration represents an declarative configuration of the BareMetalPlatformSpec type for use
+// BareMetalPlatformSpecApplyConfiguration represents a declarative configuration of the BareMetalPlatformSpec type for use
// with apply.
type BareMetalPlatformSpecApplyConfiguration struct {
APIServerInternalIPs []v1.IP `json:"apiServerInternalIPs,omitempty"`
@@ -14,7 +14,7 @@ type BareMetalPlatformSpecApplyConfiguration struct {
MachineNetworks []v1.CIDR `json:"machineNetworks,omitempty"`
}
-// BareMetalPlatformSpecApplyConfiguration constructs an declarative configuration of the BareMetalPlatformSpec type for use with
+// BareMetalPlatformSpecApplyConfiguration constructs a declarative configuration of the BareMetalPlatformSpec type for use with
// apply.
func BareMetalPlatformSpec() *BareMetalPlatformSpecApplyConfiguration {
return &BareMetalPlatformSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformstatus.go
index 87873d49ad..55b875c7c4 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformstatus.go
@@ -6,7 +6,7 @@ import (
configv1 "github.com/openshift/api/config/v1"
)
-// BareMetalPlatformStatusApplyConfiguration represents an declarative configuration of the BareMetalPlatformStatus type for use
+// BareMetalPlatformStatusApplyConfiguration represents a declarative configuration of the BareMetalPlatformStatus type for use
// with apply.
type BareMetalPlatformStatusApplyConfiguration struct {
APIServerInternalIP *string `json:"apiServerInternalIP,omitempty"`
@@ -18,7 +18,7 @@ type BareMetalPlatformStatusApplyConfiguration struct {
MachineNetworks []configv1.CIDR `json:"machineNetworks,omitempty"`
}
-// BareMetalPlatformStatusApplyConfiguration constructs an declarative configuration of the BareMetalPlatformStatus type for use with
+// BareMetalPlatformStatusApplyConfiguration constructs a declarative configuration of the BareMetalPlatformStatus type for use with
// apply.
func BareMetalPlatformStatus() *BareMetalPlatformStatusApplyConfiguration {
return &BareMetalPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/basicauthidentityprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/basicauthidentityprovider.go
index 9d181ebde2..7cbd241d02 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/basicauthidentityprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/basicauthidentityprovider.go
@@ -2,13 +2,13 @@
package v1
-// BasicAuthIdentityProviderApplyConfiguration represents an declarative configuration of the BasicAuthIdentityProvider type for use
+// BasicAuthIdentityProviderApplyConfiguration represents a declarative configuration of the BasicAuthIdentityProvider type for use
// with apply.
type BasicAuthIdentityProviderApplyConfiguration struct {
OAuthRemoteConnectionInfoApplyConfiguration `json:",inline"`
}
-// BasicAuthIdentityProviderApplyConfiguration constructs an declarative configuration of the BasicAuthIdentityProvider type for use with
+// BasicAuthIdentityProviderApplyConfiguration constructs a declarative configuration of the BasicAuthIdentityProvider type for use with
// apply.
func BasicAuthIdentityProvider() *BasicAuthIdentityProviderApplyConfiguration {
return &BasicAuthIdentityProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/build.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/build.go
index 39100461aa..06aa12e0f0 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/build.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/build.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// BuildApplyConfiguration represents an declarative configuration of the Build type for use
+// BuildApplyConfiguration represents a declarative configuration of the Build type for use
// with apply.
type BuildApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -19,7 +19,7 @@ type BuildApplyConfiguration struct {
Spec *BuildSpecApplyConfiguration `json:"spec,omitempty"`
}
-// Build constructs an declarative configuration of the Build type for use with
+// Build constructs a declarative configuration of the Build type for use with
// apply.
func Build(name string) *BuildApplyConfiguration {
b := &BuildApplyConfiguration{}
@@ -229,3 +229,9 @@ func (b *BuildApplyConfiguration) WithSpec(value *BuildSpecApplyConfiguration) *
b.Spec = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *BuildApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/builddefaults.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/builddefaults.go
index 347906b3b0..ece9244191 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/builddefaults.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/builddefaults.go
@@ -6,7 +6,7 @@ import (
corev1 "k8s.io/api/core/v1"
)
-// BuildDefaultsApplyConfiguration represents an declarative configuration of the BuildDefaults type for use
+// BuildDefaultsApplyConfiguration represents a declarative configuration of the BuildDefaults type for use
// with apply.
type BuildDefaultsApplyConfiguration struct {
DefaultProxy *ProxySpecApplyConfiguration `json:"defaultProxy,omitempty"`
@@ -16,7 +16,7 @@ type BuildDefaultsApplyConfiguration struct {
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
}
-// BuildDefaultsApplyConfiguration constructs an declarative configuration of the BuildDefaults type for use with
+// BuildDefaultsApplyConfiguration constructs a declarative configuration of the BuildDefaults type for use with
// apply.
func BuildDefaults() *BuildDefaultsApplyConfiguration {
return &BuildDefaultsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/buildoverrides.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/buildoverrides.go
index 7ce64634ac..948bc9e8a2 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/buildoverrides.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/buildoverrides.go
@@ -6,7 +6,7 @@ import (
corev1 "k8s.io/api/core/v1"
)
-// BuildOverridesApplyConfiguration represents an declarative configuration of the BuildOverrides type for use
+// BuildOverridesApplyConfiguration represents a declarative configuration of the BuildOverrides type for use
// with apply.
type BuildOverridesApplyConfiguration struct {
ImageLabels []ImageLabelApplyConfiguration `json:"imageLabels,omitempty"`
@@ -15,7 +15,7 @@ type BuildOverridesApplyConfiguration struct {
ForcePull *bool `json:"forcePull,omitempty"`
}
-// BuildOverridesApplyConfiguration constructs an declarative configuration of the BuildOverrides type for use with
+// BuildOverridesApplyConfiguration constructs a declarative configuration of the BuildOverrides type for use with
// apply.
func BuildOverrides() *BuildOverridesApplyConfiguration {
return &BuildOverridesApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/buildspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/buildspec.go
index 521cef0e87..1b8cb7054e 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/buildspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/buildspec.go
@@ -2,7 +2,7 @@
package v1
-// BuildSpecApplyConfiguration represents an declarative configuration of the BuildSpec type for use
+// BuildSpecApplyConfiguration represents a declarative configuration of the BuildSpec type for use
// with apply.
type BuildSpecApplyConfiguration struct {
AdditionalTrustedCA *ConfigMapNameReferenceApplyConfiguration `json:"additionalTrustedCA,omitempty"`
@@ -10,7 +10,7 @@ type BuildSpecApplyConfiguration struct {
BuildOverrides *BuildOverridesApplyConfiguration `json:"buildOverrides,omitempty"`
}
-// BuildSpecApplyConfiguration constructs an declarative configuration of the BuildSpec type for use with
+// BuildSpecApplyConfiguration constructs a declarative configuration of the BuildSpec type for use with
// apply.
func BuildSpec() *BuildSpecApplyConfiguration {
return &BuildSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudcontrollermanagerstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudcontrollermanagerstatus.go
index 2d7a55a783..60bf4ed6b1 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudcontrollermanagerstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudcontrollermanagerstatus.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// CloudControllerManagerStatusApplyConfiguration represents an declarative configuration of the CloudControllerManagerStatus type for use
+// CloudControllerManagerStatusApplyConfiguration represents a declarative configuration of the CloudControllerManagerStatus type for use
// with apply.
type CloudControllerManagerStatusApplyConfiguration struct {
State *v1.CloudControllerManagerState `json:"state,omitempty"`
}
-// CloudControllerManagerStatusApplyConfiguration constructs an declarative configuration of the CloudControllerManagerStatus type for use with
+// CloudControllerManagerStatusApplyConfiguration constructs a declarative configuration of the CloudControllerManagerStatus type for use with
// apply.
func CloudControllerManagerStatus() *CloudControllerManagerStatusApplyConfiguration {
return &CloudControllerManagerStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudloadbalancerconfig.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudloadbalancerconfig.go
index c84f6c7765..5be77a3a33 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudloadbalancerconfig.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudloadbalancerconfig.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// CloudLoadBalancerConfigApplyConfiguration represents an declarative configuration of the CloudLoadBalancerConfig type for use
+// CloudLoadBalancerConfigApplyConfiguration represents a declarative configuration of the CloudLoadBalancerConfig type for use
// with apply.
type CloudLoadBalancerConfigApplyConfiguration struct {
DNSType *v1.DNSType `json:"dnsType,omitempty"`
ClusterHosted *CloudLoadBalancerIPsApplyConfiguration `json:"clusterHosted,omitempty"`
}
-// CloudLoadBalancerConfigApplyConfiguration constructs an declarative configuration of the CloudLoadBalancerConfig type for use with
+// CloudLoadBalancerConfigApplyConfiguration constructs a declarative configuration of the CloudLoadBalancerConfig type for use with
// apply.
func CloudLoadBalancerConfig() *CloudLoadBalancerConfigApplyConfiguration {
return &CloudLoadBalancerConfigApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudloadbalancerips.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudloadbalancerips.go
index 6480177fe2..baef188113 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudloadbalancerips.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudloadbalancerips.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// CloudLoadBalancerIPsApplyConfiguration represents an declarative configuration of the CloudLoadBalancerIPs type for use
+// CloudLoadBalancerIPsApplyConfiguration represents a declarative configuration of the CloudLoadBalancerIPs type for use
// with apply.
type CloudLoadBalancerIPsApplyConfiguration struct {
APIIntLoadBalancerIPs []v1.IP `json:"apiIntLoadBalancerIPs,omitempty"`
@@ -14,7 +14,7 @@ type CloudLoadBalancerIPsApplyConfiguration struct {
IngressLoadBalancerIPs []v1.IP `json:"ingressLoadBalancerIPs,omitempty"`
}
-// CloudLoadBalancerIPsApplyConfiguration constructs an declarative configuration of the CloudLoadBalancerIPs type for use with
+// CloudLoadBalancerIPsApplyConfiguration constructs a declarative configuration of the CloudLoadBalancerIPs type for use with
// apply.
func CloudLoadBalancerIPs() *CloudLoadBalancerIPsApplyConfiguration {
return &CloudLoadBalancerIPsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clustercondition.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clustercondition.go
index 145fa267a4..d71c182cf1 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clustercondition.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clustercondition.go
@@ -2,14 +2,14 @@
package v1
-// ClusterConditionApplyConfiguration represents an declarative configuration of the ClusterCondition type for use
+// ClusterConditionApplyConfiguration represents a declarative configuration of the ClusterCondition type for use
// with apply.
type ClusterConditionApplyConfiguration struct {
Type *string `json:"type,omitempty"`
PromQL *PromQLClusterConditionApplyConfiguration `json:"promql,omitempty"`
}
-// ClusterConditionApplyConfiguration constructs an declarative configuration of the ClusterCondition type for use with
+// ClusterConditionApplyConfiguration constructs a declarative configuration of the ClusterCondition type for use with
// apply.
func ClusterCondition() *ClusterConditionApplyConfiguration {
return &ClusterConditionApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusternetworkentry.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusternetworkentry.go
index fe03d3355d..ac180f893d 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusternetworkentry.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusternetworkentry.go
@@ -2,14 +2,14 @@
package v1
-// ClusterNetworkEntryApplyConfiguration represents an declarative configuration of the ClusterNetworkEntry type for use
+// ClusterNetworkEntryApplyConfiguration represents a declarative configuration of the ClusterNetworkEntry type for use
// with apply.
type ClusterNetworkEntryApplyConfiguration struct {
CIDR *string `json:"cidr,omitempty"`
HostPrefix *uint32 `json:"hostPrefix,omitempty"`
}
-// ClusterNetworkEntryApplyConfiguration constructs an declarative configuration of the ClusterNetworkEntry type for use with
+// ClusterNetworkEntryApplyConfiguration constructs a declarative configuration of the ClusterNetworkEntry type for use with
// apply.
func ClusterNetworkEntry() *ClusterNetworkEntryApplyConfiguration {
return &ClusterNetworkEntryApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperator.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperator.go
index ab83fa08df..6371179a80 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperator.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperator.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ClusterOperatorApplyConfiguration represents an declarative configuration of the ClusterOperator type for use
+// ClusterOperatorApplyConfiguration represents a declarative configuration of the ClusterOperator type for use
// with apply.
type ClusterOperatorApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ClusterOperatorApplyConfiguration struct {
Status *ClusterOperatorStatusApplyConfiguration `json:"status,omitempty"`
}
-// ClusterOperator constructs an declarative configuration of the ClusterOperator type for use with
+// ClusterOperator constructs a declarative configuration of the ClusterOperator type for use with
// apply.
func ClusterOperator(name string) *ClusterOperatorApplyConfiguration {
b := &ClusterOperatorApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *ClusterOperatorApplyConfiguration) WithStatus(value *ClusterOperatorSta
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ClusterOperatorApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperatorstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperatorstatus.go
index 3fac7d9b6e..d5a1989655 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperatorstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperatorstatus.go
@@ -6,7 +6,7 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
-// ClusterOperatorStatusApplyConfiguration represents an declarative configuration of the ClusterOperatorStatus type for use
+// ClusterOperatorStatusApplyConfiguration represents a declarative configuration of the ClusterOperatorStatus type for use
// with apply.
type ClusterOperatorStatusApplyConfiguration struct {
Conditions []ClusterOperatorStatusConditionApplyConfiguration `json:"conditions,omitempty"`
@@ -15,7 +15,7 @@ type ClusterOperatorStatusApplyConfiguration struct {
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
-// ClusterOperatorStatusApplyConfiguration constructs an declarative configuration of the ClusterOperatorStatus type for use with
+// ClusterOperatorStatusApplyConfiguration constructs a declarative configuration of the ClusterOperatorStatus type for use with
// apply.
func ClusterOperatorStatus() *ClusterOperatorStatusApplyConfiguration {
return &ClusterOperatorStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperatorstatuscondition.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperatorstatuscondition.go
index 5e52013c8d..557f75d2e4 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperatorstatuscondition.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusteroperatorstatuscondition.go
@@ -7,7 +7,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// ClusterOperatorStatusConditionApplyConfiguration represents an declarative configuration of the ClusterOperatorStatusCondition type for use
+// ClusterOperatorStatusConditionApplyConfiguration represents a declarative configuration of the ClusterOperatorStatusCondition type for use
// with apply.
type ClusterOperatorStatusConditionApplyConfiguration struct {
Type *v1.ClusterStatusConditionType `json:"type,omitempty"`
@@ -17,7 +17,7 @@ type ClusterOperatorStatusConditionApplyConfiguration struct {
Message *string `json:"message,omitempty"`
}
-// ClusterOperatorStatusConditionApplyConfiguration constructs an declarative configuration of the ClusterOperatorStatusCondition type for use with
+// ClusterOperatorStatusConditionApplyConfiguration constructs a declarative configuration of the ClusterOperatorStatusCondition type for use with
// apply.
func ClusterOperatorStatusCondition() *ClusterOperatorStatusConditionApplyConfiguration {
return &ClusterOperatorStatusConditionApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversion.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversion.go
index 24d5e143c6..52f2e5cb88 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversion.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversion.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ClusterVersionApplyConfiguration represents an declarative configuration of the ClusterVersion type for use
+// ClusterVersionApplyConfiguration represents a declarative configuration of the ClusterVersion type for use
// with apply.
type ClusterVersionApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ClusterVersionApplyConfiguration struct {
Status *ClusterVersionStatusApplyConfiguration `json:"status,omitempty"`
}
-// ClusterVersion constructs an declarative configuration of the ClusterVersion type for use with
+// ClusterVersion constructs a declarative configuration of the ClusterVersion type for use with
// apply.
func ClusterVersion(name string) *ClusterVersionApplyConfiguration {
b := &ClusterVersionApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *ClusterVersionApplyConfiguration) WithStatus(value *ClusterVersionStatu
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ClusterVersionApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversioncapabilitiesspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversioncapabilitiesspec.go
index b4a28f1b24..254eb00e9d 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversioncapabilitiesspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversioncapabilitiesspec.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// ClusterVersionCapabilitiesSpecApplyConfiguration represents an declarative configuration of the ClusterVersionCapabilitiesSpec type for use
+// ClusterVersionCapabilitiesSpecApplyConfiguration represents a declarative configuration of the ClusterVersionCapabilitiesSpec type for use
// with apply.
type ClusterVersionCapabilitiesSpecApplyConfiguration struct {
BaselineCapabilitySet *v1.ClusterVersionCapabilitySet `json:"baselineCapabilitySet,omitempty"`
AdditionalEnabledCapabilities []v1.ClusterVersionCapability `json:"additionalEnabledCapabilities,omitempty"`
}
-// ClusterVersionCapabilitiesSpecApplyConfiguration constructs an declarative configuration of the ClusterVersionCapabilitiesSpec type for use with
+// ClusterVersionCapabilitiesSpecApplyConfiguration constructs a declarative configuration of the ClusterVersionCapabilitiesSpec type for use with
// apply.
func ClusterVersionCapabilitiesSpec() *ClusterVersionCapabilitiesSpecApplyConfiguration {
return &ClusterVersionCapabilitiesSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversioncapabilitiesstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversioncapabilitiesstatus.go
index 48c4363f11..05350241f1 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversioncapabilitiesstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversioncapabilitiesstatus.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// ClusterVersionCapabilitiesStatusApplyConfiguration represents an declarative configuration of the ClusterVersionCapabilitiesStatus type for use
+// ClusterVersionCapabilitiesStatusApplyConfiguration represents a declarative configuration of the ClusterVersionCapabilitiesStatus type for use
// with apply.
type ClusterVersionCapabilitiesStatusApplyConfiguration struct {
EnabledCapabilities []v1.ClusterVersionCapability `json:"enabledCapabilities,omitempty"`
KnownCapabilities []v1.ClusterVersionCapability `json:"knownCapabilities,omitempty"`
}
-// ClusterVersionCapabilitiesStatusApplyConfiguration constructs an declarative configuration of the ClusterVersionCapabilitiesStatus type for use with
+// ClusterVersionCapabilitiesStatusApplyConfiguration constructs a declarative configuration of the ClusterVersionCapabilitiesStatus type for use with
// apply.
func ClusterVersionCapabilitiesStatus() *ClusterVersionCapabilitiesStatusApplyConfiguration {
return &ClusterVersionCapabilitiesStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionspec.go
index e1fd4d37d0..b440c613b5 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionspec.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// ClusterVersionSpecApplyConfiguration represents an declarative configuration of the ClusterVersionSpec type for use
+// ClusterVersionSpecApplyConfiguration represents a declarative configuration of the ClusterVersionSpec type for use
// with apply.
type ClusterVersionSpecApplyConfiguration struct {
ClusterID *v1.ClusterID `json:"clusterID,omitempty"`
@@ -18,7 +18,7 @@ type ClusterVersionSpecApplyConfiguration struct {
Overrides []ComponentOverrideApplyConfiguration `json:"overrides,omitempty"`
}
-// ClusterVersionSpecApplyConfiguration constructs an declarative configuration of the ClusterVersionSpec type for use with
+// ClusterVersionSpecApplyConfiguration constructs a declarative configuration of the ClusterVersionSpec type for use with
// apply.
func ClusterVersionSpec() *ClusterVersionSpecApplyConfiguration {
return &ClusterVersionSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionstatus.go
index 3e9f450949..e966cf4242 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionstatus.go
@@ -2,7 +2,7 @@
package v1
-// ClusterVersionStatusApplyConfiguration represents an declarative configuration of the ClusterVersionStatus type for use
+// ClusterVersionStatusApplyConfiguration represents a declarative configuration of the ClusterVersionStatus type for use
// with apply.
type ClusterVersionStatusApplyConfiguration struct {
Desired *ReleaseApplyConfiguration `json:"desired,omitempty"`
@@ -15,7 +15,7 @@ type ClusterVersionStatusApplyConfiguration struct {
ConditionalUpdates []ConditionalUpdateApplyConfiguration `json:"conditionalUpdates,omitempty"`
}
-// ClusterVersionStatusApplyConfiguration constructs an declarative configuration of the ClusterVersionStatus type for use with
+// ClusterVersionStatusApplyConfiguration constructs a declarative configuration of the ClusterVersionStatus type for use with
// apply.
func ClusterVersionStatus() *ClusterVersionStatusApplyConfiguration {
return &ClusterVersionStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentoverride.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentoverride.go
index 8467acef42..e87332d896 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentoverride.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentoverride.go
@@ -2,7 +2,7 @@
package v1
-// ComponentOverrideApplyConfiguration represents an declarative configuration of the ComponentOverride type for use
+// ComponentOverrideApplyConfiguration represents a declarative configuration of the ComponentOverride type for use
// with apply.
type ComponentOverrideApplyConfiguration struct {
Kind *string `json:"kind,omitempty"`
@@ -12,7 +12,7 @@ type ComponentOverrideApplyConfiguration struct {
Unmanaged *bool `json:"unmanaged,omitempty"`
}
-// ComponentOverrideApplyConfiguration constructs an declarative configuration of the ComponentOverride type for use with
+// ComponentOverrideApplyConfiguration constructs a declarative configuration of the ComponentOverride type for use with
// apply.
func ComponentOverride() *ComponentOverrideApplyConfiguration {
return &ComponentOverrideApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentroutespec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentroutespec.go
index 8e5973d91a..f8a2c5e518 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentroutespec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentroutespec.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// ComponentRouteSpecApplyConfiguration represents an declarative configuration of the ComponentRouteSpec type for use
+// ComponentRouteSpecApplyConfiguration represents a declarative configuration of the ComponentRouteSpec type for use
// with apply.
type ComponentRouteSpecApplyConfiguration struct {
Namespace *string `json:"namespace,omitempty"`
@@ -15,7 +15,7 @@ type ComponentRouteSpecApplyConfiguration struct {
ServingCertKeyPairSecret *SecretNameReferenceApplyConfiguration `json:"servingCertKeyPairSecret,omitempty"`
}
-// ComponentRouteSpecApplyConfiguration constructs an declarative configuration of the ComponentRouteSpec type for use with
+// ComponentRouteSpecApplyConfiguration constructs a declarative configuration of the ComponentRouteSpec type for use with
// apply.
func ComponentRouteSpec() *ComponentRouteSpecApplyConfiguration {
return &ComponentRouteSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentroutestatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentroutestatus.go
index a26e24bd8f..abf378c84c 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentroutestatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/componentroutestatus.go
@@ -7,7 +7,7 @@ import (
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ComponentRouteStatusApplyConfiguration represents an declarative configuration of the ComponentRouteStatus type for use
+// ComponentRouteStatusApplyConfiguration represents a declarative configuration of the ComponentRouteStatus type for use
// with apply.
type ComponentRouteStatusApplyConfiguration struct {
Namespace *string `json:"namespace,omitempty"`
@@ -19,7 +19,7 @@ type ComponentRouteStatusApplyConfiguration struct {
RelatedObjects []ObjectReferenceApplyConfiguration `json:"relatedObjects,omitempty"`
}
-// ComponentRouteStatusApplyConfiguration constructs an declarative configuration of the ComponentRouteStatus type for use with
+// ComponentRouteStatusApplyConfiguration constructs a declarative configuration of the ComponentRouteStatus type for use with
// apply.
func ComponentRouteStatus() *ComponentRouteStatusApplyConfiguration {
return &ComponentRouteStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdate.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdate.go
index e6b9c27f24..f183fc6e25 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdate.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdate.go
@@ -6,7 +6,7 @@ import (
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ConditionalUpdateApplyConfiguration represents an declarative configuration of the ConditionalUpdate type for use
+// ConditionalUpdateApplyConfiguration represents a declarative configuration of the ConditionalUpdate type for use
// with apply.
type ConditionalUpdateApplyConfiguration struct {
Release *ReleaseApplyConfiguration `json:"release,omitempty"`
@@ -14,7 +14,7 @@ type ConditionalUpdateApplyConfiguration struct {
Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}
-// ConditionalUpdateApplyConfiguration constructs an declarative configuration of the ConditionalUpdate type for use with
+// ConditionalUpdateApplyConfiguration constructs a declarative configuration of the ConditionalUpdate type for use with
// apply.
func ConditionalUpdate() *ConditionalUpdateApplyConfiguration {
return &ConditionalUpdateApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdaterisk.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdaterisk.go
index 49ff03f59f..6debb6e624 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdaterisk.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdaterisk.go
@@ -2,7 +2,7 @@
package v1
-// ConditionalUpdateRiskApplyConfiguration represents an declarative configuration of the ConditionalUpdateRisk type for use
+// ConditionalUpdateRiskApplyConfiguration represents a declarative configuration of the ConditionalUpdateRisk type for use
// with apply.
type ConditionalUpdateRiskApplyConfiguration struct {
URL *string `json:"url,omitempty"`
@@ -11,7 +11,7 @@ type ConditionalUpdateRiskApplyConfiguration struct {
MatchingRules []ClusterConditionApplyConfiguration `json:"matchingRules,omitempty"`
}
-// ConditionalUpdateRiskApplyConfiguration constructs an declarative configuration of the ConditionalUpdateRisk type for use with
+// ConditionalUpdateRiskApplyConfiguration constructs a declarative configuration of the ConditionalUpdateRisk type for use with
// apply.
func ConditionalUpdateRisk() *ConditionalUpdateRiskApplyConfiguration {
return &ConditionalUpdateRiskApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/configmapfilereference.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/configmapfilereference.go
index 4f03bf8b1c..3c70be2c1e 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/configmapfilereference.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/configmapfilereference.go
@@ -2,14 +2,14 @@
package v1
-// ConfigMapFileReferenceApplyConfiguration represents an declarative configuration of the ConfigMapFileReference type for use
+// ConfigMapFileReferenceApplyConfiguration represents a declarative configuration of the ConfigMapFileReference type for use
// with apply.
type ConfigMapFileReferenceApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Key *string `json:"key,omitempty"`
}
-// ConfigMapFileReferenceApplyConfiguration constructs an declarative configuration of the ConfigMapFileReference type for use with
+// ConfigMapFileReferenceApplyConfiguration constructs a declarative configuration of the ConfigMapFileReference type for use with
// apply.
func ConfigMapFileReference() *ConfigMapFileReferenceApplyConfiguration {
return &ConfigMapFileReferenceApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/configmapnamereference.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/configmapnamereference.go
index b85607ef46..8236ba1233 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/configmapnamereference.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/configmapnamereference.go
@@ -2,13 +2,13 @@
package v1
-// ConfigMapNameReferenceApplyConfiguration represents an declarative configuration of the ConfigMapNameReference type for use
+// ConfigMapNameReferenceApplyConfiguration represents a declarative configuration of the ConfigMapNameReference type for use
// with apply.
type ConfigMapNameReferenceApplyConfiguration struct {
Name *string `json:"name,omitempty"`
}
-// ConfigMapNameReferenceApplyConfiguration constructs an declarative configuration of the ConfigMapNameReference type for use with
+// ConfigMapNameReferenceApplyConfiguration constructs a declarative configuration of the ConfigMapNameReference type for use with
// apply.
func ConfigMapNameReference() *ConfigMapNameReferenceApplyConfiguration {
return &ConfigMapNameReferenceApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/console.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/console.go
index 64188c220c..58bf394da8 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/console.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/console.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ConsoleApplyConfiguration represents an declarative configuration of the Console type for use
+// ConsoleApplyConfiguration represents a declarative configuration of the Console type for use
// with apply.
type ConsoleApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ConsoleApplyConfiguration struct {
Status *ConsoleStatusApplyConfiguration `json:"status,omitempty"`
}
-// Console constructs an declarative configuration of the Console type for use with
+// Console constructs a declarative configuration of the Console type for use with
// apply.
func Console(name string) *ConsoleApplyConfiguration {
b := &ConsoleApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *ConsoleApplyConfiguration) WithStatus(value *ConsoleStatusApplyConfigur
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ConsoleApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consoleauthentication.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consoleauthentication.go
index 5c352fb026..cdc3aa7320 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consoleauthentication.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consoleauthentication.go
@@ -2,13 +2,13 @@
package v1
-// ConsoleAuthenticationApplyConfiguration represents an declarative configuration of the ConsoleAuthentication type for use
+// ConsoleAuthenticationApplyConfiguration represents a declarative configuration of the ConsoleAuthentication type for use
// with apply.
type ConsoleAuthenticationApplyConfiguration struct {
LogoutRedirect *string `json:"logoutRedirect,omitempty"`
}
-// ConsoleAuthenticationApplyConfiguration constructs an declarative configuration of the ConsoleAuthentication type for use with
+// ConsoleAuthenticationApplyConfiguration constructs a declarative configuration of the ConsoleAuthentication type for use with
// apply.
func ConsoleAuthentication() *ConsoleAuthenticationApplyConfiguration {
return &ConsoleAuthenticationApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consolespec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consolespec.go
index ba76971068..0ce163b2bb 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consolespec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consolespec.go
@@ -2,13 +2,13 @@
package v1
-// ConsoleSpecApplyConfiguration represents an declarative configuration of the ConsoleSpec type for use
+// ConsoleSpecApplyConfiguration represents a declarative configuration of the ConsoleSpec type for use
// with apply.
type ConsoleSpecApplyConfiguration struct {
Authentication *ConsoleAuthenticationApplyConfiguration `json:"authentication,omitempty"`
}
-// ConsoleSpecApplyConfiguration constructs an declarative configuration of the ConsoleSpec type for use with
+// ConsoleSpecApplyConfiguration constructs a declarative configuration of the ConsoleSpec type for use with
// apply.
func ConsoleSpec() *ConsoleSpecApplyConfiguration {
return &ConsoleSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consolestatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consolestatus.go
index 33e04b37a3..f1336def37 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consolestatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/consolestatus.go
@@ -2,13 +2,13 @@
package v1
-// ConsoleStatusApplyConfiguration represents an declarative configuration of the ConsoleStatus type for use
+// ConsoleStatusApplyConfiguration represents a declarative configuration of the ConsoleStatus type for use
// with apply.
type ConsoleStatusApplyConfiguration struct {
ConsoleURL *string `json:"consoleURL,omitempty"`
}
-// ConsoleStatusApplyConfiguration constructs an declarative configuration of the ConsoleStatus type for use with
+// ConsoleStatusApplyConfiguration constructs a declarative configuration of the ConsoleStatus type for use with
// apply.
func ConsoleStatus() *ConsoleStatusApplyConfiguration {
return &ConsoleStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/customfeaturegates.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/customfeaturegates.go
index 0ce419b288..a0a6482879 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/customfeaturegates.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/customfeaturegates.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// CustomFeatureGatesApplyConfiguration represents an declarative configuration of the CustomFeatureGates type for use
+// CustomFeatureGatesApplyConfiguration represents a declarative configuration of the CustomFeatureGates type for use
// with apply.
type CustomFeatureGatesApplyConfiguration struct {
Enabled []v1.FeatureGateName `json:"enabled,omitempty"`
Disabled []v1.FeatureGateName `json:"disabled,omitempty"`
}
-// CustomFeatureGatesApplyConfiguration constructs an declarative configuration of the CustomFeatureGates type for use with
+// CustomFeatureGatesApplyConfiguration constructs a declarative configuration of the CustomFeatureGates type for use with
// apply.
func CustomFeatureGates() *CustomFeatureGatesApplyConfiguration {
return &CustomFeatureGatesApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/customtlsprofile.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/customtlsprofile.go
index cea54d882a..f323e11b15 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/customtlsprofile.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/customtlsprofile.go
@@ -6,13 +6,13 @@ import (
configv1 "github.com/openshift/api/config/v1"
)
-// CustomTLSProfileApplyConfiguration represents an declarative configuration of the CustomTLSProfile type for use
+// CustomTLSProfileApplyConfiguration represents a declarative configuration of the CustomTLSProfile type for use
// with apply.
type CustomTLSProfileApplyConfiguration struct {
TLSProfileSpecApplyConfiguration `json:",inline"`
}
-// CustomTLSProfileApplyConfiguration constructs an declarative configuration of the CustomTLSProfile type for use with
+// CustomTLSProfileApplyConfiguration constructs a declarative configuration of the CustomTLSProfile type for use with
// apply.
func CustomTLSProfile() *CustomTLSProfileApplyConfiguration {
return &CustomTLSProfileApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/deprecatedwebhooktokenauthenticator.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/deprecatedwebhooktokenauthenticator.go
index bb312e756a..20742aec97 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/deprecatedwebhooktokenauthenticator.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/deprecatedwebhooktokenauthenticator.go
@@ -2,13 +2,13 @@
package v1
-// DeprecatedWebhookTokenAuthenticatorApplyConfiguration represents an declarative configuration of the DeprecatedWebhookTokenAuthenticator type for use
+// DeprecatedWebhookTokenAuthenticatorApplyConfiguration represents a declarative configuration of the DeprecatedWebhookTokenAuthenticator type for use
// with apply.
type DeprecatedWebhookTokenAuthenticatorApplyConfiguration struct {
KubeConfig *SecretNameReferenceApplyConfiguration `json:"kubeConfig,omitempty"`
}
-// DeprecatedWebhookTokenAuthenticatorApplyConfiguration constructs an declarative configuration of the DeprecatedWebhookTokenAuthenticator type for use with
+// DeprecatedWebhookTokenAuthenticatorApplyConfiguration constructs a declarative configuration of the DeprecatedWebhookTokenAuthenticator type for use with
// apply.
func DeprecatedWebhookTokenAuthenticator() *DeprecatedWebhookTokenAuthenticatorApplyConfiguration {
return &DeprecatedWebhookTokenAuthenticatorApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dns.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dns.go
index 2567ddf02a..b01e456f5a 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dns.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dns.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// DNSApplyConfiguration represents an declarative configuration of the DNS type for use
+// DNSApplyConfiguration represents a declarative configuration of the DNS type for use
// with apply.
type DNSApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type DNSApplyConfiguration struct {
Status *apiconfigv1.DNSStatus `json:"status,omitempty"`
}
-// DNS constructs an declarative configuration of the DNS type for use with
+// DNS constructs a declarative configuration of the DNS type for use with
// apply.
func DNS(name string) *DNSApplyConfiguration {
b := &DNSApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *DNSApplyConfiguration) WithStatus(value apiconfigv1.DNSStatus) *DNSAppl
b.Status = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *DNSApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnsplatformspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnsplatformspec.go
index 8f43c8c5f8..fc15db1ef1 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnsplatformspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnsplatformspec.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// DNSPlatformSpecApplyConfiguration represents an declarative configuration of the DNSPlatformSpec type for use
+// DNSPlatformSpecApplyConfiguration represents a declarative configuration of the DNSPlatformSpec type for use
// with apply.
type DNSPlatformSpecApplyConfiguration struct {
Type *v1.PlatformType `json:"type,omitempty"`
AWS *AWSDNSSpecApplyConfiguration `json:"aws,omitempty"`
}
-// DNSPlatformSpecApplyConfiguration constructs an declarative configuration of the DNSPlatformSpec type for use with
+// DNSPlatformSpecApplyConfiguration constructs a declarative configuration of the DNSPlatformSpec type for use with
// apply.
func DNSPlatformSpec() *DNSPlatformSpecApplyConfiguration {
return &DNSPlatformSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnsspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnsspec.go
index b534ef9435..fbc8b60e71 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnsspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnsspec.go
@@ -2,7 +2,7 @@
package v1
-// DNSSpecApplyConfiguration represents an declarative configuration of the DNSSpec type for use
+// DNSSpecApplyConfiguration represents a declarative configuration of the DNSSpec type for use
// with apply.
type DNSSpecApplyConfiguration struct {
BaseDomain *string `json:"baseDomain,omitempty"`
@@ -11,7 +11,7 @@ type DNSSpecApplyConfiguration struct {
Platform *DNSPlatformSpecApplyConfiguration `json:"platform,omitempty"`
}
-// DNSSpecApplyConfiguration constructs an declarative configuration of the DNSSpec type for use with
+// DNSSpecApplyConfiguration constructs a declarative configuration of the DNSSpec type for use with
// apply.
func DNSSpec() *DNSSpecApplyConfiguration {
return &DNSSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnszone.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnszone.go
index 63b8d1fcc2..39ef2776e5 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnszone.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/dnszone.go
@@ -2,14 +2,14 @@
package v1
-// DNSZoneApplyConfiguration represents an declarative configuration of the DNSZone type for use
+// DNSZoneApplyConfiguration represents a declarative configuration of the DNSZone type for use
// with apply.
type DNSZoneApplyConfiguration struct {
ID *string `json:"id,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
}
-// DNSZoneApplyConfiguration constructs an declarative configuration of the DNSZone type for use with
+// DNSZoneApplyConfiguration constructs a declarative configuration of the DNSZone type for use with
// apply.
func DNSZone() *DNSZoneApplyConfiguration {
return &DNSZoneApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/equinixmetalplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/equinixmetalplatformstatus.go
index 2dbb3c386d..8e17df603f 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/equinixmetalplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/equinixmetalplatformstatus.go
@@ -2,14 +2,14 @@
package v1
-// EquinixMetalPlatformStatusApplyConfiguration represents an declarative configuration of the EquinixMetalPlatformStatus type for use
+// EquinixMetalPlatformStatusApplyConfiguration represents a declarative configuration of the EquinixMetalPlatformStatus type for use
// with apply.
type EquinixMetalPlatformStatusApplyConfiguration struct {
APIServerInternalIP *string `json:"apiServerInternalIP,omitempty"`
IngressIP *string `json:"ingressIP,omitempty"`
}
-// EquinixMetalPlatformStatusApplyConfiguration constructs an declarative configuration of the EquinixMetalPlatformStatus type for use with
+// EquinixMetalPlatformStatusApplyConfiguration constructs a declarative configuration of the EquinixMetalPlatformStatus type for use with
// apply.
func EquinixMetalPlatformStatus() *EquinixMetalPlatformStatusApplyConfiguration {
return &EquinixMetalPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalipconfig.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalipconfig.go
index d9eb037ad0..d3b9c17466 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalipconfig.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalipconfig.go
@@ -2,14 +2,14 @@
package v1
-// ExternalIPConfigApplyConfiguration represents an declarative configuration of the ExternalIPConfig type for use
+// ExternalIPConfigApplyConfiguration represents a declarative configuration of the ExternalIPConfig type for use
// with apply.
type ExternalIPConfigApplyConfiguration struct {
Policy *ExternalIPPolicyApplyConfiguration `json:"policy,omitempty"`
AutoAssignCIDRs []string `json:"autoAssignCIDRs,omitempty"`
}
-// ExternalIPConfigApplyConfiguration constructs an declarative configuration of the ExternalIPConfig type for use with
+// ExternalIPConfigApplyConfiguration constructs a declarative configuration of the ExternalIPConfig type for use with
// apply.
func ExternalIPConfig() *ExternalIPConfigApplyConfiguration {
return &ExternalIPConfigApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalippolicy.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalippolicy.go
index c368ffac83..269d934b90 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalippolicy.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalippolicy.go
@@ -2,14 +2,14 @@
package v1
-// ExternalIPPolicyApplyConfiguration represents an declarative configuration of the ExternalIPPolicy type for use
+// ExternalIPPolicyApplyConfiguration represents a declarative configuration of the ExternalIPPolicy type for use
// with apply.
type ExternalIPPolicyApplyConfiguration struct {
AllowedCIDRs []string `json:"allowedCIDRs,omitempty"`
RejectedCIDRs []string `json:"rejectedCIDRs,omitempty"`
}
-// ExternalIPPolicyApplyConfiguration constructs an declarative configuration of the ExternalIPPolicy type for use with
+// ExternalIPPolicyApplyConfiguration constructs a declarative configuration of the ExternalIPPolicy type for use with
// apply.
func ExternalIPPolicy() *ExternalIPPolicyApplyConfiguration {
return &ExternalIPPolicyApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalplatformspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalplatformspec.go
index e9d5ccae54..d7640e1429 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalplatformspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalplatformspec.go
@@ -2,13 +2,13 @@
package v1
-// ExternalPlatformSpecApplyConfiguration represents an declarative configuration of the ExternalPlatformSpec type for use
+// ExternalPlatformSpecApplyConfiguration represents a declarative configuration of the ExternalPlatformSpec type for use
// with apply.
type ExternalPlatformSpecApplyConfiguration struct {
PlatformName *string `json:"platformName,omitempty"`
}
-// ExternalPlatformSpecApplyConfiguration constructs an declarative configuration of the ExternalPlatformSpec type for use with
+// ExternalPlatformSpecApplyConfiguration constructs a declarative configuration of the ExternalPlatformSpec type for use with
// apply.
func ExternalPlatformSpec() *ExternalPlatformSpecApplyConfiguration {
return &ExternalPlatformSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalplatformstatus.go
index 12e246227a..65f8f2b109 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalplatformstatus.go
@@ -2,13 +2,13 @@
package v1
-// ExternalPlatformStatusApplyConfiguration represents an declarative configuration of the ExternalPlatformStatus type for use
+// ExternalPlatformStatusApplyConfiguration represents a declarative configuration of the ExternalPlatformStatus type for use
// with apply.
type ExternalPlatformStatusApplyConfiguration struct {
CloudControllerManager *CloudControllerManagerStatusApplyConfiguration `json:"cloudControllerManager,omitempty"`
}
-// ExternalPlatformStatusApplyConfiguration constructs an declarative configuration of the ExternalPlatformStatus type for use with
+// ExternalPlatformStatusApplyConfiguration constructs a declarative configuration of the ExternalPlatformStatus type for use with
// apply.
func ExternalPlatformStatus() *ExternalPlatformStatusApplyConfiguration {
return &ExternalPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregate.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregate.go
index 4ba3ab9c51..b179452909 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregate.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregate.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// FeatureGateApplyConfiguration represents an declarative configuration of the FeatureGate type for use
+// FeatureGateApplyConfiguration represents a declarative configuration of the FeatureGate type for use
// with apply.
type FeatureGateApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type FeatureGateApplyConfiguration struct {
Status *FeatureGateStatusApplyConfiguration `json:"status,omitempty"`
}
-// FeatureGate constructs an declarative configuration of the FeatureGate type for use with
+// FeatureGate constructs a declarative configuration of the FeatureGate type for use with
// apply.
func FeatureGate(name string) *FeatureGateApplyConfiguration {
b := &FeatureGateApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *FeatureGateApplyConfiguration) WithStatus(value *FeatureGateStatusApply
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *FeatureGateApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregateattributes.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregateattributes.go
index 817cf44f61..200460a298 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregateattributes.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregateattributes.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// FeatureGateAttributesApplyConfiguration represents an declarative configuration of the FeatureGateAttributes type for use
+// FeatureGateAttributesApplyConfiguration represents a declarative configuration of the FeatureGateAttributes type for use
// with apply.
type FeatureGateAttributesApplyConfiguration struct {
Name *v1.FeatureGateName `json:"name,omitempty"`
}
-// FeatureGateAttributesApplyConfiguration constructs an declarative configuration of the FeatureGateAttributes type for use with
+// FeatureGateAttributesApplyConfiguration constructs a declarative configuration of the FeatureGateAttributes type for use with
// apply.
func FeatureGateAttributes() *FeatureGateAttributesApplyConfiguration {
return &FeatureGateAttributesApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatedetails.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatedetails.go
index 61bd51ca2d..c451f74dfd 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatedetails.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatedetails.go
@@ -2,7 +2,7 @@
package v1
-// FeatureGateDetailsApplyConfiguration represents an declarative configuration of the FeatureGateDetails type for use
+// FeatureGateDetailsApplyConfiguration represents a declarative configuration of the FeatureGateDetails type for use
// with apply.
type FeatureGateDetailsApplyConfiguration struct {
Version *string `json:"version,omitempty"`
@@ -10,7 +10,7 @@ type FeatureGateDetailsApplyConfiguration struct {
Disabled []FeatureGateAttributesApplyConfiguration `json:"disabled,omitempty"`
}
-// FeatureGateDetailsApplyConfiguration constructs an declarative configuration of the FeatureGateDetails type for use with
+// FeatureGateDetailsApplyConfiguration constructs a declarative configuration of the FeatureGateDetails type for use with
// apply.
func FeatureGateDetails() *FeatureGateDetailsApplyConfiguration {
return &FeatureGateDetailsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregateselection.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregateselection.go
index f22ead2c0e..2aac4666ea 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregateselection.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregateselection.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// FeatureGateSelectionApplyConfiguration represents an declarative configuration of the FeatureGateSelection type for use
+// FeatureGateSelectionApplyConfiguration represents a declarative configuration of the FeatureGateSelection type for use
// with apply.
type FeatureGateSelectionApplyConfiguration struct {
FeatureSet *v1.FeatureSet `json:"featureSet,omitempty"`
CustomNoUpgrade *CustomFeatureGatesApplyConfiguration `json:"customNoUpgrade,omitempty"`
}
-// FeatureGateSelectionApplyConfiguration constructs an declarative configuration of the FeatureGateSelection type for use with
+// FeatureGateSelectionApplyConfiguration constructs a declarative configuration of the FeatureGateSelection type for use with
// apply.
func FeatureGateSelection() *FeatureGateSelectionApplyConfiguration {
return &FeatureGateSelectionApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatespec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatespec.go
index 71a7464198..39b85b5dd9 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatespec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatespec.go
@@ -6,13 +6,13 @@ import (
configv1 "github.com/openshift/api/config/v1"
)
-// FeatureGateSpecApplyConfiguration represents an declarative configuration of the FeatureGateSpec type for use
+// FeatureGateSpecApplyConfiguration represents a declarative configuration of the FeatureGateSpec type for use
// with apply.
type FeatureGateSpecApplyConfiguration struct {
FeatureGateSelectionApplyConfiguration `json:",inline"`
}
-// FeatureGateSpecApplyConfiguration constructs an declarative configuration of the FeatureGateSpec type for use with
+// FeatureGateSpecApplyConfiguration constructs a declarative configuration of the FeatureGateSpec type for use with
// apply.
func FeatureGateSpec() *FeatureGateSpecApplyConfiguration {
return &FeatureGateSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatestatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatestatus.go
index fd09f59dad..2cc69267e3 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatestatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/featuregatestatus.go
@@ -6,14 +6,14 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// FeatureGateStatusApplyConfiguration represents an declarative configuration of the FeatureGateStatus type for use
+// FeatureGateStatusApplyConfiguration represents a declarative configuration of the FeatureGateStatus type for use
// with apply.
type FeatureGateStatusApplyConfiguration struct {
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
FeatureGates []FeatureGateDetailsApplyConfiguration `json:"featureGates,omitempty"`
}
-// FeatureGateStatusApplyConfiguration constructs an declarative configuration of the FeatureGateStatus type for use with
+// FeatureGateStatusApplyConfiguration constructs a declarative configuration of the FeatureGateStatus type for use with
// apply.
func FeatureGateStatus() *FeatureGateStatusApplyConfiguration {
return &FeatureGateStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpplatformstatus.go
index 9e35e3c60b..9c28888cf9 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpplatformstatus.go
@@ -2,7 +2,7 @@
package v1
-// GCPPlatformStatusApplyConfiguration represents an declarative configuration of the GCPPlatformStatus type for use
+// GCPPlatformStatusApplyConfiguration represents a declarative configuration of the GCPPlatformStatus type for use
// with apply.
type GCPPlatformStatusApplyConfiguration struct {
ProjectID *string `json:"projectID,omitempty"`
@@ -12,7 +12,7 @@ type GCPPlatformStatusApplyConfiguration struct {
CloudLoadBalancerConfig *CloudLoadBalancerConfigApplyConfiguration `json:"cloudLoadBalancerConfig,omitempty"`
}
-// GCPPlatformStatusApplyConfiguration constructs an declarative configuration of the GCPPlatformStatus type for use with
+// GCPPlatformStatusApplyConfiguration constructs a declarative configuration of the GCPPlatformStatus type for use with
// apply.
func GCPPlatformStatus() *GCPPlatformStatusApplyConfiguration {
return &GCPPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpresourcelabel.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpresourcelabel.go
index 685b14fe13..5d408e45ed 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpresourcelabel.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpresourcelabel.go
@@ -2,14 +2,14 @@
package v1
-// GCPResourceLabelApplyConfiguration represents an declarative configuration of the GCPResourceLabel type for use
+// GCPResourceLabelApplyConfiguration represents a declarative configuration of the GCPResourceLabel type for use
// with apply.
type GCPResourceLabelApplyConfiguration struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
}
-// GCPResourceLabelApplyConfiguration constructs an declarative configuration of the GCPResourceLabel type for use with
+// GCPResourceLabelApplyConfiguration constructs a declarative configuration of the GCPResourceLabel type for use with
// apply.
func GCPResourceLabel() *GCPResourceLabelApplyConfiguration {
return &GCPResourceLabelApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpresourcetag.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpresourcetag.go
index 9611b28534..8f22d3a54e 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpresourcetag.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gcpresourcetag.go
@@ -2,7 +2,7 @@
package v1
-// GCPResourceTagApplyConfiguration represents an declarative configuration of the GCPResourceTag type for use
+// GCPResourceTagApplyConfiguration represents a declarative configuration of the GCPResourceTag type for use
// with apply.
type GCPResourceTagApplyConfiguration struct {
ParentID *string `json:"parentID,omitempty"`
@@ -10,7 +10,7 @@ type GCPResourceTagApplyConfiguration struct {
Value *string `json:"value,omitempty"`
}
-// GCPResourceTagApplyConfiguration constructs an declarative configuration of the GCPResourceTag type for use with
+// GCPResourceTagApplyConfiguration constructs a declarative configuration of the GCPResourceTag type for use with
// apply.
func GCPResourceTag() *GCPResourceTagApplyConfiguration {
return &GCPResourceTagApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/githubidentityprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/githubidentityprovider.go
index bdaa2c7ac0..c797463d36 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/githubidentityprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/githubidentityprovider.go
@@ -2,7 +2,7 @@
package v1
-// GitHubIdentityProviderApplyConfiguration represents an declarative configuration of the GitHubIdentityProvider type for use
+// GitHubIdentityProviderApplyConfiguration represents a declarative configuration of the GitHubIdentityProvider type for use
// with apply.
type GitHubIdentityProviderApplyConfiguration struct {
ClientID *string `json:"clientID,omitempty"`
@@ -13,7 +13,7 @@ type GitHubIdentityProviderApplyConfiguration struct {
CA *ConfigMapNameReferenceApplyConfiguration `json:"ca,omitempty"`
}
-// GitHubIdentityProviderApplyConfiguration constructs an declarative configuration of the GitHubIdentityProvider type for use with
+// GitHubIdentityProviderApplyConfiguration constructs a declarative configuration of the GitHubIdentityProvider type for use with
// apply.
func GitHubIdentityProvider() *GitHubIdentityProviderApplyConfiguration {
return &GitHubIdentityProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gitlabidentityprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gitlabidentityprovider.go
index ece6b0eefd..e6a542e1c0 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gitlabidentityprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gitlabidentityprovider.go
@@ -2,7 +2,7 @@
package v1
-// GitLabIdentityProviderApplyConfiguration represents an declarative configuration of the GitLabIdentityProvider type for use
+// GitLabIdentityProviderApplyConfiguration represents a declarative configuration of the GitLabIdentityProvider type for use
// with apply.
type GitLabIdentityProviderApplyConfiguration struct {
ClientID *string `json:"clientID,omitempty"`
@@ -11,7 +11,7 @@ type GitLabIdentityProviderApplyConfiguration struct {
CA *ConfigMapNameReferenceApplyConfiguration `json:"ca,omitempty"`
}
-// GitLabIdentityProviderApplyConfiguration constructs an declarative configuration of the GitLabIdentityProvider type for use with
+// GitLabIdentityProviderApplyConfiguration constructs a declarative configuration of the GitLabIdentityProvider type for use with
// apply.
func GitLabIdentityProvider() *GitLabIdentityProviderApplyConfiguration {
return &GitLabIdentityProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/googleidentityprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/googleidentityprovider.go
index 1d38e58452..d828680696 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/googleidentityprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/googleidentityprovider.go
@@ -2,7 +2,7 @@
package v1
-// GoogleIdentityProviderApplyConfiguration represents an declarative configuration of the GoogleIdentityProvider type for use
+// GoogleIdentityProviderApplyConfiguration represents a declarative configuration of the GoogleIdentityProvider type for use
// with apply.
type GoogleIdentityProviderApplyConfiguration struct {
ClientID *string `json:"clientID,omitempty"`
@@ -10,7 +10,7 @@ type GoogleIdentityProviderApplyConfiguration struct {
HostedDomain *string `json:"hostedDomain,omitempty"`
}
-// GoogleIdentityProviderApplyConfiguration constructs an declarative configuration of the GoogleIdentityProvider type for use with
+// GoogleIdentityProviderApplyConfiguration constructs a declarative configuration of the GoogleIdentityProvider type for use with
// apply.
func GoogleIdentityProvider() *GoogleIdentityProviderApplyConfiguration {
return &GoogleIdentityProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/htpasswdidentityprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/htpasswdidentityprovider.go
index 719b874354..f5c689bbe2 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/htpasswdidentityprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/htpasswdidentityprovider.go
@@ -2,13 +2,13 @@
package v1
-// HTPasswdIdentityProviderApplyConfiguration represents an declarative configuration of the HTPasswdIdentityProvider type for use
+// HTPasswdIdentityProviderApplyConfiguration represents a declarative configuration of the HTPasswdIdentityProvider type for use
// with apply.
type HTPasswdIdentityProviderApplyConfiguration struct {
FileData *SecretNameReferenceApplyConfiguration `json:"fileData,omitempty"`
}
-// HTPasswdIdentityProviderApplyConfiguration constructs an declarative configuration of the HTPasswdIdentityProvider type for use with
+// HTPasswdIdentityProviderApplyConfiguration constructs a declarative configuration of the HTPasswdIdentityProvider type for use with
// apply.
func HTPasswdIdentityProvider() *HTPasswdIdentityProviderApplyConfiguration {
return &HTPasswdIdentityProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/hubsource.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/hubsource.go
index 6b0683b9f4..333802bfec 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/hubsource.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/hubsource.go
@@ -2,14 +2,14 @@
package v1
-// HubSourceApplyConfiguration represents an declarative configuration of the HubSource type for use
+// HubSourceApplyConfiguration represents a declarative configuration of the HubSource type for use
// with apply.
type HubSourceApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Disabled *bool `json:"disabled,omitempty"`
}
-// HubSourceApplyConfiguration constructs an declarative configuration of the HubSource type for use with
+// HubSourceApplyConfiguration constructs a declarative configuration of the HubSource type for use with
// apply.
func HubSource() *HubSourceApplyConfiguration {
return &HubSourceApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/hubsourcestatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/hubsourcestatus.go
index 6c466f96e9..4a8f0c437c 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/hubsourcestatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/hubsourcestatus.go
@@ -2,7 +2,7 @@
package v1
-// HubSourceStatusApplyConfiguration represents an declarative configuration of the HubSourceStatus type for use
+// HubSourceStatusApplyConfiguration represents a declarative configuration of the HubSourceStatus type for use
// with apply.
type HubSourceStatusApplyConfiguration struct {
*HubSourceApplyConfiguration `json:"HubSource,omitempty"`
@@ -10,7 +10,7 @@ type HubSourceStatusApplyConfiguration struct {
Message *string `json:"message,omitempty"`
}
-// HubSourceStatusApplyConfiguration constructs an declarative configuration of the HubSourceStatus type for use with
+// HubSourceStatusApplyConfiguration constructs a declarative configuration of the HubSourceStatus type for use with
// apply.
func HubSourceStatus() *HubSourceStatusApplyConfiguration {
return &HubSourceStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ibmcloudplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ibmcloudplatformstatus.go
index 9d1933377a..b4b3be2ffa 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ibmcloudplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ibmcloudplatformstatus.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// IBMCloudPlatformStatusApplyConfiguration represents an declarative configuration of the IBMCloudPlatformStatus type for use
+// IBMCloudPlatformStatusApplyConfiguration represents a declarative configuration of the IBMCloudPlatformStatus type for use
// with apply.
type IBMCloudPlatformStatusApplyConfiguration struct {
Location *string `json:"location,omitempty"`
@@ -17,7 +17,7 @@ type IBMCloudPlatformStatusApplyConfiguration struct {
ServiceEndpoints []IBMCloudServiceEndpointApplyConfiguration `json:"serviceEndpoints,omitempty"`
}
-// IBMCloudPlatformStatusApplyConfiguration constructs an declarative configuration of the IBMCloudPlatformStatus type for use with
+// IBMCloudPlatformStatusApplyConfiguration constructs a declarative configuration of the IBMCloudPlatformStatus type for use with
// apply.
func IBMCloudPlatformStatus() *IBMCloudPlatformStatusApplyConfiguration {
return &IBMCloudPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ibmcloudserviceendpoint.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ibmcloudserviceendpoint.go
index 7fc9f86325..2291040614 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ibmcloudserviceendpoint.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ibmcloudserviceendpoint.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// IBMCloudServiceEndpointApplyConfiguration represents an declarative configuration of the IBMCloudServiceEndpoint type for use
+// IBMCloudServiceEndpointApplyConfiguration represents a declarative configuration of the IBMCloudServiceEndpoint type for use
// with apply.
type IBMCloudServiceEndpointApplyConfiguration struct {
Name *v1.IBMCloudServiceName `json:"name,omitempty"`
URL *string `json:"url,omitempty"`
}
-// IBMCloudServiceEndpointApplyConfiguration constructs an declarative configuration of the IBMCloudServiceEndpoint type for use with
+// IBMCloudServiceEndpointApplyConfiguration constructs a declarative configuration of the IBMCloudServiceEndpoint type for use with
// apply.
func IBMCloudServiceEndpoint() *IBMCloudServiceEndpointApplyConfiguration {
return &IBMCloudServiceEndpointApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/identityprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/identityprovider.go
index 869d822bb4..35edd9dff3 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/identityprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/identityprovider.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// IdentityProviderApplyConfiguration represents an declarative configuration of the IdentityProvider type for use
+// IdentityProviderApplyConfiguration represents a declarative configuration of the IdentityProvider type for use
// with apply.
type IdentityProviderApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -14,7 +14,7 @@ type IdentityProviderApplyConfiguration struct {
IdentityProviderConfigApplyConfiguration `json:",inline"`
}
-// IdentityProviderApplyConfiguration constructs an declarative configuration of the IdentityProvider type for use with
+// IdentityProviderApplyConfiguration constructs a declarative configuration of the IdentityProvider type for use with
// apply.
func IdentityProvider() *IdentityProviderApplyConfiguration {
return &IdentityProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/identityproviderconfig.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/identityproviderconfig.go
index e87c122879..208d23d560 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/identityproviderconfig.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/identityproviderconfig.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// IdentityProviderConfigApplyConfiguration represents an declarative configuration of the IdentityProviderConfig type for use
+// IdentityProviderConfigApplyConfiguration represents a declarative configuration of the IdentityProviderConfig type for use
// with apply.
type IdentityProviderConfigApplyConfiguration struct {
Type *v1.IdentityProviderType `json:"type,omitempty"`
@@ -21,7 +21,7 @@ type IdentityProviderConfigApplyConfiguration struct {
RequestHeader *RequestHeaderIdentityProviderApplyConfiguration `json:"requestHeader,omitempty"`
}
-// IdentityProviderConfigApplyConfiguration constructs an declarative configuration of the IdentityProviderConfig type for use with
+// IdentityProviderConfigApplyConfiguration constructs a declarative configuration of the IdentityProviderConfig type for use with
// apply.
func IdentityProviderConfig() *IdentityProviderConfigApplyConfiguration {
return &IdentityProviderConfigApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/image.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/image.go
index f93741283b..34f73ad729 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/image.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/image.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ImageApplyConfiguration represents an declarative configuration of the Image type for use
+// ImageApplyConfiguration represents a declarative configuration of the Image type for use
// with apply.
type ImageApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ImageApplyConfiguration struct {
Status *ImageStatusApplyConfiguration `json:"status,omitempty"`
}
-// Image constructs an declarative configuration of the Image type for use with
+// Image constructs a declarative configuration of the Image type for use with
// apply.
func Image(name string) *ImageApplyConfiguration {
b := &ImageApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *ImageApplyConfiguration) WithStatus(value *ImageStatusApplyConfiguratio
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ImageApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagecontentpolicy.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagecontentpolicy.go
index bded262d73..9566569f9e 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagecontentpolicy.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagecontentpolicy.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ImageContentPolicyApplyConfiguration represents an declarative configuration of the ImageContentPolicy type for use
+// ImageContentPolicyApplyConfiguration represents a declarative configuration of the ImageContentPolicy type for use
// with apply.
type ImageContentPolicyApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -19,7 +19,7 @@ type ImageContentPolicyApplyConfiguration struct {
Spec *ImageContentPolicySpecApplyConfiguration `json:"spec,omitempty"`
}
-// ImageContentPolicy constructs an declarative configuration of the ImageContentPolicy type for use with
+// ImageContentPolicy constructs a declarative configuration of the ImageContentPolicy type for use with
// apply.
func ImageContentPolicy(name string) *ImageContentPolicyApplyConfiguration {
b := &ImageContentPolicyApplyConfiguration{}
@@ -229,3 +229,9 @@ func (b *ImageContentPolicyApplyConfiguration) WithSpec(value *ImageContentPolic
b.Spec = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ImageContentPolicyApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagecontentpolicyspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagecontentpolicyspec.go
index 5f063096f0..ea674157cb 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagecontentpolicyspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagecontentpolicyspec.go
@@ -2,13 +2,13 @@
package v1
-// ImageContentPolicySpecApplyConfiguration represents an declarative configuration of the ImageContentPolicySpec type for use
+// ImageContentPolicySpecApplyConfiguration represents a declarative configuration of the ImageContentPolicySpec type for use
// with apply.
type ImageContentPolicySpecApplyConfiguration struct {
RepositoryDigestMirrors []RepositoryDigestMirrorsApplyConfiguration `json:"repositoryDigestMirrors,omitempty"`
}
-// ImageContentPolicySpecApplyConfiguration constructs an declarative configuration of the ImageContentPolicySpec type for use with
+// ImageContentPolicySpecApplyConfiguration constructs a declarative configuration of the ImageContentPolicySpec type for use with
// apply.
func ImageContentPolicySpec() *ImageContentPolicySpecApplyConfiguration {
return &ImageContentPolicySpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrors.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrors.go
index 47aa3bb82e..dc98896747 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrors.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrors.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// ImageDigestMirrorsApplyConfiguration represents an declarative configuration of the ImageDigestMirrors type for use
+// ImageDigestMirrorsApplyConfiguration represents a declarative configuration of the ImageDigestMirrors type for use
// with apply.
type ImageDigestMirrorsApplyConfiguration struct {
Source *string `json:"source,omitempty"`
@@ -14,7 +14,7 @@ type ImageDigestMirrorsApplyConfiguration struct {
MirrorSourcePolicy *v1.MirrorSourcePolicy `json:"mirrorSourcePolicy,omitempty"`
}
-// ImageDigestMirrorsApplyConfiguration constructs an declarative configuration of the ImageDigestMirrors type for use with
+// ImageDigestMirrorsApplyConfiguration constructs a declarative configuration of the ImageDigestMirrors type for use with
// apply.
func ImageDigestMirrors() *ImageDigestMirrorsApplyConfiguration {
return &ImageDigestMirrorsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrorset.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrorset.go
index b1e2aab4fa..80140961b7 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrorset.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrorset.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ImageDigestMirrorSetApplyConfiguration represents an declarative configuration of the ImageDigestMirrorSet type for use
+// ImageDigestMirrorSetApplyConfiguration represents a declarative configuration of the ImageDigestMirrorSet type for use
// with apply.
type ImageDigestMirrorSetApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ImageDigestMirrorSetApplyConfiguration struct {
Status *apiconfigv1.ImageDigestMirrorSetStatus `json:"status,omitempty"`
}
-// ImageDigestMirrorSet constructs an declarative configuration of the ImageDigestMirrorSet type for use with
+// ImageDigestMirrorSet constructs a declarative configuration of the ImageDigestMirrorSet type for use with
// apply.
func ImageDigestMirrorSet(name string) *ImageDigestMirrorSetApplyConfiguration {
b := &ImageDigestMirrorSetApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *ImageDigestMirrorSetApplyConfiguration) WithStatus(value apiconfigv1.Im
b.Status = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ImageDigestMirrorSetApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrorsetspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrorsetspec.go
index f34a0c0af7..fbb9d48ca3 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrorsetspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagedigestmirrorsetspec.go
@@ -2,13 +2,13 @@
package v1
-// ImageDigestMirrorSetSpecApplyConfiguration represents an declarative configuration of the ImageDigestMirrorSetSpec type for use
+// ImageDigestMirrorSetSpecApplyConfiguration represents a declarative configuration of the ImageDigestMirrorSetSpec type for use
// with apply.
type ImageDigestMirrorSetSpecApplyConfiguration struct {
ImageDigestMirrors []ImageDigestMirrorsApplyConfiguration `json:"imageDigestMirrors,omitempty"`
}
-// ImageDigestMirrorSetSpecApplyConfiguration constructs an declarative configuration of the ImageDigestMirrorSetSpec type for use with
+// ImageDigestMirrorSetSpecApplyConfiguration constructs a declarative configuration of the ImageDigestMirrorSetSpec type for use with
// apply.
func ImageDigestMirrorSetSpec() *ImageDigestMirrorSetSpecApplyConfiguration {
return &ImageDigestMirrorSetSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagelabel.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagelabel.go
index 1199666c48..1d19105474 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagelabel.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagelabel.go
@@ -2,14 +2,14 @@
package v1
-// ImageLabelApplyConfiguration represents an declarative configuration of the ImageLabel type for use
+// ImageLabelApplyConfiguration represents a declarative configuration of the ImageLabel type for use
// with apply.
type ImageLabelApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Value *string `json:"value,omitempty"`
}
-// ImageLabelApplyConfiguration constructs an declarative configuration of the ImageLabel type for use with
+// ImageLabelApplyConfiguration constructs a declarative configuration of the ImageLabel type for use with
// apply.
func ImageLabel() *ImageLabelApplyConfiguration {
return &ImageLabelApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagespec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagespec.go
index 10e80e77fa..2c3bf26874 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagespec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagespec.go
@@ -2,16 +2,21 @@
package v1
-// ImageSpecApplyConfiguration represents an declarative configuration of the ImageSpec type for use
+import (
+ configv1 "github.com/openshift/api/config/v1"
+)
+
+// ImageSpecApplyConfiguration represents a declarative configuration of the ImageSpec type for use
// with apply.
type ImageSpecApplyConfiguration struct {
AllowedRegistriesForImport []RegistryLocationApplyConfiguration `json:"allowedRegistriesForImport,omitempty"`
ExternalRegistryHostnames []string `json:"externalRegistryHostnames,omitempty"`
AdditionalTrustedCA *ConfigMapNameReferenceApplyConfiguration `json:"additionalTrustedCA,omitempty"`
RegistrySources *RegistrySourcesApplyConfiguration `json:"registrySources,omitempty"`
+ ImageStreamImportMode *configv1.ImportModeType `json:"imageStreamImportMode,omitempty"`
}
-// ImageSpecApplyConfiguration constructs an declarative configuration of the ImageSpec type for use with
+// ImageSpecApplyConfiguration constructs a declarative configuration of the ImageSpec type for use with
// apply.
func ImageSpec() *ImageSpecApplyConfiguration {
return &ImageSpecApplyConfiguration{}
@@ -55,3 +60,11 @@ func (b *ImageSpecApplyConfiguration) WithRegistrySources(value *RegistrySources
b.RegistrySources = value
return b
}
+
+// WithImageStreamImportMode sets the ImageStreamImportMode field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ImageStreamImportMode field is set to the value of the last call.
+func (b *ImageSpecApplyConfiguration) WithImageStreamImportMode(value configv1.ImportModeType) *ImageSpecApplyConfiguration {
+ b.ImageStreamImportMode = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagestatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagestatus.go
index 38c90271a1..601accbe64 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagestatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagestatus.go
@@ -2,14 +2,19 @@
package v1
-// ImageStatusApplyConfiguration represents an declarative configuration of the ImageStatus type for use
+import (
+ v1 "github.com/openshift/api/config/v1"
+)
+
+// ImageStatusApplyConfiguration represents a declarative configuration of the ImageStatus type for use
// with apply.
type ImageStatusApplyConfiguration struct {
- InternalRegistryHostname *string `json:"internalRegistryHostname,omitempty"`
- ExternalRegistryHostnames []string `json:"externalRegistryHostnames,omitempty"`
+ InternalRegistryHostname *string `json:"internalRegistryHostname,omitempty"`
+ ExternalRegistryHostnames []string `json:"externalRegistryHostnames,omitempty"`
+ ImageStreamImportMode *v1.ImportModeType `json:"imageStreamImportMode,omitempty"`
}
-// ImageStatusApplyConfiguration constructs an declarative configuration of the ImageStatus type for use with
+// ImageStatusApplyConfiguration constructs a declarative configuration of the ImageStatus type for use with
// apply.
func ImageStatus() *ImageStatusApplyConfiguration {
return &ImageStatusApplyConfiguration{}
@@ -32,3 +37,11 @@ func (b *ImageStatusApplyConfiguration) WithExternalRegistryHostnames(values ...
}
return b
}
+
+// WithImageStreamImportMode sets the ImageStreamImportMode field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ImageStreamImportMode field is set to the value of the last call.
+func (b *ImageStatusApplyConfiguration) WithImageStreamImportMode(value v1.ImportModeType) *ImageStatusApplyConfiguration {
+ b.ImageStreamImportMode = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrors.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrors.go
index 212d0d01ab..bede604d88 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrors.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrors.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// ImageTagMirrorsApplyConfiguration represents an declarative configuration of the ImageTagMirrors type for use
+// ImageTagMirrorsApplyConfiguration represents a declarative configuration of the ImageTagMirrors type for use
// with apply.
type ImageTagMirrorsApplyConfiguration struct {
Source *string `json:"source,omitempty"`
@@ -14,7 +14,7 @@ type ImageTagMirrorsApplyConfiguration struct {
MirrorSourcePolicy *v1.MirrorSourcePolicy `json:"mirrorSourcePolicy,omitempty"`
}
-// ImageTagMirrorsApplyConfiguration constructs an declarative configuration of the ImageTagMirrors type for use with
+// ImageTagMirrorsApplyConfiguration constructs a declarative configuration of the ImageTagMirrors type for use with
// apply.
func ImageTagMirrors() *ImageTagMirrorsApplyConfiguration {
return &ImageTagMirrorsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrorset.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrorset.go
index 1b85cc6007..37432fac00 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrorset.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrorset.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ImageTagMirrorSetApplyConfiguration represents an declarative configuration of the ImageTagMirrorSet type for use
+// ImageTagMirrorSetApplyConfiguration represents a declarative configuration of the ImageTagMirrorSet type for use
// with apply.
type ImageTagMirrorSetApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ImageTagMirrorSetApplyConfiguration struct {
Status *apiconfigv1.ImageTagMirrorSetStatus `json:"status,omitempty"`
}
-// ImageTagMirrorSet constructs an declarative configuration of the ImageTagMirrorSet type for use with
+// ImageTagMirrorSet constructs a declarative configuration of the ImageTagMirrorSet type for use with
// apply.
func ImageTagMirrorSet(name string) *ImageTagMirrorSetApplyConfiguration {
b := &ImageTagMirrorSetApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *ImageTagMirrorSetApplyConfiguration) WithStatus(value apiconfigv1.Image
b.Status = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ImageTagMirrorSetApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrorsetspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrorsetspec.go
index a6e1d9a390..ca59c38714 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrorsetspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagetagmirrorsetspec.go
@@ -2,13 +2,13 @@
package v1
-// ImageTagMirrorSetSpecApplyConfiguration represents an declarative configuration of the ImageTagMirrorSetSpec type for use
+// ImageTagMirrorSetSpecApplyConfiguration represents a declarative configuration of the ImageTagMirrorSetSpec type for use
// with apply.
type ImageTagMirrorSetSpecApplyConfiguration struct {
ImageTagMirrors []ImageTagMirrorsApplyConfiguration `json:"imageTagMirrors,omitempty"`
}
-// ImageTagMirrorSetSpecApplyConfiguration constructs an declarative configuration of the ImageTagMirrorSetSpec type for use with
+// ImageTagMirrorSetSpecApplyConfiguration constructs a declarative configuration of the ImageTagMirrorSetSpec type for use with
// apply.
func ImageTagMirrorSetSpec() *ImageTagMirrorSetSpecApplyConfiguration {
return &ImageTagMirrorSetSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructure.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructure.go
index 9a1fe21bd7..5d9551be6c 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructure.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructure.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// InfrastructureApplyConfiguration represents an declarative configuration of the Infrastructure type for use
+// InfrastructureApplyConfiguration represents a declarative configuration of the Infrastructure type for use
// with apply.
type InfrastructureApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type InfrastructureApplyConfiguration struct {
Status *InfrastructureStatusApplyConfiguration `json:"status,omitempty"`
}
-// Infrastructure constructs an declarative configuration of the Infrastructure type for use with
+// Infrastructure constructs a declarative configuration of the Infrastructure type for use with
// apply.
func Infrastructure(name string) *InfrastructureApplyConfiguration {
b := &InfrastructureApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *InfrastructureApplyConfiguration) WithStatus(value *InfrastructureStatu
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *InfrastructureApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructurespec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructurespec.go
index eb2f1636dc..83dccde29e 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructurespec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructurespec.go
@@ -2,14 +2,14 @@
package v1
-// InfrastructureSpecApplyConfiguration represents an declarative configuration of the InfrastructureSpec type for use
+// InfrastructureSpecApplyConfiguration represents a declarative configuration of the InfrastructureSpec type for use
// with apply.
type InfrastructureSpecApplyConfiguration struct {
CloudConfig *ConfigMapFileReferenceApplyConfiguration `json:"cloudConfig,omitempty"`
PlatformSpec *PlatformSpecApplyConfiguration `json:"platformSpec,omitempty"`
}
-// InfrastructureSpecApplyConfiguration constructs an declarative configuration of the InfrastructureSpec type for use with
+// InfrastructureSpecApplyConfiguration constructs a declarative configuration of the InfrastructureSpec type for use with
// apply.
func InfrastructureSpec() *InfrastructureSpecApplyConfiguration {
return &InfrastructureSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructurestatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructurestatus.go
index 0f45b5562d..89f5496df6 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructurestatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructurestatus.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// InfrastructureStatusApplyConfiguration represents an declarative configuration of the InfrastructureStatus type for use
+// InfrastructureStatusApplyConfiguration represents a declarative configuration of the InfrastructureStatus type for use
// with apply.
type InfrastructureStatusApplyConfiguration struct {
InfrastructureName *string `json:"infrastructureName,omitempty"`
@@ -20,7 +20,7 @@ type InfrastructureStatusApplyConfiguration struct {
CPUPartitioning *v1.CPUPartitioningMode `json:"cpuPartitioning,omitempty"`
}
-// InfrastructureStatusApplyConfiguration constructs an declarative configuration of the InfrastructureStatus type for use with
+// InfrastructureStatusApplyConfiguration constructs a declarative configuration of the InfrastructureStatus type for use with
// apply.
func InfrastructureStatus() *InfrastructureStatusApplyConfiguration {
return &InfrastructureStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingress.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingress.go
index c3fb8b814b..b8780886d0 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingress.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingress.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// IngressApplyConfiguration represents an declarative configuration of the Ingress type for use
+// IngressApplyConfiguration represents a declarative configuration of the Ingress type for use
// with apply.
type IngressApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type IngressApplyConfiguration struct {
Status *IngressStatusApplyConfiguration `json:"status,omitempty"`
}
-// Ingress constructs an declarative configuration of the Ingress type for use with
+// Ingress constructs a declarative configuration of the Ingress type for use with
// apply.
func Ingress(name string) *IngressApplyConfiguration {
b := &IngressApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *IngressApplyConfiguration) WithStatus(value *IngressStatusApplyConfigur
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *IngressApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressplatformspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressplatformspec.go
index ae1b18fd33..f3e25215be 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressplatformspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressplatformspec.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// IngressPlatformSpecApplyConfiguration represents an declarative configuration of the IngressPlatformSpec type for use
+// IngressPlatformSpecApplyConfiguration represents a declarative configuration of the IngressPlatformSpec type for use
// with apply.
type IngressPlatformSpecApplyConfiguration struct {
Type *v1.PlatformType `json:"type,omitempty"`
AWS *AWSIngressSpecApplyConfiguration `json:"aws,omitempty"`
}
-// IngressPlatformSpecApplyConfiguration constructs an declarative configuration of the IngressPlatformSpec type for use with
+// IngressPlatformSpecApplyConfiguration constructs a declarative configuration of the IngressPlatformSpec type for use with
// apply.
func IngressPlatformSpec() *IngressPlatformSpecApplyConfiguration {
return &IngressPlatformSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressspec.go
index d934e664be..a9b09512ca 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressspec.go
@@ -2,7 +2,7 @@
package v1
-// IngressSpecApplyConfiguration represents an declarative configuration of the IngressSpec type for use
+// IngressSpecApplyConfiguration represents a declarative configuration of the IngressSpec type for use
// with apply.
type IngressSpecApplyConfiguration struct {
Domain *string `json:"domain,omitempty"`
@@ -12,7 +12,7 @@ type IngressSpecApplyConfiguration struct {
LoadBalancer *LoadBalancerApplyConfiguration `json:"loadBalancer,omitempty"`
}
-// IngressSpecApplyConfiguration constructs an declarative configuration of the IngressSpec type for use with
+// IngressSpecApplyConfiguration constructs a declarative configuration of the IngressSpec type for use with
// apply.
func IngressSpec() *IngressSpecApplyConfiguration {
return &IngressSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressstatus.go
index 7fb9917afe..792bcd7551 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ingressstatus.go
@@ -6,14 +6,14 @@ import (
configv1 "github.com/openshift/api/config/v1"
)
-// IngressStatusApplyConfiguration represents an declarative configuration of the IngressStatus type for use
+// IngressStatusApplyConfiguration represents a declarative configuration of the IngressStatus type for use
// with apply.
type IngressStatusApplyConfiguration struct {
ComponentRoutes []ComponentRouteStatusApplyConfiguration `json:"componentRoutes,omitempty"`
DefaultPlacement *configv1.DefaultPlacement `json:"defaultPlacement,omitempty"`
}
-// IngressStatusApplyConfiguration constructs an declarative configuration of the IngressStatus type for use with
+// IngressStatusApplyConfiguration constructs a declarative configuration of the IngressStatus type for use with
// apply.
func IngressStatus() *IngressStatusApplyConfiguration {
return &IngressStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/keystoneidentityprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/keystoneidentityprovider.go
index 4f4ddd3752..88204c69a7 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/keystoneidentityprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/keystoneidentityprovider.go
@@ -2,14 +2,14 @@
package v1
-// KeystoneIdentityProviderApplyConfiguration represents an declarative configuration of the KeystoneIdentityProvider type for use
+// KeystoneIdentityProviderApplyConfiguration represents a declarative configuration of the KeystoneIdentityProvider type for use
// with apply.
type KeystoneIdentityProviderApplyConfiguration struct {
OAuthRemoteConnectionInfoApplyConfiguration `json:",inline"`
DomainName *string `json:"domainName,omitempty"`
}
-// KeystoneIdentityProviderApplyConfiguration constructs an declarative configuration of the KeystoneIdentityProvider type for use with
+// KeystoneIdentityProviderApplyConfiguration constructs a declarative configuration of the KeystoneIdentityProvider type for use with
// apply.
func KeystoneIdentityProvider() *KeystoneIdentityProviderApplyConfiguration {
return &KeystoneIdentityProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/kubevirtplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/kubevirtplatformstatus.go
index 8e092abd2e..3d136c53b2 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/kubevirtplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/kubevirtplatformstatus.go
@@ -2,14 +2,14 @@
package v1
-// KubevirtPlatformStatusApplyConfiguration represents an declarative configuration of the KubevirtPlatformStatus type for use
+// KubevirtPlatformStatusApplyConfiguration represents a declarative configuration of the KubevirtPlatformStatus type for use
// with apply.
type KubevirtPlatformStatusApplyConfiguration struct {
APIServerInternalIP *string `json:"apiServerInternalIP,omitempty"`
IngressIP *string `json:"ingressIP,omitempty"`
}
-// KubevirtPlatformStatusApplyConfiguration constructs an declarative configuration of the KubevirtPlatformStatus type for use with
+// KubevirtPlatformStatusApplyConfiguration constructs a declarative configuration of the KubevirtPlatformStatus type for use with
// apply.
func KubevirtPlatformStatus() *KubevirtPlatformStatusApplyConfiguration {
return &KubevirtPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ldapattributemapping.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ldapattributemapping.go
index 34a8916bea..b618065cea 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ldapattributemapping.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ldapattributemapping.go
@@ -2,7 +2,7 @@
package v1
-// LDAPAttributeMappingApplyConfiguration represents an declarative configuration of the LDAPAttributeMapping type for use
+// LDAPAttributeMappingApplyConfiguration represents a declarative configuration of the LDAPAttributeMapping type for use
// with apply.
type LDAPAttributeMappingApplyConfiguration struct {
ID []string `json:"id,omitempty"`
@@ -11,7 +11,7 @@ type LDAPAttributeMappingApplyConfiguration struct {
Email []string `json:"email,omitempty"`
}
-// LDAPAttributeMappingApplyConfiguration constructs an declarative configuration of the LDAPAttributeMapping type for use with
+// LDAPAttributeMappingApplyConfiguration constructs a declarative configuration of the LDAPAttributeMapping type for use with
// apply.
func LDAPAttributeMapping() *LDAPAttributeMappingApplyConfiguration {
return &LDAPAttributeMappingApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ldapidentityprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ldapidentityprovider.go
index 9ab1b90ef4..90bdfe34c2 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ldapidentityprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ldapidentityprovider.go
@@ -2,7 +2,7 @@
package v1
-// LDAPIdentityProviderApplyConfiguration represents an declarative configuration of the LDAPIdentityProvider type for use
+// LDAPIdentityProviderApplyConfiguration represents a declarative configuration of the LDAPIdentityProvider type for use
// with apply.
type LDAPIdentityProviderApplyConfiguration struct {
URL *string `json:"url,omitempty"`
@@ -13,7 +13,7 @@ type LDAPIdentityProviderApplyConfiguration struct {
Attributes *LDAPAttributeMappingApplyConfiguration `json:"attributes,omitempty"`
}
-// LDAPIdentityProviderApplyConfiguration constructs an declarative configuration of the LDAPIdentityProvider type for use with
+// LDAPIdentityProviderApplyConfiguration constructs a declarative configuration of the LDAPIdentityProvider type for use with
// apply.
func LDAPIdentityProvider() *LDAPIdentityProviderApplyConfiguration {
return &LDAPIdentityProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/loadbalancer.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/loadbalancer.go
index 6f8618760b..0dfc67c8f3 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/loadbalancer.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/loadbalancer.go
@@ -2,13 +2,13 @@
package v1
-// LoadBalancerApplyConfiguration represents an declarative configuration of the LoadBalancer type for use
+// LoadBalancerApplyConfiguration represents a declarative configuration of the LoadBalancer type for use
// with apply.
type LoadBalancerApplyConfiguration struct {
Platform *IngressPlatformSpecApplyConfiguration `json:"platform,omitempty"`
}
-// LoadBalancerApplyConfiguration constructs an declarative configuration of the LoadBalancer type for use with
+// LoadBalancerApplyConfiguration constructs a declarative configuration of the LoadBalancer type for use with
// apply.
func LoadBalancer() *LoadBalancerApplyConfiguration {
return &LoadBalancerApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/maxagepolicy.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/maxagepolicy.go
index 0712a0da7a..faa8e1dd56 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/maxagepolicy.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/maxagepolicy.go
@@ -2,14 +2,14 @@
package v1
-// MaxAgePolicyApplyConfiguration represents an declarative configuration of the MaxAgePolicy type for use
+// MaxAgePolicyApplyConfiguration represents a declarative configuration of the MaxAgePolicy type for use
// with apply.
type MaxAgePolicyApplyConfiguration struct {
LargestMaxAge *int32 `json:"largestMaxAge,omitempty"`
SmallestMaxAge *int32 `json:"smallestMaxAge,omitempty"`
}
-// MaxAgePolicyApplyConfiguration constructs an declarative configuration of the MaxAgePolicy type for use with
+// MaxAgePolicyApplyConfiguration constructs a declarative configuration of the MaxAgePolicy type for use with
// apply.
func MaxAgePolicy() *MaxAgePolicyApplyConfiguration {
return &MaxAgePolicyApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/mtumigration.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/mtumigration.go
index 23b85cf826..9db99100ee 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/mtumigration.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/mtumigration.go
@@ -2,14 +2,14 @@
package v1
-// MTUMigrationApplyConfiguration represents an declarative configuration of the MTUMigration type for use
+// MTUMigrationApplyConfiguration represents a declarative configuration of the MTUMigration type for use
// with apply.
type MTUMigrationApplyConfiguration struct {
Network *MTUMigrationValuesApplyConfiguration `json:"network,omitempty"`
Machine *MTUMigrationValuesApplyConfiguration `json:"machine,omitempty"`
}
-// MTUMigrationApplyConfiguration constructs an declarative configuration of the MTUMigration type for use with
+// MTUMigrationApplyConfiguration constructs a declarative configuration of the MTUMigration type for use with
// apply.
func MTUMigration() *MTUMigrationApplyConfiguration {
return &MTUMigrationApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/mtumigrationvalues.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/mtumigrationvalues.go
index a1e185a55c..8d346f25f4 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/mtumigrationvalues.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/mtumigrationvalues.go
@@ -2,14 +2,14 @@
package v1
-// MTUMigrationValuesApplyConfiguration represents an declarative configuration of the MTUMigrationValues type for use
+// MTUMigrationValuesApplyConfiguration represents a declarative configuration of the MTUMigrationValues type for use
// with apply.
type MTUMigrationValuesApplyConfiguration struct {
To *uint32 `json:"to,omitempty"`
From *uint32 `json:"from,omitempty"`
}
-// MTUMigrationValuesApplyConfiguration constructs an declarative configuration of the MTUMigrationValues type for use with
+// MTUMigrationValuesApplyConfiguration constructs a declarative configuration of the MTUMigrationValues type for use with
// apply.
func MTUMigrationValues() *MTUMigrationValuesApplyConfiguration {
return &MTUMigrationValuesApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/network.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/network.go
index 6604b627ff..a42f3a9ea0 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/network.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/network.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// NetworkApplyConfiguration represents an declarative configuration of the Network type for use
+// NetworkApplyConfiguration represents a declarative configuration of the Network type for use
// with apply.
type NetworkApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type NetworkApplyConfiguration struct {
Status *NetworkStatusApplyConfiguration `json:"status,omitempty"`
}
-// Network constructs an declarative configuration of the Network type for use with
+// Network constructs a declarative configuration of the Network type for use with
// apply.
func Network(name string) *NetworkApplyConfiguration {
b := &NetworkApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *NetworkApplyConfiguration) WithStatus(value *NetworkStatusApplyConfigur
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *NetworkApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnostics.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnostics.go
index 93866293e3..6f75e0385e 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnostics.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnostics.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// NetworkDiagnosticsApplyConfiguration represents an declarative configuration of the NetworkDiagnostics type for use
+// NetworkDiagnosticsApplyConfiguration represents a declarative configuration of the NetworkDiagnostics type for use
// with apply.
type NetworkDiagnosticsApplyConfiguration struct {
Mode *v1.NetworkDiagnosticsMode `json:"mode,omitempty"`
@@ -14,7 +14,7 @@ type NetworkDiagnosticsApplyConfiguration struct {
TargetPlacement *NetworkDiagnosticsTargetPlacementApplyConfiguration `json:"targetPlacement,omitempty"`
}
-// NetworkDiagnosticsApplyConfiguration constructs an declarative configuration of the NetworkDiagnostics type for use with
+// NetworkDiagnosticsApplyConfiguration constructs a declarative configuration of the NetworkDiagnostics type for use with
// apply.
func NetworkDiagnostics() *NetworkDiagnosticsApplyConfiguration {
return &NetworkDiagnosticsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnosticssourceplacement.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnosticssourceplacement.go
index efe6bbd494..2b280a828f 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnosticssourceplacement.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnosticssourceplacement.go
@@ -6,14 +6,14 @@ import (
v1 "k8s.io/api/core/v1"
)
-// NetworkDiagnosticsSourcePlacementApplyConfiguration represents an declarative configuration of the NetworkDiagnosticsSourcePlacement type for use
+// NetworkDiagnosticsSourcePlacementApplyConfiguration represents a declarative configuration of the NetworkDiagnosticsSourcePlacement type for use
// with apply.
type NetworkDiagnosticsSourcePlacementApplyConfiguration struct {
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
}
-// NetworkDiagnosticsSourcePlacementApplyConfiguration constructs an declarative configuration of the NetworkDiagnosticsSourcePlacement type for use with
+// NetworkDiagnosticsSourcePlacementApplyConfiguration constructs a declarative configuration of the NetworkDiagnosticsSourcePlacement type for use with
// apply.
func NetworkDiagnosticsSourcePlacement() *NetworkDiagnosticsSourcePlacementApplyConfiguration {
return &NetworkDiagnosticsSourcePlacementApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnosticstargetplacement.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnosticstargetplacement.go
index c1ce2d8e9d..6fee4c7956 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnosticstargetplacement.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnosticstargetplacement.go
@@ -6,14 +6,14 @@ import (
v1 "k8s.io/api/core/v1"
)
-// NetworkDiagnosticsTargetPlacementApplyConfiguration represents an declarative configuration of the NetworkDiagnosticsTargetPlacement type for use
+// NetworkDiagnosticsTargetPlacementApplyConfiguration represents a declarative configuration of the NetworkDiagnosticsTargetPlacement type for use
// with apply.
type NetworkDiagnosticsTargetPlacementApplyConfiguration struct {
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
}
-// NetworkDiagnosticsTargetPlacementApplyConfiguration constructs an declarative configuration of the NetworkDiagnosticsTargetPlacement type for use with
+// NetworkDiagnosticsTargetPlacementApplyConfiguration constructs a declarative configuration of the NetworkDiagnosticsTargetPlacement type for use with
// apply.
func NetworkDiagnosticsTargetPlacement() *NetworkDiagnosticsTargetPlacementApplyConfiguration {
return &NetworkDiagnosticsTargetPlacementApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkmigration.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkmigration.go
index c1ea6eade8..9c82947462 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkmigration.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkmigration.go
@@ -2,14 +2,14 @@
package v1
-// NetworkMigrationApplyConfiguration represents an declarative configuration of the NetworkMigration type for use
+// NetworkMigrationApplyConfiguration represents a declarative configuration of the NetworkMigration type for use
// with apply.
type NetworkMigrationApplyConfiguration struct {
NetworkType *string `json:"networkType,omitempty"`
MTU *MTUMigrationApplyConfiguration `json:"mtu,omitempty"`
}
-// NetworkMigrationApplyConfiguration constructs an declarative configuration of the NetworkMigration type for use with
+// NetworkMigrationApplyConfiguration constructs a declarative configuration of the NetworkMigration type for use with
// apply.
func NetworkMigration() *NetworkMigrationApplyConfiguration {
return &NetworkMigrationApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkspec.go
index 5d218d02c2..d4e970e34f 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkspec.go
@@ -2,7 +2,7 @@
package v1
-// NetworkSpecApplyConfiguration represents an declarative configuration of the NetworkSpec type for use
+// NetworkSpecApplyConfiguration represents a declarative configuration of the NetworkSpec type for use
// with apply.
type NetworkSpecApplyConfiguration struct {
ClusterNetwork []ClusterNetworkEntryApplyConfiguration `json:"clusterNetwork,omitempty"`
@@ -13,7 +13,7 @@ type NetworkSpecApplyConfiguration struct {
NetworkDiagnostics *NetworkDiagnosticsApplyConfiguration `json:"networkDiagnostics,omitempty"`
}
-// NetworkSpecApplyConfiguration constructs an declarative configuration of the NetworkSpec type for use with
+// NetworkSpecApplyConfiguration constructs a declarative configuration of the NetworkSpec type for use with
// apply.
func NetworkSpec() *NetworkSpecApplyConfiguration {
return &NetworkSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkstatus.go
index a2994e8112..de3697ed71 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkstatus.go
@@ -6,7 +6,7 @@ import (
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// NetworkStatusApplyConfiguration represents an declarative configuration of the NetworkStatus type for use
+// NetworkStatusApplyConfiguration represents a declarative configuration of the NetworkStatus type for use
// with apply.
type NetworkStatusApplyConfiguration struct {
ClusterNetwork []ClusterNetworkEntryApplyConfiguration `json:"clusterNetwork,omitempty"`
@@ -17,7 +17,7 @@ type NetworkStatusApplyConfiguration struct {
Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}
-// NetworkStatusApplyConfiguration constructs an declarative configuration of the NetworkStatus type for use with
+// NetworkStatusApplyConfiguration constructs a declarative configuration of the NetworkStatus type for use with
// apply.
func NetworkStatus() *NetworkStatusApplyConfiguration {
return &NetworkStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/node.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/node.go
index a407a9e450..ac4deeb66c 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/node.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/node.go
@@ -11,16 +11,16 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// NodeApplyConfiguration represents an declarative configuration of the Node type for use
+// NodeApplyConfiguration represents a declarative configuration of the Node type for use
// with apply.
type NodeApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
- Spec *NodeSpecApplyConfiguration `json:"spec,omitempty"`
- Status *apiconfigv1.NodeStatus `json:"status,omitempty"`
+ Spec *NodeSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *NodeStatusApplyConfiguration `json:"status,omitempty"`
}
-// Node constructs an declarative configuration of the Node type for use with
+// Node constructs a declarative configuration of the Node type for use with
// apply.
func Node(name string) *NodeApplyConfiguration {
b := &NodeApplyConfiguration{}
@@ -234,7 +234,13 @@ func (b *NodeApplyConfiguration) WithSpec(value *NodeSpecApplyConfiguration) *No
// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
-func (b *NodeApplyConfiguration) WithStatus(value apiconfigv1.NodeStatus) *NodeApplyConfiguration {
- b.Status = &value
+func (b *NodeApplyConfiguration) WithStatus(value *NodeStatusApplyConfiguration) *NodeApplyConfiguration {
+ b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *NodeApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nodespec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nodespec.go
index 3b7bf903bc..f1c513f4cb 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nodespec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nodespec.go
@@ -6,14 +6,15 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// NodeSpecApplyConfiguration represents an declarative configuration of the NodeSpec type for use
+// NodeSpecApplyConfiguration represents a declarative configuration of the NodeSpec type for use
// with apply.
type NodeSpecApplyConfiguration struct {
- CgroupMode *v1.CgroupMode `json:"cgroupMode,omitempty"`
- WorkerLatencyProfile *v1.WorkerLatencyProfileType `json:"workerLatencyProfile,omitempty"`
+ CgroupMode *v1.CgroupMode `json:"cgroupMode,omitempty"`
+ WorkerLatencyProfile *v1.WorkerLatencyProfileType `json:"workerLatencyProfile,omitempty"`
+ MinimumKubeletVersion *string `json:"minimumKubeletVersion,omitempty"`
}
-// NodeSpecApplyConfiguration constructs an declarative configuration of the NodeSpec type for use with
+// NodeSpecApplyConfiguration constructs a declarative configuration of the NodeSpec type for use with
// apply.
func NodeSpec() *NodeSpecApplyConfiguration {
return &NodeSpecApplyConfiguration{}
@@ -34,3 +35,11 @@ func (b *NodeSpecApplyConfiguration) WithWorkerLatencyProfile(value v1.WorkerLat
b.WorkerLatencyProfile = &value
return b
}
+
+// WithMinimumKubeletVersion sets the MinimumKubeletVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MinimumKubeletVersion field is set to the value of the last call.
+func (b *NodeSpecApplyConfiguration) WithMinimumKubeletVersion(value string) *NodeSpecApplyConfiguration {
+ b.MinimumKubeletVersion = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nodestatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nodestatus.go
new file mode 100644
index 0000000000..e36466526e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nodestatus.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// NodeStatusApplyConfiguration represents a declarative configuration of the NodeStatus type for use
+// with apply.
+type NodeStatusApplyConfiguration struct {
+ Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
+}
+
+// NodeStatusApplyConfiguration constructs a declarative configuration of the NodeStatus type for use with
+// apply.
+func NodeStatus() *NodeStatusApplyConfiguration {
+ return &NodeStatusApplyConfiguration{}
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *NodeStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *NodeStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixfailuredomain.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixfailuredomain.go
index 5af68e441c..31d77a83e2 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixfailuredomain.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixfailuredomain.go
@@ -2,7 +2,7 @@
package v1
-// NutanixFailureDomainApplyConfiguration represents an declarative configuration of the NutanixFailureDomain type for use
+// NutanixFailureDomainApplyConfiguration represents a declarative configuration of the NutanixFailureDomain type for use
// with apply.
type NutanixFailureDomainApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -10,7 +10,7 @@ type NutanixFailureDomainApplyConfiguration struct {
Subnets []NutanixResourceIdentifierApplyConfiguration `json:"subnets,omitempty"`
}
-// NutanixFailureDomainApplyConfiguration constructs an declarative configuration of the NutanixFailureDomain type for use with
+// NutanixFailureDomainApplyConfiguration constructs a declarative configuration of the NutanixFailureDomain type for use with
// apply.
func NutanixFailureDomain() *NutanixFailureDomainApplyConfiguration {
return &NutanixFailureDomainApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformloadbalancer.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformloadbalancer.go
index 5ab68bb779..3578f512b4 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformloadbalancer.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformloadbalancer.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// NutanixPlatformLoadBalancerApplyConfiguration represents an declarative configuration of the NutanixPlatformLoadBalancer type for use
+// NutanixPlatformLoadBalancerApplyConfiguration represents a declarative configuration of the NutanixPlatformLoadBalancer type for use
// with apply.
type NutanixPlatformLoadBalancerApplyConfiguration struct {
Type *v1.PlatformLoadBalancerType `json:"type,omitempty"`
}
-// NutanixPlatformLoadBalancerApplyConfiguration constructs an declarative configuration of the NutanixPlatformLoadBalancer type for use with
+// NutanixPlatformLoadBalancerApplyConfiguration constructs a declarative configuration of the NutanixPlatformLoadBalancer type for use with
// apply.
func NutanixPlatformLoadBalancer() *NutanixPlatformLoadBalancerApplyConfiguration {
return &NutanixPlatformLoadBalancerApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformspec.go
index d36708229f..8f7cb98423 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformspec.go
@@ -2,7 +2,7 @@
package v1
-// NutanixPlatformSpecApplyConfiguration represents an declarative configuration of the NutanixPlatformSpec type for use
+// NutanixPlatformSpecApplyConfiguration represents a declarative configuration of the NutanixPlatformSpec type for use
// with apply.
type NutanixPlatformSpecApplyConfiguration struct {
PrismCentral *NutanixPrismEndpointApplyConfiguration `json:"prismCentral,omitempty"`
@@ -10,7 +10,7 @@ type NutanixPlatformSpecApplyConfiguration struct {
FailureDomains []NutanixFailureDomainApplyConfiguration `json:"failureDomains,omitempty"`
}
-// NutanixPlatformSpecApplyConfiguration constructs an declarative configuration of the NutanixPlatformSpec type for use with
+// NutanixPlatformSpecApplyConfiguration constructs a declarative configuration of the NutanixPlatformSpec type for use with
// apply.
func NutanixPlatformSpec() *NutanixPlatformSpecApplyConfiguration {
return &NutanixPlatformSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformstatus.go
index 8dd8a68952..d7988e5115 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixplatformstatus.go
@@ -2,7 +2,7 @@
package v1
-// NutanixPlatformStatusApplyConfiguration represents an declarative configuration of the NutanixPlatformStatus type for use
+// NutanixPlatformStatusApplyConfiguration represents a declarative configuration of the NutanixPlatformStatus type for use
// with apply.
type NutanixPlatformStatusApplyConfiguration struct {
APIServerInternalIP *string `json:"apiServerInternalIP,omitempty"`
@@ -12,7 +12,7 @@ type NutanixPlatformStatusApplyConfiguration struct {
LoadBalancer *NutanixPlatformLoadBalancerApplyConfiguration `json:"loadBalancer,omitempty"`
}
-// NutanixPlatformStatusApplyConfiguration constructs an declarative configuration of the NutanixPlatformStatus type for use with
+// NutanixPlatformStatusApplyConfiguration constructs a declarative configuration of the NutanixPlatformStatus type for use with
// apply.
func NutanixPlatformStatus() *NutanixPlatformStatusApplyConfiguration {
return &NutanixPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixprismelementendpoint.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixprismelementendpoint.go
index 3251b5343e..2e59ff235a 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixprismelementendpoint.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixprismelementendpoint.go
@@ -2,14 +2,14 @@
package v1
-// NutanixPrismElementEndpointApplyConfiguration represents an declarative configuration of the NutanixPrismElementEndpoint type for use
+// NutanixPrismElementEndpointApplyConfiguration represents a declarative configuration of the NutanixPrismElementEndpoint type for use
// with apply.
type NutanixPrismElementEndpointApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Endpoint *NutanixPrismEndpointApplyConfiguration `json:"endpoint,omitempty"`
}
-// NutanixPrismElementEndpointApplyConfiguration constructs an declarative configuration of the NutanixPrismElementEndpoint type for use with
+// NutanixPrismElementEndpointApplyConfiguration constructs a declarative configuration of the NutanixPrismElementEndpoint type for use with
// apply.
func NutanixPrismElementEndpoint() *NutanixPrismElementEndpointApplyConfiguration {
return &NutanixPrismElementEndpointApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixprismendpoint.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixprismendpoint.go
index a901573249..8012c2cb23 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixprismendpoint.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixprismendpoint.go
@@ -2,14 +2,14 @@
package v1
-// NutanixPrismEndpointApplyConfiguration represents an declarative configuration of the NutanixPrismEndpoint type for use
+// NutanixPrismEndpointApplyConfiguration represents a declarative configuration of the NutanixPrismEndpoint type for use
// with apply.
type NutanixPrismEndpointApplyConfiguration struct {
Address *string `json:"address,omitempty"`
Port *int32 `json:"port,omitempty"`
}
-// NutanixPrismEndpointApplyConfiguration constructs an declarative configuration of the NutanixPrismEndpoint type for use with
+// NutanixPrismEndpointApplyConfiguration constructs a declarative configuration of the NutanixPrismEndpoint type for use with
// apply.
func NutanixPrismEndpoint() *NutanixPrismEndpointApplyConfiguration {
return &NutanixPrismEndpointApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixresourceidentifier.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixresourceidentifier.go
index cb039c42e9..f06b7c5d9d 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixresourceidentifier.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixresourceidentifier.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// NutanixResourceIdentifierApplyConfiguration represents an declarative configuration of the NutanixResourceIdentifier type for use
+// NutanixResourceIdentifierApplyConfiguration represents a declarative configuration of the NutanixResourceIdentifier type for use
// with apply.
type NutanixResourceIdentifierApplyConfiguration struct {
Type *v1.NutanixIdentifierType `json:"type,omitempty"`
@@ -14,7 +14,7 @@ type NutanixResourceIdentifierApplyConfiguration struct {
Name *string `json:"name,omitempty"`
}
-// NutanixResourceIdentifierApplyConfiguration constructs an declarative configuration of the NutanixResourceIdentifier type for use with
+// NutanixResourceIdentifierApplyConfiguration constructs a declarative configuration of the NutanixResourceIdentifier type for use with
// apply.
func NutanixResourceIdentifier() *NutanixResourceIdentifierApplyConfiguration {
return &NutanixResourceIdentifierApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauth.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauth.go
index 1067348bd8..61d6739c48 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauth.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauth.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// OAuthApplyConfiguration represents an declarative configuration of the OAuth type for use
+// OAuthApplyConfiguration represents a declarative configuration of the OAuth type for use
// with apply.
type OAuthApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type OAuthApplyConfiguration struct {
Status *apiconfigv1.OAuthStatus `json:"status,omitempty"`
}
-// OAuth constructs an declarative configuration of the OAuth type for use with
+// OAuth constructs a declarative configuration of the OAuth type for use with
// apply.
func OAuth(name string) *OAuthApplyConfiguration {
b := &OAuthApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *OAuthApplyConfiguration) WithStatus(value apiconfigv1.OAuthStatus) *OAu
b.Status = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *OAuthApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthremoteconnectioninfo.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthremoteconnectioninfo.go
index 5a1cca90f7..3b348819d9 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthremoteconnectioninfo.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthremoteconnectioninfo.go
@@ -2,7 +2,7 @@
package v1
-// OAuthRemoteConnectionInfoApplyConfiguration represents an declarative configuration of the OAuthRemoteConnectionInfo type for use
+// OAuthRemoteConnectionInfoApplyConfiguration represents a declarative configuration of the OAuthRemoteConnectionInfo type for use
// with apply.
type OAuthRemoteConnectionInfoApplyConfiguration struct {
URL *string `json:"url,omitempty"`
@@ -11,7 +11,7 @@ type OAuthRemoteConnectionInfoApplyConfiguration struct {
TLSClientKey *SecretNameReferenceApplyConfiguration `json:"tlsClientKey,omitempty"`
}
-// OAuthRemoteConnectionInfoApplyConfiguration constructs an declarative configuration of the OAuthRemoteConnectionInfo type for use with
+// OAuthRemoteConnectionInfoApplyConfiguration constructs a declarative configuration of the OAuthRemoteConnectionInfo type for use with
// apply.
func OAuthRemoteConnectionInfo() *OAuthRemoteConnectionInfoApplyConfiguration {
return &OAuthRemoteConnectionInfoApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthspec.go
index 3fd9878827..5eacc05cb4 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthspec.go
@@ -2,7 +2,7 @@
package v1
-// OAuthSpecApplyConfiguration represents an declarative configuration of the OAuthSpec type for use
+// OAuthSpecApplyConfiguration represents a declarative configuration of the OAuthSpec type for use
// with apply.
type OAuthSpecApplyConfiguration struct {
IdentityProviders []IdentityProviderApplyConfiguration `json:"identityProviders,omitempty"`
@@ -10,7 +10,7 @@ type OAuthSpecApplyConfiguration struct {
Templates *OAuthTemplatesApplyConfiguration `json:"templates,omitempty"`
}
-// OAuthSpecApplyConfiguration constructs an declarative configuration of the OAuthSpec type for use with
+// OAuthSpecApplyConfiguration constructs a declarative configuration of the OAuthSpec type for use with
// apply.
func OAuthSpec() *OAuthSpecApplyConfiguration {
return &OAuthSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthtemplates.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthtemplates.go
index 99b615e1b4..98bc5a0db9 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthtemplates.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oauthtemplates.go
@@ -2,7 +2,7 @@
package v1
-// OAuthTemplatesApplyConfiguration represents an declarative configuration of the OAuthTemplates type for use
+// OAuthTemplatesApplyConfiguration represents a declarative configuration of the OAuthTemplates type for use
// with apply.
type OAuthTemplatesApplyConfiguration struct {
Login *SecretNameReferenceApplyConfiguration `json:"login,omitempty"`
@@ -10,7 +10,7 @@ type OAuthTemplatesApplyConfiguration struct {
Error *SecretNameReferenceApplyConfiguration `json:"error,omitempty"`
}
-// OAuthTemplatesApplyConfiguration constructs an declarative configuration of the OAuthTemplates type for use with
+// OAuthTemplatesApplyConfiguration constructs a declarative configuration of the OAuthTemplates type for use with
// apply.
func OAuthTemplates() *OAuthTemplatesApplyConfiguration {
return &OAuthTemplatesApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/objectreference.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/objectreference.go
index fd46a832d2..dfbc465e71 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/objectreference.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/objectreference.go
@@ -2,7 +2,7 @@
package v1
-// ObjectReferenceApplyConfiguration represents an declarative configuration of the ObjectReference type for use
+// ObjectReferenceApplyConfiguration represents a declarative configuration of the ObjectReference type for use
// with apply.
type ObjectReferenceApplyConfiguration struct {
Group *string `json:"group,omitempty"`
@@ -11,7 +11,7 @@ type ObjectReferenceApplyConfiguration struct {
Name *string `json:"name,omitempty"`
}
-// ObjectReferenceApplyConfiguration constructs an declarative configuration of the ObjectReference type for use with
+// ObjectReferenceApplyConfiguration constructs a declarative configuration of the ObjectReference type for use with
// apply.
func ObjectReference() *ObjectReferenceApplyConfiguration {
return &ObjectReferenceApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientconfig.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientconfig.go
index 1a66c43aa3..65fa3dd462 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientconfig.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientconfig.go
@@ -2,7 +2,7 @@
package v1
-// OIDCClientConfigApplyConfiguration represents an declarative configuration of the OIDCClientConfig type for use
+// OIDCClientConfigApplyConfiguration represents a declarative configuration of the OIDCClientConfig type for use
// with apply.
type OIDCClientConfigApplyConfiguration struct {
ComponentName *string `json:"componentName,omitempty"`
@@ -12,7 +12,7 @@ type OIDCClientConfigApplyConfiguration struct {
ExtraScopes []string `json:"extraScopes,omitempty"`
}
-// OIDCClientConfigApplyConfiguration constructs an declarative configuration of the OIDCClientConfig type for use with
+// OIDCClientConfigApplyConfiguration constructs a declarative configuration of the OIDCClientConfig type for use with
// apply.
func OIDCClientConfig() *OIDCClientConfigApplyConfiguration {
return &OIDCClientConfigApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientreference.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientreference.go
index 3c20508e54..5109305b23 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientreference.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientreference.go
@@ -2,7 +2,7 @@
package v1
-// OIDCClientReferenceApplyConfiguration represents an declarative configuration of the OIDCClientReference type for use
+// OIDCClientReferenceApplyConfiguration represents a declarative configuration of the OIDCClientReference type for use
// with apply.
type OIDCClientReferenceApplyConfiguration struct {
OIDCProviderName *string `json:"oidcProviderName,omitempty"`
@@ -10,7 +10,7 @@ type OIDCClientReferenceApplyConfiguration struct {
ClientID *string `json:"clientID,omitempty"`
}
-// OIDCClientReferenceApplyConfiguration constructs an declarative configuration of the OIDCClientReference type for use with
+// OIDCClientReferenceApplyConfiguration constructs a declarative configuration of the OIDCClientReference type for use with
// apply.
func OIDCClientReference() *OIDCClientReferenceApplyConfiguration {
return &OIDCClientReferenceApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientstatus.go
index 7a57e89d06..5d365a87ec 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientstatus.go
@@ -7,7 +7,7 @@ import (
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// OIDCClientStatusApplyConfiguration represents an declarative configuration of the OIDCClientStatus type for use
+// OIDCClientStatusApplyConfiguration represents a declarative configuration of the OIDCClientStatus type for use
// with apply.
type OIDCClientStatusApplyConfiguration struct {
ComponentName *string `json:"componentName,omitempty"`
@@ -17,7 +17,7 @@ type OIDCClientStatusApplyConfiguration struct {
Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}
-// OIDCClientStatusApplyConfiguration constructs an declarative configuration of the OIDCClientStatus type for use with
+// OIDCClientStatusApplyConfiguration constructs a declarative configuration of the OIDCClientStatus type for use with
// apply.
func OIDCClientStatus() *OIDCClientStatusApplyConfiguration {
return &OIDCClientStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcprovider.go
index d700ea5e15..7d93003673 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcprovider.go
@@ -2,7 +2,7 @@
package v1
-// OIDCProviderApplyConfiguration represents an declarative configuration of the OIDCProvider type for use
+// OIDCProviderApplyConfiguration represents a declarative configuration of the OIDCProvider type for use
// with apply.
type OIDCProviderApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -12,7 +12,7 @@ type OIDCProviderApplyConfiguration struct {
ClaimValidationRules []TokenClaimValidationRuleApplyConfiguration `json:"claimValidationRules,omitempty"`
}
-// OIDCProviderApplyConfiguration constructs an declarative configuration of the OIDCProvider type for use with
+// OIDCProviderApplyConfiguration constructs a declarative configuration of the OIDCProvider type for use with
// apply.
func OIDCProvider() *OIDCProviderApplyConfiguration {
return &OIDCProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openidclaims.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openidclaims.go
index ddaa7d5056..18c2a768f7 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openidclaims.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openidclaims.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// OpenIDClaimsApplyConfiguration represents an declarative configuration of the OpenIDClaims type for use
+// OpenIDClaimsApplyConfiguration represents a declarative configuration of the OpenIDClaims type for use
// with apply.
type OpenIDClaimsApplyConfiguration struct {
PreferredUsername []string `json:"preferredUsername,omitempty"`
@@ -15,7 +15,7 @@ type OpenIDClaimsApplyConfiguration struct {
Groups []v1.OpenIDClaim `json:"groups,omitempty"`
}
-// OpenIDClaimsApplyConfiguration constructs an declarative configuration of the OpenIDClaims type for use with
+// OpenIDClaimsApplyConfiguration constructs a declarative configuration of the OpenIDClaims type for use with
// apply.
func OpenIDClaims() *OpenIDClaimsApplyConfiguration {
return &OpenIDClaimsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openididentityprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openididentityprovider.go
index 6b143db8be..9372178cf2 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openididentityprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openididentityprovider.go
@@ -2,7 +2,7 @@
package v1
-// OpenIDIdentityProviderApplyConfiguration represents an declarative configuration of the OpenIDIdentityProvider type for use
+// OpenIDIdentityProviderApplyConfiguration represents a declarative configuration of the OpenIDIdentityProvider type for use
// with apply.
type OpenIDIdentityProviderApplyConfiguration struct {
ClientID *string `json:"clientID,omitempty"`
@@ -14,7 +14,7 @@ type OpenIDIdentityProviderApplyConfiguration struct {
Claims *OpenIDClaimsApplyConfiguration `json:"claims,omitempty"`
}
-// OpenIDIdentityProviderApplyConfiguration constructs an declarative configuration of the OpenIDIdentityProvider type for use with
+// OpenIDIdentityProviderApplyConfiguration constructs a declarative configuration of the OpenIDIdentityProvider type for use with
// apply.
func OpenIDIdentityProvider() *OpenIDIdentityProviderApplyConfiguration {
return &OpenIDIdentityProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformloadbalancer.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformloadbalancer.go
index 2eed83e1cb..3e4990789f 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformloadbalancer.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformloadbalancer.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// OpenStackPlatformLoadBalancerApplyConfiguration represents an declarative configuration of the OpenStackPlatformLoadBalancer type for use
+// OpenStackPlatformLoadBalancerApplyConfiguration represents a declarative configuration of the OpenStackPlatformLoadBalancer type for use
// with apply.
type OpenStackPlatformLoadBalancerApplyConfiguration struct {
Type *v1.PlatformLoadBalancerType `json:"type,omitempty"`
}
-// OpenStackPlatformLoadBalancerApplyConfiguration constructs an declarative configuration of the OpenStackPlatformLoadBalancer type for use with
+// OpenStackPlatformLoadBalancerApplyConfiguration constructs a declarative configuration of the OpenStackPlatformLoadBalancer type for use with
// apply.
func OpenStackPlatformLoadBalancer() *OpenStackPlatformLoadBalancerApplyConfiguration {
return &OpenStackPlatformLoadBalancerApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformspec.go
index 3a54152ae9..393a1bb939 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformspec.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// OpenStackPlatformSpecApplyConfiguration represents an declarative configuration of the OpenStackPlatformSpec type for use
+// OpenStackPlatformSpecApplyConfiguration represents a declarative configuration of the OpenStackPlatformSpec type for use
// with apply.
type OpenStackPlatformSpecApplyConfiguration struct {
APIServerInternalIPs []v1.IP `json:"apiServerInternalIPs,omitempty"`
@@ -14,7 +14,7 @@ type OpenStackPlatformSpecApplyConfiguration struct {
MachineNetworks []v1.CIDR `json:"machineNetworks,omitempty"`
}
-// OpenStackPlatformSpecApplyConfiguration constructs an declarative configuration of the OpenStackPlatformSpec type for use with
+// OpenStackPlatformSpecApplyConfiguration constructs a declarative configuration of the OpenStackPlatformSpec type for use with
// apply.
func OpenStackPlatformSpec() *OpenStackPlatformSpecApplyConfiguration {
return &OpenStackPlatformSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformstatus.go
index 8cfab14db9..f06c78e243 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformstatus.go
@@ -6,7 +6,7 @@ import (
configv1 "github.com/openshift/api/config/v1"
)
-// OpenStackPlatformStatusApplyConfiguration represents an declarative configuration of the OpenStackPlatformStatus type for use
+// OpenStackPlatformStatusApplyConfiguration represents a declarative configuration of the OpenStackPlatformStatus type for use
// with apply.
type OpenStackPlatformStatusApplyConfiguration struct {
APIServerInternalIP *string `json:"apiServerInternalIP,omitempty"`
@@ -19,7 +19,7 @@ type OpenStackPlatformStatusApplyConfiguration struct {
MachineNetworks []configv1.CIDR `json:"machineNetworks,omitempty"`
}
-// OpenStackPlatformStatusApplyConfiguration constructs an declarative configuration of the OpenStackPlatformStatus type for use with
+// OpenStackPlatformStatusApplyConfiguration constructs a declarative configuration of the OpenStackPlatformStatus type for use with
// apply.
func OpenStackPlatformStatus() *OpenStackPlatformStatusApplyConfiguration {
return &OpenStackPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operandversion.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operandversion.go
index 6d9fc37c88..6c4336d6eb 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operandversion.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operandversion.go
@@ -2,14 +2,14 @@
package v1
-// OperandVersionApplyConfiguration represents an declarative configuration of the OperandVersion type for use
+// OperandVersionApplyConfiguration represents a declarative configuration of the OperandVersion type for use
// with apply.
type OperandVersionApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Version *string `json:"version,omitempty"`
}
-// OperandVersionApplyConfiguration constructs an declarative configuration of the OperandVersion type for use with
+// OperandVersionApplyConfiguration constructs a declarative configuration of the OperandVersion type for use with
// apply.
func OperandVersion() *OperandVersionApplyConfiguration {
return &OperandVersionApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhub.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhub.go
index 57f017a9dc..bda9b75e8b 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhub.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhub.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// OperatorHubApplyConfiguration represents an declarative configuration of the OperatorHub type for use
+// OperatorHubApplyConfiguration represents a declarative configuration of the OperatorHub type for use
// with apply.
type OperatorHubApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type OperatorHubApplyConfiguration struct {
Status *OperatorHubStatusApplyConfiguration `json:"status,omitempty"`
}
-// OperatorHub constructs an declarative configuration of the OperatorHub type for use with
+// OperatorHub constructs a declarative configuration of the OperatorHub type for use with
// apply.
func OperatorHub(name string) *OperatorHubApplyConfiguration {
b := &OperatorHubApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *OperatorHubApplyConfiguration) WithStatus(value *OperatorHubStatusApply
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *OperatorHubApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhubspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhubspec.go
index 831b0769ec..56179c4cf9 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhubspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhubspec.go
@@ -2,14 +2,14 @@
package v1
-// OperatorHubSpecApplyConfiguration represents an declarative configuration of the OperatorHubSpec type for use
+// OperatorHubSpecApplyConfiguration represents a declarative configuration of the OperatorHubSpec type for use
// with apply.
type OperatorHubSpecApplyConfiguration struct {
DisableAllDefaultSources *bool `json:"disableAllDefaultSources,omitempty"`
Sources []HubSourceApplyConfiguration `json:"sources,omitempty"`
}
-// OperatorHubSpecApplyConfiguration constructs an declarative configuration of the OperatorHubSpec type for use with
+// OperatorHubSpecApplyConfiguration constructs a declarative configuration of the OperatorHubSpec type for use with
// apply.
func OperatorHubSpec() *OperatorHubSpecApplyConfiguration {
return &OperatorHubSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhubstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhubstatus.go
index 86c134ff58..7e7cda1ac6 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhubstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/operatorhubstatus.go
@@ -2,13 +2,13 @@
package v1
-// OperatorHubStatusApplyConfiguration represents an declarative configuration of the OperatorHubStatus type for use
+// OperatorHubStatusApplyConfiguration represents a declarative configuration of the OperatorHubStatus type for use
// with apply.
type OperatorHubStatusApplyConfiguration struct {
Sources []HubSourceStatusApplyConfiguration `json:"sources,omitempty"`
}
-// OperatorHubStatusApplyConfiguration constructs an declarative configuration of the OperatorHubStatus type for use with
+// OperatorHubStatusApplyConfiguration constructs a declarative configuration of the OperatorHubStatus type for use with
// apply.
func OperatorHubStatus() *OperatorHubStatusApplyConfiguration {
return &OperatorHubStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ovirtplatformloadbalancer.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ovirtplatformloadbalancer.go
index 73c2a03a5d..b679a55fd0 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ovirtplatformloadbalancer.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ovirtplatformloadbalancer.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// OvirtPlatformLoadBalancerApplyConfiguration represents an declarative configuration of the OvirtPlatformLoadBalancer type for use
+// OvirtPlatformLoadBalancerApplyConfiguration represents a declarative configuration of the OvirtPlatformLoadBalancer type for use
// with apply.
type OvirtPlatformLoadBalancerApplyConfiguration struct {
Type *v1.PlatformLoadBalancerType `json:"type,omitempty"`
}
-// OvirtPlatformLoadBalancerApplyConfiguration constructs an declarative configuration of the OvirtPlatformLoadBalancer type for use with
+// OvirtPlatformLoadBalancerApplyConfiguration constructs a declarative configuration of the OvirtPlatformLoadBalancer type for use with
// apply.
func OvirtPlatformLoadBalancer() *OvirtPlatformLoadBalancerApplyConfiguration {
return &OvirtPlatformLoadBalancerApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ovirtplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ovirtplatformstatus.go
index 21bb6c8426..18ad5d8492 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ovirtplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ovirtplatformstatus.go
@@ -2,7 +2,7 @@
package v1
-// OvirtPlatformStatusApplyConfiguration represents an declarative configuration of the OvirtPlatformStatus type for use
+// OvirtPlatformStatusApplyConfiguration represents a declarative configuration of the OvirtPlatformStatus type for use
// with apply.
type OvirtPlatformStatusApplyConfiguration struct {
APIServerInternalIP *string `json:"apiServerInternalIP,omitempty"`
@@ -13,7 +13,7 @@ type OvirtPlatformStatusApplyConfiguration struct {
LoadBalancer *OvirtPlatformLoadBalancerApplyConfiguration `json:"loadBalancer,omitempty"`
}
-// OvirtPlatformStatusApplyConfiguration constructs an declarative configuration of the OvirtPlatformStatus type for use with
+// OvirtPlatformStatusApplyConfiguration constructs a declarative configuration of the OvirtPlatformStatus type for use with
// apply.
func OvirtPlatformStatus() *OvirtPlatformStatusApplyConfiguration {
return &OvirtPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/platformspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/platformspec.go
index b5d001691c..6ff5bcf0cb 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/platformspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/platformspec.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// PlatformSpecApplyConfiguration represents an declarative configuration of the PlatformSpec type for use
+// PlatformSpecApplyConfiguration represents a declarative configuration of the PlatformSpec type for use
// with apply.
type PlatformSpecApplyConfiguration struct {
Type *v1.PlatformType `json:"type,omitempty"`
@@ -26,7 +26,7 @@ type PlatformSpecApplyConfiguration struct {
External *ExternalPlatformSpecApplyConfiguration `json:"external,omitempty"`
}
-// PlatformSpecApplyConfiguration constructs an declarative configuration of the PlatformSpec type for use with
+// PlatformSpecApplyConfiguration constructs a declarative configuration of the PlatformSpec type for use with
// apply.
func PlatformSpec() *PlatformSpecApplyConfiguration {
return &PlatformSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/platformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/platformstatus.go
index b6afa04a6c..6519ef8b02 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/platformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/platformstatus.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// PlatformStatusApplyConfiguration represents an declarative configuration of the PlatformStatus type for use
+// PlatformStatusApplyConfiguration represents a declarative configuration of the PlatformStatus type for use
// with apply.
type PlatformStatusApplyConfiguration struct {
Type *v1.PlatformType `json:"type,omitempty"`
@@ -26,7 +26,7 @@ type PlatformStatusApplyConfiguration struct {
External *ExternalPlatformStatusApplyConfiguration `json:"external,omitempty"`
}
-// PlatformStatusApplyConfiguration constructs an declarative configuration of the PlatformStatus type for use with
+// PlatformStatusApplyConfiguration constructs a declarative configuration of the PlatformStatus type for use with
// apply.
func PlatformStatus() *PlatformStatusApplyConfiguration {
return &PlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsplatformspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsplatformspec.go
index c371a6a262..db3c3d1d93 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsplatformspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsplatformspec.go
@@ -2,13 +2,13 @@
package v1
-// PowerVSPlatformSpecApplyConfiguration represents an declarative configuration of the PowerVSPlatformSpec type for use
+// PowerVSPlatformSpecApplyConfiguration represents a declarative configuration of the PowerVSPlatformSpec type for use
// with apply.
type PowerVSPlatformSpecApplyConfiguration struct {
ServiceEndpoints []PowerVSServiceEndpointApplyConfiguration `json:"serviceEndpoints,omitempty"`
}
-// PowerVSPlatformSpecApplyConfiguration constructs an declarative configuration of the PowerVSPlatformSpec type for use with
+// PowerVSPlatformSpecApplyConfiguration constructs a declarative configuration of the PowerVSPlatformSpec type for use with
// apply.
func PowerVSPlatformSpec() *PowerVSPlatformSpecApplyConfiguration {
return &PowerVSPlatformSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsplatformstatus.go
index c1660d005a..f40099f16f 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsplatformstatus.go
@@ -2,7 +2,7 @@
package v1
-// PowerVSPlatformStatusApplyConfiguration represents an declarative configuration of the PowerVSPlatformStatus type for use
+// PowerVSPlatformStatusApplyConfiguration represents a declarative configuration of the PowerVSPlatformStatus type for use
// with apply.
type PowerVSPlatformStatusApplyConfiguration struct {
Region *string `json:"region,omitempty"`
@@ -13,7 +13,7 @@ type PowerVSPlatformStatusApplyConfiguration struct {
DNSInstanceCRN *string `json:"dnsInstanceCRN,omitempty"`
}
-// PowerVSPlatformStatusApplyConfiguration constructs an declarative configuration of the PowerVSPlatformStatus type for use with
+// PowerVSPlatformStatusApplyConfiguration constructs a declarative configuration of the PowerVSPlatformStatus type for use with
// apply.
func PowerVSPlatformStatus() *PowerVSPlatformStatusApplyConfiguration {
return &PowerVSPlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsserviceendpoint.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsserviceendpoint.go
index ef262d38cd..8fd231a2ab 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsserviceendpoint.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/powervsserviceendpoint.go
@@ -2,14 +2,14 @@
package v1
-// PowerVSServiceEndpointApplyConfiguration represents an declarative configuration of the PowerVSServiceEndpoint type for use
+// PowerVSServiceEndpointApplyConfiguration represents a declarative configuration of the PowerVSServiceEndpoint type for use
// with apply.
type PowerVSServiceEndpointApplyConfiguration struct {
Name *string `json:"name,omitempty"`
URL *string `json:"url,omitempty"`
}
-// PowerVSServiceEndpointApplyConfiguration constructs an declarative configuration of the PowerVSServiceEndpoint type for use with
+// PowerVSServiceEndpointApplyConfiguration constructs a declarative configuration of the PowerVSServiceEndpoint type for use with
// apply.
func PowerVSServiceEndpoint() *PowerVSServiceEndpointApplyConfiguration {
return &PowerVSServiceEndpointApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/prefixedclaimmapping.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/prefixedclaimmapping.go
index fedc364e3f..bf10a68916 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/prefixedclaimmapping.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/prefixedclaimmapping.go
@@ -2,14 +2,14 @@
package v1
-// PrefixedClaimMappingApplyConfiguration represents an declarative configuration of the PrefixedClaimMapping type for use
+// PrefixedClaimMappingApplyConfiguration represents a declarative configuration of the PrefixedClaimMapping type for use
// with apply.
type PrefixedClaimMappingApplyConfiguration struct {
TokenClaimMappingApplyConfiguration `json:",inline"`
Prefix *string `json:"prefix,omitempty"`
}
-// PrefixedClaimMappingApplyConfiguration constructs an declarative configuration of the PrefixedClaimMapping type for use with
+// PrefixedClaimMappingApplyConfiguration constructs a declarative configuration of the PrefixedClaimMapping type for use with
// apply.
func PrefixedClaimMapping() *PrefixedClaimMappingApplyConfiguration {
return &PrefixedClaimMappingApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/profilecustomizations.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/profilecustomizations.go
index 15723fcc6b..f0e90acc97 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/profilecustomizations.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/profilecustomizations.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// ProfileCustomizationsApplyConfiguration represents an declarative configuration of the ProfileCustomizations type for use
+// ProfileCustomizationsApplyConfiguration represents a declarative configuration of the ProfileCustomizations type for use
// with apply.
type ProfileCustomizationsApplyConfiguration struct {
DynamicResourceAllocation *v1.DRAEnablement `json:"dynamicResourceAllocation,omitempty"`
}
-// ProfileCustomizationsApplyConfiguration constructs an declarative configuration of the ProfileCustomizations type for use with
+// ProfileCustomizationsApplyConfiguration constructs a declarative configuration of the ProfileCustomizations type for use with
// apply.
func ProfileCustomizations() *ProfileCustomizationsApplyConfiguration {
return &ProfileCustomizationsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/project.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/project.go
index 9e074da6c4..864277b594 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/project.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/project.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ProjectApplyConfiguration represents an declarative configuration of the Project type for use
+// ProjectApplyConfiguration represents a declarative configuration of the Project type for use
// with apply.
type ProjectApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ProjectApplyConfiguration struct {
Status *apiconfigv1.ProjectStatus `json:"status,omitempty"`
}
-// Project constructs an declarative configuration of the Project type for use with
+// Project constructs a declarative configuration of the Project type for use with
// apply.
func Project(name string) *ProjectApplyConfiguration {
b := &ProjectApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *ProjectApplyConfiguration) WithStatus(value apiconfigv1.ProjectStatus)
b.Status = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ProjectApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/projectspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/projectspec.go
index 0e0a2334ee..417be90be4 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/projectspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/projectspec.go
@@ -2,14 +2,14 @@
package v1
-// ProjectSpecApplyConfiguration represents an declarative configuration of the ProjectSpec type for use
+// ProjectSpecApplyConfiguration represents a declarative configuration of the ProjectSpec type for use
// with apply.
type ProjectSpecApplyConfiguration struct {
ProjectRequestMessage *string `json:"projectRequestMessage,omitempty"`
ProjectRequestTemplate *TemplateReferenceApplyConfiguration `json:"projectRequestTemplate,omitempty"`
}
-// ProjectSpecApplyConfiguration constructs an declarative configuration of the ProjectSpec type for use with
+// ProjectSpecApplyConfiguration constructs a declarative configuration of the ProjectSpec type for use with
// apply.
func ProjectSpec() *ProjectSpecApplyConfiguration {
return &ProjectSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/promqlclustercondition.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/promqlclustercondition.go
index 282559a40d..e3f40e4f9e 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/promqlclustercondition.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/promqlclustercondition.go
@@ -2,13 +2,13 @@
package v1
-// PromQLClusterConditionApplyConfiguration represents an declarative configuration of the PromQLClusterCondition type for use
+// PromQLClusterConditionApplyConfiguration represents a declarative configuration of the PromQLClusterCondition type for use
// with apply.
type PromQLClusterConditionApplyConfiguration struct {
PromQL *string `json:"promql,omitempty"`
}
-// PromQLClusterConditionApplyConfiguration constructs an declarative configuration of the PromQLClusterCondition type for use with
+// PromQLClusterConditionApplyConfiguration constructs a declarative configuration of the PromQLClusterCondition type for use with
// apply.
func PromQLClusterCondition() *PromQLClusterConditionApplyConfiguration {
return &PromQLClusterConditionApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxy.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxy.go
index 79360af8e2..fdfe260f52 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxy.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxy.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ProxyApplyConfiguration represents an declarative configuration of the Proxy type for use
+// ProxyApplyConfiguration represents a declarative configuration of the Proxy type for use
// with apply.
type ProxyApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ProxyApplyConfiguration struct {
Status *ProxyStatusApplyConfiguration `json:"status,omitempty"`
}
-// Proxy constructs an declarative configuration of the Proxy type for use with
+// Proxy constructs a declarative configuration of the Proxy type for use with
// apply.
func Proxy(name string) *ProxyApplyConfiguration {
b := &ProxyApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *ProxyApplyConfiguration) WithStatus(value *ProxyStatusApplyConfiguratio
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ProxyApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxyspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxyspec.go
index 0eecac56c1..bd2cf66570 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxyspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxyspec.go
@@ -2,7 +2,7 @@
package v1
-// ProxySpecApplyConfiguration represents an declarative configuration of the ProxySpec type for use
+// ProxySpecApplyConfiguration represents a declarative configuration of the ProxySpec type for use
// with apply.
type ProxySpecApplyConfiguration struct {
HTTPProxy *string `json:"httpProxy,omitempty"`
@@ -12,7 +12,7 @@ type ProxySpecApplyConfiguration struct {
TrustedCA *ConfigMapNameReferenceApplyConfiguration `json:"trustedCA,omitempty"`
}
-// ProxySpecApplyConfiguration constructs an declarative configuration of the ProxySpec type for use with
+// ProxySpecApplyConfiguration constructs a declarative configuration of the ProxySpec type for use with
// apply.
func ProxySpec() *ProxySpecApplyConfiguration {
return &ProxySpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxystatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxystatus.go
index 069d479fbd..784afdff6f 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxystatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/proxystatus.go
@@ -2,7 +2,7 @@
package v1
-// ProxyStatusApplyConfiguration represents an declarative configuration of the ProxyStatus type for use
+// ProxyStatusApplyConfiguration represents a declarative configuration of the ProxyStatus type for use
// with apply.
type ProxyStatusApplyConfiguration struct {
HTTPProxy *string `json:"httpProxy,omitempty"`
@@ -10,7 +10,7 @@ type ProxyStatusApplyConfiguration struct {
NoProxy *string `json:"noProxy,omitempty"`
}
-// ProxyStatusApplyConfiguration constructs an declarative configuration of the ProxyStatus type for use with
+// ProxyStatusApplyConfiguration constructs a declarative configuration of the ProxyStatus type for use with
// apply.
func ProxyStatus() *ProxyStatusApplyConfiguration {
return &ProxyStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/registrylocation.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/registrylocation.go
index 2f48be9320..d4aaa4e1e8 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/registrylocation.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/registrylocation.go
@@ -2,14 +2,14 @@
package v1
-// RegistryLocationApplyConfiguration represents an declarative configuration of the RegistryLocation type for use
+// RegistryLocationApplyConfiguration represents a declarative configuration of the RegistryLocation type for use
// with apply.
type RegistryLocationApplyConfiguration struct {
DomainName *string `json:"domainName,omitempty"`
Insecure *bool `json:"insecure,omitempty"`
}
-// RegistryLocationApplyConfiguration constructs an declarative configuration of the RegistryLocation type for use with
+// RegistryLocationApplyConfiguration constructs a declarative configuration of the RegistryLocation type for use with
// apply.
func RegistryLocation() *RegistryLocationApplyConfiguration {
return &RegistryLocationApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/registrysources.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/registrysources.go
index 02ff90c577..a92592f304 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/registrysources.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/registrysources.go
@@ -2,7 +2,7 @@
package v1
-// RegistrySourcesApplyConfiguration represents an declarative configuration of the RegistrySources type for use
+// RegistrySourcesApplyConfiguration represents a declarative configuration of the RegistrySources type for use
// with apply.
type RegistrySourcesApplyConfiguration struct {
InsecureRegistries []string `json:"insecureRegistries,omitempty"`
@@ -11,7 +11,7 @@ type RegistrySourcesApplyConfiguration struct {
ContainerRuntimeSearchRegistries []string `json:"containerRuntimeSearchRegistries,omitempty"`
}
-// RegistrySourcesApplyConfiguration constructs an declarative configuration of the RegistrySources type for use with
+// RegistrySourcesApplyConfiguration constructs a declarative configuration of the RegistrySources type for use with
// apply.
func RegistrySources() *RegistrySourcesApplyConfiguration {
return &RegistrySourcesApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/release.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/release.go
index 18b3f76f84..4ffecd9266 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/release.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/release.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// ReleaseApplyConfiguration represents an declarative configuration of the Release type for use
+// ReleaseApplyConfiguration represents a declarative configuration of the Release type for use
// with apply.
type ReleaseApplyConfiguration struct {
Version *string `json:"version,omitempty"`
@@ -15,7 +15,7 @@ type ReleaseApplyConfiguration struct {
Channels []string `json:"channels,omitempty"`
}
-// ReleaseApplyConfiguration constructs an declarative configuration of the Release type for use with
+// ReleaseApplyConfiguration constructs a declarative configuration of the Release type for use with
// apply.
func Release() *ReleaseApplyConfiguration {
return &ReleaseApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/repositorydigestmirrors.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/repositorydigestmirrors.go
index 2806aea92b..f903170f36 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/repositorydigestmirrors.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/repositorydigestmirrors.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// RepositoryDigestMirrorsApplyConfiguration represents an declarative configuration of the RepositoryDigestMirrors type for use
+// RepositoryDigestMirrorsApplyConfiguration represents a declarative configuration of the RepositoryDigestMirrors type for use
// with apply.
type RepositoryDigestMirrorsApplyConfiguration struct {
Source *string `json:"source,omitempty"`
@@ -14,7 +14,7 @@ type RepositoryDigestMirrorsApplyConfiguration struct {
Mirrors []v1.Mirror `json:"mirrors,omitempty"`
}
-// RepositoryDigestMirrorsApplyConfiguration constructs an declarative configuration of the RepositoryDigestMirrors type for use with
+// RepositoryDigestMirrorsApplyConfiguration constructs a declarative configuration of the RepositoryDigestMirrors type for use with
// apply.
func RepositoryDigestMirrors() *RepositoryDigestMirrorsApplyConfiguration {
return &RepositoryDigestMirrorsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/requestheaderidentityprovider.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/requestheaderidentityprovider.go
index fa787ce7c2..2911473d02 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/requestheaderidentityprovider.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/requestheaderidentityprovider.go
@@ -2,7 +2,7 @@
package v1
-// RequestHeaderIdentityProviderApplyConfiguration represents an declarative configuration of the RequestHeaderIdentityProvider type for use
+// RequestHeaderIdentityProviderApplyConfiguration represents a declarative configuration of the RequestHeaderIdentityProvider type for use
// with apply.
type RequestHeaderIdentityProviderApplyConfiguration struct {
LoginURL *string `json:"loginURL,omitempty"`
@@ -15,7 +15,7 @@ type RequestHeaderIdentityProviderApplyConfiguration struct {
EmailHeaders []string `json:"emailHeaders,omitempty"`
}
-// RequestHeaderIdentityProviderApplyConfiguration constructs an declarative configuration of the RequestHeaderIdentityProvider type for use with
+// RequestHeaderIdentityProviderApplyConfiguration constructs a declarative configuration of the RequestHeaderIdentityProvider type for use with
// apply.
func RequestHeaderIdentityProvider() *RequestHeaderIdentityProviderApplyConfiguration {
return &RequestHeaderIdentityProviderApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/requiredhstspolicy.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/requiredhstspolicy.go
index 5b3e741077..a9ffe1350d 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/requiredhstspolicy.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/requiredhstspolicy.go
@@ -7,7 +7,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// RequiredHSTSPolicyApplyConfiguration represents an declarative configuration of the RequiredHSTSPolicy type for use
+// RequiredHSTSPolicyApplyConfiguration represents a declarative configuration of the RequiredHSTSPolicy type for use
// with apply.
type RequiredHSTSPolicyApplyConfiguration struct {
NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
@@ -17,7 +17,7 @@ type RequiredHSTSPolicyApplyConfiguration struct {
IncludeSubDomainsPolicy *apiconfigv1.IncludeSubDomainsPolicy `json:"includeSubDomainsPolicy,omitempty"`
}
-// RequiredHSTSPolicyApplyConfiguration constructs an declarative configuration of the RequiredHSTSPolicy type for use with
+// RequiredHSTSPolicyApplyConfiguration constructs a declarative configuration of the RequiredHSTSPolicy type for use with
// apply.
func RequiredHSTSPolicy() *RequiredHSTSPolicyApplyConfiguration {
return &RequiredHSTSPolicyApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/scheduler.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/scheduler.go
index d9de60a42f..33e73fab9b 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/scheduler.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/scheduler.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// SchedulerApplyConfiguration represents an declarative configuration of the Scheduler type for use
+// SchedulerApplyConfiguration represents a declarative configuration of the Scheduler type for use
// with apply.
type SchedulerApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type SchedulerApplyConfiguration struct {
Status *apiconfigv1.SchedulerStatus `json:"status,omitempty"`
}
-// Scheduler constructs an declarative configuration of the Scheduler type for use with
+// Scheduler constructs a declarative configuration of the Scheduler type for use with
// apply.
func Scheduler(name string) *SchedulerApplyConfiguration {
b := &SchedulerApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *SchedulerApplyConfiguration) WithStatus(value apiconfigv1.SchedulerStat
b.Status = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *SchedulerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/schedulerspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/schedulerspec.go
index 1df067067f..2160ab2ff5 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/schedulerspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/schedulerspec.go
@@ -6,7 +6,7 @@ import (
configv1 "github.com/openshift/api/config/v1"
)
-// SchedulerSpecApplyConfiguration represents an declarative configuration of the SchedulerSpec type for use
+// SchedulerSpecApplyConfiguration represents a declarative configuration of the SchedulerSpec type for use
// with apply.
type SchedulerSpecApplyConfiguration struct {
Policy *ConfigMapNameReferenceApplyConfiguration `json:"policy,omitempty"`
@@ -16,7 +16,7 @@ type SchedulerSpecApplyConfiguration struct {
MastersSchedulable *bool `json:"mastersSchedulable,omitempty"`
}
-// SchedulerSpecApplyConfiguration constructs an declarative configuration of the SchedulerSpec type for use with
+// SchedulerSpecApplyConfiguration constructs a declarative configuration of the SchedulerSpec type for use with
// apply.
func SchedulerSpec() *SchedulerSpecApplyConfiguration {
return &SchedulerSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/secretnamereference.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/secretnamereference.go
index 9cd673082c..692056c6b8 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/secretnamereference.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/secretnamereference.go
@@ -2,13 +2,13 @@
package v1
-// SecretNameReferenceApplyConfiguration represents an declarative configuration of the SecretNameReference type for use
+// SecretNameReferenceApplyConfiguration represents a declarative configuration of the SecretNameReference type for use
// with apply.
type SecretNameReferenceApplyConfiguration struct {
Name *string `json:"name,omitempty"`
}
-// SecretNameReferenceApplyConfiguration constructs an declarative configuration of the SecretNameReference type for use with
+// SecretNameReferenceApplyConfiguration constructs a declarative configuration of the SecretNameReference type for use with
// apply.
func SecretNameReference() *SecretNameReferenceApplyConfiguration {
return &SecretNameReferenceApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/signaturestore.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/signaturestore.go
index b0d95c6e74..918f13df6a 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/signaturestore.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/signaturestore.go
@@ -2,14 +2,14 @@
package v1
-// SignatureStoreApplyConfiguration represents an declarative configuration of the SignatureStore type for use
+// SignatureStoreApplyConfiguration represents a declarative configuration of the SignatureStore type for use
// with apply.
type SignatureStoreApplyConfiguration struct {
URL *string `json:"url,omitempty"`
CA *ConfigMapNameReferenceApplyConfiguration `json:"ca,omitempty"`
}
-// SignatureStoreApplyConfiguration constructs an declarative configuration of the SignatureStore type for use with
+// SignatureStoreApplyConfiguration constructs a declarative configuration of the SignatureStore type for use with
// apply.
func SignatureStore() *SignatureStoreApplyConfiguration {
return &SignatureStoreApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/templatereference.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/templatereference.go
index e1da30be39..30112046a0 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/templatereference.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/templatereference.go
@@ -2,13 +2,13 @@
package v1
-// TemplateReferenceApplyConfiguration represents an declarative configuration of the TemplateReference type for use
+// TemplateReferenceApplyConfiguration represents a declarative configuration of the TemplateReference type for use
// with apply.
type TemplateReferenceApplyConfiguration struct {
Name *string `json:"name,omitempty"`
}
-// TemplateReferenceApplyConfiguration constructs an declarative configuration of the TemplateReference type for use with
+// TemplateReferenceApplyConfiguration constructs a declarative configuration of the TemplateReference type for use with
// apply.
func TemplateReference() *TemplateReferenceApplyConfiguration {
return &TemplateReferenceApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tlsprofilespec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tlsprofilespec.go
index 3e08cc9ade..c874fcf0c8 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tlsprofilespec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tlsprofilespec.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// TLSProfileSpecApplyConfiguration represents an declarative configuration of the TLSProfileSpec type for use
+// TLSProfileSpecApplyConfiguration represents a declarative configuration of the TLSProfileSpec type for use
// with apply.
type TLSProfileSpecApplyConfiguration struct {
Ciphers []string `json:"ciphers,omitempty"`
MinTLSVersion *v1.TLSProtocolVersion `json:"minTLSVersion,omitempty"`
}
-// TLSProfileSpecApplyConfiguration constructs an declarative configuration of the TLSProfileSpec type for use with
+// TLSProfileSpecApplyConfiguration constructs a declarative configuration of the TLSProfileSpec type for use with
// apply.
func TLSProfileSpec() *TLSProfileSpecApplyConfiguration {
return &TLSProfileSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tlssecurityprofile.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tlssecurityprofile.go
index fb32e8516f..004632489f 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tlssecurityprofile.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tlssecurityprofile.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// TLSSecurityProfileApplyConfiguration represents an declarative configuration of the TLSSecurityProfile type for use
+// TLSSecurityProfileApplyConfiguration represents a declarative configuration of the TLSSecurityProfile type for use
// with apply.
type TLSSecurityProfileApplyConfiguration struct {
Type *v1.TLSProfileType `json:"type,omitempty"`
@@ -16,7 +16,7 @@ type TLSSecurityProfileApplyConfiguration struct {
Custom *CustomTLSProfileApplyConfiguration `json:"custom,omitempty"`
}
-// TLSSecurityProfileApplyConfiguration constructs an declarative configuration of the TLSSecurityProfile type for use with
+// TLSSecurityProfileApplyConfiguration constructs a declarative configuration of the TLSSecurityProfile type for use with
// apply.
func TLSSecurityProfile() *TLSSecurityProfileApplyConfiguration {
return &TLSSecurityProfileApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimmapping.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimmapping.go
index 91c29b61c4..dbd509f068 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimmapping.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimmapping.go
@@ -2,13 +2,13 @@
package v1
-// TokenClaimMappingApplyConfiguration represents an declarative configuration of the TokenClaimMapping type for use
+// TokenClaimMappingApplyConfiguration represents a declarative configuration of the TokenClaimMapping type for use
// with apply.
type TokenClaimMappingApplyConfiguration struct {
Claim *string `json:"claim,omitempty"`
}
-// TokenClaimMappingApplyConfiguration constructs an declarative configuration of the TokenClaimMapping type for use with
+// TokenClaimMappingApplyConfiguration constructs a declarative configuration of the TokenClaimMapping type for use with
// apply.
func TokenClaimMapping() *TokenClaimMappingApplyConfiguration {
return &TokenClaimMappingApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimmappings.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimmappings.go
index 1a2fdb0953..9b3b0bb561 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimmappings.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimmappings.go
@@ -2,14 +2,14 @@
package v1
-// TokenClaimMappingsApplyConfiguration represents an declarative configuration of the TokenClaimMappings type for use
+// TokenClaimMappingsApplyConfiguration represents a declarative configuration of the TokenClaimMappings type for use
// with apply.
type TokenClaimMappingsApplyConfiguration struct {
Username *UsernameClaimMappingApplyConfiguration `json:"username,omitempty"`
Groups *PrefixedClaimMappingApplyConfiguration `json:"groups,omitempty"`
}
-// TokenClaimMappingsApplyConfiguration constructs an declarative configuration of the TokenClaimMappings type for use with
+// TokenClaimMappingsApplyConfiguration constructs a declarative configuration of the TokenClaimMappings type for use with
// apply.
func TokenClaimMappings() *TokenClaimMappingsApplyConfiguration {
return &TokenClaimMappingsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationrule.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationrule.go
index 6793f93279..ad9968eefe 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationrule.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationrule.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// TokenClaimValidationRuleApplyConfiguration represents an declarative configuration of the TokenClaimValidationRule type for use
+// TokenClaimValidationRuleApplyConfiguration represents a declarative configuration of the TokenClaimValidationRule type for use
// with apply.
type TokenClaimValidationRuleApplyConfiguration struct {
Type *v1.TokenValidationRuleType `json:"type,omitempty"`
RequiredClaim *TokenRequiredClaimApplyConfiguration `json:"requiredClaim,omitempty"`
}
-// TokenClaimValidationRuleApplyConfiguration constructs an declarative configuration of the TokenClaimValidationRule type for use with
+// TokenClaimValidationRuleApplyConfiguration constructs a declarative configuration of the TokenClaimValidationRule type for use with
// apply.
func TokenClaimValidationRule() *TokenClaimValidationRuleApplyConfiguration {
return &TokenClaimValidationRuleApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenconfig.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenconfig.go
index 865d4ddbe1..7a103935e3 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenconfig.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenconfig.go
@@ -6,7 +6,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// TokenConfigApplyConfiguration represents an declarative configuration of the TokenConfig type for use
+// TokenConfigApplyConfiguration represents a declarative configuration of the TokenConfig type for use
// with apply.
type TokenConfigApplyConfiguration struct {
AccessTokenMaxAgeSeconds *int32 `json:"accessTokenMaxAgeSeconds,omitempty"`
@@ -14,7 +14,7 @@ type TokenConfigApplyConfiguration struct {
AccessTokenInactivityTimeout *v1.Duration `json:"accessTokenInactivityTimeout,omitempty"`
}
-// TokenConfigApplyConfiguration constructs an declarative configuration of the TokenConfig type for use with
+// TokenConfigApplyConfiguration constructs a declarative configuration of the TokenConfig type for use with
// apply.
func TokenConfig() *TokenConfigApplyConfiguration {
return &TokenConfigApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenissuer.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenissuer.go
index 808e61a1db..0811ca729a 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenissuer.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenissuer.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// TokenIssuerApplyConfiguration represents an declarative configuration of the TokenIssuer type for use
+// TokenIssuerApplyConfiguration represents a declarative configuration of the TokenIssuer type for use
// with apply.
type TokenIssuerApplyConfiguration struct {
URL *string `json:"issuerURL,omitempty"`
@@ -14,7 +14,7 @@ type TokenIssuerApplyConfiguration struct {
CertificateAuthority *ConfigMapNameReferenceApplyConfiguration `json:"issuerCertificateAuthority,omitempty"`
}
-// TokenIssuerApplyConfiguration constructs an declarative configuration of the TokenIssuer type for use with
+// TokenIssuerApplyConfiguration constructs a declarative configuration of the TokenIssuer type for use with
// apply.
func TokenIssuer() *TokenIssuerApplyConfiguration {
return &TokenIssuerApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenrequiredclaim.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenrequiredclaim.go
index f7ae34d017..6dec5b2a19 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenrequiredclaim.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenrequiredclaim.go
@@ -2,14 +2,14 @@
package v1
-// TokenRequiredClaimApplyConfiguration represents an declarative configuration of the TokenRequiredClaim type for use
+// TokenRequiredClaimApplyConfiguration represents a declarative configuration of the TokenRequiredClaim type for use
// with apply.
type TokenRequiredClaimApplyConfiguration struct {
Claim *string `json:"claim,omitempty"`
RequiredValue *string `json:"requiredValue,omitempty"`
}
-// TokenRequiredClaimApplyConfiguration constructs an declarative configuration of the TokenRequiredClaim type for use with
+// TokenRequiredClaimApplyConfiguration constructs a declarative configuration of the TokenRequiredClaim type for use with
// apply.
func TokenRequiredClaim() *TokenRequiredClaimApplyConfiguration {
return &TokenRequiredClaimApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/update.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/update.go
index 1f63851c24..1d1547d87a 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/update.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/update.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// UpdateApplyConfiguration represents an declarative configuration of the Update type for use
+// UpdateApplyConfiguration represents a declarative configuration of the Update type for use
// with apply.
type UpdateApplyConfiguration struct {
Architecture *v1.ClusterVersionArchitecture `json:"architecture,omitempty"`
@@ -15,7 +15,7 @@ type UpdateApplyConfiguration struct {
Force *bool `json:"force,omitempty"`
}
-// UpdateApplyConfiguration constructs an declarative configuration of the Update type for use with
+// UpdateApplyConfiguration constructs a declarative configuration of the Update type for use with
// apply.
func Update() *UpdateApplyConfiguration {
return &UpdateApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/updatehistory.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/updatehistory.go
index 17dc2a0a10..6a4deaf3fb 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/updatehistory.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/updatehistory.go
@@ -7,7 +7,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// UpdateHistoryApplyConfiguration represents an declarative configuration of the UpdateHistory type for use
+// UpdateHistoryApplyConfiguration represents a declarative configuration of the UpdateHistory type for use
// with apply.
type UpdateHistoryApplyConfiguration struct {
State *v1.UpdateState `json:"state,omitempty"`
@@ -19,7 +19,7 @@ type UpdateHistoryApplyConfiguration struct {
AcceptedRisks *string `json:"acceptedRisks,omitempty"`
}
-// UpdateHistoryApplyConfiguration constructs an declarative configuration of the UpdateHistory type for use with
+// UpdateHistoryApplyConfiguration constructs a declarative configuration of the UpdateHistory type for use with
// apply.
func UpdateHistory() *UpdateHistoryApplyConfiguration {
return &UpdateHistoryApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameclaimmapping.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameclaimmapping.go
index 641fb48b28..daec7fb46a 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameclaimmapping.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameclaimmapping.go
@@ -6,7 +6,7 @@ import (
configv1 "github.com/openshift/api/config/v1"
)
-// UsernameClaimMappingApplyConfiguration represents an declarative configuration of the UsernameClaimMapping type for use
+// UsernameClaimMappingApplyConfiguration represents a declarative configuration of the UsernameClaimMapping type for use
// with apply.
type UsernameClaimMappingApplyConfiguration struct {
TokenClaimMappingApplyConfiguration `json:",inline"`
@@ -14,7 +14,7 @@ type UsernameClaimMappingApplyConfiguration struct {
Prefix *UsernamePrefixApplyConfiguration `json:"prefix,omitempty"`
}
-// UsernameClaimMappingApplyConfiguration constructs an declarative configuration of the UsernameClaimMapping type for use with
+// UsernameClaimMappingApplyConfiguration constructs a declarative configuration of the UsernameClaimMapping type for use with
// apply.
func UsernameClaimMapping() *UsernameClaimMappingApplyConfiguration {
return &UsernameClaimMappingApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameprefix.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameprefix.go
index b95bc9ba64..03720723bd 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameprefix.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameprefix.go
@@ -2,13 +2,13 @@
package v1
-// UsernamePrefixApplyConfiguration represents an declarative configuration of the UsernamePrefix type for use
+// UsernamePrefixApplyConfiguration represents a declarative configuration of the UsernamePrefix type for use
// with apply.
type UsernamePrefixApplyConfiguration struct {
PrefixString *string `json:"prefixString,omitempty"`
}
-// UsernamePrefixApplyConfiguration constructs an declarative configuration of the UsernamePrefix type for use with
+// UsernamePrefixApplyConfiguration constructs a declarative configuration of the UsernamePrefix type for use with
// apply.
func UsernamePrefix() *UsernamePrefixApplyConfiguration {
return &UsernamePrefixApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformfailuredomainspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformfailuredomainspec.go
index 0bad0fadf8..1c5ec2cf10 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformfailuredomainspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformfailuredomainspec.go
@@ -2,7 +2,7 @@
package v1
-// VSpherePlatformFailureDomainSpecApplyConfiguration represents an declarative configuration of the VSpherePlatformFailureDomainSpec type for use
+// VSpherePlatformFailureDomainSpecApplyConfiguration represents a declarative configuration of the VSpherePlatformFailureDomainSpec type for use
// with apply.
type VSpherePlatformFailureDomainSpecApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -12,7 +12,7 @@ type VSpherePlatformFailureDomainSpecApplyConfiguration struct {
Topology *VSpherePlatformTopologyApplyConfiguration `json:"topology,omitempty"`
}
-// VSpherePlatformFailureDomainSpecApplyConfiguration constructs an declarative configuration of the VSpherePlatformFailureDomainSpec type for use with
+// VSpherePlatformFailureDomainSpecApplyConfiguration constructs a declarative configuration of the VSpherePlatformFailureDomainSpec type for use with
// apply.
func VSpherePlatformFailureDomainSpec() *VSpherePlatformFailureDomainSpecApplyConfiguration {
return &VSpherePlatformFailureDomainSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformloadbalancer.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformloadbalancer.go
index 873f0289e8..d1dcebec4d 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformloadbalancer.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformloadbalancer.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/config/v1"
)
-// VSpherePlatformLoadBalancerApplyConfiguration represents an declarative configuration of the VSpherePlatformLoadBalancer type for use
+// VSpherePlatformLoadBalancerApplyConfiguration represents a declarative configuration of the VSpherePlatformLoadBalancer type for use
// with apply.
type VSpherePlatformLoadBalancerApplyConfiguration struct {
Type *v1.PlatformLoadBalancerType `json:"type,omitempty"`
}
-// VSpherePlatformLoadBalancerApplyConfiguration constructs an declarative configuration of the VSpherePlatformLoadBalancer type for use with
+// VSpherePlatformLoadBalancerApplyConfiguration constructs a declarative configuration of the VSpherePlatformLoadBalancer type for use with
// apply.
func VSpherePlatformLoadBalancer() *VSpherePlatformLoadBalancerApplyConfiguration {
return &VSpherePlatformLoadBalancerApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformnodenetworking.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformnodenetworking.go
index 042737f1d8..f83a0c50a7 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformnodenetworking.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformnodenetworking.go
@@ -2,14 +2,14 @@
package v1
-// VSpherePlatformNodeNetworkingApplyConfiguration represents an declarative configuration of the VSpherePlatformNodeNetworking type for use
+// VSpherePlatformNodeNetworkingApplyConfiguration represents a declarative configuration of the VSpherePlatformNodeNetworking type for use
// with apply.
type VSpherePlatformNodeNetworkingApplyConfiguration struct {
External *VSpherePlatformNodeNetworkingSpecApplyConfiguration `json:"external,omitempty"`
Internal *VSpherePlatformNodeNetworkingSpecApplyConfiguration `json:"internal,omitempty"`
}
-// VSpherePlatformNodeNetworkingApplyConfiguration constructs an declarative configuration of the VSpherePlatformNodeNetworking type for use with
+// VSpherePlatformNodeNetworkingApplyConfiguration constructs a declarative configuration of the VSpherePlatformNodeNetworking type for use with
// apply.
func VSpherePlatformNodeNetworking() *VSpherePlatformNodeNetworkingApplyConfiguration {
return &VSpherePlatformNodeNetworkingApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformnodenetworkingspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformnodenetworkingspec.go
index e13c42d64e..670448d3c1 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformnodenetworkingspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformnodenetworkingspec.go
@@ -2,7 +2,7 @@
package v1
-// VSpherePlatformNodeNetworkingSpecApplyConfiguration represents an declarative configuration of the VSpherePlatformNodeNetworkingSpec type for use
+// VSpherePlatformNodeNetworkingSpecApplyConfiguration represents a declarative configuration of the VSpherePlatformNodeNetworkingSpec type for use
// with apply.
type VSpherePlatformNodeNetworkingSpecApplyConfiguration struct {
NetworkSubnetCIDR []string `json:"networkSubnetCidr,omitempty"`
@@ -10,7 +10,7 @@ type VSpherePlatformNodeNetworkingSpecApplyConfiguration struct {
ExcludeNetworkSubnetCIDR []string `json:"excludeNetworkSubnetCidr,omitempty"`
}
-// VSpherePlatformNodeNetworkingSpecApplyConfiguration constructs an declarative configuration of the VSpherePlatformNodeNetworkingSpec type for use with
+// VSpherePlatformNodeNetworkingSpecApplyConfiguration constructs a declarative configuration of the VSpherePlatformNodeNetworkingSpec type for use with
// apply.
func VSpherePlatformNodeNetworkingSpec() *VSpherePlatformNodeNetworkingSpecApplyConfiguration {
return &VSpherePlatformNodeNetworkingSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformspec.go
index f51fc93d53..d0d191331e 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformspec.go
@@ -6,7 +6,7 @@ import (
configv1 "github.com/openshift/api/config/v1"
)
-// VSpherePlatformSpecApplyConfiguration represents an declarative configuration of the VSpherePlatformSpec type for use
+// VSpherePlatformSpecApplyConfiguration represents a declarative configuration of the VSpherePlatformSpec type for use
// with apply.
type VSpherePlatformSpecApplyConfiguration struct {
VCenters []VSpherePlatformVCenterSpecApplyConfiguration `json:"vcenters,omitempty"`
@@ -17,7 +17,7 @@ type VSpherePlatformSpecApplyConfiguration struct {
MachineNetworks []configv1.CIDR `json:"machineNetworks,omitempty"`
}
-// VSpherePlatformSpecApplyConfiguration constructs an declarative configuration of the VSpherePlatformSpec type for use with
+// VSpherePlatformSpecApplyConfiguration constructs a declarative configuration of the VSpherePlatformSpec type for use with
// apply.
func VSpherePlatformSpec() *VSpherePlatformSpecApplyConfiguration {
return &VSpherePlatformSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformstatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformstatus.go
index 11a0420d5b..36696df716 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformstatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformstatus.go
@@ -6,7 +6,7 @@ import (
configv1 "github.com/openshift/api/config/v1"
)
-// VSpherePlatformStatusApplyConfiguration represents an declarative configuration of the VSpherePlatformStatus type for use
+// VSpherePlatformStatusApplyConfiguration represents a declarative configuration of the VSpherePlatformStatus type for use
// with apply.
type VSpherePlatformStatusApplyConfiguration struct {
APIServerInternalIP *string `json:"apiServerInternalIP,omitempty"`
@@ -18,7 +18,7 @@ type VSpherePlatformStatusApplyConfiguration struct {
MachineNetworks []configv1.CIDR `json:"machineNetworks,omitempty"`
}
-// VSpherePlatformStatusApplyConfiguration constructs an declarative configuration of the VSpherePlatformStatus type for use with
+// VSpherePlatformStatusApplyConfiguration constructs a declarative configuration of the VSpherePlatformStatus type for use with
// apply.
func VSpherePlatformStatus() *VSpherePlatformStatusApplyConfiguration {
return &VSpherePlatformStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformtopology.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformtopology.go
index a16213812e..a3036a5cfe 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformtopology.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformtopology.go
@@ -2,7 +2,7 @@
package v1
-// VSpherePlatformTopologyApplyConfiguration represents an declarative configuration of the VSpherePlatformTopology type for use
+// VSpherePlatformTopologyApplyConfiguration represents a declarative configuration of the VSpherePlatformTopology type for use
// with apply.
type VSpherePlatformTopologyApplyConfiguration struct {
Datacenter *string `json:"datacenter,omitempty"`
@@ -14,7 +14,7 @@ type VSpherePlatformTopologyApplyConfiguration struct {
Template *string `json:"template,omitempty"`
}
-// VSpherePlatformTopologyApplyConfiguration constructs an declarative configuration of the VSpherePlatformTopology type for use with
+// VSpherePlatformTopologyApplyConfiguration constructs a declarative configuration of the VSpherePlatformTopology type for use with
// apply.
func VSpherePlatformTopology() *VSpherePlatformTopologyApplyConfiguration {
return &VSpherePlatformTopologyApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformvcenterspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformvcenterspec.go
index 59b2261c24..ff65276186 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformvcenterspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vsphereplatformvcenterspec.go
@@ -2,7 +2,7 @@
package v1
-// VSpherePlatformVCenterSpecApplyConfiguration represents an declarative configuration of the VSpherePlatformVCenterSpec type for use
+// VSpherePlatformVCenterSpecApplyConfiguration represents a declarative configuration of the VSpherePlatformVCenterSpec type for use
// with apply.
type VSpherePlatformVCenterSpecApplyConfiguration struct {
Server *string `json:"server,omitempty"`
@@ -10,7 +10,7 @@ type VSpherePlatformVCenterSpecApplyConfiguration struct {
Datacenters []string `json:"datacenters,omitempty"`
}
-// VSpherePlatformVCenterSpecApplyConfiguration constructs an declarative configuration of the VSpherePlatformVCenterSpec type for use with
+// VSpherePlatformVCenterSpecApplyConfiguration constructs a declarative configuration of the VSpherePlatformVCenterSpec type for use with
// apply.
func VSpherePlatformVCenterSpec() *VSpherePlatformVCenterSpecApplyConfiguration {
return &VSpherePlatformVCenterSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/webhooktokenauthenticator.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/webhooktokenauthenticator.go
index fc15008599..4ed9e2d2d4 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/webhooktokenauthenticator.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/webhooktokenauthenticator.go
@@ -2,13 +2,13 @@
package v1
-// WebhookTokenAuthenticatorApplyConfiguration represents an declarative configuration of the WebhookTokenAuthenticator type for use
+// WebhookTokenAuthenticatorApplyConfiguration represents a declarative configuration of the WebhookTokenAuthenticator type for use
// with apply.
type WebhookTokenAuthenticatorApplyConfiguration struct {
KubeConfig *SecretNameReferenceApplyConfiguration `json:"kubeConfig,omitempty"`
}
-// WebhookTokenAuthenticatorApplyConfiguration constructs an declarative configuration of the WebhookTokenAuthenticator type for use with
+// WebhookTokenAuthenticatorApplyConfiguration constructs a declarative configuration of the WebhookTokenAuthenticator type for use with
// apply.
func WebhookTokenAuthenticator() *WebhookTokenAuthenticatorApplyConfiguration {
return &WebhookTokenAuthenticatorApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/backup.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/backup.go
index d06f12e509..e5a58f2640 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/backup.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/backup.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// BackupApplyConfiguration represents an declarative configuration of the Backup type for use
+// BackupApplyConfiguration represents a declarative configuration of the Backup type for use
// with apply.
type BackupApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type BackupApplyConfiguration struct {
Status *configv1alpha1.BackupStatus `json:"status,omitempty"`
}
-// Backup constructs an declarative configuration of the Backup type for use with
+// Backup constructs a declarative configuration of the Backup type for use with
// apply.
func Backup(name string) *BackupApplyConfiguration {
b := &BackupApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *BackupApplyConfiguration) WithStatus(value configv1alpha1.BackupStatus)
b.Status = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *BackupApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/backupspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/backupspec.go
index 8ecb7e8136..9bca4aca57 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/backupspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/backupspec.go
@@ -2,13 +2,13 @@
package v1alpha1
-// BackupSpecApplyConfiguration represents an declarative configuration of the BackupSpec type for use
+// BackupSpecApplyConfiguration represents a declarative configuration of the BackupSpec type for use
// with apply.
type BackupSpecApplyConfiguration struct {
EtcdBackupSpec *EtcdBackupSpecApplyConfiguration `json:"etcd,omitempty"`
}
-// BackupSpecApplyConfiguration constructs an declarative configuration of the BackupSpec type for use with
+// BackupSpecApplyConfiguration constructs a declarative configuration of the BackupSpec type for use with
// apply.
func BackupSpec() *BackupSpecApplyConfiguration {
return &BackupSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicy.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicy.go
index 68089a6a72..1e462c3c5f 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicy.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicy.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ClusterImagePolicyApplyConfiguration represents an declarative configuration of the ClusterImagePolicy type for use
+// ClusterImagePolicyApplyConfiguration represents a declarative configuration of the ClusterImagePolicy type for use
// with apply.
type ClusterImagePolicyApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ClusterImagePolicyApplyConfiguration struct {
Status *ClusterImagePolicyStatusApplyConfiguration `json:"status,omitempty"`
}
-// ClusterImagePolicy constructs an declarative configuration of the ClusterImagePolicy type for use with
+// ClusterImagePolicy constructs a declarative configuration of the ClusterImagePolicy type for use with
// apply.
func ClusterImagePolicy(name string) *ClusterImagePolicyApplyConfiguration {
b := &ClusterImagePolicyApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *ClusterImagePolicyApplyConfiguration) WithStatus(value *ClusterImagePol
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ClusterImagePolicyApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicyspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicyspec.go
index 64dfa92dd6..bbb25ceb65 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicyspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicyspec.go
@@ -6,14 +6,14 @@ import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
)
-// ClusterImagePolicySpecApplyConfiguration represents an declarative configuration of the ClusterImagePolicySpec type for use
+// ClusterImagePolicySpecApplyConfiguration represents a declarative configuration of the ClusterImagePolicySpec type for use
// with apply.
type ClusterImagePolicySpecApplyConfiguration struct {
Scopes []v1alpha1.ImageScope `json:"scopes,omitempty"`
Policy *PolicyApplyConfiguration `json:"policy,omitempty"`
}
-// ClusterImagePolicySpecApplyConfiguration constructs an declarative configuration of the ClusterImagePolicySpec type for use with
+// ClusterImagePolicySpecApplyConfiguration constructs a declarative configuration of the ClusterImagePolicySpec type for use with
// apply.
func ClusterImagePolicySpec() *ClusterImagePolicySpecApplyConfiguration {
return &ClusterImagePolicySpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicystatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicystatus.go
index 0b5ea75358..b5b4a82581 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicystatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clusterimagepolicystatus.go
@@ -6,13 +6,13 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ClusterImagePolicyStatusApplyConfiguration represents an declarative configuration of the ClusterImagePolicyStatus type for use
+// ClusterImagePolicyStatusApplyConfiguration represents a declarative configuration of the ClusterImagePolicyStatus type for use
// with apply.
type ClusterImagePolicyStatusApplyConfiguration struct {
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}
-// ClusterImagePolicyStatusApplyConfiguration constructs an declarative configuration of the ClusterImagePolicyStatus type for use with
+// ClusterImagePolicyStatusApplyConfiguration constructs a declarative configuration of the ClusterImagePolicyStatus type for use with
// apply.
func ClusterImagePolicyStatus() *ClusterImagePolicyStatusApplyConfiguration {
return &ClusterImagePolicyStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/etcdbackupspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/etcdbackupspec.go
index 4255313b1a..ab631f302c 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/etcdbackupspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/etcdbackupspec.go
@@ -2,7 +2,7 @@
package v1alpha1
-// EtcdBackupSpecApplyConfiguration represents an declarative configuration of the EtcdBackupSpec type for use
+// EtcdBackupSpecApplyConfiguration represents a declarative configuration of the EtcdBackupSpec type for use
// with apply.
type EtcdBackupSpecApplyConfiguration struct {
Schedule *string `json:"schedule,omitempty"`
@@ -11,7 +11,7 @@ type EtcdBackupSpecApplyConfiguration struct {
PVCName *string `json:"pvcName,omitempty"`
}
-// EtcdBackupSpecApplyConfiguration constructs an declarative configuration of the EtcdBackupSpec type for use with
+// EtcdBackupSpecApplyConfiguration constructs a declarative configuration of the EtcdBackupSpec type for use with
// apply.
func EtcdBackupSpec() *EtcdBackupSpecApplyConfiguration {
return &EtcdBackupSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/fulciocawithrekor.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/fulciocawithrekor.go
index 681d1ce165..2a907a7e97 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/fulciocawithrekor.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/fulciocawithrekor.go
@@ -2,7 +2,7 @@
package v1alpha1
-// FulcioCAWithRekorApplyConfiguration represents an declarative configuration of the FulcioCAWithRekor type for use
+// FulcioCAWithRekorApplyConfiguration represents a declarative configuration of the FulcioCAWithRekor type for use
// with apply.
type FulcioCAWithRekorApplyConfiguration struct {
FulcioCAData []byte `json:"fulcioCAData,omitempty"`
@@ -10,7 +10,7 @@ type FulcioCAWithRekorApplyConfiguration struct {
FulcioSubject *PolicyFulcioSubjectApplyConfiguration `json:"fulcioSubject,omitempty"`
}
-// FulcioCAWithRekorApplyConfiguration constructs an declarative configuration of the FulcioCAWithRekor type for use with
+// FulcioCAWithRekorApplyConfiguration constructs a declarative configuration of the FulcioCAWithRekor type for use with
// apply.
func FulcioCAWithRekor() *FulcioCAWithRekorApplyConfiguration {
return &FulcioCAWithRekorApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/gatherconfig.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/gatherconfig.go
index 2eec8ffd27..0f3edbd9f6 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/gatherconfig.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/gatherconfig.go
@@ -6,14 +6,14 @@ import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
)
-// GatherConfigApplyConfiguration represents an declarative configuration of the GatherConfig type for use
+// GatherConfigApplyConfiguration represents a declarative configuration of the GatherConfig type for use
// with apply.
type GatherConfigApplyConfiguration struct {
DataPolicy *v1alpha1.DataPolicy `json:"dataPolicy,omitempty"`
DisabledGatherers []string `json:"disabledGatherers,omitempty"`
}
-// GatherConfigApplyConfiguration constructs an declarative configuration of the GatherConfig type for use with
+// GatherConfigApplyConfiguration constructs a declarative configuration of the GatherConfig type for use with
// apply.
func GatherConfig() *GatherConfigApplyConfiguration {
return &GatherConfigApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicy.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicy.go
index 412a28fc71..f08aa7e472 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicy.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicy.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ImagePolicyApplyConfiguration represents an declarative configuration of the ImagePolicy type for use
+// ImagePolicyApplyConfiguration represents a declarative configuration of the ImagePolicy type for use
// with apply.
type ImagePolicyApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ImagePolicyApplyConfiguration struct {
Status *ImagePolicyStatusApplyConfiguration `json:"status,omitempty"`
}
-// ImagePolicy constructs an declarative configuration of the ImagePolicy type for use with
+// ImagePolicy constructs a declarative configuration of the ImagePolicy type for use with
// apply.
func ImagePolicy(name, namespace string) *ImagePolicyApplyConfiguration {
b := &ImagePolicyApplyConfiguration{}
@@ -240,3 +240,9 @@ func (b *ImagePolicyApplyConfiguration) WithStatus(value *ImagePolicyStatusApply
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ImagePolicyApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicyspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicyspec.go
index aecf932a70..1c706d99fe 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicyspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicyspec.go
@@ -6,14 +6,14 @@ import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
)
-// ImagePolicySpecApplyConfiguration represents an declarative configuration of the ImagePolicySpec type for use
+// ImagePolicySpecApplyConfiguration represents a declarative configuration of the ImagePolicySpec type for use
// with apply.
type ImagePolicySpecApplyConfiguration struct {
Scopes []v1alpha1.ImageScope `json:"scopes,omitempty"`
Policy *PolicyApplyConfiguration `json:"policy,omitempty"`
}
-// ImagePolicySpecApplyConfiguration constructs an declarative configuration of the ImagePolicySpec type for use with
+// ImagePolicySpecApplyConfiguration constructs a declarative configuration of the ImagePolicySpec type for use with
// apply.
func ImagePolicySpec() *ImagePolicySpecApplyConfiguration {
return &ImagePolicySpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicystatus.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicystatus.go
index d20853ae7d..d5c664772d 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicystatus.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/imagepolicystatus.go
@@ -6,13 +6,13 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ImagePolicyStatusApplyConfiguration represents an declarative configuration of the ImagePolicyStatus type for use
+// ImagePolicyStatusApplyConfiguration represents a declarative configuration of the ImagePolicyStatus type for use
// with apply.
type ImagePolicyStatusApplyConfiguration struct {
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}
-// ImagePolicyStatusApplyConfiguration constructs an declarative configuration of the ImagePolicyStatus type for use with
+// ImagePolicyStatusApplyConfiguration constructs a declarative configuration of the ImagePolicyStatus type for use with
// apply.
func ImagePolicyStatus() *ImagePolicyStatusApplyConfiguration {
return &ImagePolicyStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/insightsdatagather.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/insightsdatagather.go
index b86f19208e..d743eec8d4 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/insightsdatagather.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/insightsdatagather.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// InsightsDataGatherApplyConfiguration represents an declarative configuration of the InsightsDataGather type for use
+// InsightsDataGatherApplyConfiguration represents a declarative configuration of the InsightsDataGather type for use
// with apply.
type InsightsDataGatherApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type InsightsDataGatherApplyConfiguration struct {
Status *configv1alpha1.InsightsDataGatherStatus `json:"status,omitempty"`
}
-// InsightsDataGather constructs an declarative configuration of the InsightsDataGather type for use with
+// InsightsDataGather constructs a declarative configuration of the InsightsDataGather type for use with
// apply.
func InsightsDataGather(name string) *InsightsDataGatherApplyConfiguration {
b := &InsightsDataGatherApplyConfiguration{}
@@ -238,3 +238,9 @@ func (b *InsightsDataGatherApplyConfiguration) WithStatus(value configv1alpha1.I
b.Status = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *InsightsDataGatherApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/insightsdatagatherspec.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/insightsdatagatherspec.go
index 44416cf858..51b0ba6295 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/insightsdatagatherspec.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/insightsdatagatherspec.go
@@ -2,13 +2,13 @@
package v1alpha1
-// InsightsDataGatherSpecApplyConfiguration represents an declarative configuration of the InsightsDataGatherSpec type for use
+// InsightsDataGatherSpecApplyConfiguration represents a declarative configuration of the InsightsDataGatherSpec type for use
// with apply.
type InsightsDataGatherSpecApplyConfiguration struct {
GatherConfig *GatherConfigApplyConfiguration `json:"gatherConfig,omitempty"`
}
-// InsightsDataGatherSpecApplyConfiguration constructs an declarative configuration of the InsightsDataGatherSpec type for use with
+// InsightsDataGatherSpecApplyConfiguration constructs a declarative configuration of the InsightsDataGatherSpec type for use with
// apply.
func InsightsDataGatherSpec() *InsightsDataGatherSpecApplyConfiguration {
return &InsightsDataGatherSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policy.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policy.go
index f4697d2bbb..61e4856642 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policy.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policy.go
@@ -2,14 +2,14 @@
package v1alpha1
-// PolicyApplyConfiguration represents an declarative configuration of the Policy type for use
+// PolicyApplyConfiguration represents a declarative configuration of the Policy type for use
// with apply.
type PolicyApplyConfiguration struct {
RootOfTrust *PolicyRootOfTrustApplyConfiguration `json:"rootOfTrust,omitempty"`
SignedIdentity *PolicyIdentityApplyConfiguration `json:"signedIdentity,omitempty"`
}
-// PolicyApplyConfiguration constructs an declarative configuration of the Policy type for use with
+// PolicyApplyConfiguration constructs a declarative configuration of the Policy type for use with
// apply.
func Policy() *PolicyApplyConfiguration {
return &PolicyApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyfulciosubject.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyfulciosubject.go
index 98b0db5904..c4608f47a2 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyfulciosubject.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyfulciosubject.go
@@ -2,14 +2,14 @@
package v1alpha1
-// PolicyFulcioSubjectApplyConfiguration represents an declarative configuration of the PolicyFulcioSubject type for use
+// PolicyFulcioSubjectApplyConfiguration represents a declarative configuration of the PolicyFulcioSubject type for use
// with apply.
type PolicyFulcioSubjectApplyConfiguration struct {
OIDCIssuer *string `json:"oidcIssuer,omitempty"`
SignedEmail *string `json:"signedEmail,omitempty"`
}
-// PolicyFulcioSubjectApplyConfiguration constructs an declarative configuration of the PolicyFulcioSubject type for use with
+// PolicyFulcioSubjectApplyConfiguration constructs a declarative configuration of the PolicyFulcioSubject type for use with
// apply.
func PolicyFulcioSubject() *PolicyFulcioSubjectApplyConfiguration {
return &PolicyFulcioSubjectApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyidentity.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyidentity.go
index ef4769d02d..157c04281b 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyidentity.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyidentity.go
@@ -6,7 +6,7 @@ import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
)
-// PolicyIdentityApplyConfiguration represents an declarative configuration of the PolicyIdentity type for use
+// PolicyIdentityApplyConfiguration represents a declarative configuration of the PolicyIdentity type for use
// with apply.
type PolicyIdentityApplyConfiguration struct {
MatchPolicy *v1alpha1.IdentityMatchPolicy `json:"matchPolicy,omitempty"`
@@ -14,7 +14,7 @@ type PolicyIdentityApplyConfiguration struct {
PolicyMatchRemapIdentity *PolicyMatchRemapIdentityApplyConfiguration `json:"remapIdentity,omitempty"`
}
-// PolicyIdentityApplyConfiguration constructs an declarative configuration of the PolicyIdentity type for use with
+// PolicyIdentityApplyConfiguration constructs a declarative configuration of the PolicyIdentity type for use with
// apply.
func PolicyIdentity() *PolicyIdentityApplyConfiguration {
return &PolicyIdentityApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policymatchexactrepository.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policymatchexactrepository.go
index 6bf36d733e..8b0499ddba 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policymatchexactrepository.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policymatchexactrepository.go
@@ -6,13 +6,13 @@ import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
)
-// PolicyMatchExactRepositoryApplyConfiguration represents an declarative configuration of the PolicyMatchExactRepository type for use
+// PolicyMatchExactRepositoryApplyConfiguration represents a declarative configuration of the PolicyMatchExactRepository type for use
// with apply.
type PolicyMatchExactRepositoryApplyConfiguration struct {
Repository *v1alpha1.IdentityRepositoryPrefix `json:"repository,omitempty"`
}
-// PolicyMatchExactRepositoryApplyConfiguration constructs an declarative configuration of the PolicyMatchExactRepository type for use with
+// PolicyMatchExactRepositoryApplyConfiguration constructs a declarative configuration of the PolicyMatchExactRepository type for use with
// apply.
func PolicyMatchExactRepository() *PolicyMatchExactRepositoryApplyConfiguration {
return &PolicyMatchExactRepositoryApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policymatchremapidentity.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policymatchremapidentity.go
index 20ecf141ca..bfe573c9a6 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policymatchremapidentity.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policymatchremapidentity.go
@@ -6,14 +6,14 @@ import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
)
-// PolicyMatchRemapIdentityApplyConfiguration represents an declarative configuration of the PolicyMatchRemapIdentity type for use
+// PolicyMatchRemapIdentityApplyConfiguration represents a declarative configuration of the PolicyMatchRemapIdentity type for use
// with apply.
type PolicyMatchRemapIdentityApplyConfiguration struct {
Prefix *v1alpha1.IdentityRepositoryPrefix `json:"prefix,omitempty"`
SignedPrefix *v1alpha1.IdentityRepositoryPrefix `json:"signedPrefix,omitempty"`
}
-// PolicyMatchRemapIdentityApplyConfiguration constructs an declarative configuration of the PolicyMatchRemapIdentity type for use with
+// PolicyMatchRemapIdentityApplyConfiguration constructs a declarative configuration of the PolicyMatchRemapIdentity type for use with
// apply.
func PolicyMatchRemapIdentity() *PolicyMatchRemapIdentityApplyConfiguration {
return &PolicyMatchRemapIdentityApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyrootoftrust.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyrootoftrust.go
index cc442ddaea..ca4c73f6a9 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyrootoftrust.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/policyrootoftrust.go
@@ -6,7 +6,7 @@ import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
)
-// PolicyRootOfTrustApplyConfiguration represents an declarative configuration of the PolicyRootOfTrust type for use
+// PolicyRootOfTrustApplyConfiguration represents a declarative configuration of the PolicyRootOfTrust type for use
// with apply.
type PolicyRootOfTrustApplyConfiguration struct {
PolicyType *v1alpha1.PolicyType `json:"policyType,omitempty"`
@@ -14,7 +14,7 @@ type PolicyRootOfTrustApplyConfiguration struct {
FulcioCAWithRekor *FulcioCAWithRekorApplyConfiguration `json:"fulcioCAWithRekor,omitempty"`
}
-// PolicyRootOfTrustApplyConfiguration constructs an declarative configuration of the PolicyRootOfTrust type for use with
+// PolicyRootOfTrustApplyConfiguration constructs a declarative configuration of the PolicyRootOfTrust type for use with
// apply.
func PolicyRootOfTrust() *PolicyRootOfTrustApplyConfiguration {
return &PolicyRootOfTrustApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/publickey.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/publickey.go
index 0636a283ef..91665a90b7 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/publickey.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/publickey.go
@@ -2,14 +2,14 @@
package v1alpha1
-// PublicKeyApplyConfiguration represents an declarative configuration of the PublicKey type for use
+// PublicKeyApplyConfiguration represents a declarative configuration of the PublicKey type for use
// with apply.
type PublicKeyApplyConfiguration struct {
KeyData []byte `json:"keyData,omitempty"`
RekorKeyData []byte `json:"rekorKeyData,omitempty"`
}
-// PublicKeyApplyConfiguration constructs an declarative configuration of the PublicKey type for use with
+// PublicKeyApplyConfiguration constructs a declarative configuration of the PublicKey type for use with
// apply.
func PublicKey() *PublicKeyApplyConfiguration {
return &PublicKeyApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionnumberconfig.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionnumberconfig.go
index 833c540eca..f6a7871717 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionnumberconfig.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionnumberconfig.go
@@ -2,13 +2,13 @@
package v1alpha1
-// RetentionNumberConfigApplyConfiguration represents an declarative configuration of the RetentionNumberConfig type for use
+// RetentionNumberConfigApplyConfiguration represents a declarative configuration of the RetentionNumberConfig type for use
// with apply.
type RetentionNumberConfigApplyConfiguration struct {
MaxNumberOfBackups *int `json:"maxNumberOfBackups,omitempty"`
}
-// RetentionNumberConfigApplyConfiguration constructs an declarative configuration of the RetentionNumberConfig type for use with
+// RetentionNumberConfigApplyConfiguration constructs a declarative configuration of the RetentionNumberConfig type for use with
// apply.
func RetentionNumberConfig() *RetentionNumberConfigApplyConfiguration {
return &RetentionNumberConfigApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionpolicy.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionpolicy.go
index 7d0de95c97..8fe865a97d 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionpolicy.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionpolicy.go
@@ -6,7 +6,7 @@ import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
)
-// RetentionPolicyApplyConfiguration represents an declarative configuration of the RetentionPolicy type for use
+// RetentionPolicyApplyConfiguration represents a declarative configuration of the RetentionPolicy type for use
// with apply.
type RetentionPolicyApplyConfiguration struct {
RetentionType *v1alpha1.RetentionType `json:"retentionType,omitempty"`
@@ -14,7 +14,7 @@ type RetentionPolicyApplyConfiguration struct {
RetentionSize *RetentionSizeConfigApplyConfiguration `json:"retentionSize,omitempty"`
}
-// RetentionPolicyApplyConfiguration constructs an declarative configuration of the RetentionPolicy type for use with
+// RetentionPolicyApplyConfiguration constructs a declarative configuration of the RetentionPolicy type for use with
// apply.
func RetentionPolicy() *RetentionPolicyApplyConfiguration {
return &RetentionPolicyApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionsizeconfig.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionsizeconfig.go
index 50519b53a8..96b723be4c 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionsizeconfig.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retentionsizeconfig.go
@@ -2,13 +2,13 @@
package v1alpha1
-// RetentionSizeConfigApplyConfiguration represents an declarative configuration of the RetentionSizeConfig type for use
+// RetentionSizeConfigApplyConfiguration represents a declarative configuration of the RetentionSizeConfig type for use
// with apply.
type RetentionSizeConfigApplyConfiguration struct {
MaxSizeOfBackupsGb *int `json:"maxSizeOfBackupsGb,omitempty"`
}
-// RetentionSizeConfigApplyConfiguration constructs an declarative configuration of the RetentionSizeConfig type for use with
+// RetentionSizeConfigApplyConfiguration constructs a declarative configuration of the RetentionSizeConfig type for use with
// apply.
func RetentionSizeConfig() *RetentionSizeConfigApplyConfiguration {
return &RetentionSizeConfigApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go
index fc70cbc320..55099fc988 100644
--- a/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go
@@ -139,6 +139,11 @@ var schemaYAML = typed.YAMLObject(`types:
- name: com.github.openshift.api.config.v1.AWSPlatformStatus
map:
fields:
+ - name: cloudLoadBalancerConfig
+ type:
+ namedType: com.github.openshift.api.config.v1.CloudLoadBalancerConfig
+ default:
+ dnsType: PlatformDefault
- name: region
type:
scalar: string
@@ -630,7 +635,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: extension
type:
namedType: __untyped_atomic_
- default: {}
- name: relatedObjects
type:
list:
@@ -649,7 +653,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: lastTransitionTime
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
- default: {}
- name: message
type:
scalar: string
@@ -1621,6 +1624,10 @@ var schemaYAML = typed.YAMLObject(`types:
elementType:
scalar: string
elementRelationship: atomic
+ - name: imageStreamImportMode
+ type:
+ scalar: string
+ default: ""
- name: registrySources
type:
namedType: com.github.openshift.api.config.v1.RegistrySources
@@ -1634,6 +1641,9 @@ var schemaYAML = typed.YAMLObject(`types:
elementType:
scalar: string
elementRelationship: atomic
+ - name: imageStreamImportMode
+ type:
+ scalar: string
- name: internalRegistryHostname
type:
scalar: string
@@ -2162,21 +2172,24 @@ var schemaYAML = typed.YAMLObject(`types:
- name: cgroupMode
type:
scalar: string
+ - name: minimumKubeletVersion
+ type:
+ scalar: string
+ default: ""
- name: workerLatencyProfile
type:
scalar: string
- name: com.github.openshift.api.config.v1.NodeStatus
map:
- elementType:
- scalar: untyped
- list:
- elementType:
- namedType: __untyped_atomic_
- elementRelationship: atomic
- map:
- elementType:
- namedType: __untyped_deduced_
- elementRelationship: separable
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
+ elementRelationship: associative
+ keys:
+ - type
- name: com.github.openshift.api.config.v1.NutanixFailureDomain
map:
fields:
@@ -3345,7 +3358,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: startedTime
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
- default: {}
- name: state
type:
scalar: string
@@ -3963,6 +3975,9 @@ var schemaYAML = typed.YAMLObject(`types:
type:
scalar: string
default: ""
+ - name: request
+ type:
+ scalar: string
- name: io.k8s.api.core.v1.ResourceFieldSelector
map:
fields:
@@ -3972,7 +3987,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: divisor
type:
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
- default: {}
- name: resource
type:
scalar: string
@@ -4040,7 +4054,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: lastTransitionTime
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
- default: {}
- name: message
type:
scalar: string
@@ -4141,7 +4154,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: creationTimestamp
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
- default: {}
- name: deletionGracePeriodSeconds
type:
scalar: numeric
diff --git a/vendor/github.com/openshift/client-go/config/applyconfigurations/utils.go b/vendor/github.com/openshift/client-go/config/applyconfigurations/utils.go
new file mode 100644
index 0000000000..a470354475
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/config/applyconfigurations/utils.go
@@ -0,0 +1,460 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package applyconfigurations
+
+import (
+ v1 "github.com/openshift/api/config/v1"
+ v1alpha1 "github.com/openshift/api/config/v1alpha1"
+ configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
+ configv1alpha1 "github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1"
+ internal "github.com/openshift/client-go/config/applyconfigurations/internal"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ testing "k8s.io/client-go/testing"
+)
+
+// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no
+// apply configuration type exists for the given GroupVersionKind.
+func ForKind(kind schema.GroupVersionKind) interface{} {
+ switch kind {
+ // Group=config.openshift.io, Version=v1
+ case v1.SchemeGroupVersion.WithKind("AlibabaCloudPlatformStatus"):
+ return &configv1.AlibabaCloudPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AlibabaCloudResourceTag"):
+ return &configv1.AlibabaCloudResourceTagApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("APIServer"):
+ return &configv1.APIServerApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("APIServerEncryption"):
+ return &configv1.APIServerEncryptionApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("APIServerNamedServingCert"):
+ return &configv1.APIServerNamedServingCertApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("APIServerServingCerts"):
+ return &configv1.APIServerServingCertsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("APIServerSpec"):
+ return &configv1.APIServerSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Audit"):
+ return &configv1.AuditApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AuditCustomRule"):
+ return &configv1.AuditCustomRuleApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Authentication"):
+ return &configv1.AuthenticationApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AuthenticationSpec"):
+ return &configv1.AuthenticationSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AuthenticationStatus"):
+ return &configv1.AuthenticationStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AWSDNSSpec"):
+ return &configv1.AWSDNSSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AWSIngressSpec"):
+ return &configv1.AWSIngressSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AWSPlatformSpec"):
+ return &configv1.AWSPlatformSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AWSPlatformStatus"):
+ return &configv1.AWSPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AWSResourceTag"):
+ return &configv1.AWSResourceTagApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AWSServiceEndpoint"):
+ return &configv1.AWSServiceEndpointApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AzurePlatformStatus"):
+ return &configv1.AzurePlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("AzureResourceTag"):
+ return &configv1.AzureResourceTagApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("BareMetalPlatformLoadBalancer"):
+ return &configv1.BareMetalPlatformLoadBalancerApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("BareMetalPlatformSpec"):
+ return &configv1.BareMetalPlatformSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("BareMetalPlatformStatus"):
+ return &configv1.BareMetalPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("BasicAuthIdentityProvider"):
+ return &configv1.BasicAuthIdentityProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Build"):
+ return &configv1.BuildApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("BuildDefaults"):
+ return &configv1.BuildDefaultsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("BuildOverrides"):
+ return &configv1.BuildOverridesApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("BuildSpec"):
+ return &configv1.BuildSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("CloudControllerManagerStatus"):
+ return &configv1.CloudControllerManagerStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("CloudLoadBalancerConfig"):
+ return &configv1.CloudLoadBalancerConfigApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("CloudLoadBalancerIPs"):
+ return &configv1.CloudLoadBalancerIPsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ClusterCondition"):
+ return &configv1.ClusterConditionApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ClusterNetworkEntry"):
+ return &configv1.ClusterNetworkEntryApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ClusterOperator"):
+ return &configv1.ClusterOperatorApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ClusterOperatorStatus"):
+ return &configv1.ClusterOperatorStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ClusterOperatorStatusCondition"):
+ return &configv1.ClusterOperatorStatusConditionApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ClusterVersion"):
+ return &configv1.ClusterVersionApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ClusterVersionCapabilitiesSpec"):
+ return &configv1.ClusterVersionCapabilitiesSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ClusterVersionCapabilitiesStatus"):
+ return &configv1.ClusterVersionCapabilitiesStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ClusterVersionSpec"):
+ return &configv1.ClusterVersionSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ClusterVersionStatus"):
+ return &configv1.ClusterVersionStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ComponentOverride"):
+ return &configv1.ComponentOverrideApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ComponentRouteSpec"):
+ return &configv1.ComponentRouteSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ComponentRouteStatus"):
+ return &configv1.ComponentRouteStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ConditionalUpdate"):
+ return &configv1.ConditionalUpdateApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ConditionalUpdateRisk"):
+ return &configv1.ConditionalUpdateRiskApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ConfigMapFileReference"):
+ return &configv1.ConfigMapFileReferenceApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ConfigMapNameReference"):
+ return &configv1.ConfigMapNameReferenceApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Console"):
+ return &configv1.ConsoleApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ConsoleAuthentication"):
+ return &configv1.ConsoleAuthenticationApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ConsoleSpec"):
+ return &configv1.ConsoleSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ConsoleStatus"):
+ return &configv1.ConsoleStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("CustomFeatureGates"):
+ return &configv1.CustomFeatureGatesApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("CustomTLSProfile"):
+ return &configv1.CustomTLSProfileApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("DeprecatedWebhookTokenAuthenticator"):
+ return &configv1.DeprecatedWebhookTokenAuthenticatorApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("DNS"):
+ return &configv1.DNSApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("DNSPlatformSpec"):
+ return &configv1.DNSPlatformSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("DNSSpec"):
+ return &configv1.DNSSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("DNSZone"):
+ return &configv1.DNSZoneApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("EquinixMetalPlatformStatus"):
+ return &configv1.EquinixMetalPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ExternalIPConfig"):
+ return &configv1.ExternalIPConfigApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ExternalIPPolicy"):
+ return &configv1.ExternalIPPolicyApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ExternalPlatformSpec"):
+ return &configv1.ExternalPlatformSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ExternalPlatformStatus"):
+ return &configv1.ExternalPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("FeatureGate"):
+ return &configv1.FeatureGateApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("FeatureGateAttributes"):
+ return &configv1.FeatureGateAttributesApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("FeatureGateDetails"):
+ return &configv1.FeatureGateDetailsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("FeatureGateSelection"):
+ return &configv1.FeatureGateSelectionApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("FeatureGateSpec"):
+ return &configv1.FeatureGateSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("FeatureGateStatus"):
+ return &configv1.FeatureGateStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("GCPPlatformStatus"):
+ return &configv1.GCPPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("GCPResourceLabel"):
+ return &configv1.GCPResourceLabelApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("GCPResourceTag"):
+ return &configv1.GCPResourceTagApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("GitHubIdentityProvider"):
+ return &configv1.GitHubIdentityProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("GitLabIdentityProvider"):
+ return &configv1.GitLabIdentityProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("GoogleIdentityProvider"):
+ return &configv1.GoogleIdentityProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("HTPasswdIdentityProvider"):
+ return &configv1.HTPasswdIdentityProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("HubSource"):
+ return &configv1.HubSourceApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("HubSourceStatus"):
+ return &configv1.HubSourceStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("IBMCloudPlatformStatus"):
+ return &configv1.IBMCloudPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("IBMCloudServiceEndpoint"):
+ return &configv1.IBMCloudServiceEndpointApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("IdentityProvider"):
+ return &configv1.IdentityProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("IdentityProviderConfig"):
+ return &configv1.IdentityProviderConfigApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Image"):
+ return &configv1.ImageApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageContentPolicy"):
+ return &configv1.ImageContentPolicyApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageContentPolicySpec"):
+ return &configv1.ImageContentPolicySpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageDigestMirrors"):
+ return &configv1.ImageDigestMirrorsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageDigestMirrorSet"):
+ return &configv1.ImageDigestMirrorSetApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageDigestMirrorSetSpec"):
+ return &configv1.ImageDigestMirrorSetSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageLabel"):
+ return &configv1.ImageLabelApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageSpec"):
+ return &configv1.ImageSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageStatus"):
+ return &configv1.ImageStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageTagMirrors"):
+ return &configv1.ImageTagMirrorsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageTagMirrorSet"):
+ return &configv1.ImageTagMirrorSetApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ImageTagMirrorSetSpec"):
+ return &configv1.ImageTagMirrorSetSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Infrastructure"):
+ return &configv1.InfrastructureApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("InfrastructureSpec"):
+ return &configv1.InfrastructureSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("InfrastructureStatus"):
+ return &configv1.InfrastructureStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Ingress"):
+ return &configv1.IngressApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("IngressPlatformSpec"):
+ return &configv1.IngressPlatformSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("IngressSpec"):
+ return &configv1.IngressSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("IngressStatus"):
+ return &configv1.IngressStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("KeystoneIdentityProvider"):
+ return &configv1.KeystoneIdentityProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("KubevirtPlatformStatus"):
+ return &configv1.KubevirtPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("LDAPAttributeMapping"):
+ return &configv1.LDAPAttributeMappingApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("LDAPIdentityProvider"):
+ return &configv1.LDAPIdentityProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("LoadBalancer"):
+ return &configv1.LoadBalancerApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("MaxAgePolicy"):
+ return &configv1.MaxAgePolicyApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("MTUMigration"):
+ return &configv1.MTUMigrationApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("MTUMigrationValues"):
+ return &configv1.MTUMigrationValuesApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Network"):
+ return &configv1.NetworkApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NetworkDiagnostics"):
+ return &configv1.NetworkDiagnosticsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NetworkDiagnosticsSourcePlacement"):
+ return &configv1.NetworkDiagnosticsSourcePlacementApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NetworkDiagnosticsTargetPlacement"):
+ return &configv1.NetworkDiagnosticsTargetPlacementApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NetworkMigration"):
+ return &configv1.NetworkMigrationApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NetworkSpec"):
+ return &configv1.NetworkSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NetworkStatus"):
+ return &configv1.NetworkStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Node"):
+ return &configv1.NodeApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NodeSpec"):
+ return &configv1.NodeSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NodeStatus"):
+ return &configv1.NodeStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NutanixFailureDomain"):
+ return &configv1.NutanixFailureDomainApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NutanixPlatformLoadBalancer"):
+ return &configv1.NutanixPlatformLoadBalancerApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NutanixPlatformSpec"):
+ return &configv1.NutanixPlatformSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NutanixPlatformStatus"):
+ return &configv1.NutanixPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NutanixPrismElementEndpoint"):
+ return &configv1.NutanixPrismElementEndpointApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NutanixPrismEndpoint"):
+ return &configv1.NutanixPrismEndpointApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("NutanixResourceIdentifier"):
+ return &configv1.NutanixResourceIdentifierApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OAuth"):
+ return &configv1.OAuthApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OAuthRemoteConnectionInfo"):
+ return &configv1.OAuthRemoteConnectionInfoApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OAuthSpec"):
+ return &configv1.OAuthSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OAuthTemplates"):
+ return &configv1.OAuthTemplatesApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ObjectReference"):
+ return &configv1.ObjectReferenceApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OIDCClientConfig"):
+ return &configv1.OIDCClientConfigApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OIDCClientReference"):
+ return &configv1.OIDCClientReferenceApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OIDCClientStatus"):
+ return &configv1.OIDCClientStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OIDCProvider"):
+ return &configv1.OIDCProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OpenIDClaims"):
+ return &configv1.OpenIDClaimsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OpenIDIdentityProvider"):
+ return &configv1.OpenIDIdentityProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OpenStackPlatformLoadBalancer"):
+ return &configv1.OpenStackPlatformLoadBalancerApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OpenStackPlatformSpec"):
+ return &configv1.OpenStackPlatformSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OpenStackPlatformStatus"):
+ return &configv1.OpenStackPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OperandVersion"):
+ return &configv1.OperandVersionApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OperatorHub"):
+ return &configv1.OperatorHubApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OperatorHubSpec"):
+ return &configv1.OperatorHubSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OperatorHubStatus"):
+ return &configv1.OperatorHubStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OvirtPlatformLoadBalancer"):
+ return &configv1.OvirtPlatformLoadBalancerApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("OvirtPlatformStatus"):
+ return &configv1.OvirtPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("PlatformSpec"):
+ return &configv1.PlatformSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("PlatformStatus"):
+ return &configv1.PlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("PowerVSPlatformSpec"):
+ return &configv1.PowerVSPlatformSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("PowerVSPlatformStatus"):
+ return &configv1.PowerVSPlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("PowerVSServiceEndpoint"):
+ return &configv1.PowerVSServiceEndpointApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("PrefixedClaimMapping"):
+ return &configv1.PrefixedClaimMappingApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ProfileCustomizations"):
+ return &configv1.ProfileCustomizationsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Project"):
+ return &configv1.ProjectApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ProjectSpec"):
+ return &configv1.ProjectSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("PromQLClusterCondition"):
+ return &configv1.PromQLClusterConditionApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Proxy"):
+ return &configv1.ProxyApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ProxySpec"):
+ return &configv1.ProxySpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("ProxyStatus"):
+ return &configv1.ProxyStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("RegistryLocation"):
+ return &configv1.RegistryLocationApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("RegistrySources"):
+ return &configv1.RegistrySourcesApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Release"):
+ return &configv1.ReleaseApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("RepositoryDigestMirrors"):
+ return &configv1.RepositoryDigestMirrorsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("RequestHeaderIdentityProvider"):
+ return &configv1.RequestHeaderIdentityProviderApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("RequiredHSTSPolicy"):
+ return &configv1.RequiredHSTSPolicyApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Scheduler"):
+ return &configv1.SchedulerApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("SchedulerSpec"):
+ return &configv1.SchedulerSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("SecretNameReference"):
+ return &configv1.SecretNameReferenceApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("SignatureStore"):
+ return &configv1.SignatureStoreApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("TemplateReference"):
+ return &configv1.TemplateReferenceApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("TLSProfileSpec"):
+ return &configv1.TLSProfileSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("TLSSecurityProfile"):
+ return &configv1.TLSSecurityProfileApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("TokenClaimMapping"):
+ return &configv1.TokenClaimMappingApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("TokenClaimMappings"):
+ return &configv1.TokenClaimMappingsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("TokenClaimValidationRule"):
+ return &configv1.TokenClaimValidationRuleApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("TokenConfig"):
+ return &configv1.TokenConfigApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("TokenIssuer"):
+ return &configv1.TokenIssuerApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("TokenRequiredClaim"):
+ return &configv1.TokenRequiredClaimApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("Update"):
+ return &configv1.UpdateApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("UpdateHistory"):
+ return &configv1.UpdateHistoryApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("UsernameClaimMapping"):
+ return &configv1.UsernameClaimMappingApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("UsernamePrefix"):
+ return &configv1.UsernamePrefixApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("VSpherePlatformFailureDomainSpec"):
+ return &configv1.VSpherePlatformFailureDomainSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("VSpherePlatformLoadBalancer"):
+ return &configv1.VSpherePlatformLoadBalancerApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("VSpherePlatformNodeNetworking"):
+ return &configv1.VSpherePlatformNodeNetworkingApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("VSpherePlatformNodeNetworkingSpec"):
+ return &configv1.VSpherePlatformNodeNetworkingSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("VSpherePlatformSpec"):
+ return &configv1.VSpherePlatformSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("VSpherePlatformStatus"):
+ return &configv1.VSpherePlatformStatusApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("VSpherePlatformTopology"):
+ return &configv1.VSpherePlatformTopologyApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("VSpherePlatformVCenterSpec"):
+ return &configv1.VSpherePlatformVCenterSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("WebhookTokenAuthenticator"):
+ return &configv1.WebhookTokenAuthenticatorApplyConfiguration{}
+
+ // Group=config.openshift.io, Version=v1alpha1
+ case v1alpha1.SchemeGroupVersion.WithKind("Backup"):
+ return &configv1alpha1.BackupApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("BackupSpec"):
+ return &configv1alpha1.BackupSpecApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("ClusterImagePolicy"):
+ return &configv1alpha1.ClusterImagePolicyApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("ClusterImagePolicySpec"):
+ return &configv1alpha1.ClusterImagePolicySpecApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("ClusterImagePolicyStatus"):
+ return &configv1alpha1.ClusterImagePolicyStatusApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("EtcdBackupSpec"):
+ return &configv1alpha1.EtcdBackupSpecApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("FulcioCAWithRekor"):
+ return &configv1alpha1.FulcioCAWithRekorApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("GatherConfig"):
+ return &configv1alpha1.GatherConfigApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("ImagePolicy"):
+ return &configv1alpha1.ImagePolicyApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("ImagePolicySpec"):
+ return &configv1alpha1.ImagePolicySpecApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("ImagePolicyStatus"):
+ return &configv1alpha1.ImagePolicyStatusApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("InsightsDataGather"):
+ return &configv1alpha1.InsightsDataGatherApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("InsightsDataGatherSpec"):
+ return &configv1alpha1.InsightsDataGatherSpecApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("Policy"):
+ return &configv1alpha1.PolicyApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("PolicyFulcioSubject"):
+ return &configv1alpha1.PolicyFulcioSubjectApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("PolicyIdentity"):
+ return &configv1alpha1.PolicyIdentityApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("PolicyMatchExactRepository"):
+ return &configv1alpha1.PolicyMatchExactRepositoryApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("PolicyMatchRemapIdentity"):
+ return &configv1alpha1.PolicyMatchRemapIdentityApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("PolicyRootOfTrust"):
+ return &configv1alpha1.PolicyRootOfTrustApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("PublicKey"):
+ return &configv1alpha1.PublicKeyApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("RetentionNumberConfig"):
+ return &configv1alpha1.RetentionNumberConfigApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("RetentionPolicy"):
+ return &configv1alpha1.RetentionPolicyApplyConfiguration{}
+ case v1alpha1.SchemeGroupVersion.WithKind("RetentionSizeConfig"):
+ return &configv1alpha1.RetentionSizeConfigApplyConfiguration{}
+
+ }
+ return nil
+}
+
+func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter {
+ return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()}
+}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go
index cb8a9224bb..ddf12da1e7 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go
@@ -3,6 +3,7 @@
package fake
import (
+ applyconfigurations "github.com/openshift/client-go/config/applyconfigurations"
clientset "github.com/openshift/client-go/config/clientset/versioned"
configv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1"
fakeconfigv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake"
@@ -17,8 +18,12 @@ import (
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
-// without applying any validations and/or defaults. It shouldn't be considered a replacement
+// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
+//
+// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves
+// server side apply testing. NewClientset is only available when apply configurations are generated (e.g.
+// via --with-applyconfig).
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
for _, obj := range objects {
@@ -60,6 +65,38 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
+// NewClientset returns a clientset that will respond with the provided objects.
+// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
+// without applying any validations and/or defaults. It shouldn't be considered a replacement
+// for a real clientset and is mostly useful in simple unit tests.
+func NewClientset(objects ...runtime.Object) *Clientset {
+ o := testing.NewFieldManagedObjectTracker(
+ scheme,
+ codecs.UniversalDecoder(),
+ applyconfigurations.NewTypeConverter(scheme),
+ )
+ for _, obj := range objects {
+ if err := o.Add(obj); err != nil {
+ panic(err)
+ }
+ }
+
+ cs := &Clientset{tracker: o}
+ cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
+ cs.AddReactor("*", "*", testing.ObjectReaction(o))
+ cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
+ gvr := action.GetResource()
+ ns := action.GetNamespace()
+ watch, err := o.Watch(gvr, ns)
+ if err != nil {
+ return false, nil, err
+ }
+ return true, watch, nil
+ })
+
+ return cs
+}
+
var (
_ clientset.Interface = &Clientset{}
_ testing.FakeClient = &Clientset{}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/apiserver.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/apiserver.go
index d4fff3f957..5751cebe79 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/apiserver.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/apiserver.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// APIServersGetter has a method to return a APIServerInterface.
@@ -27,6 +24,7 @@ type APIServersGetter interface {
type APIServerInterface interface {
Create(ctx context.Context, aPIServer *v1.APIServer, opts metav1.CreateOptions) (*v1.APIServer, error)
Update(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (*v1.APIServer, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (*v1.APIServer, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type APIServerInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.APIServer, err error)
Apply(ctx context.Context, aPIServer *configv1.APIServerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.APIServer, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, aPIServer *configv1.APIServerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.APIServer, err error)
APIServerExpansion
}
// aPIServers implements APIServerInterface
type aPIServers struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.APIServer, *v1.APIServerList, *configv1.APIServerApplyConfiguration]
}
// newAPIServers returns a APIServers
func newAPIServers(c *ConfigV1Client) *aPIServers {
return &aPIServers{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.APIServer, *v1.APIServerList, *configv1.APIServerApplyConfiguration](
+ "apiservers",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.APIServer { return &v1.APIServer{} },
+ func() *v1.APIServerList { return &v1.APIServerList{} }),
}
}
-
-// Get takes name of the aPIServer, and returns the corresponding aPIServer object, and an error if there is any.
-func (c *aPIServers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.APIServer, err error) {
- result = &v1.APIServer{}
- err = c.client.Get().
- Resource("apiservers").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of APIServers that match those selectors.
-func (c *aPIServers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.APIServerList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.APIServerList{}
- err = c.client.Get().
- Resource("apiservers").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested aPIServers.
-func (c *aPIServers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("apiservers").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a aPIServer and creates it. Returns the server's representation of the aPIServer, and an error, if there is any.
-func (c *aPIServers) Create(ctx context.Context, aPIServer *v1.APIServer, opts metav1.CreateOptions) (result *v1.APIServer, err error) {
- result = &v1.APIServer{}
- err = c.client.Post().
- Resource("apiservers").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(aPIServer).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a aPIServer and updates it. Returns the server's representation of the aPIServer, and an error, if there is any.
-func (c *aPIServers) Update(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (result *v1.APIServer, err error) {
- result = &v1.APIServer{}
- err = c.client.Put().
- Resource("apiservers").
- Name(aPIServer.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(aPIServer).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *aPIServers) UpdateStatus(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (result *v1.APIServer, err error) {
- result = &v1.APIServer{}
- err = c.client.Put().
- Resource("apiservers").
- Name(aPIServer.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(aPIServer).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the aPIServer and deletes it. Returns an error if one occurs.
-func (c *aPIServers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("apiservers").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *aPIServers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("apiservers").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched aPIServer.
-func (c *aPIServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.APIServer, err error) {
- result = &v1.APIServer{}
- err = c.client.Patch(pt).
- Resource("apiservers").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied aPIServer.
-func (c *aPIServers) Apply(ctx context.Context, aPIServer *configv1.APIServerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.APIServer, err error) {
- if aPIServer == nil {
- return nil, fmt.Errorf("aPIServer provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(aPIServer)
- if err != nil {
- return nil, err
- }
- name := aPIServer.Name
- if name == nil {
- return nil, fmt.Errorf("aPIServer.Name must be provided to Apply")
- }
- result = &v1.APIServer{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("apiservers").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *aPIServers) ApplyStatus(ctx context.Context, aPIServer *configv1.APIServerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.APIServer, err error) {
- if aPIServer == nil {
- return nil, fmt.Errorf("aPIServer provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(aPIServer)
- if err != nil {
- return nil, err
- }
-
- name := aPIServer.Name
- if name == nil {
- return nil, fmt.Errorf("aPIServer.Name must be provided to Apply")
- }
-
- result = &v1.APIServer{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("apiservers").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go
index 91c5d99d2d..89b1779b3c 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// AuthenticationsGetter has a method to return a AuthenticationInterface.
@@ -27,6 +24,7 @@ type AuthenticationsGetter interface {
type AuthenticationInterface interface {
Create(ctx context.Context, authentication *v1.Authentication, opts metav1.CreateOptions) (*v1.Authentication, error)
Update(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (*v1.Authentication, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (*v1.Authentication, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type AuthenticationInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Authentication, err error)
Apply(ctx context.Context, authentication *configv1.AuthenticationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Authentication, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, authentication *configv1.AuthenticationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Authentication, err error)
AuthenticationExpansion
}
// authentications implements AuthenticationInterface
type authentications struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Authentication, *v1.AuthenticationList, *configv1.AuthenticationApplyConfiguration]
}
// newAuthentications returns a Authentications
func newAuthentications(c *ConfigV1Client) *authentications {
return &authentications{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Authentication, *v1.AuthenticationList, *configv1.AuthenticationApplyConfiguration](
+ "authentications",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Authentication { return &v1.Authentication{} },
+ func() *v1.AuthenticationList { return &v1.AuthenticationList{} }),
}
}
-
-// Get takes name of the authentication, and returns the corresponding authentication object, and an error if there is any.
-func (c *authentications) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Authentication, err error) {
- result = &v1.Authentication{}
- err = c.client.Get().
- Resource("authentications").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Authentications that match those selectors.
-func (c *authentications) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AuthenticationList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.AuthenticationList{}
- err = c.client.Get().
- Resource("authentications").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested authentications.
-func (c *authentications) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("authentications").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a authentication and creates it. Returns the server's representation of the authentication, and an error, if there is any.
-func (c *authentications) Create(ctx context.Context, authentication *v1.Authentication, opts metav1.CreateOptions) (result *v1.Authentication, err error) {
- result = &v1.Authentication{}
- err = c.client.Post().
- Resource("authentications").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(authentication).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a authentication and updates it. Returns the server's representation of the authentication, and an error, if there is any.
-func (c *authentications) Update(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (result *v1.Authentication, err error) {
- result = &v1.Authentication{}
- err = c.client.Put().
- Resource("authentications").
- Name(authentication.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(authentication).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *authentications) UpdateStatus(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (result *v1.Authentication, err error) {
- result = &v1.Authentication{}
- err = c.client.Put().
- Resource("authentications").
- Name(authentication.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(authentication).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the authentication and deletes it. Returns an error if one occurs.
-func (c *authentications) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("authentications").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *authentications) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("authentications").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched authentication.
-func (c *authentications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Authentication, err error) {
- result = &v1.Authentication{}
- err = c.client.Patch(pt).
- Resource("authentications").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied authentication.
-func (c *authentications) Apply(ctx context.Context, authentication *configv1.AuthenticationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Authentication, err error) {
- if authentication == nil {
- return nil, fmt.Errorf("authentication provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(authentication)
- if err != nil {
- return nil, err
- }
- name := authentication.Name
- if name == nil {
- return nil, fmt.Errorf("authentication.Name must be provided to Apply")
- }
- result = &v1.Authentication{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("authentications").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *authentications) ApplyStatus(ctx context.Context, authentication *configv1.AuthenticationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Authentication, err error) {
- if authentication == nil {
- return nil, fmt.Errorf("authentication provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(authentication)
- if err != nil {
- return nil, err
- }
-
- name := authentication.Name
- if name == nil {
- return nil, fmt.Errorf("authentication.Name must be provided to Apply")
- }
-
- result = &v1.Authentication{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("authentications").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go
index e2d09ef1cb..2ecfb68d91 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// BuildsGetter has a method to return a BuildInterface.
@@ -39,143 +36,18 @@ type BuildInterface interface {
// builds implements BuildInterface
type builds struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Build, *v1.BuildList, *configv1.BuildApplyConfiguration]
}
// newBuilds returns a Builds
func newBuilds(c *ConfigV1Client) *builds {
return &builds{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Build, *v1.BuildList, *configv1.BuildApplyConfiguration](
+ "builds",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Build { return &v1.Build{} },
+ func() *v1.BuildList { return &v1.BuildList{} }),
}
}
-
-// Get takes name of the build, and returns the corresponding build object, and an error if there is any.
-func (c *builds) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Build, err error) {
- result = &v1.Build{}
- err = c.client.Get().
- Resource("builds").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Builds that match those selectors.
-func (c *builds) List(ctx context.Context, opts metav1.ListOptions) (result *v1.BuildList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.BuildList{}
- err = c.client.Get().
- Resource("builds").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested builds.
-func (c *builds) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("builds").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a build and creates it. Returns the server's representation of the build, and an error, if there is any.
-func (c *builds) Create(ctx context.Context, build *v1.Build, opts metav1.CreateOptions) (result *v1.Build, err error) {
- result = &v1.Build{}
- err = c.client.Post().
- Resource("builds").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(build).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a build and updates it. Returns the server's representation of the build, and an error, if there is any.
-func (c *builds) Update(ctx context.Context, build *v1.Build, opts metav1.UpdateOptions) (result *v1.Build, err error) {
- result = &v1.Build{}
- err = c.client.Put().
- Resource("builds").
- Name(build.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(build).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the build and deletes it. Returns an error if one occurs.
-func (c *builds) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("builds").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *builds) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("builds").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched build.
-func (c *builds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Build, err error) {
- result = &v1.Build{}
- err = c.client.Patch(pt).
- Resource("builds").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied build.
-func (c *builds) Apply(ctx context.Context, build *configv1.BuildApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Build, err error) {
- if build == nil {
- return nil, fmt.Errorf("build provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(build)
- if err != nil {
- return nil, err
- }
- name := build.Name
- if name == nil {
- return nil, fmt.Errorf("build.Name must be provided to Apply")
- }
- result = &v1.Build{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("builds").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go
index 941a160948..b1015c40db 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ClusterOperatorsGetter has a method to return a ClusterOperatorInterface.
@@ -27,6 +24,7 @@ type ClusterOperatorsGetter interface {
type ClusterOperatorInterface interface {
Create(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.CreateOptions) (*v1.ClusterOperator, error)
Update(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (*v1.ClusterOperator, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (*v1.ClusterOperator, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type ClusterOperatorInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterOperator, err error)
Apply(ctx context.Context, clusterOperator *configv1.ClusterOperatorApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterOperator, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, clusterOperator *configv1.ClusterOperatorApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterOperator, err error)
ClusterOperatorExpansion
}
// clusterOperators implements ClusterOperatorInterface
type clusterOperators struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.ClusterOperator, *v1.ClusterOperatorList, *configv1.ClusterOperatorApplyConfiguration]
}
// newClusterOperators returns a ClusterOperators
func newClusterOperators(c *ConfigV1Client) *clusterOperators {
return &clusterOperators{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.ClusterOperator, *v1.ClusterOperatorList, *configv1.ClusterOperatorApplyConfiguration](
+ "clusteroperators",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.ClusterOperator { return &v1.ClusterOperator{} },
+ func() *v1.ClusterOperatorList { return &v1.ClusterOperatorList{} }),
}
}
-
-// Get takes name of the clusterOperator, and returns the corresponding clusterOperator object, and an error if there is any.
-func (c *clusterOperators) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterOperator, err error) {
- result = &v1.ClusterOperator{}
- err = c.client.Get().
- Resource("clusteroperators").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ClusterOperators that match those selectors.
-func (c *clusterOperators) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterOperatorList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ClusterOperatorList{}
- err = c.client.Get().
- Resource("clusteroperators").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested clusterOperators.
-func (c *clusterOperators) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("clusteroperators").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a clusterOperator and creates it. Returns the server's representation of the clusterOperator, and an error, if there is any.
-func (c *clusterOperators) Create(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.CreateOptions) (result *v1.ClusterOperator, err error) {
- result = &v1.ClusterOperator{}
- err = c.client.Post().
- Resource("clusteroperators").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterOperator).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a clusterOperator and updates it. Returns the server's representation of the clusterOperator, and an error, if there is any.
-func (c *clusterOperators) Update(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (result *v1.ClusterOperator, err error) {
- result = &v1.ClusterOperator{}
- err = c.client.Put().
- Resource("clusteroperators").
- Name(clusterOperator.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterOperator).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *clusterOperators) UpdateStatus(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (result *v1.ClusterOperator, err error) {
- result = &v1.ClusterOperator{}
- err = c.client.Put().
- Resource("clusteroperators").
- Name(clusterOperator.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterOperator).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the clusterOperator and deletes it. Returns an error if one occurs.
-func (c *clusterOperators) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("clusteroperators").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *clusterOperators) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("clusteroperators").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched clusterOperator.
-func (c *clusterOperators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterOperator, err error) {
- result = &v1.ClusterOperator{}
- err = c.client.Patch(pt).
- Resource("clusteroperators").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied clusterOperator.
-func (c *clusterOperators) Apply(ctx context.Context, clusterOperator *configv1.ClusterOperatorApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterOperator, err error) {
- if clusterOperator == nil {
- return nil, fmt.Errorf("clusterOperator provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(clusterOperator)
- if err != nil {
- return nil, err
- }
- name := clusterOperator.Name
- if name == nil {
- return nil, fmt.Errorf("clusterOperator.Name must be provided to Apply")
- }
- result = &v1.ClusterOperator{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("clusteroperators").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *clusterOperators) ApplyStatus(ctx context.Context, clusterOperator *configv1.ClusterOperatorApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterOperator, err error) {
- if clusterOperator == nil {
- return nil, fmt.Errorf("clusterOperator provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(clusterOperator)
- if err != nil {
- return nil, err
- }
-
- name := clusterOperator.Name
- if name == nil {
- return nil, fmt.Errorf("clusterOperator.Name must be provided to Apply")
- }
-
- result = &v1.ClusterOperator{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("clusteroperators").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go
index 8b7e5b9d24..2b6717096f 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ClusterVersionsGetter has a method to return a ClusterVersionInterface.
@@ -27,6 +24,7 @@ type ClusterVersionsGetter interface {
type ClusterVersionInterface interface {
Create(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.CreateOptions) (*v1.ClusterVersion, error)
Update(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (*v1.ClusterVersion, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (*v1.ClusterVersion, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type ClusterVersionInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterVersion, err error)
Apply(ctx context.Context, clusterVersion *configv1.ClusterVersionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterVersion, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, clusterVersion *configv1.ClusterVersionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterVersion, err error)
ClusterVersionExpansion
}
// clusterVersions implements ClusterVersionInterface
type clusterVersions struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.ClusterVersion, *v1.ClusterVersionList, *configv1.ClusterVersionApplyConfiguration]
}
// newClusterVersions returns a ClusterVersions
func newClusterVersions(c *ConfigV1Client) *clusterVersions {
return &clusterVersions{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.ClusterVersion, *v1.ClusterVersionList, *configv1.ClusterVersionApplyConfiguration](
+ "clusterversions",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.ClusterVersion { return &v1.ClusterVersion{} },
+ func() *v1.ClusterVersionList { return &v1.ClusterVersionList{} }),
}
}
-
-// Get takes name of the clusterVersion, and returns the corresponding clusterVersion object, and an error if there is any.
-func (c *clusterVersions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterVersion, err error) {
- result = &v1.ClusterVersion{}
- err = c.client.Get().
- Resource("clusterversions").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ClusterVersions that match those selectors.
-func (c *clusterVersions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterVersionList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ClusterVersionList{}
- err = c.client.Get().
- Resource("clusterversions").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested clusterVersions.
-func (c *clusterVersions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("clusterversions").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a clusterVersion and creates it. Returns the server's representation of the clusterVersion, and an error, if there is any.
-func (c *clusterVersions) Create(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.CreateOptions) (result *v1.ClusterVersion, err error) {
- result = &v1.ClusterVersion{}
- err = c.client.Post().
- Resource("clusterversions").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterVersion).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a clusterVersion and updates it. Returns the server's representation of the clusterVersion, and an error, if there is any.
-func (c *clusterVersions) Update(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (result *v1.ClusterVersion, err error) {
- result = &v1.ClusterVersion{}
- err = c.client.Put().
- Resource("clusterversions").
- Name(clusterVersion.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterVersion).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *clusterVersions) UpdateStatus(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (result *v1.ClusterVersion, err error) {
- result = &v1.ClusterVersion{}
- err = c.client.Put().
- Resource("clusterversions").
- Name(clusterVersion.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterVersion).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the clusterVersion and deletes it. Returns an error if one occurs.
-func (c *clusterVersions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("clusterversions").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *clusterVersions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("clusterversions").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched clusterVersion.
-func (c *clusterVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterVersion, err error) {
- result = &v1.ClusterVersion{}
- err = c.client.Patch(pt).
- Resource("clusterversions").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied clusterVersion.
-func (c *clusterVersions) Apply(ctx context.Context, clusterVersion *configv1.ClusterVersionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterVersion, err error) {
- if clusterVersion == nil {
- return nil, fmt.Errorf("clusterVersion provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(clusterVersion)
- if err != nil {
- return nil, err
- }
- name := clusterVersion.Name
- if name == nil {
- return nil, fmt.Errorf("clusterVersion.Name must be provided to Apply")
- }
- result = &v1.ClusterVersion{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("clusterversions").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *clusterVersions) ApplyStatus(ctx context.Context, clusterVersion *configv1.ClusterVersionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterVersion, err error) {
- if clusterVersion == nil {
- return nil, fmt.Errorf("clusterVersion provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(clusterVersion)
- if err != nil {
- return nil, err
- }
-
- name := clusterVersion.Name
- if name == nil {
- return nil, fmt.Errorf("clusterVersion.Name must be provided to Apply")
- }
-
- result = &v1.ClusterVersion{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("clusterversions").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go
index 99c51bf970..994d5994dd 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ConsolesGetter has a method to return a ConsoleInterface.
@@ -27,6 +24,7 @@ type ConsolesGetter interface {
type ConsoleInterface interface {
Create(ctx context.Context, console *v1.Console, opts metav1.CreateOptions) (*v1.Console, error)
Update(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (*v1.Console, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (*v1.Console, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type ConsoleInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Console, err error)
Apply(ctx context.Context, console *configv1.ConsoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Console, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, console *configv1.ConsoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Console, err error)
ConsoleExpansion
}
// consoles implements ConsoleInterface
type consoles struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Console, *v1.ConsoleList, *configv1.ConsoleApplyConfiguration]
}
// newConsoles returns a Consoles
func newConsoles(c *ConfigV1Client) *consoles {
return &consoles{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Console, *v1.ConsoleList, *configv1.ConsoleApplyConfiguration](
+ "consoles",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Console { return &v1.Console{} },
+ func() *v1.ConsoleList { return &v1.ConsoleList{} }),
}
}
-
-// Get takes name of the console, and returns the corresponding console object, and an error if there is any.
-func (c *consoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Console, err error) {
- result = &v1.Console{}
- err = c.client.Get().
- Resource("consoles").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Consoles that match those selectors.
-func (c *consoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConsoleList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ConsoleList{}
- err = c.client.Get().
- Resource("consoles").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested consoles.
-func (c *consoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("consoles").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a console and creates it. Returns the server's representation of the console, and an error, if there is any.
-func (c *consoles) Create(ctx context.Context, console *v1.Console, opts metav1.CreateOptions) (result *v1.Console, err error) {
- result = &v1.Console{}
- err = c.client.Post().
- Resource("consoles").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(console).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a console and updates it. Returns the server's representation of the console, and an error, if there is any.
-func (c *consoles) Update(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (result *v1.Console, err error) {
- result = &v1.Console{}
- err = c.client.Put().
- Resource("consoles").
- Name(console.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(console).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *consoles) UpdateStatus(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (result *v1.Console, err error) {
- result = &v1.Console{}
- err = c.client.Put().
- Resource("consoles").
- Name(console.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(console).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the console and deletes it. Returns an error if one occurs.
-func (c *consoles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("consoles").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *consoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("consoles").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched console.
-func (c *consoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Console, err error) {
- result = &v1.Console{}
- err = c.client.Patch(pt).
- Resource("consoles").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied console.
-func (c *consoles) Apply(ctx context.Context, console *configv1.ConsoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Console, err error) {
- if console == nil {
- return nil, fmt.Errorf("console provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(console)
- if err != nil {
- return nil, err
- }
- name := console.Name
- if name == nil {
- return nil, fmt.Errorf("console.Name must be provided to Apply")
- }
- result = &v1.Console{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("consoles").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *consoles) ApplyStatus(ctx context.Context, console *configv1.ConsoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Console, err error) {
- if console == nil {
- return nil, fmt.Errorf("console provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(console)
- if err != nil {
- return nil, err
- }
-
- name := console.Name
- if name == nil {
- return nil, fmt.Errorf("console.Name must be provided to Apply")
- }
-
- result = &v1.Console{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("consoles").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go
index 86fbbcf959..b91aa0d0d5 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// DNSesGetter has a method to return a DNSInterface.
@@ -27,6 +24,7 @@ type DNSesGetter interface {
type DNSInterface interface {
Create(ctx context.Context, dNS *v1.DNS, opts metav1.CreateOptions) (*v1.DNS, error)
Update(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (*v1.DNS, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (*v1.DNS, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type DNSInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNS, err error)
Apply(ctx context.Context, dNS *configv1.DNSApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DNS, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, dNS *configv1.DNSApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DNS, err error)
DNSExpansion
}
// dNSes implements DNSInterface
type dNSes struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.DNS, *v1.DNSList, *configv1.DNSApplyConfiguration]
}
// newDNSes returns a DNSes
func newDNSes(c *ConfigV1Client) *dNSes {
return &dNSes{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.DNS, *v1.DNSList, *configv1.DNSApplyConfiguration](
+ "dnses",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.DNS { return &v1.DNS{} },
+ func() *v1.DNSList { return &v1.DNSList{} }),
}
}
-
-// Get takes name of the dNS, and returns the corresponding dNS object, and an error if there is any.
-func (c *dNSes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DNS, err error) {
- result = &v1.DNS{}
- err = c.client.Get().
- Resource("dnses").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of DNSes that match those selectors.
-func (c *dNSes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DNSList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.DNSList{}
- err = c.client.Get().
- Resource("dnses").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested dNSes.
-func (c *dNSes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("dnses").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a dNS and creates it. Returns the server's representation of the dNS, and an error, if there is any.
-func (c *dNSes) Create(ctx context.Context, dNS *v1.DNS, opts metav1.CreateOptions) (result *v1.DNS, err error) {
- result = &v1.DNS{}
- err = c.client.Post().
- Resource("dnses").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(dNS).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a dNS and updates it. Returns the server's representation of the dNS, and an error, if there is any.
-func (c *dNSes) Update(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (result *v1.DNS, err error) {
- result = &v1.DNS{}
- err = c.client.Put().
- Resource("dnses").
- Name(dNS.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(dNS).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *dNSes) UpdateStatus(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (result *v1.DNS, err error) {
- result = &v1.DNS{}
- err = c.client.Put().
- Resource("dnses").
- Name(dNS.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(dNS).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the dNS and deletes it. Returns an error if one occurs.
-func (c *dNSes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("dnses").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *dNSes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("dnses").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched dNS.
-func (c *dNSes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNS, err error) {
- result = &v1.DNS{}
- err = c.client.Patch(pt).
- Resource("dnses").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied dNS.
-func (c *dNSes) Apply(ctx context.Context, dNS *configv1.DNSApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DNS, err error) {
- if dNS == nil {
- return nil, fmt.Errorf("dNS provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(dNS)
- if err != nil {
- return nil, err
- }
- name := dNS.Name
- if name == nil {
- return nil, fmt.Errorf("dNS.Name must be provided to Apply")
- }
- result = &v1.DNS{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("dnses").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *dNSes) ApplyStatus(ctx context.Context, dNS *configv1.DNSApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DNS, err error) {
- if dNS == nil {
- return nil, fmt.Errorf("dNS provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(dNS)
- if err != nil {
- return nil, err
- }
-
- name := dNS.Name
- if name == nil {
- return nil, fmt.Errorf("dNS.Name must be provided to Apply")
- }
-
- result = &v1.DNS{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("dnses").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_apiserver.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_apiserver.go
index 7ab942b5d6..e5e7c02cf7 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_apiserver.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_apiserver.go
@@ -27,20 +27,22 @@ var apiserversKind = v1.SchemeGroupVersion.WithKind("APIServer")
// Get takes name of the aPIServer, and returns the corresponding aPIServer object, and an error if there is any.
func (c *FakeAPIServers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.APIServer, err error) {
+ emptyResult := &v1.APIServer{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(apiserversResource, name), &v1.APIServer{})
+ Invokes(testing.NewRootGetActionWithOptions(apiserversResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.APIServer), err
}
// List takes label and field selectors, and returns the list of APIServers that match those selectors.
func (c *FakeAPIServers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.APIServerList, err error) {
+ emptyResult := &v1.APIServerList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(apiserversResource, apiserversKind, opts), &v1.APIServerList{})
+ Invokes(testing.NewRootListActionWithOptions(apiserversResource, apiserversKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeAPIServers) List(ctx context.Context, opts metav1.ListOptions) (res
// Watch returns a watch.Interface that watches the requested aPIServers.
func (c *FakeAPIServers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(apiserversResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(apiserversResource, opts))
}
// Create takes the representation of a aPIServer and creates it. Returns the server's representation of the aPIServer, and an error, if there is any.
func (c *FakeAPIServers) Create(ctx context.Context, aPIServer *v1.APIServer, opts metav1.CreateOptions) (result *v1.APIServer, err error) {
+ emptyResult := &v1.APIServer{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(apiserversResource, aPIServer), &v1.APIServer{})
+ Invokes(testing.NewRootCreateActionWithOptions(apiserversResource, aPIServer, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.APIServer), err
}
// Update takes the representation of a aPIServer and updates it. Returns the server's representation of the aPIServer, and an error, if there is any.
func (c *FakeAPIServers) Update(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (result *v1.APIServer, err error) {
+ emptyResult := &v1.APIServer{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(apiserversResource, aPIServer), &v1.APIServer{})
+ Invokes(testing.NewRootUpdateActionWithOptions(apiserversResource, aPIServer, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.APIServer), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeAPIServers) UpdateStatus(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (*v1.APIServer, error) {
+func (c *FakeAPIServers) UpdateStatus(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (result *v1.APIServer, err error) {
+ emptyResult := &v1.APIServer{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(apiserversResource, "status", aPIServer), &v1.APIServer{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(apiserversResource, "status", aPIServer, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.APIServer), err
}
@@ -102,7 +107,7 @@ func (c *FakeAPIServers) Delete(ctx context.Context, name string, opts metav1.De
// DeleteCollection deletes a collection of objects.
func (c *FakeAPIServers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(apiserversResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(apiserversResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.APIServerList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeAPIServers) DeleteCollection(ctx context.Context, opts metav1.Delet
// Patch applies the patch and returns the patched aPIServer.
func (c *FakeAPIServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.APIServer, err error) {
+ emptyResult := &v1.APIServer{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(apiserversResource, name, pt, data, subresources...), &v1.APIServer{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiserversResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.APIServer), err
}
@@ -131,10 +137,11 @@ func (c *FakeAPIServers) Apply(ctx context.Context, aPIServer *configv1.APIServe
if name == nil {
return nil, fmt.Errorf("aPIServer.Name must be provided to Apply")
}
+ emptyResult := &v1.APIServer{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(apiserversResource, *name, types.ApplyPatchType, data), &v1.APIServer{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiserversResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.APIServer), err
}
@@ -153,10 +160,11 @@ func (c *FakeAPIServers) ApplyStatus(ctx context.Context, aPIServer *configv1.AP
if name == nil {
return nil, fmt.Errorf("aPIServer.Name must be provided to Apply")
}
+ emptyResult := &v1.APIServer{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(apiserversResource, *name, types.ApplyPatchType, data, "status"), &v1.APIServer{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiserversResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.APIServer), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go
index f978eb316b..11e4117f34 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go
@@ -27,20 +27,22 @@ var authenticationsKind = v1.SchemeGroupVersion.WithKind("Authentication")
// Get takes name of the authentication, and returns the corresponding authentication object, and an error if there is any.
func (c *FakeAuthentications) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Authentication, err error) {
+ emptyResult := &v1.Authentication{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(authenticationsResource, name), &v1.Authentication{})
+ Invokes(testing.NewRootGetActionWithOptions(authenticationsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Authentication), err
}
// List takes label and field selectors, and returns the list of Authentications that match those selectors.
func (c *FakeAuthentications) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AuthenticationList, err error) {
+ emptyResult := &v1.AuthenticationList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(authenticationsResource, authenticationsKind, opts), &v1.AuthenticationList{})
+ Invokes(testing.NewRootListActionWithOptions(authenticationsResource, authenticationsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeAuthentications) List(ctx context.Context, opts metav1.ListOptions)
// Watch returns a watch.Interface that watches the requested authentications.
func (c *FakeAuthentications) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(authenticationsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(authenticationsResource, opts))
}
// Create takes the representation of a authentication and creates it. Returns the server's representation of the authentication, and an error, if there is any.
func (c *FakeAuthentications) Create(ctx context.Context, authentication *v1.Authentication, opts metav1.CreateOptions) (result *v1.Authentication, err error) {
+ emptyResult := &v1.Authentication{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(authenticationsResource, authentication), &v1.Authentication{})
+ Invokes(testing.NewRootCreateActionWithOptions(authenticationsResource, authentication, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Authentication), err
}
// Update takes the representation of a authentication and updates it. Returns the server's representation of the authentication, and an error, if there is any.
func (c *FakeAuthentications) Update(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (result *v1.Authentication, err error) {
+ emptyResult := &v1.Authentication{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(authenticationsResource, authentication), &v1.Authentication{})
+ Invokes(testing.NewRootUpdateActionWithOptions(authenticationsResource, authentication, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Authentication), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeAuthentications) UpdateStatus(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (*v1.Authentication, error) {
+func (c *FakeAuthentications) UpdateStatus(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (result *v1.Authentication, err error) {
+ emptyResult := &v1.Authentication{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(authenticationsResource, "status", authentication), &v1.Authentication{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(authenticationsResource, "status", authentication, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Authentication), err
}
@@ -102,7 +107,7 @@ func (c *FakeAuthentications) Delete(ctx context.Context, name string, opts meta
// DeleteCollection deletes a collection of objects.
func (c *FakeAuthentications) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(authenticationsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(authenticationsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.AuthenticationList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeAuthentications) DeleteCollection(ctx context.Context, opts metav1.
// Patch applies the patch and returns the patched authentication.
func (c *FakeAuthentications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Authentication, err error) {
+ emptyResult := &v1.Authentication{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(authenticationsResource, name, pt, data, subresources...), &v1.Authentication{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(authenticationsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Authentication), err
}
@@ -131,10 +137,11 @@ func (c *FakeAuthentications) Apply(ctx context.Context, authentication *configv
if name == nil {
return nil, fmt.Errorf("authentication.Name must be provided to Apply")
}
+ emptyResult := &v1.Authentication{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(authenticationsResource, *name, types.ApplyPatchType, data), &v1.Authentication{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(authenticationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Authentication), err
}
@@ -153,10 +160,11 @@ func (c *FakeAuthentications) ApplyStatus(ctx context.Context, authentication *c
if name == nil {
return nil, fmt.Errorf("authentication.Name must be provided to Apply")
}
+ emptyResult := &v1.Authentication{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(authenticationsResource, *name, types.ApplyPatchType, data, "status"), &v1.Authentication{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(authenticationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Authentication), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go
index 1f4df4f0aa..10576484cd 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go
@@ -27,20 +27,22 @@ var buildsKind = v1.SchemeGroupVersion.WithKind("Build")
// Get takes name of the build, and returns the corresponding build object, and an error if there is any.
func (c *FakeBuilds) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Build, err error) {
+ emptyResult := &v1.Build{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(buildsResource, name), &v1.Build{})
+ Invokes(testing.NewRootGetActionWithOptions(buildsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Build), err
}
// List takes label and field selectors, and returns the list of Builds that match those selectors.
func (c *FakeBuilds) List(ctx context.Context, opts metav1.ListOptions) (result *v1.BuildList, err error) {
+ emptyResult := &v1.BuildList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(buildsResource, buildsKind, opts), &v1.BuildList{})
+ Invokes(testing.NewRootListActionWithOptions(buildsResource, buildsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,25 +61,27 @@ func (c *FakeBuilds) List(ctx context.Context, opts metav1.ListOptions) (result
// Watch returns a watch.Interface that watches the requested builds.
func (c *FakeBuilds) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(buildsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(buildsResource, opts))
}
// Create takes the representation of a build and creates it. Returns the server's representation of the build, and an error, if there is any.
func (c *FakeBuilds) Create(ctx context.Context, build *v1.Build, opts metav1.CreateOptions) (result *v1.Build, err error) {
+ emptyResult := &v1.Build{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(buildsResource, build), &v1.Build{})
+ Invokes(testing.NewRootCreateActionWithOptions(buildsResource, build, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Build), err
}
// Update takes the representation of a build and updates it. Returns the server's representation of the build, and an error, if there is any.
func (c *FakeBuilds) Update(ctx context.Context, build *v1.Build, opts metav1.UpdateOptions) (result *v1.Build, err error) {
+ emptyResult := &v1.Build{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(buildsResource, build), &v1.Build{})
+ Invokes(testing.NewRootUpdateActionWithOptions(buildsResource, build, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Build), err
}
@@ -91,7 +95,7 @@ func (c *FakeBuilds) Delete(ctx context.Context, name string, opts metav1.Delete
// DeleteCollection deletes a collection of objects.
func (c *FakeBuilds) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(buildsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(buildsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.BuildList{})
return err
@@ -99,10 +103,11 @@ func (c *FakeBuilds) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt
// Patch applies the patch and returns the patched build.
func (c *FakeBuilds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Build, err error) {
+ emptyResult := &v1.Build{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(buildsResource, name, pt, data, subresources...), &v1.Build{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(buildsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Build), err
}
@@ -120,10 +125,11 @@ func (c *FakeBuilds) Apply(ctx context.Context, build *configv1.BuildApplyConfig
if name == nil {
return nil, fmt.Errorf("build.Name must be provided to Apply")
}
+ emptyResult := &v1.Build{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(buildsResource, *name, types.ApplyPatchType, data), &v1.Build{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(buildsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Build), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go
index f57cf9ce96..c9fa330194 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go
@@ -27,20 +27,22 @@ var clusteroperatorsKind = v1.SchemeGroupVersion.WithKind("ClusterOperator")
// Get takes name of the clusterOperator, and returns the corresponding clusterOperator object, and an error if there is any.
func (c *FakeClusterOperators) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterOperator, err error) {
+ emptyResult := &v1.ClusterOperator{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(clusteroperatorsResource, name), &v1.ClusterOperator{})
+ Invokes(testing.NewRootGetActionWithOptions(clusteroperatorsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterOperator), err
}
// List takes label and field selectors, and returns the list of ClusterOperators that match those selectors.
func (c *FakeClusterOperators) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterOperatorList, err error) {
+ emptyResult := &v1.ClusterOperatorList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(clusteroperatorsResource, clusteroperatorsKind, opts), &v1.ClusterOperatorList{})
+ Invokes(testing.NewRootListActionWithOptions(clusteroperatorsResource, clusteroperatorsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeClusterOperators) List(ctx context.Context, opts metav1.ListOptions
// Watch returns a watch.Interface that watches the requested clusterOperators.
func (c *FakeClusterOperators) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(clusteroperatorsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(clusteroperatorsResource, opts))
}
// Create takes the representation of a clusterOperator and creates it. Returns the server's representation of the clusterOperator, and an error, if there is any.
func (c *FakeClusterOperators) Create(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.CreateOptions) (result *v1.ClusterOperator, err error) {
+ emptyResult := &v1.ClusterOperator{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(clusteroperatorsResource, clusterOperator), &v1.ClusterOperator{})
+ Invokes(testing.NewRootCreateActionWithOptions(clusteroperatorsResource, clusterOperator, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterOperator), err
}
// Update takes the representation of a clusterOperator and updates it. Returns the server's representation of the clusterOperator, and an error, if there is any.
func (c *FakeClusterOperators) Update(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (result *v1.ClusterOperator, err error) {
+ emptyResult := &v1.ClusterOperator{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(clusteroperatorsResource, clusterOperator), &v1.ClusterOperator{})
+ Invokes(testing.NewRootUpdateActionWithOptions(clusteroperatorsResource, clusterOperator, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterOperator), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeClusterOperators) UpdateStatus(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (*v1.ClusterOperator, error) {
+func (c *FakeClusterOperators) UpdateStatus(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (result *v1.ClusterOperator, err error) {
+ emptyResult := &v1.ClusterOperator{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(clusteroperatorsResource, "status", clusterOperator), &v1.ClusterOperator{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clusteroperatorsResource, "status", clusterOperator, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterOperator), err
}
@@ -102,7 +107,7 @@ func (c *FakeClusterOperators) Delete(ctx context.Context, name string, opts met
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterOperators) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(clusteroperatorsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(clusteroperatorsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.ClusterOperatorList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeClusterOperators) DeleteCollection(ctx context.Context, opts metav1
// Patch applies the patch and returns the patched clusterOperator.
func (c *FakeClusterOperators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterOperator, err error) {
+ emptyResult := &v1.ClusterOperator{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusteroperatorsResource, name, pt, data, subresources...), &v1.ClusterOperator{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusteroperatorsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterOperator), err
}
@@ -131,10 +137,11 @@ func (c *FakeClusterOperators) Apply(ctx context.Context, clusterOperator *confi
if name == nil {
return nil, fmt.Errorf("clusterOperator.Name must be provided to Apply")
}
+ emptyResult := &v1.ClusterOperator{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusteroperatorsResource, *name, types.ApplyPatchType, data), &v1.ClusterOperator{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusteroperatorsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterOperator), err
}
@@ -153,10 +160,11 @@ func (c *FakeClusterOperators) ApplyStatus(ctx context.Context, clusterOperator
if name == nil {
return nil, fmt.Errorf("clusterOperator.Name must be provided to Apply")
}
+ emptyResult := &v1.ClusterOperator{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusteroperatorsResource, *name, types.ApplyPatchType, data, "status"), &v1.ClusterOperator{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusteroperatorsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterOperator), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go
index 64b60c9eb4..2505908774 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go
@@ -27,20 +27,22 @@ var clusterversionsKind = v1.SchemeGroupVersion.WithKind("ClusterVersion")
// Get takes name of the clusterVersion, and returns the corresponding clusterVersion object, and an error if there is any.
func (c *FakeClusterVersions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterVersion, err error) {
+ emptyResult := &v1.ClusterVersion{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(clusterversionsResource, name), &v1.ClusterVersion{})
+ Invokes(testing.NewRootGetActionWithOptions(clusterversionsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterVersion), err
}
// List takes label and field selectors, and returns the list of ClusterVersions that match those selectors.
func (c *FakeClusterVersions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterVersionList, err error) {
+ emptyResult := &v1.ClusterVersionList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(clusterversionsResource, clusterversionsKind, opts), &v1.ClusterVersionList{})
+ Invokes(testing.NewRootListActionWithOptions(clusterversionsResource, clusterversionsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeClusterVersions) List(ctx context.Context, opts metav1.ListOptions)
// Watch returns a watch.Interface that watches the requested clusterVersions.
func (c *FakeClusterVersions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(clusterversionsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(clusterversionsResource, opts))
}
// Create takes the representation of a clusterVersion and creates it. Returns the server's representation of the clusterVersion, and an error, if there is any.
func (c *FakeClusterVersions) Create(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.CreateOptions) (result *v1.ClusterVersion, err error) {
+ emptyResult := &v1.ClusterVersion{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(clusterversionsResource, clusterVersion), &v1.ClusterVersion{})
+ Invokes(testing.NewRootCreateActionWithOptions(clusterversionsResource, clusterVersion, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterVersion), err
}
// Update takes the representation of a clusterVersion and updates it. Returns the server's representation of the clusterVersion, and an error, if there is any.
func (c *FakeClusterVersions) Update(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (result *v1.ClusterVersion, err error) {
+ emptyResult := &v1.ClusterVersion{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(clusterversionsResource, clusterVersion), &v1.ClusterVersion{})
+ Invokes(testing.NewRootUpdateActionWithOptions(clusterversionsResource, clusterVersion, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterVersion), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeClusterVersions) UpdateStatus(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (*v1.ClusterVersion, error) {
+func (c *FakeClusterVersions) UpdateStatus(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (result *v1.ClusterVersion, err error) {
+ emptyResult := &v1.ClusterVersion{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(clusterversionsResource, "status", clusterVersion), &v1.ClusterVersion{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clusterversionsResource, "status", clusterVersion, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterVersion), err
}
@@ -102,7 +107,7 @@ func (c *FakeClusterVersions) Delete(ctx context.Context, name string, opts meta
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterVersions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(clusterversionsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(clusterversionsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.ClusterVersionList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeClusterVersions) DeleteCollection(ctx context.Context, opts metav1.
// Patch applies the patch and returns the patched clusterVersion.
func (c *FakeClusterVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterVersion, err error) {
+ emptyResult := &v1.ClusterVersion{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterversionsResource, name, pt, data, subresources...), &v1.ClusterVersion{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterversionsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterVersion), err
}
@@ -131,10 +137,11 @@ func (c *FakeClusterVersions) Apply(ctx context.Context, clusterVersion *configv
if name == nil {
return nil, fmt.Errorf("clusterVersion.Name must be provided to Apply")
}
+ emptyResult := &v1.ClusterVersion{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterversionsResource, *name, types.ApplyPatchType, data), &v1.ClusterVersion{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterversionsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterVersion), err
}
@@ -153,10 +160,11 @@ func (c *FakeClusterVersions) ApplyStatus(ctx context.Context, clusterVersion *c
if name == nil {
return nil, fmt.Errorf("clusterVersion.Name must be provided to Apply")
}
+ emptyResult := &v1.ClusterVersion{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterversionsResource, *name, types.ApplyPatchType, data, "status"), &v1.ClusterVersion{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterversionsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ClusterVersion), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go
index c271333629..93da56fec2 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go
@@ -27,20 +27,22 @@ var consolesKind = v1.SchemeGroupVersion.WithKind("Console")
// Get takes name of the console, and returns the corresponding console object, and an error if there is any.
func (c *FakeConsoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Console, err error) {
+ emptyResult := &v1.Console{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(consolesResource, name), &v1.Console{})
+ Invokes(testing.NewRootGetActionWithOptions(consolesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Console), err
}
// List takes label and field selectors, and returns the list of Consoles that match those selectors.
func (c *FakeConsoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConsoleList, err error) {
+ emptyResult := &v1.ConsoleList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(consolesResource, consolesKind, opts), &v1.ConsoleList{})
+ Invokes(testing.NewRootListActionWithOptions(consolesResource, consolesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeConsoles) List(ctx context.Context, opts metav1.ListOptions) (resul
// Watch returns a watch.Interface that watches the requested consoles.
func (c *FakeConsoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(consolesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(consolesResource, opts))
}
// Create takes the representation of a console and creates it. Returns the server's representation of the console, and an error, if there is any.
func (c *FakeConsoles) Create(ctx context.Context, console *v1.Console, opts metav1.CreateOptions) (result *v1.Console, err error) {
+ emptyResult := &v1.Console{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(consolesResource, console), &v1.Console{})
+ Invokes(testing.NewRootCreateActionWithOptions(consolesResource, console, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Console), err
}
// Update takes the representation of a console and updates it. Returns the server's representation of the console, and an error, if there is any.
func (c *FakeConsoles) Update(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (result *v1.Console, err error) {
+ emptyResult := &v1.Console{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(consolesResource, console), &v1.Console{})
+ Invokes(testing.NewRootUpdateActionWithOptions(consolesResource, console, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Console), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeConsoles) UpdateStatus(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (*v1.Console, error) {
+func (c *FakeConsoles) UpdateStatus(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (result *v1.Console, err error) {
+ emptyResult := &v1.Console{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(consolesResource, "status", console), &v1.Console{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(consolesResource, "status", console, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Console), err
}
@@ -102,7 +107,7 @@ func (c *FakeConsoles) Delete(ctx context.Context, name string, opts metav1.Dele
// DeleteCollection deletes a collection of objects.
func (c *FakeConsoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(consolesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(consolesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.ConsoleList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeConsoles) DeleteCollection(ctx context.Context, opts metav1.DeleteO
// Patch applies the patch and returns the patched console.
func (c *FakeConsoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Console, err error) {
+ emptyResult := &v1.Console{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(consolesResource, name, pt, data, subresources...), &v1.Console{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(consolesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Console), err
}
@@ -131,10 +137,11 @@ func (c *FakeConsoles) Apply(ctx context.Context, console *configv1.ConsoleApply
if name == nil {
return nil, fmt.Errorf("console.Name must be provided to Apply")
}
+ emptyResult := &v1.Console{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(consolesResource, *name, types.ApplyPatchType, data), &v1.Console{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(consolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Console), err
}
@@ -153,10 +160,11 @@ func (c *FakeConsoles) ApplyStatus(ctx context.Context, console *configv1.Consol
if name == nil {
return nil, fmt.Errorf("console.Name must be provided to Apply")
}
+ emptyResult := &v1.Console{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(consolesResource, *name, types.ApplyPatchType, data, "status"), &v1.Console{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(consolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Console), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go
index 95a15db11a..f89edf6d62 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go
@@ -27,20 +27,22 @@ var dnsesKind = v1.SchemeGroupVersion.WithKind("DNS")
// Get takes name of the dNS, and returns the corresponding dNS object, and an error if there is any.
func (c *FakeDNSes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DNS, err error) {
+ emptyResult := &v1.DNS{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(dnsesResource, name), &v1.DNS{})
+ Invokes(testing.NewRootGetActionWithOptions(dnsesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.DNS), err
}
// List takes label and field selectors, and returns the list of DNSes that match those selectors.
func (c *FakeDNSes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DNSList, err error) {
+ emptyResult := &v1.DNSList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(dnsesResource, dnsesKind, opts), &v1.DNSList{})
+ Invokes(testing.NewRootListActionWithOptions(dnsesResource, dnsesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeDNSes) List(ctx context.Context, opts metav1.ListOptions) (result *
// Watch returns a watch.Interface that watches the requested dNSes.
func (c *FakeDNSes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(dnsesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(dnsesResource, opts))
}
// Create takes the representation of a dNS and creates it. Returns the server's representation of the dNS, and an error, if there is any.
func (c *FakeDNSes) Create(ctx context.Context, dNS *v1.DNS, opts metav1.CreateOptions) (result *v1.DNS, err error) {
+ emptyResult := &v1.DNS{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(dnsesResource, dNS), &v1.DNS{})
+ Invokes(testing.NewRootCreateActionWithOptions(dnsesResource, dNS, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.DNS), err
}
// Update takes the representation of a dNS and updates it. Returns the server's representation of the dNS, and an error, if there is any.
func (c *FakeDNSes) Update(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (result *v1.DNS, err error) {
+ emptyResult := &v1.DNS{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(dnsesResource, dNS), &v1.DNS{})
+ Invokes(testing.NewRootUpdateActionWithOptions(dnsesResource, dNS, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.DNS), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeDNSes) UpdateStatus(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (*v1.DNS, error) {
+func (c *FakeDNSes) UpdateStatus(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (result *v1.DNS, err error) {
+ emptyResult := &v1.DNS{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(dnsesResource, "status", dNS), &v1.DNS{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(dnsesResource, "status", dNS, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.DNS), err
}
@@ -102,7 +107,7 @@ func (c *FakeDNSes) Delete(ctx context.Context, name string, opts metav1.DeleteO
// DeleteCollection deletes a collection of objects.
func (c *FakeDNSes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(dnsesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(dnsesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.DNSList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeDNSes) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti
// Patch applies the patch and returns the patched dNS.
func (c *FakeDNSes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNS, err error) {
+ emptyResult := &v1.DNS{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(dnsesResource, name, pt, data, subresources...), &v1.DNS{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(dnsesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.DNS), err
}
@@ -131,10 +137,11 @@ func (c *FakeDNSes) Apply(ctx context.Context, dNS *configv1.DNSApplyConfigurati
if name == nil {
return nil, fmt.Errorf("dNS.Name must be provided to Apply")
}
+ emptyResult := &v1.DNS{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(dnsesResource, *name, types.ApplyPatchType, data), &v1.DNS{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(dnsesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.DNS), err
}
@@ -153,10 +160,11 @@ func (c *FakeDNSes) ApplyStatus(ctx context.Context, dNS *configv1.DNSApplyConfi
if name == nil {
return nil, fmt.Errorf("dNS.Name must be provided to Apply")
}
+ emptyResult := &v1.DNS{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(dnsesResource, *name, types.ApplyPatchType, data, "status"), &v1.DNS{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(dnsesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.DNS), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_featuregate.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_featuregate.go
index 360d3f1875..ef23684bbd 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_featuregate.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_featuregate.go
@@ -27,20 +27,22 @@ var featuregatesKind = v1.SchemeGroupVersion.WithKind("FeatureGate")
// Get takes name of the featureGate, and returns the corresponding featureGate object, and an error if there is any.
func (c *FakeFeatureGates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FeatureGate, err error) {
+ emptyResult := &v1.FeatureGate{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(featuregatesResource, name), &v1.FeatureGate{})
+ Invokes(testing.NewRootGetActionWithOptions(featuregatesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.FeatureGate), err
}
// List takes label and field selectors, and returns the list of FeatureGates that match those selectors.
func (c *FakeFeatureGates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FeatureGateList, err error) {
+ emptyResult := &v1.FeatureGateList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(featuregatesResource, featuregatesKind, opts), &v1.FeatureGateList{})
+ Invokes(testing.NewRootListActionWithOptions(featuregatesResource, featuregatesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeFeatureGates) List(ctx context.Context, opts metav1.ListOptions) (r
// Watch returns a watch.Interface that watches the requested featureGates.
func (c *FakeFeatureGates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(featuregatesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(featuregatesResource, opts))
}
// Create takes the representation of a featureGate and creates it. Returns the server's representation of the featureGate, and an error, if there is any.
func (c *FakeFeatureGates) Create(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.CreateOptions) (result *v1.FeatureGate, err error) {
+ emptyResult := &v1.FeatureGate{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(featuregatesResource, featureGate), &v1.FeatureGate{})
+ Invokes(testing.NewRootCreateActionWithOptions(featuregatesResource, featureGate, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.FeatureGate), err
}
// Update takes the representation of a featureGate and updates it. Returns the server's representation of the featureGate, and an error, if there is any.
func (c *FakeFeatureGates) Update(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (result *v1.FeatureGate, err error) {
+ emptyResult := &v1.FeatureGate{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(featuregatesResource, featureGate), &v1.FeatureGate{})
+ Invokes(testing.NewRootUpdateActionWithOptions(featuregatesResource, featureGate, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.FeatureGate), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeFeatureGates) UpdateStatus(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (*v1.FeatureGate, error) {
+func (c *FakeFeatureGates) UpdateStatus(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (result *v1.FeatureGate, err error) {
+ emptyResult := &v1.FeatureGate{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(featuregatesResource, "status", featureGate), &v1.FeatureGate{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(featuregatesResource, "status", featureGate, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.FeatureGate), err
}
@@ -102,7 +107,7 @@ func (c *FakeFeatureGates) Delete(ctx context.Context, name string, opts metav1.
// DeleteCollection deletes a collection of objects.
func (c *FakeFeatureGates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(featuregatesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(featuregatesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.FeatureGateList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeFeatureGates) DeleteCollection(ctx context.Context, opts metav1.Del
// Patch applies the patch and returns the patched featureGate.
func (c *FakeFeatureGates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FeatureGate, err error) {
+ emptyResult := &v1.FeatureGate{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(featuregatesResource, name, pt, data, subresources...), &v1.FeatureGate{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(featuregatesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.FeatureGate), err
}
@@ -131,10 +137,11 @@ func (c *FakeFeatureGates) Apply(ctx context.Context, featureGate *configv1.Feat
if name == nil {
return nil, fmt.Errorf("featureGate.Name must be provided to Apply")
}
+ emptyResult := &v1.FeatureGate{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(featuregatesResource, *name, types.ApplyPatchType, data), &v1.FeatureGate{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(featuregatesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.FeatureGate), err
}
@@ -153,10 +160,11 @@ func (c *FakeFeatureGates) ApplyStatus(ctx context.Context, featureGate *configv
if name == nil {
return nil, fmt.Errorf("featureGate.Name must be provided to Apply")
}
+ emptyResult := &v1.FeatureGate{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(featuregatesResource, *name, types.ApplyPatchType, data, "status"), &v1.FeatureGate{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(featuregatesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.FeatureGate), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go
index edd7ae7327..a6bcc09e9d 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go
@@ -27,20 +27,22 @@ var imagesKind = v1.SchemeGroupVersion.WithKind("Image")
// Get takes name of the image, and returns the corresponding image object, and an error if there is any.
func (c *FakeImages) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Image, err error) {
+ emptyResult := &v1.Image{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(imagesResource, name), &v1.Image{})
+ Invokes(testing.NewRootGetActionWithOptions(imagesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Image), err
}
// List takes label and field selectors, and returns the list of Images that match those selectors.
func (c *FakeImages) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageList, err error) {
+ emptyResult := &v1.ImageList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(imagesResource, imagesKind, opts), &v1.ImageList{})
+ Invokes(testing.NewRootListActionWithOptions(imagesResource, imagesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeImages) List(ctx context.Context, opts metav1.ListOptions) (result
// Watch returns a watch.Interface that watches the requested images.
func (c *FakeImages) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(imagesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(imagesResource, opts))
}
// Create takes the representation of a image and creates it. Returns the server's representation of the image, and an error, if there is any.
func (c *FakeImages) Create(ctx context.Context, image *v1.Image, opts metav1.CreateOptions) (result *v1.Image, err error) {
+ emptyResult := &v1.Image{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(imagesResource, image), &v1.Image{})
+ Invokes(testing.NewRootCreateActionWithOptions(imagesResource, image, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Image), err
}
// Update takes the representation of a image and updates it. Returns the server's representation of the image, and an error, if there is any.
func (c *FakeImages) Update(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (result *v1.Image, err error) {
+ emptyResult := &v1.Image{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(imagesResource, image), &v1.Image{})
+ Invokes(testing.NewRootUpdateActionWithOptions(imagesResource, image, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Image), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeImages) UpdateStatus(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (*v1.Image, error) {
+func (c *FakeImages) UpdateStatus(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (result *v1.Image, err error) {
+ emptyResult := &v1.Image{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(imagesResource, "status", image), &v1.Image{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(imagesResource, "status", image, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Image), err
}
@@ -102,7 +107,7 @@ func (c *FakeImages) Delete(ctx context.Context, name string, opts metav1.Delete
// DeleteCollection deletes a collection of objects.
func (c *FakeImages) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(imagesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(imagesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.ImageList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeImages) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt
// Patch applies the patch and returns the patched image.
func (c *FakeImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Image, err error) {
+ emptyResult := &v1.Image{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagesResource, name, pt, data, subresources...), &v1.Image{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Image), err
}
@@ -131,10 +137,11 @@ func (c *FakeImages) Apply(ctx context.Context, image *configv1.ImageApplyConfig
if name == nil {
return nil, fmt.Errorf("image.Name must be provided to Apply")
}
+ emptyResult := &v1.Image{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagesResource, *name, types.ApplyPatchType, data), &v1.Image{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Image), err
}
@@ -153,10 +160,11 @@ func (c *FakeImages) ApplyStatus(ctx context.Context, image *configv1.ImageApply
if name == nil {
return nil, fmt.Errorf("image.Name must be provided to Apply")
}
+ emptyResult := &v1.Image{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagesResource, *name, types.ApplyPatchType, data, "status"), &v1.Image{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Image), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagecontentpolicy.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagecontentpolicy.go
index b155b98a6b..1905ae32d6 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagecontentpolicy.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagecontentpolicy.go
@@ -27,20 +27,22 @@ var imagecontentpoliciesKind = v1.SchemeGroupVersion.WithKind("ImageContentPolic
// Get takes name of the imageContentPolicy, and returns the corresponding imageContentPolicy object, and an error if there is any.
func (c *FakeImageContentPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ImageContentPolicy, err error) {
+ emptyResult := &v1.ImageContentPolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(imagecontentpoliciesResource, name), &v1.ImageContentPolicy{})
+ Invokes(testing.NewRootGetActionWithOptions(imagecontentpoliciesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageContentPolicy), err
}
// List takes label and field selectors, and returns the list of ImageContentPolicies that match those selectors.
func (c *FakeImageContentPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageContentPolicyList, err error) {
+ emptyResult := &v1.ImageContentPolicyList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(imagecontentpoliciesResource, imagecontentpoliciesKind, opts), &v1.ImageContentPolicyList{})
+ Invokes(testing.NewRootListActionWithOptions(imagecontentpoliciesResource, imagecontentpoliciesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,25 +61,27 @@ func (c *FakeImageContentPolicies) List(ctx context.Context, opts metav1.ListOpt
// Watch returns a watch.Interface that watches the requested imageContentPolicies.
func (c *FakeImageContentPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(imagecontentpoliciesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(imagecontentpoliciesResource, opts))
}
// Create takes the representation of a imageContentPolicy and creates it. Returns the server's representation of the imageContentPolicy, and an error, if there is any.
func (c *FakeImageContentPolicies) Create(ctx context.Context, imageContentPolicy *v1.ImageContentPolicy, opts metav1.CreateOptions) (result *v1.ImageContentPolicy, err error) {
+ emptyResult := &v1.ImageContentPolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(imagecontentpoliciesResource, imageContentPolicy), &v1.ImageContentPolicy{})
+ Invokes(testing.NewRootCreateActionWithOptions(imagecontentpoliciesResource, imageContentPolicy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageContentPolicy), err
}
// Update takes the representation of a imageContentPolicy and updates it. Returns the server's representation of the imageContentPolicy, and an error, if there is any.
func (c *FakeImageContentPolicies) Update(ctx context.Context, imageContentPolicy *v1.ImageContentPolicy, opts metav1.UpdateOptions) (result *v1.ImageContentPolicy, err error) {
+ emptyResult := &v1.ImageContentPolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(imagecontentpoliciesResource, imageContentPolicy), &v1.ImageContentPolicy{})
+ Invokes(testing.NewRootUpdateActionWithOptions(imagecontentpoliciesResource, imageContentPolicy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageContentPolicy), err
}
@@ -91,7 +95,7 @@ func (c *FakeImageContentPolicies) Delete(ctx context.Context, name string, opts
// DeleteCollection deletes a collection of objects.
func (c *FakeImageContentPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(imagecontentpoliciesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(imagecontentpoliciesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.ImageContentPolicyList{})
return err
@@ -99,10 +103,11 @@ func (c *FakeImageContentPolicies) DeleteCollection(ctx context.Context, opts me
// Patch applies the patch and returns the patched imageContentPolicy.
func (c *FakeImageContentPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImageContentPolicy, err error) {
+ emptyResult := &v1.ImageContentPolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagecontentpoliciesResource, name, pt, data, subresources...), &v1.ImageContentPolicy{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagecontentpoliciesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageContentPolicy), err
}
@@ -120,10 +125,11 @@ func (c *FakeImageContentPolicies) Apply(ctx context.Context, imageContentPolicy
if name == nil {
return nil, fmt.Errorf("imageContentPolicy.Name must be provided to Apply")
}
+ emptyResult := &v1.ImageContentPolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagecontentpoliciesResource, *name, types.ApplyPatchType, data), &v1.ImageContentPolicy{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagecontentpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageContentPolicy), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagedigestmirrorset.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagedigestmirrorset.go
index af2d455aa0..25d147a43c 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagedigestmirrorset.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagedigestmirrorset.go
@@ -27,20 +27,22 @@ var imagedigestmirrorsetsKind = v1.SchemeGroupVersion.WithKind("ImageDigestMirro
// Get takes name of the imageDigestMirrorSet, and returns the corresponding imageDigestMirrorSet object, and an error if there is any.
func (c *FakeImageDigestMirrorSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ImageDigestMirrorSet, err error) {
+ emptyResult := &v1.ImageDigestMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(imagedigestmirrorsetsResource, name), &v1.ImageDigestMirrorSet{})
+ Invokes(testing.NewRootGetActionWithOptions(imagedigestmirrorsetsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageDigestMirrorSet), err
}
// List takes label and field selectors, and returns the list of ImageDigestMirrorSets that match those selectors.
func (c *FakeImageDigestMirrorSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageDigestMirrorSetList, err error) {
+ emptyResult := &v1.ImageDigestMirrorSetList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(imagedigestmirrorsetsResource, imagedigestmirrorsetsKind, opts), &v1.ImageDigestMirrorSetList{})
+ Invokes(testing.NewRootListActionWithOptions(imagedigestmirrorsetsResource, imagedigestmirrorsetsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeImageDigestMirrorSets) List(ctx context.Context, opts metav1.ListOp
// Watch returns a watch.Interface that watches the requested imageDigestMirrorSets.
func (c *FakeImageDigestMirrorSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(imagedigestmirrorsetsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(imagedigestmirrorsetsResource, opts))
}
// Create takes the representation of a imageDigestMirrorSet and creates it. Returns the server's representation of the imageDigestMirrorSet, and an error, if there is any.
func (c *FakeImageDigestMirrorSets) Create(ctx context.Context, imageDigestMirrorSet *v1.ImageDigestMirrorSet, opts metav1.CreateOptions) (result *v1.ImageDigestMirrorSet, err error) {
+ emptyResult := &v1.ImageDigestMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(imagedigestmirrorsetsResource, imageDigestMirrorSet), &v1.ImageDigestMirrorSet{})
+ Invokes(testing.NewRootCreateActionWithOptions(imagedigestmirrorsetsResource, imageDigestMirrorSet, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageDigestMirrorSet), err
}
// Update takes the representation of a imageDigestMirrorSet and updates it. Returns the server's representation of the imageDigestMirrorSet, and an error, if there is any.
func (c *FakeImageDigestMirrorSets) Update(ctx context.Context, imageDigestMirrorSet *v1.ImageDigestMirrorSet, opts metav1.UpdateOptions) (result *v1.ImageDigestMirrorSet, err error) {
+ emptyResult := &v1.ImageDigestMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(imagedigestmirrorsetsResource, imageDigestMirrorSet), &v1.ImageDigestMirrorSet{})
+ Invokes(testing.NewRootUpdateActionWithOptions(imagedigestmirrorsetsResource, imageDigestMirrorSet, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageDigestMirrorSet), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeImageDigestMirrorSets) UpdateStatus(ctx context.Context, imageDigestMirrorSet *v1.ImageDigestMirrorSet, opts metav1.UpdateOptions) (*v1.ImageDigestMirrorSet, error) {
+func (c *FakeImageDigestMirrorSets) UpdateStatus(ctx context.Context, imageDigestMirrorSet *v1.ImageDigestMirrorSet, opts metav1.UpdateOptions) (result *v1.ImageDigestMirrorSet, err error) {
+ emptyResult := &v1.ImageDigestMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(imagedigestmirrorsetsResource, "status", imageDigestMirrorSet), &v1.ImageDigestMirrorSet{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(imagedigestmirrorsetsResource, "status", imageDigestMirrorSet, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageDigestMirrorSet), err
}
@@ -102,7 +107,7 @@ func (c *FakeImageDigestMirrorSets) Delete(ctx context.Context, name string, opt
// DeleteCollection deletes a collection of objects.
func (c *FakeImageDigestMirrorSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(imagedigestmirrorsetsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(imagedigestmirrorsetsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.ImageDigestMirrorSetList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeImageDigestMirrorSets) DeleteCollection(ctx context.Context, opts m
// Patch applies the patch and returns the patched imageDigestMirrorSet.
func (c *FakeImageDigestMirrorSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImageDigestMirrorSet, err error) {
+ emptyResult := &v1.ImageDigestMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagedigestmirrorsetsResource, name, pt, data, subresources...), &v1.ImageDigestMirrorSet{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagedigestmirrorsetsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageDigestMirrorSet), err
}
@@ -131,10 +137,11 @@ func (c *FakeImageDigestMirrorSets) Apply(ctx context.Context, imageDigestMirror
if name == nil {
return nil, fmt.Errorf("imageDigestMirrorSet.Name must be provided to Apply")
}
+ emptyResult := &v1.ImageDigestMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagedigestmirrorsetsResource, *name, types.ApplyPatchType, data), &v1.ImageDigestMirrorSet{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagedigestmirrorsetsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageDigestMirrorSet), err
}
@@ -153,10 +160,11 @@ func (c *FakeImageDigestMirrorSets) ApplyStatus(ctx context.Context, imageDigest
if name == nil {
return nil, fmt.Errorf("imageDigestMirrorSet.Name must be provided to Apply")
}
+ emptyResult := &v1.ImageDigestMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagedigestmirrorsetsResource, *name, types.ApplyPatchType, data, "status"), &v1.ImageDigestMirrorSet{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagedigestmirrorsetsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageDigestMirrorSet), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagetagmirrorset.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagetagmirrorset.go
index bca03a946e..3ebcdb95c0 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagetagmirrorset.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_imagetagmirrorset.go
@@ -27,20 +27,22 @@ var imagetagmirrorsetsKind = v1.SchemeGroupVersion.WithKind("ImageTagMirrorSet")
// Get takes name of the imageTagMirrorSet, and returns the corresponding imageTagMirrorSet object, and an error if there is any.
func (c *FakeImageTagMirrorSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ImageTagMirrorSet, err error) {
+ emptyResult := &v1.ImageTagMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(imagetagmirrorsetsResource, name), &v1.ImageTagMirrorSet{})
+ Invokes(testing.NewRootGetActionWithOptions(imagetagmirrorsetsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageTagMirrorSet), err
}
// List takes label and field selectors, and returns the list of ImageTagMirrorSets that match those selectors.
func (c *FakeImageTagMirrorSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageTagMirrorSetList, err error) {
+ emptyResult := &v1.ImageTagMirrorSetList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(imagetagmirrorsetsResource, imagetagmirrorsetsKind, opts), &v1.ImageTagMirrorSetList{})
+ Invokes(testing.NewRootListActionWithOptions(imagetagmirrorsetsResource, imagetagmirrorsetsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeImageTagMirrorSets) List(ctx context.Context, opts metav1.ListOptio
// Watch returns a watch.Interface that watches the requested imageTagMirrorSets.
func (c *FakeImageTagMirrorSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(imagetagmirrorsetsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(imagetagmirrorsetsResource, opts))
}
// Create takes the representation of a imageTagMirrorSet and creates it. Returns the server's representation of the imageTagMirrorSet, and an error, if there is any.
func (c *FakeImageTagMirrorSets) Create(ctx context.Context, imageTagMirrorSet *v1.ImageTagMirrorSet, opts metav1.CreateOptions) (result *v1.ImageTagMirrorSet, err error) {
+ emptyResult := &v1.ImageTagMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(imagetagmirrorsetsResource, imageTagMirrorSet), &v1.ImageTagMirrorSet{})
+ Invokes(testing.NewRootCreateActionWithOptions(imagetagmirrorsetsResource, imageTagMirrorSet, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageTagMirrorSet), err
}
// Update takes the representation of a imageTagMirrorSet and updates it. Returns the server's representation of the imageTagMirrorSet, and an error, if there is any.
func (c *FakeImageTagMirrorSets) Update(ctx context.Context, imageTagMirrorSet *v1.ImageTagMirrorSet, opts metav1.UpdateOptions) (result *v1.ImageTagMirrorSet, err error) {
+ emptyResult := &v1.ImageTagMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(imagetagmirrorsetsResource, imageTagMirrorSet), &v1.ImageTagMirrorSet{})
+ Invokes(testing.NewRootUpdateActionWithOptions(imagetagmirrorsetsResource, imageTagMirrorSet, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageTagMirrorSet), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeImageTagMirrorSets) UpdateStatus(ctx context.Context, imageTagMirrorSet *v1.ImageTagMirrorSet, opts metav1.UpdateOptions) (*v1.ImageTagMirrorSet, error) {
+func (c *FakeImageTagMirrorSets) UpdateStatus(ctx context.Context, imageTagMirrorSet *v1.ImageTagMirrorSet, opts metav1.UpdateOptions) (result *v1.ImageTagMirrorSet, err error) {
+ emptyResult := &v1.ImageTagMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(imagetagmirrorsetsResource, "status", imageTagMirrorSet), &v1.ImageTagMirrorSet{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(imagetagmirrorsetsResource, "status", imageTagMirrorSet, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageTagMirrorSet), err
}
@@ -102,7 +107,7 @@ func (c *FakeImageTagMirrorSets) Delete(ctx context.Context, name string, opts m
// DeleteCollection deletes a collection of objects.
func (c *FakeImageTagMirrorSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(imagetagmirrorsetsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(imagetagmirrorsetsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.ImageTagMirrorSetList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeImageTagMirrorSets) DeleteCollection(ctx context.Context, opts meta
// Patch applies the patch and returns the patched imageTagMirrorSet.
func (c *FakeImageTagMirrorSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImageTagMirrorSet, err error) {
+ emptyResult := &v1.ImageTagMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagetagmirrorsetsResource, name, pt, data, subresources...), &v1.ImageTagMirrorSet{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagetagmirrorsetsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageTagMirrorSet), err
}
@@ -131,10 +137,11 @@ func (c *FakeImageTagMirrorSets) Apply(ctx context.Context, imageTagMirrorSet *c
if name == nil {
return nil, fmt.Errorf("imageTagMirrorSet.Name must be provided to Apply")
}
+ emptyResult := &v1.ImageTagMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagetagmirrorsetsResource, *name, types.ApplyPatchType, data), &v1.ImageTagMirrorSet{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagetagmirrorsetsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageTagMirrorSet), err
}
@@ -153,10 +160,11 @@ func (c *FakeImageTagMirrorSets) ApplyStatus(ctx context.Context, imageTagMirror
if name == nil {
return nil, fmt.Errorf("imageTagMirrorSet.Name must be provided to Apply")
}
+ emptyResult := &v1.ImageTagMirrorSet{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(imagetagmirrorsetsResource, *name, types.ApplyPatchType, data, "status"), &v1.ImageTagMirrorSet{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(imagetagmirrorsetsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.ImageTagMirrorSet), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go
index a676da41d0..6b3f399abb 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go
@@ -27,20 +27,22 @@ var infrastructuresKind = v1.SchemeGroupVersion.WithKind("Infrastructure")
// Get takes name of the infrastructure, and returns the corresponding infrastructure object, and an error if there is any.
func (c *FakeInfrastructures) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Infrastructure, err error) {
+ emptyResult := &v1.Infrastructure{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(infrastructuresResource, name), &v1.Infrastructure{})
+ Invokes(testing.NewRootGetActionWithOptions(infrastructuresResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Infrastructure), err
}
// List takes label and field selectors, and returns the list of Infrastructures that match those selectors.
func (c *FakeInfrastructures) List(ctx context.Context, opts metav1.ListOptions) (result *v1.InfrastructureList, err error) {
+ emptyResult := &v1.InfrastructureList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(infrastructuresResource, infrastructuresKind, opts), &v1.InfrastructureList{})
+ Invokes(testing.NewRootListActionWithOptions(infrastructuresResource, infrastructuresKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeInfrastructures) List(ctx context.Context, opts metav1.ListOptions)
// Watch returns a watch.Interface that watches the requested infrastructures.
func (c *FakeInfrastructures) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(infrastructuresResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(infrastructuresResource, opts))
}
// Create takes the representation of a infrastructure and creates it. Returns the server's representation of the infrastructure, and an error, if there is any.
func (c *FakeInfrastructures) Create(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.CreateOptions) (result *v1.Infrastructure, err error) {
+ emptyResult := &v1.Infrastructure{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(infrastructuresResource, infrastructure), &v1.Infrastructure{})
+ Invokes(testing.NewRootCreateActionWithOptions(infrastructuresResource, infrastructure, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Infrastructure), err
}
// Update takes the representation of a infrastructure and updates it. Returns the server's representation of the infrastructure, and an error, if there is any.
func (c *FakeInfrastructures) Update(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (result *v1.Infrastructure, err error) {
+ emptyResult := &v1.Infrastructure{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(infrastructuresResource, infrastructure), &v1.Infrastructure{})
+ Invokes(testing.NewRootUpdateActionWithOptions(infrastructuresResource, infrastructure, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Infrastructure), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeInfrastructures) UpdateStatus(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (*v1.Infrastructure, error) {
+func (c *FakeInfrastructures) UpdateStatus(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (result *v1.Infrastructure, err error) {
+ emptyResult := &v1.Infrastructure{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(infrastructuresResource, "status", infrastructure), &v1.Infrastructure{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(infrastructuresResource, "status", infrastructure, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Infrastructure), err
}
@@ -102,7 +107,7 @@ func (c *FakeInfrastructures) Delete(ctx context.Context, name string, opts meta
// DeleteCollection deletes a collection of objects.
func (c *FakeInfrastructures) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(infrastructuresResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(infrastructuresResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.InfrastructureList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeInfrastructures) DeleteCollection(ctx context.Context, opts metav1.
// Patch applies the patch and returns the patched infrastructure.
func (c *FakeInfrastructures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Infrastructure, err error) {
+ emptyResult := &v1.Infrastructure{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(infrastructuresResource, name, pt, data, subresources...), &v1.Infrastructure{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(infrastructuresResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Infrastructure), err
}
@@ -131,10 +137,11 @@ func (c *FakeInfrastructures) Apply(ctx context.Context, infrastructure *configv
if name == nil {
return nil, fmt.Errorf("infrastructure.Name must be provided to Apply")
}
+ emptyResult := &v1.Infrastructure{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(infrastructuresResource, *name, types.ApplyPatchType, data), &v1.Infrastructure{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(infrastructuresResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Infrastructure), err
}
@@ -153,10 +160,11 @@ func (c *FakeInfrastructures) ApplyStatus(ctx context.Context, infrastructure *c
if name == nil {
return nil, fmt.Errorf("infrastructure.Name must be provided to Apply")
}
+ emptyResult := &v1.Infrastructure{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(infrastructuresResource, *name, types.ApplyPatchType, data, "status"), &v1.Infrastructure{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(infrastructuresResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Infrastructure), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go
index e2a9462b4e..249b717a45 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go
@@ -27,20 +27,22 @@ var ingressesKind = v1.SchemeGroupVersion.WithKind("Ingress")
// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any.
func (c *FakeIngresses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Ingress, err error) {
+ emptyResult := &v1.Ingress{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(ingressesResource, name), &v1.Ingress{})
+ Invokes(testing.NewRootGetActionWithOptions(ingressesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Ingress), err
}
// List takes label and field selectors, and returns the list of Ingresses that match those selectors.
func (c *FakeIngresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) {
+ emptyResult := &v1.IngressList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(ingressesResource, ingressesKind, opts), &v1.IngressList{})
+ Invokes(testing.NewRootListActionWithOptions(ingressesResource, ingressesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeIngresses) List(ctx context.Context, opts metav1.ListOptions) (resu
// Watch returns a watch.Interface that watches the requested ingresses.
func (c *FakeIngresses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(ingressesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(ingressesResource, opts))
}
// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any.
func (c *FakeIngresses) Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (result *v1.Ingress, err error) {
+ emptyResult := &v1.Ingress{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(ingressesResource, ingress), &v1.Ingress{})
+ Invokes(testing.NewRootCreateActionWithOptions(ingressesResource, ingress, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Ingress), err
}
// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any.
func (c *FakeIngresses) Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) {
+ emptyResult := &v1.Ingress{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(ingressesResource, ingress), &v1.Ingress{})
+ Invokes(testing.NewRootUpdateActionWithOptions(ingressesResource, ingress, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Ingress), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error) {
+func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) {
+ emptyResult := &v1.Ingress{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(ingressesResource, "status", ingress), &v1.Ingress{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(ingressesResource, "status", ingress, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Ingress), err
}
@@ -102,7 +107,7 @@ func (c *FakeIngresses) Delete(ctx context.Context, name string, opts metav1.Del
// DeleteCollection deletes a collection of objects.
func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(ingressesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(ingressesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.IngressList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts metav1.Delete
// Patch applies the patch and returns the patched ingress.
func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) {
+ emptyResult := &v1.Ingress{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(ingressesResource, name, pt, data, subresources...), &v1.Ingress{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Ingress), err
}
@@ -131,10 +137,11 @@ func (c *FakeIngresses) Apply(ctx context.Context, ingress *configv1.IngressAppl
if name == nil {
return nil, fmt.Errorf("ingress.Name must be provided to Apply")
}
+ emptyResult := &v1.Ingress{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(ingressesResource, *name, types.ApplyPatchType, data), &v1.Ingress{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Ingress), err
}
@@ -153,10 +160,11 @@ func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *configv1.Ingre
if name == nil {
return nil, fmt.Errorf("ingress.Name must be provided to Apply")
}
+ emptyResult := &v1.Ingress{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(ingressesResource, *name, types.ApplyPatchType, data, "status"), &v1.Ingress{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Ingress), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go
index 8ac289c0ac..3ab994475a 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go
@@ -27,20 +27,22 @@ var networksKind = v1.SchemeGroupVersion.WithKind("Network")
// Get takes name of the network, and returns the corresponding network object, and an error if there is any.
func (c *FakeNetworks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Network, err error) {
+ emptyResult := &v1.Network{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(networksResource, name), &v1.Network{})
+ Invokes(testing.NewRootGetActionWithOptions(networksResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Network), err
}
// List takes label and field selectors, and returns the list of Networks that match those selectors.
func (c *FakeNetworks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkList, err error) {
+ emptyResult := &v1.NetworkList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(networksResource, networksKind, opts), &v1.NetworkList{})
+ Invokes(testing.NewRootListActionWithOptions(networksResource, networksKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeNetworks) List(ctx context.Context, opts metav1.ListOptions) (resul
// Watch returns a watch.Interface that watches the requested networks.
func (c *FakeNetworks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(networksResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(networksResource, opts))
}
// Create takes the representation of a network and creates it. Returns the server's representation of the network, and an error, if there is any.
func (c *FakeNetworks) Create(ctx context.Context, network *v1.Network, opts metav1.CreateOptions) (result *v1.Network, err error) {
+ emptyResult := &v1.Network{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(networksResource, network), &v1.Network{})
+ Invokes(testing.NewRootCreateActionWithOptions(networksResource, network, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Network), err
}
// Update takes the representation of a network and updates it. Returns the server's representation of the network, and an error, if there is any.
func (c *FakeNetworks) Update(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (result *v1.Network, err error) {
+ emptyResult := &v1.Network{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(networksResource, network), &v1.Network{})
+ Invokes(testing.NewRootUpdateActionWithOptions(networksResource, network, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Network), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeNetworks) UpdateStatus(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (*v1.Network, error) {
+func (c *FakeNetworks) UpdateStatus(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (result *v1.Network, err error) {
+ emptyResult := &v1.Network{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(networksResource, "status", network), &v1.Network{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(networksResource, "status", network, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Network), err
}
@@ -102,7 +107,7 @@ func (c *FakeNetworks) Delete(ctx context.Context, name string, opts metav1.Dele
// DeleteCollection deletes a collection of objects.
func (c *FakeNetworks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(networksResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(networksResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.NetworkList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeNetworks) DeleteCollection(ctx context.Context, opts metav1.DeleteO
// Patch applies the patch and returns the patched network.
func (c *FakeNetworks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Network, err error) {
+ emptyResult := &v1.Network{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(networksResource, name, pt, data, subresources...), &v1.Network{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(networksResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Network), err
}
@@ -131,10 +137,11 @@ func (c *FakeNetworks) Apply(ctx context.Context, network *configv1.NetworkApply
if name == nil {
return nil, fmt.Errorf("network.Name must be provided to Apply")
}
+ emptyResult := &v1.Network{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(networksResource, *name, types.ApplyPatchType, data), &v1.Network{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(networksResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Network), err
}
@@ -153,10 +160,11 @@ func (c *FakeNetworks) ApplyStatus(ctx context.Context, network *configv1.Networ
if name == nil {
return nil, fmt.Errorf("network.Name must be provided to Apply")
}
+ emptyResult := &v1.Network{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(networksResource, *name, types.ApplyPatchType, data, "status"), &v1.Network{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(networksResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Network), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_node.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_node.go
index 5849806470..a5792da429 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_node.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_node.go
@@ -27,20 +27,22 @@ var nodesKind = v1.SchemeGroupVersion.WithKind("Node")
// Get takes name of the node, and returns the corresponding node object, and an error if there is any.
func (c *FakeNodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Node, err error) {
+ emptyResult := &v1.Node{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(nodesResource, name), &v1.Node{})
+ Invokes(testing.NewRootGetActionWithOptions(nodesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Node), err
}
// List takes label and field selectors, and returns the list of Nodes that match those selectors.
func (c *FakeNodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) {
+ emptyResult := &v1.NodeList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(nodesResource, nodesKind, opts), &v1.NodeList{})
+ Invokes(testing.NewRootListActionWithOptions(nodesResource, nodesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeNodes) List(ctx context.Context, opts metav1.ListOptions) (result *
// Watch returns a watch.Interface that watches the requested nodes.
func (c *FakeNodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(nodesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(nodesResource, opts))
}
// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any.
func (c *FakeNodes) Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (result *v1.Node, err error) {
+ emptyResult := &v1.Node{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(nodesResource, node), &v1.Node{})
+ Invokes(testing.NewRootCreateActionWithOptions(nodesResource, node, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Node), err
}
// Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any.
func (c *FakeNodes) Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) {
+ emptyResult := &v1.Node{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(nodesResource, node), &v1.Node{})
+ Invokes(testing.NewRootUpdateActionWithOptions(nodesResource, node, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Node), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeNodes) UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) {
+func (c *FakeNodes) UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) {
+ emptyResult := &v1.Node{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(nodesResource, "status", node), &v1.Node{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(nodesResource, "status", node, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Node), err
}
@@ -102,7 +107,7 @@ func (c *FakeNodes) Delete(ctx context.Context, name string, opts metav1.DeleteO
// DeleteCollection deletes a collection of objects.
func (c *FakeNodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(nodesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(nodesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.NodeList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeNodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti
// Patch applies the patch and returns the patched node.
func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) {
+ emptyResult := &v1.Node{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(nodesResource, name, pt, data, subresources...), &v1.Node{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Node), err
}
@@ -131,10 +137,11 @@ func (c *FakeNodes) Apply(ctx context.Context, node *configv1.NodeApplyConfigura
if name == nil {
return nil, fmt.Errorf("node.Name must be provided to Apply")
}
+ emptyResult := &v1.Node{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data), &v1.Node{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Node), err
}
@@ -153,10 +160,11 @@ func (c *FakeNodes) ApplyStatus(ctx context.Context, node *configv1.NodeApplyCon
if name == nil {
return nil, fmt.Errorf("node.Name must be provided to Apply")
}
+ emptyResult := &v1.Node{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data, "status"), &v1.Node{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Node), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go
index 491aefd002..5955231254 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go
@@ -27,20 +27,22 @@ var oauthsKind = v1.SchemeGroupVersion.WithKind("OAuth")
// Get takes name of the oAuth, and returns the corresponding oAuth object, and an error if there is any.
func (c *FakeOAuths) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OAuth, err error) {
+ emptyResult := &v1.OAuth{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(oauthsResource, name), &v1.OAuth{})
+ Invokes(testing.NewRootGetActionWithOptions(oauthsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OAuth), err
}
// List takes label and field selectors, and returns the list of OAuths that match those selectors.
func (c *FakeOAuths) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OAuthList, err error) {
+ emptyResult := &v1.OAuthList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(oauthsResource, oauthsKind, opts), &v1.OAuthList{})
+ Invokes(testing.NewRootListActionWithOptions(oauthsResource, oauthsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeOAuths) List(ctx context.Context, opts metav1.ListOptions) (result
// Watch returns a watch.Interface that watches the requested oAuths.
func (c *FakeOAuths) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(oauthsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(oauthsResource, opts))
}
// Create takes the representation of a oAuth and creates it. Returns the server's representation of the oAuth, and an error, if there is any.
func (c *FakeOAuths) Create(ctx context.Context, oAuth *v1.OAuth, opts metav1.CreateOptions) (result *v1.OAuth, err error) {
+ emptyResult := &v1.OAuth{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(oauthsResource, oAuth), &v1.OAuth{})
+ Invokes(testing.NewRootCreateActionWithOptions(oauthsResource, oAuth, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OAuth), err
}
// Update takes the representation of a oAuth and updates it. Returns the server's representation of the oAuth, and an error, if there is any.
func (c *FakeOAuths) Update(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (result *v1.OAuth, err error) {
+ emptyResult := &v1.OAuth{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(oauthsResource, oAuth), &v1.OAuth{})
+ Invokes(testing.NewRootUpdateActionWithOptions(oauthsResource, oAuth, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OAuth), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeOAuths) UpdateStatus(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (*v1.OAuth, error) {
+func (c *FakeOAuths) UpdateStatus(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (result *v1.OAuth, err error) {
+ emptyResult := &v1.OAuth{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(oauthsResource, "status", oAuth), &v1.OAuth{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(oauthsResource, "status", oAuth, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OAuth), err
}
@@ -102,7 +107,7 @@ func (c *FakeOAuths) Delete(ctx context.Context, name string, opts metav1.Delete
// DeleteCollection deletes a collection of objects.
func (c *FakeOAuths) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(oauthsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(oauthsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.OAuthList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeOAuths) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt
// Patch applies the patch and returns the patched oAuth.
func (c *FakeOAuths) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OAuth, err error) {
+ emptyResult := &v1.OAuth{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(oauthsResource, name, pt, data, subresources...), &v1.OAuth{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(oauthsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OAuth), err
}
@@ -131,10 +137,11 @@ func (c *FakeOAuths) Apply(ctx context.Context, oAuth *configv1.OAuthApplyConfig
if name == nil {
return nil, fmt.Errorf("oAuth.Name must be provided to Apply")
}
+ emptyResult := &v1.OAuth{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(oauthsResource, *name, types.ApplyPatchType, data), &v1.OAuth{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(oauthsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OAuth), err
}
@@ -153,10 +160,11 @@ func (c *FakeOAuths) ApplyStatus(ctx context.Context, oAuth *configv1.OAuthApply
if name == nil {
return nil, fmt.Errorf("oAuth.Name must be provided to Apply")
}
+ emptyResult := &v1.OAuth{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(oauthsResource, *name, types.ApplyPatchType, data, "status"), &v1.OAuth{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(oauthsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OAuth), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_operatorhub.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_operatorhub.go
index 9b9c78ae92..7d72fc000d 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_operatorhub.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_operatorhub.go
@@ -27,20 +27,22 @@ var operatorhubsKind = v1.SchemeGroupVersion.WithKind("OperatorHub")
// Get takes name of the operatorHub, and returns the corresponding operatorHub object, and an error if there is any.
func (c *FakeOperatorHubs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OperatorHub, err error) {
+ emptyResult := &v1.OperatorHub{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(operatorhubsResource, name), &v1.OperatorHub{})
+ Invokes(testing.NewRootGetActionWithOptions(operatorhubsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OperatorHub), err
}
// List takes label and field selectors, and returns the list of OperatorHubs that match those selectors.
func (c *FakeOperatorHubs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OperatorHubList, err error) {
+ emptyResult := &v1.OperatorHubList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(operatorhubsResource, operatorhubsKind, opts), &v1.OperatorHubList{})
+ Invokes(testing.NewRootListActionWithOptions(operatorhubsResource, operatorhubsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeOperatorHubs) List(ctx context.Context, opts metav1.ListOptions) (r
// Watch returns a watch.Interface that watches the requested operatorHubs.
func (c *FakeOperatorHubs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(operatorhubsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(operatorhubsResource, opts))
}
// Create takes the representation of a operatorHub and creates it. Returns the server's representation of the operatorHub, and an error, if there is any.
func (c *FakeOperatorHubs) Create(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.CreateOptions) (result *v1.OperatorHub, err error) {
+ emptyResult := &v1.OperatorHub{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(operatorhubsResource, operatorHub), &v1.OperatorHub{})
+ Invokes(testing.NewRootCreateActionWithOptions(operatorhubsResource, operatorHub, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OperatorHub), err
}
// Update takes the representation of a operatorHub and updates it. Returns the server's representation of the operatorHub, and an error, if there is any.
func (c *FakeOperatorHubs) Update(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (result *v1.OperatorHub, err error) {
+ emptyResult := &v1.OperatorHub{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(operatorhubsResource, operatorHub), &v1.OperatorHub{})
+ Invokes(testing.NewRootUpdateActionWithOptions(operatorhubsResource, operatorHub, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OperatorHub), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeOperatorHubs) UpdateStatus(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (*v1.OperatorHub, error) {
+func (c *FakeOperatorHubs) UpdateStatus(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (result *v1.OperatorHub, err error) {
+ emptyResult := &v1.OperatorHub{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(operatorhubsResource, "status", operatorHub), &v1.OperatorHub{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(operatorhubsResource, "status", operatorHub, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OperatorHub), err
}
@@ -102,7 +107,7 @@ func (c *FakeOperatorHubs) Delete(ctx context.Context, name string, opts metav1.
// DeleteCollection deletes a collection of objects.
func (c *FakeOperatorHubs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(operatorhubsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(operatorhubsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.OperatorHubList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeOperatorHubs) DeleteCollection(ctx context.Context, opts metav1.Del
// Patch applies the patch and returns the patched operatorHub.
func (c *FakeOperatorHubs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OperatorHub, err error) {
+ emptyResult := &v1.OperatorHub{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(operatorhubsResource, name, pt, data, subresources...), &v1.OperatorHub{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(operatorhubsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OperatorHub), err
}
@@ -131,10 +137,11 @@ func (c *FakeOperatorHubs) Apply(ctx context.Context, operatorHub *configv1.Oper
if name == nil {
return nil, fmt.Errorf("operatorHub.Name must be provided to Apply")
}
+ emptyResult := &v1.OperatorHub{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(operatorhubsResource, *name, types.ApplyPatchType, data), &v1.OperatorHub{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(operatorhubsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OperatorHub), err
}
@@ -153,10 +160,11 @@ func (c *FakeOperatorHubs) ApplyStatus(ctx context.Context, operatorHub *configv
if name == nil {
return nil, fmt.Errorf("operatorHub.Name must be provided to Apply")
}
+ emptyResult := &v1.OperatorHub{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(operatorhubsResource, *name, types.ApplyPatchType, data, "status"), &v1.OperatorHub{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(operatorhubsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.OperatorHub), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go
index ade41d4726..62a2aa019d 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go
@@ -27,20 +27,22 @@ var projectsKind = v1.SchemeGroupVersion.WithKind("Project")
// Get takes name of the project, and returns the corresponding project object, and an error if there is any.
func (c *FakeProjects) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Project, err error) {
+ emptyResult := &v1.Project{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(projectsResource, name), &v1.Project{})
+ Invokes(testing.NewRootGetActionWithOptions(projectsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Project), err
}
// List takes label and field selectors, and returns the list of Projects that match those selectors.
func (c *FakeProjects) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectList, err error) {
+ emptyResult := &v1.ProjectList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(projectsResource, projectsKind, opts), &v1.ProjectList{})
+ Invokes(testing.NewRootListActionWithOptions(projectsResource, projectsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeProjects) List(ctx context.Context, opts metav1.ListOptions) (resul
// Watch returns a watch.Interface that watches the requested projects.
func (c *FakeProjects) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(projectsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(projectsResource, opts))
}
// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any.
func (c *FakeProjects) Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (result *v1.Project, err error) {
+ emptyResult := &v1.Project{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(projectsResource, project), &v1.Project{})
+ Invokes(testing.NewRootCreateActionWithOptions(projectsResource, project, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Project), err
}
// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any.
func (c *FakeProjects) Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) {
+ emptyResult := &v1.Project{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(projectsResource, project), &v1.Project{})
+ Invokes(testing.NewRootUpdateActionWithOptions(projectsResource, project, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Project), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeProjects) UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error) {
+func (c *FakeProjects) UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) {
+ emptyResult := &v1.Project{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(projectsResource, "status", project), &v1.Project{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(projectsResource, "status", project, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Project), err
}
@@ -102,7 +107,7 @@ func (c *FakeProjects) Delete(ctx context.Context, name string, opts metav1.Dele
// DeleteCollection deletes a collection of objects.
func (c *FakeProjects) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(projectsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(projectsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.ProjectList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeProjects) DeleteCollection(ctx context.Context, opts metav1.DeleteO
// Patch applies the patch and returns the patched project.
func (c *FakeProjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error) {
+ emptyResult := &v1.Project{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(projectsResource, name, pt, data, subresources...), &v1.Project{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(projectsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Project), err
}
@@ -131,10 +137,11 @@ func (c *FakeProjects) Apply(ctx context.Context, project *configv1.ProjectApply
if name == nil {
return nil, fmt.Errorf("project.Name must be provided to Apply")
}
+ emptyResult := &v1.Project{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(projectsResource, *name, types.ApplyPatchType, data), &v1.Project{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(projectsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Project), err
}
@@ -153,10 +160,11 @@ func (c *FakeProjects) ApplyStatus(ctx context.Context, project *configv1.Projec
if name == nil {
return nil, fmt.Errorf("project.Name must be provided to Apply")
}
+ emptyResult := &v1.Project{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(projectsResource, *name, types.ApplyPatchType, data, "status"), &v1.Project{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(projectsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Project), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_proxy.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_proxy.go
index 87a0456d36..9f4de37a27 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_proxy.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_proxy.go
@@ -27,20 +27,22 @@ var proxiesKind = v1.SchemeGroupVersion.WithKind("Proxy")
// Get takes name of the proxy, and returns the corresponding proxy object, and an error if there is any.
func (c *FakeProxies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Proxy, err error) {
+ emptyResult := &v1.Proxy{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(proxiesResource, name), &v1.Proxy{})
+ Invokes(testing.NewRootGetActionWithOptions(proxiesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Proxy), err
}
// List takes label and field selectors, and returns the list of Proxies that match those selectors.
func (c *FakeProxies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProxyList, err error) {
+ emptyResult := &v1.ProxyList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(proxiesResource, proxiesKind, opts), &v1.ProxyList{})
+ Invokes(testing.NewRootListActionWithOptions(proxiesResource, proxiesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeProxies) List(ctx context.Context, opts metav1.ListOptions) (result
// Watch returns a watch.Interface that watches the requested proxies.
func (c *FakeProxies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(proxiesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(proxiesResource, opts))
}
// Create takes the representation of a proxy and creates it. Returns the server's representation of the proxy, and an error, if there is any.
func (c *FakeProxies) Create(ctx context.Context, proxy *v1.Proxy, opts metav1.CreateOptions) (result *v1.Proxy, err error) {
+ emptyResult := &v1.Proxy{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(proxiesResource, proxy), &v1.Proxy{})
+ Invokes(testing.NewRootCreateActionWithOptions(proxiesResource, proxy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Proxy), err
}
// Update takes the representation of a proxy and updates it. Returns the server's representation of the proxy, and an error, if there is any.
func (c *FakeProxies) Update(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (result *v1.Proxy, err error) {
+ emptyResult := &v1.Proxy{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(proxiesResource, proxy), &v1.Proxy{})
+ Invokes(testing.NewRootUpdateActionWithOptions(proxiesResource, proxy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Proxy), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeProxies) UpdateStatus(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (*v1.Proxy, error) {
+func (c *FakeProxies) UpdateStatus(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (result *v1.Proxy, err error) {
+ emptyResult := &v1.Proxy{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(proxiesResource, "status", proxy), &v1.Proxy{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(proxiesResource, "status", proxy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Proxy), err
}
@@ -102,7 +107,7 @@ func (c *FakeProxies) Delete(ctx context.Context, name string, opts metav1.Delet
// DeleteCollection deletes a collection of objects.
func (c *FakeProxies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(proxiesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(proxiesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.ProxyList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeProxies) DeleteCollection(ctx context.Context, opts metav1.DeleteOp
// Patch applies the patch and returns the patched proxy.
func (c *FakeProxies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Proxy, err error) {
+ emptyResult := &v1.Proxy{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(proxiesResource, name, pt, data, subresources...), &v1.Proxy{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(proxiesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Proxy), err
}
@@ -131,10 +137,11 @@ func (c *FakeProxies) Apply(ctx context.Context, proxy *configv1.ProxyApplyConfi
if name == nil {
return nil, fmt.Errorf("proxy.Name must be provided to Apply")
}
+ emptyResult := &v1.Proxy{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(proxiesResource, *name, types.ApplyPatchType, data), &v1.Proxy{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(proxiesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Proxy), err
}
@@ -153,10 +160,11 @@ func (c *FakeProxies) ApplyStatus(ctx context.Context, proxy *configv1.ProxyAppl
if name == nil {
return nil, fmt.Errorf("proxy.Name must be provided to Apply")
}
+ emptyResult := &v1.Proxy{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(proxiesResource, *name, types.ApplyPatchType, data, "status"), &v1.Proxy{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(proxiesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Proxy), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduler.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduler.go
index a5dbbf40ce..79890ff842 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduler.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduler.go
@@ -27,20 +27,22 @@ var schedulersKind = v1.SchemeGroupVersion.WithKind("Scheduler")
// Get takes name of the scheduler, and returns the corresponding scheduler object, and an error if there is any.
func (c *FakeSchedulers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Scheduler, err error) {
+ emptyResult := &v1.Scheduler{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(schedulersResource, name), &v1.Scheduler{})
+ Invokes(testing.NewRootGetActionWithOptions(schedulersResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Scheduler), err
}
// List takes label and field selectors, and returns the list of Schedulers that match those selectors.
func (c *FakeSchedulers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SchedulerList, err error) {
+ emptyResult := &v1.SchedulerList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(schedulersResource, schedulersKind, opts), &v1.SchedulerList{})
+ Invokes(testing.NewRootListActionWithOptions(schedulersResource, schedulersKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeSchedulers) List(ctx context.Context, opts metav1.ListOptions) (res
// Watch returns a watch.Interface that watches the requested schedulers.
func (c *FakeSchedulers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(schedulersResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(schedulersResource, opts))
}
// Create takes the representation of a scheduler and creates it. Returns the server's representation of the scheduler, and an error, if there is any.
func (c *FakeSchedulers) Create(ctx context.Context, scheduler *v1.Scheduler, opts metav1.CreateOptions) (result *v1.Scheduler, err error) {
+ emptyResult := &v1.Scheduler{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(schedulersResource, scheduler), &v1.Scheduler{})
+ Invokes(testing.NewRootCreateActionWithOptions(schedulersResource, scheduler, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Scheduler), err
}
// Update takes the representation of a scheduler and updates it. Returns the server's representation of the scheduler, and an error, if there is any.
func (c *FakeSchedulers) Update(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (result *v1.Scheduler, err error) {
+ emptyResult := &v1.Scheduler{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(schedulersResource, scheduler), &v1.Scheduler{})
+ Invokes(testing.NewRootUpdateActionWithOptions(schedulersResource, scheduler, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Scheduler), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeSchedulers) UpdateStatus(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (*v1.Scheduler, error) {
+func (c *FakeSchedulers) UpdateStatus(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (result *v1.Scheduler, err error) {
+ emptyResult := &v1.Scheduler{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(schedulersResource, "status", scheduler), &v1.Scheduler{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(schedulersResource, "status", scheduler, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Scheduler), err
}
@@ -102,7 +107,7 @@ func (c *FakeSchedulers) Delete(ctx context.Context, name string, opts metav1.De
// DeleteCollection deletes a collection of objects.
func (c *FakeSchedulers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(schedulersResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(schedulersResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.SchedulerList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeSchedulers) DeleteCollection(ctx context.Context, opts metav1.Delet
// Patch applies the patch and returns the patched scheduler.
func (c *FakeSchedulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Scheduler, err error) {
+ emptyResult := &v1.Scheduler{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(schedulersResource, name, pt, data, subresources...), &v1.Scheduler{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(schedulersResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Scheduler), err
}
@@ -131,10 +137,11 @@ func (c *FakeSchedulers) Apply(ctx context.Context, scheduler *configv1.Schedule
if name == nil {
return nil, fmt.Errorf("scheduler.Name must be provided to Apply")
}
+ emptyResult := &v1.Scheduler{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(schedulersResource, *name, types.ApplyPatchType, data), &v1.Scheduler{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(schedulersResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Scheduler), err
}
@@ -153,10 +160,11 @@ func (c *FakeSchedulers) ApplyStatus(ctx context.Context, scheduler *configv1.Sc
if name == nil {
return nil, fmt.Errorf("scheduler.Name must be provided to Apply")
}
+ emptyResult := &v1.Scheduler{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(schedulersResource, *name, types.ApplyPatchType, data, "status"), &v1.Scheduler{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(schedulersResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.Scheduler), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/featuregate.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/featuregate.go
index 112322c84b..fcbfe3577d 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/featuregate.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/featuregate.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// FeatureGatesGetter has a method to return a FeatureGateInterface.
@@ -27,6 +24,7 @@ type FeatureGatesGetter interface {
type FeatureGateInterface interface {
Create(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.CreateOptions) (*v1.FeatureGate, error)
Update(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (*v1.FeatureGate, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (*v1.FeatureGate, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type FeatureGateInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FeatureGate, err error)
Apply(ctx context.Context, featureGate *configv1.FeatureGateApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FeatureGate, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, featureGate *configv1.FeatureGateApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FeatureGate, err error)
FeatureGateExpansion
}
// featureGates implements FeatureGateInterface
type featureGates struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.FeatureGate, *v1.FeatureGateList, *configv1.FeatureGateApplyConfiguration]
}
// newFeatureGates returns a FeatureGates
func newFeatureGates(c *ConfigV1Client) *featureGates {
return &featureGates{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.FeatureGate, *v1.FeatureGateList, *configv1.FeatureGateApplyConfiguration](
+ "featuregates",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.FeatureGate { return &v1.FeatureGate{} },
+ func() *v1.FeatureGateList { return &v1.FeatureGateList{} }),
}
}
-
-// Get takes name of the featureGate, and returns the corresponding featureGate object, and an error if there is any.
-func (c *featureGates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FeatureGate, err error) {
- result = &v1.FeatureGate{}
- err = c.client.Get().
- Resource("featuregates").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of FeatureGates that match those selectors.
-func (c *featureGates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FeatureGateList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.FeatureGateList{}
- err = c.client.Get().
- Resource("featuregates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested featureGates.
-func (c *featureGates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("featuregates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a featureGate and creates it. Returns the server's representation of the featureGate, and an error, if there is any.
-func (c *featureGates) Create(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.CreateOptions) (result *v1.FeatureGate, err error) {
- result = &v1.FeatureGate{}
- err = c.client.Post().
- Resource("featuregates").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(featureGate).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a featureGate and updates it. Returns the server's representation of the featureGate, and an error, if there is any.
-func (c *featureGates) Update(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (result *v1.FeatureGate, err error) {
- result = &v1.FeatureGate{}
- err = c.client.Put().
- Resource("featuregates").
- Name(featureGate.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(featureGate).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *featureGates) UpdateStatus(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (result *v1.FeatureGate, err error) {
- result = &v1.FeatureGate{}
- err = c.client.Put().
- Resource("featuregates").
- Name(featureGate.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(featureGate).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the featureGate and deletes it. Returns an error if one occurs.
-func (c *featureGates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("featuregates").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *featureGates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("featuregates").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched featureGate.
-func (c *featureGates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FeatureGate, err error) {
- result = &v1.FeatureGate{}
- err = c.client.Patch(pt).
- Resource("featuregates").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied featureGate.
-func (c *featureGates) Apply(ctx context.Context, featureGate *configv1.FeatureGateApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FeatureGate, err error) {
- if featureGate == nil {
- return nil, fmt.Errorf("featureGate provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(featureGate)
- if err != nil {
- return nil, err
- }
- name := featureGate.Name
- if name == nil {
- return nil, fmt.Errorf("featureGate.Name must be provided to Apply")
- }
- result = &v1.FeatureGate{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("featuregates").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *featureGates) ApplyStatus(ctx context.Context, featureGate *configv1.FeatureGateApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FeatureGate, err error) {
- if featureGate == nil {
- return nil, fmt.Errorf("featureGate provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(featureGate)
- if err != nil {
- return nil, err
- }
-
- name := featureGate.Name
- if name == nil {
- return nil, fmt.Errorf("featureGate.Name must be provided to Apply")
- }
-
- result = &v1.FeatureGate{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("featuregates").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go
index 5357f96d8a..536693d3e9 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImagesGetter has a method to return a ImageInterface.
@@ -27,6 +24,7 @@ type ImagesGetter interface {
type ImageInterface interface {
Create(ctx context.Context, image *v1.Image, opts metav1.CreateOptions) (*v1.Image, error)
Update(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (*v1.Image, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (*v1.Image, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type ImageInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Image, err error)
Apply(ctx context.Context, image *configv1.ImageApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Image, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, image *configv1.ImageApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Image, err error)
ImageExpansion
}
// images implements ImageInterface
type images struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Image, *v1.ImageList, *configv1.ImageApplyConfiguration]
}
// newImages returns a Images
func newImages(c *ConfigV1Client) *images {
return &images{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Image, *v1.ImageList, *configv1.ImageApplyConfiguration](
+ "images",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Image { return &v1.Image{} },
+ func() *v1.ImageList { return &v1.ImageList{} }),
}
}
-
-// Get takes name of the image, and returns the corresponding image object, and an error if there is any.
-func (c *images) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Image, err error) {
- result = &v1.Image{}
- err = c.client.Get().
- Resource("images").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Images that match those selectors.
-func (c *images) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ImageList{}
- err = c.client.Get().
- Resource("images").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested images.
-func (c *images) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("images").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a image and creates it. Returns the server's representation of the image, and an error, if there is any.
-func (c *images) Create(ctx context.Context, image *v1.Image, opts metav1.CreateOptions) (result *v1.Image, err error) {
- result = &v1.Image{}
- err = c.client.Post().
- Resource("images").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(image).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a image and updates it. Returns the server's representation of the image, and an error, if there is any.
-func (c *images) Update(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (result *v1.Image, err error) {
- result = &v1.Image{}
- err = c.client.Put().
- Resource("images").
- Name(image.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(image).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *images) UpdateStatus(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (result *v1.Image, err error) {
- result = &v1.Image{}
- err = c.client.Put().
- Resource("images").
- Name(image.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(image).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the image and deletes it. Returns an error if one occurs.
-func (c *images) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("images").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *images) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("images").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched image.
-func (c *images) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Image, err error) {
- result = &v1.Image{}
- err = c.client.Patch(pt).
- Resource("images").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied image.
-func (c *images) Apply(ctx context.Context, image *configv1.ImageApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Image, err error) {
- if image == nil {
- return nil, fmt.Errorf("image provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(image)
- if err != nil {
- return nil, err
- }
- name := image.Name
- if name == nil {
- return nil, fmt.Errorf("image.Name must be provided to Apply")
- }
- result = &v1.Image{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("images").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *images) ApplyStatus(ctx context.Context, image *configv1.ImageApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Image, err error) {
- if image == nil {
- return nil, fmt.Errorf("image provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(image)
- if err != nil {
- return nil, err
- }
-
- name := image.Name
- if name == nil {
- return nil, fmt.Errorf("image.Name must be provided to Apply")
- }
-
- result = &v1.Image{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("images").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagecontentpolicy.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagecontentpolicy.go
index 3128290ca5..bc8a8b3424 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagecontentpolicy.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagecontentpolicy.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImageContentPoliciesGetter has a method to return a ImageContentPolicyInterface.
@@ -39,143 +36,18 @@ type ImageContentPolicyInterface interface {
// imageContentPolicies implements ImageContentPolicyInterface
type imageContentPolicies struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.ImageContentPolicy, *v1.ImageContentPolicyList, *configv1.ImageContentPolicyApplyConfiguration]
}
// newImageContentPolicies returns a ImageContentPolicies
func newImageContentPolicies(c *ConfigV1Client) *imageContentPolicies {
return &imageContentPolicies{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.ImageContentPolicy, *v1.ImageContentPolicyList, *configv1.ImageContentPolicyApplyConfiguration](
+ "imagecontentpolicies",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.ImageContentPolicy { return &v1.ImageContentPolicy{} },
+ func() *v1.ImageContentPolicyList { return &v1.ImageContentPolicyList{} }),
}
}
-
-// Get takes name of the imageContentPolicy, and returns the corresponding imageContentPolicy object, and an error if there is any.
-func (c *imageContentPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ImageContentPolicy, err error) {
- result = &v1.ImageContentPolicy{}
- err = c.client.Get().
- Resource("imagecontentpolicies").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ImageContentPolicies that match those selectors.
-func (c *imageContentPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageContentPolicyList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ImageContentPolicyList{}
- err = c.client.Get().
- Resource("imagecontentpolicies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested imageContentPolicies.
-func (c *imageContentPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("imagecontentpolicies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a imageContentPolicy and creates it. Returns the server's representation of the imageContentPolicy, and an error, if there is any.
-func (c *imageContentPolicies) Create(ctx context.Context, imageContentPolicy *v1.ImageContentPolicy, opts metav1.CreateOptions) (result *v1.ImageContentPolicy, err error) {
- result = &v1.ImageContentPolicy{}
- err = c.client.Post().
- Resource("imagecontentpolicies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageContentPolicy).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a imageContentPolicy and updates it. Returns the server's representation of the imageContentPolicy, and an error, if there is any.
-func (c *imageContentPolicies) Update(ctx context.Context, imageContentPolicy *v1.ImageContentPolicy, opts metav1.UpdateOptions) (result *v1.ImageContentPolicy, err error) {
- result = &v1.ImageContentPolicy{}
- err = c.client.Put().
- Resource("imagecontentpolicies").
- Name(imageContentPolicy.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageContentPolicy).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the imageContentPolicy and deletes it. Returns an error if one occurs.
-func (c *imageContentPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("imagecontentpolicies").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *imageContentPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("imagecontentpolicies").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched imageContentPolicy.
-func (c *imageContentPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImageContentPolicy, err error) {
- result = &v1.ImageContentPolicy{}
- err = c.client.Patch(pt).
- Resource("imagecontentpolicies").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied imageContentPolicy.
-func (c *imageContentPolicies) Apply(ctx context.Context, imageContentPolicy *configv1.ImageContentPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageContentPolicy, err error) {
- if imageContentPolicy == nil {
- return nil, fmt.Errorf("imageContentPolicy provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(imageContentPolicy)
- if err != nil {
- return nil, err
- }
- name := imageContentPolicy.Name
- if name == nil {
- return nil, fmt.Errorf("imageContentPolicy.Name must be provided to Apply")
- }
- result = &v1.ImageContentPolicy{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("imagecontentpolicies").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagedigestmirrorset.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagedigestmirrorset.go
index 65e01a8446..eca9b95b65 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagedigestmirrorset.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagedigestmirrorset.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImageDigestMirrorSetsGetter has a method to return a ImageDigestMirrorSetInterface.
@@ -27,6 +24,7 @@ type ImageDigestMirrorSetsGetter interface {
type ImageDigestMirrorSetInterface interface {
Create(ctx context.Context, imageDigestMirrorSet *v1.ImageDigestMirrorSet, opts metav1.CreateOptions) (*v1.ImageDigestMirrorSet, error)
Update(ctx context.Context, imageDigestMirrorSet *v1.ImageDigestMirrorSet, opts metav1.UpdateOptions) (*v1.ImageDigestMirrorSet, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, imageDigestMirrorSet *v1.ImageDigestMirrorSet, opts metav1.UpdateOptions) (*v1.ImageDigestMirrorSet, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type ImageDigestMirrorSetInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImageDigestMirrorSet, err error)
Apply(ctx context.Context, imageDigestMirrorSet *configv1.ImageDigestMirrorSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageDigestMirrorSet, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, imageDigestMirrorSet *configv1.ImageDigestMirrorSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageDigestMirrorSet, err error)
ImageDigestMirrorSetExpansion
}
// imageDigestMirrorSets implements ImageDigestMirrorSetInterface
type imageDigestMirrorSets struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.ImageDigestMirrorSet, *v1.ImageDigestMirrorSetList, *configv1.ImageDigestMirrorSetApplyConfiguration]
}
// newImageDigestMirrorSets returns a ImageDigestMirrorSets
func newImageDigestMirrorSets(c *ConfigV1Client) *imageDigestMirrorSets {
return &imageDigestMirrorSets{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.ImageDigestMirrorSet, *v1.ImageDigestMirrorSetList, *configv1.ImageDigestMirrorSetApplyConfiguration](
+ "imagedigestmirrorsets",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.ImageDigestMirrorSet { return &v1.ImageDigestMirrorSet{} },
+ func() *v1.ImageDigestMirrorSetList { return &v1.ImageDigestMirrorSetList{} }),
}
}
-
-// Get takes name of the imageDigestMirrorSet, and returns the corresponding imageDigestMirrorSet object, and an error if there is any.
-func (c *imageDigestMirrorSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ImageDigestMirrorSet, err error) {
- result = &v1.ImageDigestMirrorSet{}
- err = c.client.Get().
- Resource("imagedigestmirrorsets").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ImageDigestMirrorSets that match those selectors.
-func (c *imageDigestMirrorSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageDigestMirrorSetList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ImageDigestMirrorSetList{}
- err = c.client.Get().
- Resource("imagedigestmirrorsets").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested imageDigestMirrorSets.
-func (c *imageDigestMirrorSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("imagedigestmirrorsets").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a imageDigestMirrorSet and creates it. Returns the server's representation of the imageDigestMirrorSet, and an error, if there is any.
-func (c *imageDigestMirrorSets) Create(ctx context.Context, imageDigestMirrorSet *v1.ImageDigestMirrorSet, opts metav1.CreateOptions) (result *v1.ImageDigestMirrorSet, err error) {
- result = &v1.ImageDigestMirrorSet{}
- err = c.client.Post().
- Resource("imagedigestmirrorsets").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageDigestMirrorSet).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a imageDigestMirrorSet and updates it. Returns the server's representation of the imageDigestMirrorSet, and an error, if there is any.
-func (c *imageDigestMirrorSets) Update(ctx context.Context, imageDigestMirrorSet *v1.ImageDigestMirrorSet, opts metav1.UpdateOptions) (result *v1.ImageDigestMirrorSet, err error) {
- result = &v1.ImageDigestMirrorSet{}
- err = c.client.Put().
- Resource("imagedigestmirrorsets").
- Name(imageDigestMirrorSet.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageDigestMirrorSet).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *imageDigestMirrorSets) UpdateStatus(ctx context.Context, imageDigestMirrorSet *v1.ImageDigestMirrorSet, opts metav1.UpdateOptions) (result *v1.ImageDigestMirrorSet, err error) {
- result = &v1.ImageDigestMirrorSet{}
- err = c.client.Put().
- Resource("imagedigestmirrorsets").
- Name(imageDigestMirrorSet.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageDigestMirrorSet).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the imageDigestMirrorSet and deletes it. Returns an error if one occurs.
-func (c *imageDigestMirrorSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("imagedigestmirrorsets").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *imageDigestMirrorSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("imagedigestmirrorsets").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched imageDigestMirrorSet.
-func (c *imageDigestMirrorSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImageDigestMirrorSet, err error) {
- result = &v1.ImageDigestMirrorSet{}
- err = c.client.Patch(pt).
- Resource("imagedigestmirrorsets").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied imageDigestMirrorSet.
-func (c *imageDigestMirrorSets) Apply(ctx context.Context, imageDigestMirrorSet *configv1.ImageDigestMirrorSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageDigestMirrorSet, err error) {
- if imageDigestMirrorSet == nil {
- return nil, fmt.Errorf("imageDigestMirrorSet provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(imageDigestMirrorSet)
- if err != nil {
- return nil, err
- }
- name := imageDigestMirrorSet.Name
- if name == nil {
- return nil, fmt.Errorf("imageDigestMirrorSet.Name must be provided to Apply")
- }
- result = &v1.ImageDigestMirrorSet{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("imagedigestmirrorsets").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *imageDigestMirrorSets) ApplyStatus(ctx context.Context, imageDigestMirrorSet *configv1.ImageDigestMirrorSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageDigestMirrorSet, err error) {
- if imageDigestMirrorSet == nil {
- return nil, fmt.Errorf("imageDigestMirrorSet provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(imageDigestMirrorSet)
- if err != nil {
- return nil, err
- }
-
- name := imageDigestMirrorSet.Name
- if name == nil {
- return nil, fmt.Errorf("imageDigestMirrorSet.Name must be provided to Apply")
- }
-
- result = &v1.ImageDigestMirrorSet{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("imagedigestmirrorsets").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagetagmirrorset.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagetagmirrorset.go
index dc8337970d..add148a557 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagetagmirrorset.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagetagmirrorset.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImageTagMirrorSetsGetter has a method to return a ImageTagMirrorSetInterface.
@@ -27,6 +24,7 @@ type ImageTagMirrorSetsGetter interface {
type ImageTagMirrorSetInterface interface {
Create(ctx context.Context, imageTagMirrorSet *v1.ImageTagMirrorSet, opts metav1.CreateOptions) (*v1.ImageTagMirrorSet, error)
Update(ctx context.Context, imageTagMirrorSet *v1.ImageTagMirrorSet, opts metav1.UpdateOptions) (*v1.ImageTagMirrorSet, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, imageTagMirrorSet *v1.ImageTagMirrorSet, opts metav1.UpdateOptions) (*v1.ImageTagMirrorSet, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type ImageTagMirrorSetInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImageTagMirrorSet, err error)
Apply(ctx context.Context, imageTagMirrorSet *configv1.ImageTagMirrorSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageTagMirrorSet, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, imageTagMirrorSet *configv1.ImageTagMirrorSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageTagMirrorSet, err error)
ImageTagMirrorSetExpansion
}
// imageTagMirrorSets implements ImageTagMirrorSetInterface
type imageTagMirrorSets struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.ImageTagMirrorSet, *v1.ImageTagMirrorSetList, *configv1.ImageTagMirrorSetApplyConfiguration]
}
// newImageTagMirrorSets returns a ImageTagMirrorSets
func newImageTagMirrorSets(c *ConfigV1Client) *imageTagMirrorSets {
return &imageTagMirrorSets{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.ImageTagMirrorSet, *v1.ImageTagMirrorSetList, *configv1.ImageTagMirrorSetApplyConfiguration](
+ "imagetagmirrorsets",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.ImageTagMirrorSet { return &v1.ImageTagMirrorSet{} },
+ func() *v1.ImageTagMirrorSetList { return &v1.ImageTagMirrorSetList{} }),
}
}
-
-// Get takes name of the imageTagMirrorSet, and returns the corresponding imageTagMirrorSet object, and an error if there is any.
-func (c *imageTagMirrorSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ImageTagMirrorSet, err error) {
- result = &v1.ImageTagMirrorSet{}
- err = c.client.Get().
- Resource("imagetagmirrorsets").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ImageTagMirrorSets that match those selectors.
-func (c *imageTagMirrorSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageTagMirrorSetList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ImageTagMirrorSetList{}
- err = c.client.Get().
- Resource("imagetagmirrorsets").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested imageTagMirrorSets.
-func (c *imageTagMirrorSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("imagetagmirrorsets").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a imageTagMirrorSet and creates it. Returns the server's representation of the imageTagMirrorSet, and an error, if there is any.
-func (c *imageTagMirrorSets) Create(ctx context.Context, imageTagMirrorSet *v1.ImageTagMirrorSet, opts metav1.CreateOptions) (result *v1.ImageTagMirrorSet, err error) {
- result = &v1.ImageTagMirrorSet{}
- err = c.client.Post().
- Resource("imagetagmirrorsets").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageTagMirrorSet).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a imageTagMirrorSet and updates it. Returns the server's representation of the imageTagMirrorSet, and an error, if there is any.
-func (c *imageTagMirrorSets) Update(ctx context.Context, imageTagMirrorSet *v1.ImageTagMirrorSet, opts metav1.UpdateOptions) (result *v1.ImageTagMirrorSet, err error) {
- result = &v1.ImageTagMirrorSet{}
- err = c.client.Put().
- Resource("imagetagmirrorsets").
- Name(imageTagMirrorSet.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageTagMirrorSet).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *imageTagMirrorSets) UpdateStatus(ctx context.Context, imageTagMirrorSet *v1.ImageTagMirrorSet, opts metav1.UpdateOptions) (result *v1.ImageTagMirrorSet, err error) {
- result = &v1.ImageTagMirrorSet{}
- err = c.client.Put().
- Resource("imagetagmirrorsets").
- Name(imageTagMirrorSet.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageTagMirrorSet).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the imageTagMirrorSet and deletes it. Returns an error if one occurs.
-func (c *imageTagMirrorSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("imagetagmirrorsets").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *imageTagMirrorSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("imagetagmirrorsets").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched imageTagMirrorSet.
-func (c *imageTagMirrorSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImageTagMirrorSet, err error) {
- result = &v1.ImageTagMirrorSet{}
- err = c.client.Patch(pt).
- Resource("imagetagmirrorsets").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied imageTagMirrorSet.
-func (c *imageTagMirrorSets) Apply(ctx context.Context, imageTagMirrorSet *configv1.ImageTagMirrorSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageTagMirrorSet, err error) {
- if imageTagMirrorSet == nil {
- return nil, fmt.Errorf("imageTagMirrorSet provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(imageTagMirrorSet)
- if err != nil {
- return nil, err
- }
- name := imageTagMirrorSet.Name
- if name == nil {
- return nil, fmt.Errorf("imageTagMirrorSet.Name must be provided to Apply")
- }
- result = &v1.ImageTagMirrorSet{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("imagetagmirrorsets").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *imageTagMirrorSets) ApplyStatus(ctx context.Context, imageTagMirrorSet *configv1.ImageTagMirrorSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageTagMirrorSet, err error) {
- if imageTagMirrorSet == nil {
- return nil, fmt.Errorf("imageTagMirrorSet provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(imageTagMirrorSet)
- if err != nil {
- return nil, err
- }
-
- name := imageTagMirrorSet.Name
- if name == nil {
- return nil, fmt.Errorf("imageTagMirrorSet.Name must be provided to Apply")
- }
-
- result = &v1.ImageTagMirrorSet{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("imagetagmirrorsets").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go
index c3728aa83d..4d85508331 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// InfrastructuresGetter has a method to return a InfrastructureInterface.
@@ -27,6 +24,7 @@ type InfrastructuresGetter interface {
type InfrastructureInterface interface {
Create(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.CreateOptions) (*v1.Infrastructure, error)
Update(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (*v1.Infrastructure, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (*v1.Infrastructure, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type InfrastructureInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Infrastructure, err error)
Apply(ctx context.Context, infrastructure *configv1.InfrastructureApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Infrastructure, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, infrastructure *configv1.InfrastructureApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Infrastructure, err error)
InfrastructureExpansion
}
// infrastructures implements InfrastructureInterface
type infrastructures struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Infrastructure, *v1.InfrastructureList, *configv1.InfrastructureApplyConfiguration]
}
// newInfrastructures returns a Infrastructures
func newInfrastructures(c *ConfigV1Client) *infrastructures {
return &infrastructures{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Infrastructure, *v1.InfrastructureList, *configv1.InfrastructureApplyConfiguration](
+ "infrastructures",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Infrastructure { return &v1.Infrastructure{} },
+ func() *v1.InfrastructureList { return &v1.InfrastructureList{} }),
}
}
-
-// Get takes name of the infrastructure, and returns the corresponding infrastructure object, and an error if there is any.
-func (c *infrastructures) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Infrastructure, err error) {
- result = &v1.Infrastructure{}
- err = c.client.Get().
- Resource("infrastructures").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Infrastructures that match those selectors.
-func (c *infrastructures) List(ctx context.Context, opts metav1.ListOptions) (result *v1.InfrastructureList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.InfrastructureList{}
- err = c.client.Get().
- Resource("infrastructures").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested infrastructures.
-func (c *infrastructures) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("infrastructures").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a infrastructure and creates it. Returns the server's representation of the infrastructure, and an error, if there is any.
-func (c *infrastructures) Create(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.CreateOptions) (result *v1.Infrastructure, err error) {
- result = &v1.Infrastructure{}
- err = c.client.Post().
- Resource("infrastructures").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(infrastructure).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a infrastructure and updates it. Returns the server's representation of the infrastructure, and an error, if there is any.
-func (c *infrastructures) Update(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (result *v1.Infrastructure, err error) {
- result = &v1.Infrastructure{}
- err = c.client.Put().
- Resource("infrastructures").
- Name(infrastructure.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(infrastructure).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *infrastructures) UpdateStatus(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (result *v1.Infrastructure, err error) {
- result = &v1.Infrastructure{}
- err = c.client.Put().
- Resource("infrastructures").
- Name(infrastructure.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(infrastructure).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the infrastructure and deletes it. Returns an error if one occurs.
-func (c *infrastructures) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("infrastructures").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *infrastructures) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("infrastructures").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched infrastructure.
-func (c *infrastructures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Infrastructure, err error) {
- result = &v1.Infrastructure{}
- err = c.client.Patch(pt).
- Resource("infrastructures").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied infrastructure.
-func (c *infrastructures) Apply(ctx context.Context, infrastructure *configv1.InfrastructureApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Infrastructure, err error) {
- if infrastructure == nil {
- return nil, fmt.Errorf("infrastructure provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(infrastructure)
- if err != nil {
- return nil, err
- }
- name := infrastructure.Name
- if name == nil {
- return nil, fmt.Errorf("infrastructure.Name must be provided to Apply")
- }
- result = &v1.Infrastructure{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("infrastructures").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *infrastructures) ApplyStatus(ctx context.Context, infrastructure *configv1.InfrastructureApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Infrastructure, err error) {
- if infrastructure == nil {
- return nil, fmt.Errorf("infrastructure provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(infrastructure)
- if err != nil {
- return nil, err
- }
-
- name := infrastructure.Name
- if name == nil {
- return nil, fmt.Errorf("infrastructure.Name must be provided to Apply")
- }
-
- result = &v1.Infrastructure{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("infrastructures").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go
index 4d909f8842..cc4fa53c40 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// IngressesGetter has a method to return a IngressInterface.
@@ -27,6 +24,7 @@ type IngressesGetter interface {
type IngressInterface interface {
Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (*v1.Ingress, error)
Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type IngressInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error)
Apply(ctx context.Context, ingress *configv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, ingress *configv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error)
IngressExpansion
}
// ingresses implements IngressInterface
type ingresses struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Ingress, *v1.IngressList, *configv1.IngressApplyConfiguration]
}
// newIngresses returns a Ingresses
func newIngresses(c *ConfigV1Client) *ingresses {
return &ingresses{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Ingress, *v1.IngressList, *configv1.IngressApplyConfiguration](
+ "ingresses",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Ingress { return &v1.Ingress{} },
+ func() *v1.IngressList { return &v1.IngressList{} }),
}
}
-
-// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any.
-func (c *ingresses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Ingress, err error) {
- result = &v1.Ingress{}
- err = c.client.Get().
- Resource("ingresses").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Ingresses that match those selectors.
-func (c *ingresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.IngressList{}
- err = c.client.Get().
- Resource("ingresses").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested ingresses.
-func (c *ingresses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("ingresses").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any.
-func (c *ingresses) Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (result *v1.Ingress, err error) {
- result = &v1.Ingress{}
- err = c.client.Post().
- Resource("ingresses").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(ingress).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any.
-func (c *ingresses) Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) {
- result = &v1.Ingress{}
- err = c.client.Put().
- Resource("ingresses").
- Name(ingress.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(ingress).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *ingresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) {
- result = &v1.Ingress{}
- err = c.client.Put().
- Resource("ingresses").
- Name(ingress.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(ingress).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the ingress and deletes it. Returns an error if one occurs.
-func (c *ingresses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("ingresses").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *ingresses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("ingresses").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched ingress.
-func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) {
- result = &v1.Ingress{}
- err = c.client.Patch(pt).
- Resource("ingresses").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied ingress.
-func (c *ingresses) Apply(ctx context.Context, ingress *configv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) {
- if ingress == nil {
- return nil, fmt.Errorf("ingress provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(ingress)
- if err != nil {
- return nil, err
- }
- name := ingress.Name
- if name == nil {
- return nil, fmt.Errorf("ingress.Name must be provided to Apply")
- }
- result = &v1.Ingress{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("ingresses").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *ingresses) ApplyStatus(ctx context.Context, ingress *configv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) {
- if ingress == nil {
- return nil, fmt.Errorf("ingress provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(ingress)
- if err != nil {
- return nil, err
- }
-
- name := ingress.Name
- if name == nil {
- return nil, fmt.Errorf("ingress.Name must be provided to Apply")
- }
-
- result = &v1.Ingress{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("ingresses").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go
index d9d8a4e475..ca61ca93ad 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// NetworksGetter has a method to return a NetworkInterface.
@@ -27,6 +24,7 @@ type NetworksGetter interface {
type NetworkInterface interface {
Create(ctx context.Context, network *v1.Network, opts metav1.CreateOptions) (*v1.Network, error)
Update(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (*v1.Network, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (*v1.Network, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type NetworkInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Network, err error)
Apply(ctx context.Context, network *configv1.NetworkApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Network, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, network *configv1.NetworkApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Network, err error)
NetworkExpansion
}
// networks implements NetworkInterface
type networks struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Network, *v1.NetworkList, *configv1.NetworkApplyConfiguration]
}
// newNetworks returns a Networks
func newNetworks(c *ConfigV1Client) *networks {
return &networks{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Network, *v1.NetworkList, *configv1.NetworkApplyConfiguration](
+ "networks",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Network { return &v1.Network{} },
+ func() *v1.NetworkList { return &v1.NetworkList{} }),
}
}
-
-// Get takes name of the network, and returns the corresponding network object, and an error if there is any.
-func (c *networks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Network, err error) {
- result = &v1.Network{}
- err = c.client.Get().
- Resource("networks").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Networks that match those selectors.
-func (c *networks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.NetworkList{}
- err = c.client.Get().
- Resource("networks").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested networks.
-func (c *networks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("networks").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a network and creates it. Returns the server's representation of the network, and an error, if there is any.
-func (c *networks) Create(ctx context.Context, network *v1.Network, opts metav1.CreateOptions) (result *v1.Network, err error) {
- result = &v1.Network{}
- err = c.client.Post().
- Resource("networks").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(network).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a network and updates it. Returns the server's representation of the network, and an error, if there is any.
-func (c *networks) Update(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (result *v1.Network, err error) {
- result = &v1.Network{}
- err = c.client.Put().
- Resource("networks").
- Name(network.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(network).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *networks) UpdateStatus(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (result *v1.Network, err error) {
- result = &v1.Network{}
- err = c.client.Put().
- Resource("networks").
- Name(network.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(network).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the network and deletes it. Returns an error if one occurs.
-func (c *networks) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("networks").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *networks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("networks").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched network.
-func (c *networks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Network, err error) {
- result = &v1.Network{}
- err = c.client.Patch(pt).
- Resource("networks").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied network.
-func (c *networks) Apply(ctx context.Context, network *configv1.NetworkApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Network, err error) {
- if network == nil {
- return nil, fmt.Errorf("network provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(network)
- if err != nil {
- return nil, err
- }
- name := network.Name
- if name == nil {
- return nil, fmt.Errorf("network.Name must be provided to Apply")
- }
- result = &v1.Network{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("networks").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *networks) ApplyStatus(ctx context.Context, network *configv1.NetworkApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Network, err error) {
- if network == nil {
- return nil, fmt.Errorf("network provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(network)
- if err != nil {
- return nil, err
- }
-
- name := network.Name
- if name == nil {
- return nil, fmt.Errorf("network.Name must be provided to Apply")
- }
-
- result = &v1.Network{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("networks").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/node.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/node.go
index 6c7969c5ad..0ec0e5e5ac 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/node.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/node.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// NodesGetter has a method to return a NodeInterface.
@@ -27,6 +24,7 @@ type NodesGetter interface {
type NodeInterface interface {
Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (*v1.Node, error)
Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type NodeInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error)
Apply(ctx context.Context, node *configv1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, node *configv1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error)
NodeExpansion
}
// nodes implements NodeInterface
type nodes struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Node, *v1.NodeList, *configv1.NodeApplyConfiguration]
}
// newNodes returns a Nodes
func newNodes(c *ConfigV1Client) *nodes {
return &nodes{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Node, *v1.NodeList, *configv1.NodeApplyConfiguration](
+ "nodes",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Node { return &v1.Node{} },
+ func() *v1.NodeList { return &v1.NodeList{} }),
}
}
-
-// Get takes name of the node, and returns the corresponding node object, and an error if there is any.
-func (c *nodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Node, err error) {
- result = &v1.Node{}
- err = c.client.Get().
- Resource("nodes").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Nodes that match those selectors.
-func (c *nodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.NodeList{}
- err = c.client.Get().
- Resource("nodes").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested nodes.
-func (c *nodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("nodes").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any.
-func (c *nodes) Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (result *v1.Node, err error) {
- result = &v1.Node{}
- err = c.client.Post().
- Resource("nodes").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(node).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any.
-func (c *nodes) Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) {
- result = &v1.Node{}
- err = c.client.Put().
- Resource("nodes").
- Name(node.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(node).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *nodes) UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) {
- result = &v1.Node{}
- err = c.client.Put().
- Resource("nodes").
- Name(node.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(node).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the node and deletes it. Returns an error if one occurs.
-func (c *nodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("nodes").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *nodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("nodes").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched node.
-func (c *nodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) {
- result = &v1.Node{}
- err = c.client.Patch(pt).
- Resource("nodes").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied node.
-func (c *nodes) Apply(ctx context.Context, node *configv1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) {
- if node == nil {
- return nil, fmt.Errorf("node provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(node)
- if err != nil {
- return nil, err
- }
- name := node.Name
- if name == nil {
- return nil, fmt.Errorf("node.Name must be provided to Apply")
- }
- result = &v1.Node{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("nodes").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *nodes) ApplyStatus(ctx context.Context, node *configv1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) {
- if node == nil {
- return nil, fmt.Errorf("node provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(node)
- if err != nil {
- return nil, err
- }
-
- name := node.Name
- if name == nil {
- return nil, fmt.Errorf("node.Name must be provided to Apply")
- }
-
- result = &v1.Node{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("nodes").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go
index b418cc0469..d6f7814aac 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// OAuthsGetter has a method to return a OAuthInterface.
@@ -27,6 +24,7 @@ type OAuthsGetter interface {
type OAuthInterface interface {
Create(ctx context.Context, oAuth *v1.OAuth, opts metav1.CreateOptions) (*v1.OAuth, error)
Update(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (*v1.OAuth, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (*v1.OAuth, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type OAuthInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OAuth, err error)
Apply(ctx context.Context, oAuth *configv1.OAuthApplyConfiguration, opts metav1.ApplyOptions) (result *v1.OAuth, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, oAuth *configv1.OAuthApplyConfiguration, opts metav1.ApplyOptions) (result *v1.OAuth, err error)
OAuthExpansion
}
// oAuths implements OAuthInterface
type oAuths struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.OAuth, *v1.OAuthList, *configv1.OAuthApplyConfiguration]
}
// newOAuths returns a OAuths
func newOAuths(c *ConfigV1Client) *oAuths {
return &oAuths{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.OAuth, *v1.OAuthList, *configv1.OAuthApplyConfiguration](
+ "oauths",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.OAuth { return &v1.OAuth{} },
+ func() *v1.OAuthList { return &v1.OAuthList{} }),
}
}
-
-// Get takes name of the oAuth, and returns the corresponding oAuth object, and an error if there is any.
-func (c *oAuths) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OAuth, err error) {
- result = &v1.OAuth{}
- err = c.client.Get().
- Resource("oauths").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of OAuths that match those selectors.
-func (c *oAuths) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OAuthList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.OAuthList{}
- err = c.client.Get().
- Resource("oauths").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested oAuths.
-func (c *oAuths) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("oauths").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a oAuth and creates it. Returns the server's representation of the oAuth, and an error, if there is any.
-func (c *oAuths) Create(ctx context.Context, oAuth *v1.OAuth, opts metav1.CreateOptions) (result *v1.OAuth, err error) {
- result = &v1.OAuth{}
- err = c.client.Post().
- Resource("oauths").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(oAuth).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a oAuth and updates it. Returns the server's representation of the oAuth, and an error, if there is any.
-func (c *oAuths) Update(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (result *v1.OAuth, err error) {
- result = &v1.OAuth{}
- err = c.client.Put().
- Resource("oauths").
- Name(oAuth.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(oAuth).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *oAuths) UpdateStatus(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (result *v1.OAuth, err error) {
- result = &v1.OAuth{}
- err = c.client.Put().
- Resource("oauths").
- Name(oAuth.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(oAuth).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the oAuth and deletes it. Returns an error if one occurs.
-func (c *oAuths) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("oauths").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *oAuths) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("oauths").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched oAuth.
-func (c *oAuths) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OAuth, err error) {
- result = &v1.OAuth{}
- err = c.client.Patch(pt).
- Resource("oauths").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied oAuth.
-func (c *oAuths) Apply(ctx context.Context, oAuth *configv1.OAuthApplyConfiguration, opts metav1.ApplyOptions) (result *v1.OAuth, err error) {
- if oAuth == nil {
- return nil, fmt.Errorf("oAuth provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(oAuth)
- if err != nil {
- return nil, err
- }
- name := oAuth.Name
- if name == nil {
- return nil, fmt.Errorf("oAuth.Name must be provided to Apply")
- }
- result = &v1.OAuth{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("oauths").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *oAuths) ApplyStatus(ctx context.Context, oAuth *configv1.OAuthApplyConfiguration, opts metav1.ApplyOptions) (result *v1.OAuth, err error) {
- if oAuth == nil {
- return nil, fmt.Errorf("oAuth provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(oAuth)
- if err != nil {
- return nil, err
- }
-
- name := oAuth.Name
- if name == nil {
- return nil, fmt.Errorf("oAuth.Name must be provided to Apply")
- }
-
- result = &v1.OAuth{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("oauths").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/operatorhub.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/operatorhub.go
index 67b7e0f893..c8a2914861 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/operatorhub.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/operatorhub.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// OperatorHubsGetter has a method to return a OperatorHubInterface.
@@ -27,6 +24,7 @@ type OperatorHubsGetter interface {
type OperatorHubInterface interface {
Create(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.CreateOptions) (*v1.OperatorHub, error)
Update(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (*v1.OperatorHub, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (*v1.OperatorHub, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type OperatorHubInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OperatorHub, err error)
Apply(ctx context.Context, operatorHub *configv1.OperatorHubApplyConfiguration, opts metav1.ApplyOptions) (result *v1.OperatorHub, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, operatorHub *configv1.OperatorHubApplyConfiguration, opts metav1.ApplyOptions) (result *v1.OperatorHub, err error)
OperatorHubExpansion
}
// operatorHubs implements OperatorHubInterface
type operatorHubs struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.OperatorHub, *v1.OperatorHubList, *configv1.OperatorHubApplyConfiguration]
}
// newOperatorHubs returns a OperatorHubs
func newOperatorHubs(c *ConfigV1Client) *operatorHubs {
return &operatorHubs{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.OperatorHub, *v1.OperatorHubList, *configv1.OperatorHubApplyConfiguration](
+ "operatorhubs",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.OperatorHub { return &v1.OperatorHub{} },
+ func() *v1.OperatorHubList { return &v1.OperatorHubList{} }),
}
}
-
-// Get takes name of the operatorHub, and returns the corresponding operatorHub object, and an error if there is any.
-func (c *operatorHubs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OperatorHub, err error) {
- result = &v1.OperatorHub{}
- err = c.client.Get().
- Resource("operatorhubs").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of OperatorHubs that match those selectors.
-func (c *operatorHubs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OperatorHubList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.OperatorHubList{}
- err = c.client.Get().
- Resource("operatorhubs").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested operatorHubs.
-func (c *operatorHubs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("operatorhubs").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a operatorHub and creates it. Returns the server's representation of the operatorHub, and an error, if there is any.
-func (c *operatorHubs) Create(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.CreateOptions) (result *v1.OperatorHub, err error) {
- result = &v1.OperatorHub{}
- err = c.client.Post().
- Resource("operatorhubs").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(operatorHub).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a operatorHub and updates it. Returns the server's representation of the operatorHub, and an error, if there is any.
-func (c *operatorHubs) Update(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (result *v1.OperatorHub, err error) {
- result = &v1.OperatorHub{}
- err = c.client.Put().
- Resource("operatorhubs").
- Name(operatorHub.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(operatorHub).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *operatorHubs) UpdateStatus(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (result *v1.OperatorHub, err error) {
- result = &v1.OperatorHub{}
- err = c.client.Put().
- Resource("operatorhubs").
- Name(operatorHub.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(operatorHub).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the operatorHub and deletes it. Returns an error if one occurs.
-func (c *operatorHubs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("operatorhubs").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *operatorHubs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("operatorhubs").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched operatorHub.
-func (c *operatorHubs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OperatorHub, err error) {
- result = &v1.OperatorHub{}
- err = c.client.Patch(pt).
- Resource("operatorhubs").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied operatorHub.
-func (c *operatorHubs) Apply(ctx context.Context, operatorHub *configv1.OperatorHubApplyConfiguration, opts metav1.ApplyOptions) (result *v1.OperatorHub, err error) {
- if operatorHub == nil {
- return nil, fmt.Errorf("operatorHub provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(operatorHub)
- if err != nil {
- return nil, err
- }
- name := operatorHub.Name
- if name == nil {
- return nil, fmt.Errorf("operatorHub.Name must be provided to Apply")
- }
- result = &v1.OperatorHub{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("operatorhubs").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *operatorHubs) ApplyStatus(ctx context.Context, operatorHub *configv1.OperatorHubApplyConfiguration, opts metav1.ApplyOptions) (result *v1.OperatorHub, err error) {
- if operatorHub == nil {
- return nil, fmt.Errorf("operatorHub provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(operatorHub)
- if err != nil {
- return nil, err
- }
-
- name := operatorHub.Name
- if name == nil {
- return nil, fmt.Errorf("operatorHub.Name must be provided to Apply")
- }
-
- result = &v1.OperatorHub{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("operatorhubs").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go
index cada42734b..75cd01ec12 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ProjectsGetter has a method to return a ProjectInterface.
@@ -27,6 +24,7 @@ type ProjectsGetter interface {
type ProjectInterface interface {
Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (*v1.Project, error)
Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type ProjectInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error)
Apply(ctx context.Context, project *configv1.ProjectApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Project, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, project *configv1.ProjectApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Project, err error)
ProjectExpansion
}
// projects implements ProjectInterface
type projects struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Project, *v1.ProjectList, *configv1.ProjectApplyConfiguration]
}
// newProjects returns a Projects
func newProjects(c *ConfigV1Client) *projects {
return &projects{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Project, *v1.ProjectList, *configv1.ProjectApplyConfiguration](
+ "projects",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Project { return &v1.Project{} },
+ func() *v1.ProjectList { return &v1.ProjectList{} }),
}
}
-
-// Get takes name of the project, and returns the corresponding project object, and an error if there is any.
-func (c *projects) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Project, err error) {
- result = &v1.Project{}
- err = c.client.Get().
- Resource("projects").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Projects that match those selectors.
-func (c *projects) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ProjectList{}
- err = c.client.Get().
- Resource("projects").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested projects.
-func (c *projects) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("projects").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any.
-func (c *projects) Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (result *v1.Project, err error) {
- result = &v1.Project{}
- err = c.client.Post().
- Resource("projects").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(project).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any.
-func (c *projects) Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) {
- result = &v1.Project{}
- err = c.client.Put().
- Resource("projects").
- Name(project.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(project).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *projects) UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) {
- result = &v1.Project{}
- err = c.client.Put().
- Resource("projects").
- Name(project.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(project).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the project and deletes it. Returns an error if one occurs.
-func (c *projects) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("projects").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *projects) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("projects").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched project.
-func (c *projects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error) {
- result = &v1.Project{}
- err = c.client.Patch(pt).
- Resource("projects").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied project.
-func (c *projects) Apply(ctx context.Context, project *configv1.ProjectApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Project, err error) {
- if project == nil {
- return nil, fmt.Errorf("project provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(project)
- if err != nil {
- return nil, err
- }
- name := project.Name
- if name == nil {
- return nil, fmt.Errorf("project.Name must be provided to Apply")
- }
- result = &v1.Project{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("projects").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *projects) ApplyStatus(ctx context.Context, project *configv1.ProjectApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Project, err error) {
- if project == nil {
- return nil, fmt.Errorf("project provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(project)
- if err != nil {
- return nil, err
- }
-
- name := project.Name
- if name == nil {
- return nil, fmt.Errorf("project.Name must be provided to Apply")
- }
-
- result = &v1.Project{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("projects").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/proxy.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/proxy.go
index a187dc8fc7..dfa2b4d197 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/proxy.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/proxy.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ProxiesGetter has a method to return a ProxyInterface.
@@ -27,6 +24,7 @@ type ProxiesGetter interface {
type ProxyInterface interface {
Create(ctx context.Context, proxy *v1.Proxy, opts metav1.CreateOptions) (*v1.Proxy, error)
Update(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (*v1.Proxy, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (*v1.Proxy, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type ProxyInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Proxy, err error)
Apply(ctx context.Context, proxy *configv1.ProxyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Proxy, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, proxy *configv1.ProxyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Proxy, err error)
ProxyExpansion
}
// proxies implements ProxyInterface
type proxies struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Proxy, *v1.ProxyList, *configv1.ProxyApplyConfiguration]
}
// newProxies returns a Proxies
func newProxies(c *ConfigV1Client) *proxies {
return &proxies{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Proxy, *v1.ProxyList, *configv1.ProxyApplyConfiguration](
+ "proxies",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Proxy { return &v1.Proxy{} },
+ func() *v1.ProxyList { return &v1.ProxyList{} }),
}
}
-
-// Get takes name of the proxy, and returns the corresponding proxy object, and an error if there is any.
-func (c *proxies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Proxy, err error) {
- result = &v1.Proxy{}
- err = c.client.Get().
- Resource("proxies").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Proxies that match those selectors.
-func (c *proxies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProxyList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ProxyList{}
- err = c.client.Get().
- Resource("proxies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested proxies.
-func (c *proxies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("proxies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a proxy and creates it. Returns the server's representation of the proxy, and an error, if there is any.
-func (c *proxies) Create(ctx context.Context, proxy *v1.Proxy, opts metav1.CreateOptions) (result *v1.Proxy, err error) {
- result = &v1.Proxy{}
- err = c.client.Post().
- Resource("proxies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(proxy).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a proxy and updates it. Returns the server's representation of the proxy, and an error, if there is any.
-func (c *proxies) Update(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (result *v1.Proxy, err error) {
- result = &v1.Proxy{}
- err = c.client.Put().
- Resource("proxies").
- Name(proxy.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(proxy).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *proxies) UpdateStatus(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (result *v1.Proxy, err error) {
- result = &v1.Proxy{}
- err = c.client.Put().
- Resource("proxies").
- Name(proxy.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(proxy).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the proxy and deletes it. Returns an error if one occurs.
-func (c *proxies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("proxies").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *proxies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("proxies").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched proxy.
-func (c *proxies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Proxy, err error) {
- result = &v1.Proxy{}
- err = c.client.Patch(pt).
- Resource("proxies").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied proxy.
-func (c *proxies) Apply(ctx context.Context, proxy *configv1.ProxyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Proxy, err error) {
- if proxy == nil {
- return nil, fmt.Errorf("proxy provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(proxy)
- if err != nil {
- return nil, err
- }
- name := proxy.Name
- if name == nil {
- return nil, fmt.Errorf("proxy.Name must be provided to Apply")
- }
- result = &v1.Proxy{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("proxies").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *proxies) ApplyStatus(ctx context.Context, proxy *configv1.ProxyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Proxy, err error) {
- if proxy == nil {
- return nil, fmt.Errorf("proxy provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(proxy)
- if err != nil {
- return nil, err
- }
-
- name := proxy.Name
- if name == nil {
- return nil, fmt.Errorf("proxy.Name must be provided to Apply")
- }
-
- result = &v1.Proxy{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("proxies").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduler.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduler.go
index da67a4f061..7d459060ea 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduler.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduler.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/config/v1"
configv1 "github.com/openshift/client-go/config/applyconfigurations/config/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// SchedulersGetter has a method to return a SchedulerInterface.
@@ -27,6 +24,7 @@ type SchedulersGetter interface {
type SchedulerInterface interface {
Create(ctx context.Context, scheduler *v1.Scheduler, opts metav1.CreateOptions) (*v1.Scheduler, error)
Update(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (*v1.Scheduler, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (*v1.Scheduler, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,193 +33,25 @@ type SchedulerInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Scheduler, err error)
Apply(ctx context.Context, scheduler *configv1.SchedulerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Scheduler, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, scheduler *configv1.SchedulerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Scheduler, err error)
SchedulerExpansion
}
// schedulers implements SchedulerInterface
type schedulers struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Scheduler, *v1.SchedulerList, *configv1.SchedulerApplyConfiguration]
}
// newSchedulers returns a Schedulers
func newSchedulers(c *ConfigV1Client) *schedulers {
return &schedulers{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Scheduler, *v1.SchedulerList, *configv1.SchedulerApplyConfiguration](
+ "schedulers",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Scheduler { return &v1.Scheduler{} },
+ func() *v1.SchedulerList { return &v1.SchedulerList{} }),
}
}
-
-// Get takes name of the scheduler, and returns the corresponding scheduler object, and an error if there is any.
-func (c *schedulers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Scheduler, err error) {
- result = &v1.Scheduler{}
- err = c.client.Get().
- Resource("schedulers").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Schedulers that match those selectors.
-func (c *schedulers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SchedulerList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.SchedulerList{}
- err = c.client.Get().
- Resource("schedulers").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested schedulers.
-func (c *schedulers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("schedulers").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a scheduler and creates it. Returns the server's representation of the scheduler, and an error, if there is any.
-func (c *schedulers) Create(ctx context.Context, scheduler *v1.Scheduler, opts metav1.CreateOptions) (result *v1.Scheduler, err error) {
- result = &v1.Scheduler{}
- err = c.client.Post().
- Resource("schedulers").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(scheduler).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a scheduler and updates it. Returns the server's representation of the scheduler, and an error, if there is any.
-func (c *schedulers) Update(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (result *v1.Scheduler, err error) {
- result = &v1.Scheduler{}
- err = c.client.Put().
- Resource("schedulers").
- Name(scheduler.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(scheduler).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *schedulers) UpdateStatus(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (result *v1.Scheduler, err error) {
- result = &v1.Scheduler{}
- err = c.client.Put().
- Resource("schedulers").
- Name(scheduler.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(scheduler).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the scheduler and deletes it. Returns an error if one occurs.
-func (c *schedulers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("schedulers").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *schedulers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("schedulers").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched scheduler.
-func (c *schedulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Scheduler, err error) {
- result = &v1.Scheduler{}
- err = c.client.Patch(pt).
- Resource("schedulers").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied scheduler.
-func (c *schedulers) Apply(ctx context.Context, scheduler *configv1.SchedulerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Scheduler, err error) {
- if scheduler == nil {
- return nil, fmt.Errorf("scheduler provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(scheduler)
- if err != nil {
- return nil, err
- }
- name := scheduler.Name
- if name == nil {
- return nil, fmt.Errorf("scheduler.Name must be provided to Apply")
- }
- result = &v1.Scheduler{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("schedulers").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *schedulers) ApplyStatus(ctx context.Context, scheduler *configv1.SchedulerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Scheduler, err error) {
- if scheduler == nil {
- return nil, fmt.Errorf("scheduler provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(scheduler)
- if err != nil {
- return nil, err
- }
-
- name := scheduler.Name
- if name == nil {
- return nil, fmt.Errorf("scheduler.Name must be provided to Apply")
- }
-
- result = &v1.Scheduler{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("schedulers").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/backup.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/backup.go
index 8209afbb52..40ade83918 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/backup.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/backup.go
@@ -4,9 +4,6 @@ package v1alpha1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1alpha1 "github.com/openshift/api/config/v1alpha1"
configv1alpha1 "github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1"
@@ -14,7 +11,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// BackupsGetter has a method to return a BackupInterface.
@@ -27,6 +24,7 @@ type BackupsGetter interface {
type BackupInterface interface {
Create(ctx context.Context, backup *v1alpha1.Backup, opts v1.CreateOptions) (*v1alpha1.Backup, error)
Update(ctx context.Context, backup *v1alpha1.Backup, opts v1.UpdateOptions) (*v1alpha1.Backup, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, backup *v1alpha1.Backup, opts v1.UpdateOptions) (*v1alpha1.Backup, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@@ -35,193 +33,25 @@ type BackupInterface interface {
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Backup, err error)
Apply(ctx context.Context, backup *configv1alpha1.BackupApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Backup, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, backup *configv1alpha1.BackupApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Backup, err error)
BackupExpansion
}
// backups implements BackupInterface
type backups struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1alpha1.Backup, *v1alpha1.BackupList, *configv1alpha1.BackupApplyConfiguration]
}
// newBackups returns a Backups
func newBackups(c *ConfigV1alpha1Client) *backups {
return &backups{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1alpha1.Backup, *v1alpha1.BackupList, *configv1alpha1.BackupApplyConfiguration](
+ "backups",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1alpha1.Backup { return &v1alpha1.Backup{} },
+ func() *v1alpha1.BackupList { return &v1alpha1.BackupList{} }),
}
}
-
-// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any.
-func (c *backups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Backup, err error) {
- result = &v1alpha1.Backup{}
- err = c.client.Get().
- Resource("backups").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Backups that match those selectors.
-func (c *backups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BackupList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.BackupList{}
- err = c.client.Get().
- Resource("backups").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested backups.
-func (c *backups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("backups").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any.
-func (c *backups) Create(ctx context.Context, backup *v1alpha1.Backup, opts v1.CreateOptions) (result *v1alpha1.Backup, err error) {
- result = &v1alpha1.Backup{}
- err = c.client.Post().
- Resource("backups").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(backup).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any.
-func (c *backups) Update(ctx context.Context, backup *v1alpha1.Backup, opts v1.UpdateOptions) (result *v1alpha1.Backup, err error) {
- result = &v1alpha1.Backup{}
- err = c.client.Put().
- Resource("backups").
- Name(backup.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(backup).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *backups) UpdateStatus(ctx context.Context, backup *v1alpha1.Backup, opts v1.UpdateOptions) (result *v1alpha1.Backup, err error) {
- result = &v1alpha1.Backup{}
- err = c.client.Put().
- Resource("backups").
- Name(backup.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(backup).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the backup and deletes it. Returns an error if one occurs.
-func (c *backups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("backups").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *backups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("backups").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched backup.
-func (c *backups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Backup, err error) {
- result = &v1alpha1.Backup{}
- err = c.client.Patch(pt).
- Resource("backups").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied backup.
-func (c *backups) Apply(ctx context.Context, backup *configv1alpha1.BackupApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Backup, err error) {
- if backup == nil {
- return nil, fmt.Errorf("backup provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(backup)
- if err != nil {
- return nil, err
- }
- name := backup.Name
- if name == nil {
- return nil, fmt.Errorf("backup.Name must be provided to Apply")
- }
- result = &v1alpha1.Backup{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("backups").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *backups) ApplyStatus(ctx context.Context, backup *configv1alpha1.BackupApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Backup, err error) {
- if backup == nil {
- return nil, fmt.Errorf("backup provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(backup)
- if err != nil {
- return nil, err
- }
-
- name := backup.Name
- if name == nil {
- return nil, fmt.Errorf("backup.Name must be provided to Apply")
- }
-
- result = &v1alpha1.Backup{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("backups").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/clusterimagepolicy.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/clusterimagepolicy.go
index 89ed7717e4..508b3604bf 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/clusterimagepolicy.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/clusterimagepolicy.go
@@ -4,9 +4,6 @@ package v1alpha1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1alpha1 "github.com/openshift/api/config/v1alpha1"
configv1alpha1 "github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1"
@@ -14,7 +11,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ClusterImagePoliciesGetter has a method to return a ClusterImagePolicyInterface.
@@ -27,6 +24,7 @@ type ClusterImagePoliciesGetter interface {
type ClusterImagePolicyInterface interface {
Create(ctx context.Context, clusterImagePolicy *v1alpha1.ClusterImagePolicy, opts v1.CreateOptions) (*v1alpha1.ClusterImagePolicy, error)
Update(ctx context.Context, clusterImagePolicy *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, clusterImagePolicy *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@@ -35,193 +33,25 @@ type ClusterImagePolicyInterface interface {
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterImagePolicy, err error)
Apply(ctx context.Context, clusterImagePolicy *configv1alpha1.ClusterImagePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterImagePolicy, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, clusterImagePolicy *configv1alpha1.ClusterImagePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterImagePolicy, err error)
ClusterImagePolicyExpansion
}
// clusterImagePolicies implements ClusterImagePolicyInterface
type clusterImagePolicies struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1alpha1.ClusterImagePolicy, *v1alpha1.ClusterImagePolicyList, *configv1alpha1.ClusterImagePolicyApplyConfiguration]
}
// newClusterImagePolicies returns a ClusterImagePolicies
func newClusterImagePolicies(c *ConfigV1alpha1Client) *clusterImagePolicies {
return &clusterImagePolicies{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1alpha1.ClusterImagePolicy, *v1alpha1.ClusterImagePolicyList, *configv1alpha1.ClusterImagePolicyApplyConfiguration](
+ "clusterimagepolicies",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1alpha1.ClusterImagePolicy { return &v1alpha1.ClusterImagePolicy{} },
+ func() *v1alpha1.ClusterImagePolicyList { return &v1alpha1.ClusterImagePolicyList{} }),
}
}
-
-// Get takes name of the clusterImagePolicy, and returns the corresponding clusterImagePolicy object, and an error if there is any.
-func (c *clusterImagePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterImagePolicy, err error) {
- result = &v1alpha1.ClusterImagePolicy{}
- err = c.client.Get().
- Resource("clusterimagepolicies").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ClusterImagePolicies that match those selectors.
-func (c *clusterImagePolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterImagePolicyList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.ClusterImagePolicyList{}
- err = c.client.Get().
- Resource("clusterimagepolicies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested clusterImagePolicies.
-func (c *clusterImagePolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("clusterimagepolicies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a clusterImagePolicy and creates it. Returns the server's representation of the clusterImagePolicy, and an error, if there is any.
-func (c *clusterImagePolicies) Create(ctx context.Context, clusterImagePolicy *v1alpha1.ClusterImagePolicy, opts v1.CreateOptions) (result *v1alpha1.ClusterImagePolicy, err error) {
- result = &v1alpha1.ClusterImagePolicy{}
- err = c.client.Post().
- Resource("clusterimagepolicies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterImagePolicy).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a clusterImagePolicy and updates it. Returns the server's representation of the clusterImagePolicy, and an error, if there is any.
-func (c *clusterImagePolicies) Update(ctx context.Context, clusterImagePolicy *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (result *v1alpha1.ClusterImagePolicy, err error) {
- result = &v1alpha1.ClusterImagePolicy{}
- err = c.client.Put().
- Resource("clusterimagepolicies").
- Name(clusterImagePolicy.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterImagePolicy).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *clusterImagePolicies) UpdateStatus(ctx context.Context, clusterImagePolicy *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (result *v1alpha1.ClusterImagePolicy, err error) {
- result = &v1alpha1.ClusterImagePolicy{}
- err = c.client.Put().
- Resource("clusterimagepolicies").
- Name(clusterImagePolicy.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(clusterImagePolicy).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the clusterImagePolicy and deletes it. Returns an error if one occurs.
-func (c *clusterImagePolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("clusterimagepolicies").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *clusterImagePolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("clusterimagepolicies").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched clusterImagePolicy.
-func (c *clusterImagePolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterImagePolicy, err error) {
- result = &v1alpha1.ClusterImagePolicy{}
- err = c.client.Patch(pt).
- Resource("clusterimagepolicies").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied clusterImagePolicy.
-func (c *clusterImagePolicies) Apply(ctx context.Context, clusterImagePolicy *configv1alpha1.ClusterImagePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterImagePolicy, err error) {
- if clusterImagePolicy == nil {
- return nil, fmt.Errorf("clusterImagePolicy provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(clusterImagePolicy)
- if err != nil {
- return nil, err
- }
- name := clusterImagePolicy.Name
- if name == nil {
- return nil, fmt.Errorf("clusterImagePolicy.Name must be provided to Apply")
- }
- result = &v1alpha1.ClusterImagePolicy{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("clusterimagepolicies").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *clusterImagePolicies) ApplyStatus(ctx context.Context, clusterImagePolicy *configv1alpha1.ClusterImagePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterImagePolicy, err error) {
- if clusterImagePolicy == nil {
- return nil, fmt.Errorf("clusterImagePolicy provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(clusterImagePolicy)
- if err != nil {
- return nil, err
- }
-
- name := clusterImagePolicy.Name
- if name == nil {
- return nil, fmt.Errorf("clusterImagePolicy.Name must be provided to Apply")
- }
-
- result = &v1alpha1.ClusterImagePolicy{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("clusterimagepolicies").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_backup.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_backup.go
index 66bb50ab54..22e83601e2 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_backup.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_backup.go
@@ -27,20 +27,22 @@ var backupsKind = v1alpha1.SchemeGroupVersion.WithKind("Backup")
// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any.
func (c *FakeBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Backup, err error) {
+ emptyResult := &v1alpha1.Backup{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(backupsResource, name), &v1alpha1.Backup{})
+ Invokes(testing.NewRootGetActionWithOptions(backupsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.Backup), err
}
// List takes label and field selectors, and returns the list of Backups that match those selectors.
func (c *FakeBackups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BackupList, err error) {
+ emptyResult := &v1alpha1.BackupList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(backupsResource, backupsKind, opts), &v1alpha1.BackupList{})
+ Invokes(testing.NewRootListActionWithOptions(backupsResource, backupsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeBackups) List(ctx context.Context, opts v1.ListOptions) (result *v1
// Watch returns a watch.Interface that watches the requested backups.
func (c *FakeBackups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(backupsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(backupsResource, opts))
}
// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any.
func (c *FakeBackups) Create(ctx context.Context, backup *v1alpha1.Backup, opts v1.CreateOptions) (result *v1alpha1.Backup, err error) {
+ emptyResult := &v1alpha1.Backup{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(backupsResource, backup), &v1alpha1.Backup{})
+ Invokes(testing.NewRootCreateActionWithOptions(backupsResource, backup, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.Backup), err
}
// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any.
func (c *FakeBackups) Update(ctx context.Context, backup *v1alpha1.Backup, opts v1.UpdateOptions) (result *v1alpha1.Backup, err error) {
+ emptyResult := &v1alpha1.Backup{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(backupsResource, backup), &v1alpha1.Backup{})
+ Invokes(testing.NewRootUpdateActionWithOptions(backupsResource, backup, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.Backup), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeBackups) UpdateStatus(ctx context.Context, backup *v1alpha1.Backup, opts v1.UpdateOptions) (*v1alpha1.Backup, error) {
+func (c *FakeBackups) UpdateStatus(ctx context.Context, backup *v1alpha1.Backup, opts v1.UpdateOptions) (result *v1alpha1.Backup, err error) {
+ emptyResult := &v1alpha1.Backup{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(backupsResource, "status", backup), &v1alpha1.Backup{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(backupsResource, "status", backup, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.Backup), err
}
@@ -102,7 +107,7 @@ func (c *FakeBackups) Delete(ctx context.Context, name string, opts v1.DeleteOpt
// DeleteCollection deletes a collection of objects.
func (c *FakeBackups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(backupsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(backupsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.BackupList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeBackups) DeleteCollection(ctx context.Context, opts v1.DeleteOption
// Patch applies the patch and returns the patched backup.
func (c *FakeBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Backup, err error) {
+ emptyResult := &v1alpha1.Backup{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(backupsResource, name, pt, data, subresources...), &v1alpha1.Backup{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(backupsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.Backup), err
}
@@ -131,10 +137,11 @@ func (c *FakeBackups) Apply(ctx context.Context, backup *configv1alpha1.BackupAp
if name == nil {
return nil, fmt.Errorf("backup.Name must be provided to Apply")
}
+ emptyResult := &v1alpha1.Backup{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(backupsResource, *name, types.ApplyPatchType, data), &v1alpha1.Backup{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(backupsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.Backup), err
}
@@ -153,10 +160,11 @@ func (c *FakeBackups) ApplyStatus(ctx context.Context, backup *configv1alpha1.Ba
if name == nil {
return nil, fmt.Errorf("backup.Name must be provided to Apply")
}
+ emptyResult := &v1alpha1.Backup{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(backupsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.Backup{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(backupsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.Backup), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_clusterimagepolicy.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_clusterimagepolicy.go
index 3e3853c905..886f25a252 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_clusterimagepolicy.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_clusterimagepolicy.go
@@ -27,20 +27,22 @@ var clusterimagepoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterImag
// Get takes name of the clusterImagePolicy, and returns the corresponding clusterImagePolicy object, and an error if there is any.
func (c *FakeClusterImagePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterImagePolicy, err error) {
+ emptyResult := &v1alpha1.ClusterImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(clusterimagepoliciesResource, name), &v1alpha1.ClusterImagePolicy{})
+ Invokes(testing.NewRootGetActionWithOptions(clusterimagepoliciesResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterImagePolicy), err
}
// List takes label and field selectors, and returns the list of ClusterImagePolicies that match those selectors.
func (c *FakeClusterImagePolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterImagePolicyList, err error) {
+ emptyResult := &v1alpha1.ClusterImagePolicyList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(clusterimagepoliciesResource, clusterimagepoliciesKind, opts), &v1alpha1.ClusterImagePolicyList{})
+ Invokes(testing.NewRootListActionWithOptions(clusterimagepoliciesResource, clusterimagepoliciesKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeClusterImagePolicies) List(ctx context.Context, opts v1.ListOptions
// Watch returns a watch.Interface that watches the requested clusterImagePolicies.
func (c *FakeClusterImagePolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(clusterimagepoliciesResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(clusterimagepoliciesResource, opts))
}
// Create takes the representation of a clusterImagePolicy and creates it. Returns the server's representation of the clusterImagePolicy, and an error, if there is any.
func (c *FakeClusterImagePolicies) Create(ctx context.Context, clusterImagePolicy *v1alpha1.ClusterImagePolicy, opts v1.CreateOptions) (result *v1alpha1.ClusterImagePolicy, err error) {
+ emptyResult := &v1alpha1.ClusterImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(clusterimagepoliciesResource, clusterImagePolicy), &v1alpha1.ClusterImagePolicy{})
+ Invokes(testing.NewRootCreateActionWithOptions(clusterimagepoliciesResource, clusterImagePolicy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterImagePolicy), err
}
// Update takes the representation of a clusterImagePolicy and updates it. Returns the server's representation of the clusterImagePolicy, and an error, if there is any.
func (c *FakeClusterImagePolicies) Update(ctx context.Context, clusterImagePolicy *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (result *v1alpha1.ClusterImagePolicy, err error) {
+ emptyResult := &v1alpha1.ClusterImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(clusterimagepoliciesResource, clusterImagePolicy), &v1alpha1.ClusterImagePolicy{})
+ Invokes(testing.NewRootUpdateActionWithOptions(clusterimagepoliciesResource, clusterImagePolicy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterImagePolicy), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeClusterImagePolicies) UpdateStatus(ctx context.Context, clusterImagePolicy *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) {
+func (c *FakeClusterImagePolicies) UpdateStatus(ctx context.Context, clusterImagePolicy *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (result *v1alpha1.ClusterImagePolicy, err error) {
+ emptyResult := &v1alpha1.ClusterImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(clusterimagepoliciesResource, "status", clusterImagePolicy), &v1alpha1.ClusterImagePolicy{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clusterimagepoliciesResource, "status", clusterImagePolicy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterImagePolicy), err
}
@@ -102,7 +107,7 @@ func (c *FakeClusterImagePolicies) Delete(ctx context.Context, name string, opts
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterImagePolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(clusterimagepoliciesResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(clusterimagepoliciesResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterImagePolicyList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeClusterImagePolicies) DeleteCollection(ctx context.Context, opts v1
// Patch applies the patch and returns the patched clusterImagePolicy.
func (c *FakeClusterImagePolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterImagePolicy, err error) {
+ emptyResult := &v1alpha1.ClusterImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterimagepoliciesResource, name, pt, data, subresources...), &v1alpha1.ClusterImagePolicy{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterimagepoliciesResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterImagePolicy), err
}
@@ -131,10 +137,11 @@ func (c *FakeClusterImagePolicies) Apply(ctx context.Context, clusterImagePolicy
if name == nil {
return nil, fmt.Errorf("clusterImagePolicy.Name must be provided to Apply")
}
+ emptyResult := &v1alpha1.ClusterImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterimagepoliciesResource, *name, types.ApplyPatchType, data), &v1alpha1.ClusterImagePolicy{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterimagepoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterImagePolicy), err
}
@@ -153,10 +160,11 @@ func (c *FakeClusterImagePolicies) ApplyStatus(ctx context.Context, clusterImage
if name == nil {
return nil, fmt.Errorf("clusterImagePolicy.Name must be provided to Apply")
}
+ emptyResult := &v1alpha1.ClusterImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(clusterimagepoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.ClusterImagePolicy{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterimagepoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ClusterImagePolicy), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_imagepolicy.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_imagepolicy.go
index 7eb686af90..c7bf7d9e12 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_imagepolicy.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_imagepolicy.go
@@ -28,22 +28,24 @@ var imagepoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("ImagePolicy")
// Get takes name of the imagePolicy, and returns the corresponding imagePolicy object, and an error if there is any.
func (c *FakeImagePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ImagePolicy, err error) {
+ emptyResult := &v1alpha1.ImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewGetAction(imagepoliciesResource, c.ns, name), &v1alpha1.ImagePolicy{})
+ Invokes(testing.NewGetActionWithOptions(imagepoliciesResource, c.ns, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ImagePolicy), err
}
// List takes label and field selectors, and returns the list of ImagePolicies that match those selectors.
func (c *FakeImagePolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ImagePolicyList, err error) {
+ emptyResult := &v1alpha1.ImagePolicyList{}
obj, err := c.Fake.
- Invokes(testing.NewListAction(imagepoliciesResource, imagepoliciesKind, c.ns, opts), &v1alpha1.ImagePolicyList{})
+ Invokes(testing.NewListActionWithOptions(imagepoliciesResource, imagepoliciesKind, c.ns, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -62,40 +64,43 @@ func (c *FakeImagePolicies) List(ctx context.Context, opts v1.ListOptions) (resu
// Watch returns a watch.Interface that watches the requested imagePolicies.
func (c *FakeImagePolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewWatchAction(imagepoliciesResource, c.ns, opts))
+ InvokesWatch(testing.NewWatchActionWithOptions(imagepoliciesResource, c.ns, opts))
}
// Create takes the representation of a imagePolicy and creates it. Returns the server's representation of the imagePolicy, and an error, if there is any.
func (c *FakeImagePolicies) Create(ctx context.Context, imagePolicy *v1alpha1.ImagePolicy, opts v1.CreateOptions) (result *v1alpha1.ImagePolicy, err error) {
+ emptyResult := &v1alpha1.ImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(imagepoliciesResource, c.ns, imagePolicy), &v1alpha1.ImagePolicy{})
+ Invokes(testing.NewCreateActionWithOptions(imagepoliciesResource, c.ns, imagePolicy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ImagePolicy), err
}
// Update takes the representation of a imagePolicy and updates it. Returns the server's representation of the imagePolicy, and an error, if there is any.
func (c *FakeImagePolicies) Update(ctx context.Context, imagePolicy *v1alpha1.ImagePolicy, opts v1.UpdateOptions) (result *v1alpha1.ImagePolicy, err error) {
+ emptyResult := &v1alpha1.ImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(imagepoliciesResource, c.ns, imagePolicy), &v1alpha1.ImagePolicy{})
+ Invokes(testing.NewUpdateActionWithOptions(imagepoliciesResource, c.ns, imagePolicy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ImagePolicy), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeImagePolicies) UpdateStatus(ctx context.Context, imagePolicy *v1alpha1.ImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ImagePolicy, error) {
+func (c *FakeImagePolicies) UpdateStatus(ctx context.Context, imagePolicy *v1alpha1.ImagePolicy, opts v1.UpdateOptions) (result *v1alpha1.ImagePolicy, err error) {
+ emptyResult := &v1alpha1.ImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewUpdateSubresourceAction(imagepoliciesResource, "status", c.ns, imagePolicy), &v1alpha1.ImagePolicy{})
+ Invokes(testing.NewUpdateSubresourceActionWithOptions(imagepoliciesResource, "status", c.ns, imagePolicy, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ImagePolicy), err
}
@@ -110,7 +115,7 @@ func (c *FakeImagePolicies) Delete(ctx context.Context, name string, opts v1.Del
// DeleteCollection deletes a collection of objects.
func (c *FakeImagePolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(imagepoliciesResource, c.ns, listOpts)
+ action := testing.NewDeleteCollectionActionWithOptions(imagepoliciesResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ImagePolicyList{})
return err
@@ -118,11 +123,12 @@ func (c *FakeImagePolicies) DeleteCollection(ctx context.Context, opts v1.Delete
// Patch applies the patch and returns the patched imagePolicy.
func (c *FakeImagePolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ImagePolicy, err error) {
+ emptyResult := &v1alpha1.ImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(imagepoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha1.ImagePolicy{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(imagepoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ImagePolicy), err
}
@@ -140,11 +146,12 @@ func (c *FakeImagePolicies) Apply(ctx context.Context, imagePolicy *configv1alph
if name == nil {
return nil, fmt.Errorf("imagePolicy.Name must be provided to Apply")
}
+ emptyResult := &v1alpha1.ImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(imagepoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.ImagePolicy{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(imagepoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ImagePolicy), err
}
@@ -163,11 +170,12 @@ func (c *FakeImagePolicies) ApplyStatus(ctx context.Context, imagePolicy *config
if name == nil {
return nil, fmt.Errorf("imagePolicy.Name must be provided to Apply")
}
+ emptyResult := &v1alpha1.ImagePolicy{}
obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(imagepoliciesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.ImagePolicy{})
+ Invokes(testing.NewPatchSubresourceActionWithOptions(imagepoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.ImagePolicy), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_insightsdatagather.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_insightsdatagather.go
index 8450586e78..d3405fbce8 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_insightsdatagather.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/fake/fake_insightsdatagather.go
@@ -27,20 +27,22 @@ var insightsdatagathersKind = v1alpha1.SchemeGroupVersion.WithKind("InsightsData
// Get takes name of the insightsDataGather, and returns the corresponding insightsDataGather object, and an error if there is any.
func (c *FakeInsightsDataGathers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.InsightsDataGather, err error) {
+ emptyResult := &v1alpha1.InsightsDataGather{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(insightsdatagathersResource, name), &v1alpha1.InsightsDataGather{})
+ Invokes(testing.NewRootGetActionWithOptions(insightsdatagathersResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.InsightsDataGather), err
}
// List takes label and field selectors, and returns the list of InsightsDataGathers that match those selectors.
func (c *FakeInsightsDataGathers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.InsightsDataGatherList, err error) {
+ emptyResult := &v1alpha1.InsightsDataGatherList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(insightsdatagathersResource, insightsdatagathersKind, opts), &v1alpha1.InsightsDataGatherList{})
+ Invokes(testing.NewRootListActionWithOptions(insightsdatagathersResource, insightsdatagathersKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,36 +61,39 @@ func (c *FakeInsightsDataGathers) List(ctx context.Context, opts v1.ListOptions)
// Watch returns a watch.Interface that watches the requested insightsDataGathers.
func (c *FakeInsightsDataGathers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(insightsdatagathersResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(insightsdatagathersResource, opts))
}
// Create takes the representation of a insightsDataGather and creates it. Returns the server's representation of the insightsDataGather, and an error, if there is any.
func (c *FakeInsightsDataGathers) Create(ctx context.Context, insightsDataGather *v1alpha1.InsightsDataGather, opts v1.CreateOptions) (result *v1alpha1.InsightsDataGather, err error) {
+ emptyResult := &v1alpha1.InsightsDataGather{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(insightsdatagathersResource, insightsDataGather), &v1alpha1.InsightsDataGather{})
+ Invokes(testing.NewRootCreateActionWithOptions(insightsdatagathersResource, insightsDataGather, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.InsightsDataGather), err
}
// Update takes the representation of a insightsDataGather and updates it. Returns the server's representation of the insightsDataGather, and an error, if there is any.
func (c *FakeInsightsDataGathers) Update(ctx context.Context, insightsDataGather *v1alpha1.InsightsDataGather, opts v1.UpdateOptions) (result *v1alpha1.InsightsDataGather, err error) {
+ emptyResult := &v1alpha1.InsightsDataGather{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(insightsdatagathersResource, insightsDataGather), &v1alpha1.InsightsDataGather{})
+ Invokes(testing.NewRootUpdateActionWithOptions(insightsdatagathersResource, insightsDataGather, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.InsightsDataGather), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeInsightsDataGathers) UpdateStatus(ctx context.Context, insightsDataGather *v1alpha1.InsightsDataGather, opts v1.UpdateOptions) (*v1alpha1.InsightsDataGather, error) {
+func (c *FakeInsightsDataGathers) UpdateStatus(ctx context.Context, insightsDataGather *v1alpha1.InsightsDataGather, opts v1.UpdateOptions) (result *v1alpha1.InsightsDataGather, err error) {
+ emptyResult := &v1alpha1.InsightsDataGather{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateSubresourceAction(insightsdatagathersResource, "status", insightsDataGather), &v1alpha1.InsightsDataGather{})
+ Invokes(testing.NewRootUpdateSubresourceActionWithOptions(insightsdatagathersResource, "status", insightsDataGather, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.InsightsDataGather), err
}
@@ -102,7 +107,7 @@ func (c *FakeInsightsDataGathers) Delete(ctx context.Context, name string, opts
// DeleteCollection deletes a collection of objects.
func (c *FakeInsightsDataGathers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(insightsdatagathersResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(insightsdatagathersResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.InsightsDataGatherList{})
return err
@@ -110,10 +115,11 @@ func (c *FakeInsightsDataGathers) DeleteCollection(ctx context.Context, opts v1.
// Patch applies the patch and returns the patched insightsDataGather.
func (c *FakeInsightsDataGathers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.InsightsDataGather, err error) {
+ emptyResult := &v1alpha1.InsightsDataGather{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(insightsdatagathersResource, name, pt, data, subresources...), &v1alpha1.InsightsDataGather{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(insightsdatagathersResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.InsightsDataGather), err
}
@@ -131,10 +137,11 @@ func (c *FakeInsightsDataGathers) Apply(ctx context.Context, insightsDataGather
if name == nil {
return nil, fmt.Errorf("insightsDataGather.Name must be provided to Apply")
}
+ emptyResult := &v1alpha1.InsightsDataGather{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(insightsdatagathersResource, *name, types.ApplyPatchType, data), &v1alpha1.InsightsDataGather{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(insightsdatagathersResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.InsightsDataGather), err
}
@@ -153,10 +160,11 @@ func (c *FakeInsightsDataGathers) ApplyStatus(ctx context.Context, insightsDataG
if name == nil {
return nil, fmt.Errorf("insightsDataGather.Name must be provided to Apply")
}
+ emptyResult := &v1alpha1.InsightsDataGather{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(insightsdatagathersResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.InsightsDataGather{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(insightsdatagathersResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1alpha1.InsightsDataGather), err
}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/imagepolicy.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/imagepolicy.go
index a67969cf3b..02caded7ae 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/imagepolicy.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/imagepolicy.go
@@ -4,9 +4,6 @@ package v1alpha1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1alpha1 "github.com/openshift/api/config/v1alpha1"
configv1alpha1 "github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1"
@@ -14,7 +11,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImagePoliciesGetter has a method to return a ImagePolicyInterface.
@@ -27,6 +24,7 @@ type ImagePoliciesGetter interface {
type ImagePolicyInterface interface {
Create(ctx context.Context, imagePolicy *v1alpha1.ImagePolicy, opts v1.CreateOptions) (*v1alpha1.ImagePolicy, error)
Update(ctx context.Context, imagePolicy *v1alpha1.ImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ImagePolicy, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, imagePolicy *v1alpha1.ImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ImagePolicy, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@@ -35,206 +33,25 @@ type ImagePolicyInterface interface {
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ImagePolicy, err error)
Apply(ctx context.Context, imagePolicy *configv1alpha1.ImagePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ImagePolicy, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, imagePolicy *configv1alpha1.ImagePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ImagePolicy, err error)
ImagePolicyExpansion
}
// imagePolicies implements ImagePolicyInterface
type imagePolicies struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithListAndApply[*v1alpha1.ImagePolicy, *v1alpha1.ImagePolicyList, *configv1alpha1.ImagePolicyApplyConfiguration]
}
// newImagePolicies returns a ImagePolicies
func newImagePolicies(c *ConfigV1alpha1Client, namespace string) *imagePolicies {
return &imagePolicies{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithListAndApply[*v1alpha1.ImagePolicy, *v1alpha1.ImagePolicyList, *configv1alpha1.ImagePolicyApplyConfiguration](
+ "imagepolicies",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1alpha1.ImagePolicy { return &v1alpha1.ImagePolicy{} },
+ func() *v1alpha1.ImagePolicyList { return &v1alpha1.ImagePolicyList{} }),
}
}
-
-// Get takes name of the imagePolicy, and returns the corresponding imagePolicy object, and an error if there is any.
-func (c *imagePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ImagePolicy, err error) {
- result = &v1alpha1.ImagePolicy{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("imagepolicies").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ImagePolicies that match those selectors.
-func (c *imagePolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ImagePolicyList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.ImagePolicyList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("imagepolicies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested imagePolicies.
-func (c *imagePolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("imagepolicies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a imagePolicy and creates it. Returns the server's representation of the imagePolicy, and an error, if there is any.
-func (c *imagePolicies) Create(ctx context.Context, imagePolicy *v1alpha1.ImagePolicy, opts v1.CreateOptions) (result *v1alpha1.ImagePolicy, err error) {
- result = &v1alpha1.ImagePolicy{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("imagepolicies").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imagePolicy).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a imagePolicy and updates it. Returns the server's representation of the imagePolicy, and an error, if there is any.
-func (c *imagePolicies) Update(ctx context.Context, imagePolicy *v1alpha1.ImagePolicy, opts v1.UpdateOptions) (result *v1alpha1.ImagePolicy, err error) {
- result = &v1alpha1.ImagePolicy{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("imagepolicies").
- Name(imagePolicy.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imagePolicy).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *imagePolicies) UpdateStatus(ctx context.Context, imagePolicy *v1alpha1.ImagePolicy, opts v1.UpdateOptions) (result *v1alpha1.ImagePolicy, err error) {
- result = &v1alpha1.ImagePolicy{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("imagepolicies").
- Name(imagePolicy.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imagePolicy).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the imagePolicy and deletes it. Returns an error if one occurs.
-func (c *imagePolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("imagepolicies").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *imagePolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Namespace(c.ns).
- Resource("imagepolicies").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched imagePolicy.
-func (c *imagePolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ImagePolicy, err error) {
- result = &v1alpha1.ImagePolicy{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("imagepolicies").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied imagePolicy.
-func (c *imagePolicies) Apply(ctx context.Context, imagePolicy *configv1alpha1.ImagePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ImagePolicy, err error) {
- if imagePolicy == nil {
- return nil, fmt.Errorf("imagePolicy provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(imagePolicy)
- if err != nil {
- return nil, err
- }
- name := imagePolicy.Name
- if name == nil {
- return nil, fmt.Errorf("imagePolicy.Name must be provided to Apply")
- }
- result = &v1alpha1.ImagePolicy{}
- err = c.client.Patch(types.ApplyPatchType).
- Namespace(c.ns).
- Resource("imagepolicies").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *imagePolicies) ApplyStatus(ctx context.Context, imagePolicy *configv1alpha1.ImagePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ImagePolicy, err error) {
- if imagePolicy == nil {
- return nil, fmt.Errorf("imagePolicy provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(imagePolicy)
- if err != nil {
- return nil, err
- }
-
- name := imagePolicy.Name
- if name == nil {
- return nil, fmt.Errorf("imagePolicy.Name must be provided to Apply")
- }
-
- result = &v1alpha1.ImagePolicy{}
- err = c.client.Patch(types.ApplyPatchType).
- Namespace(c.ns).
- Resource("imagepolicies").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/insightsdatagather.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/insightsdatagather.go
index e3e66488a8..8f147bae11 100644
--- a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/insightsdatagather.go
+++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/insightsdatagather.go
@@ -4,9 +4,6 @@ package v1alpha1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1alpha1 "github.com/openshift/api/config/v1alpha1"
configv1alpha1 "github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1"
@@ -14,7 +11,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// InsightsDataGathersGetter has a method to return a InsightsDataGatherInterface.
@@ -27,6 +24,7 @@ type InsightsDataGathersGetter interface {
type InsightsDataGatherInterface interface {
Create(ctx context.Context, insightsDataGather *v1alpha1.InsightsDataGather, opts v1.CreateOptions) (*v1alpha1.InsightsDataGather, error)
Update(ctx context.Context, insightsDataGather *v1alpha1.InsightsDataGather, opts v1.UpdateOptions) (*v1alpha1.InsightsDataGather, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, insightsDataGather *v1alpha1.InsightsDataGather, opts v1.UpdateOptions) (*v1alpha1.InsightsDataGather, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
@@ -35,193 +33,25 @@ type InsightsDataGatherInterface interface {
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.InsightsDataGather, err error)
Apply(ctx context.Context, insightsDataGather *configv1alpha1.InsightsDataGatherApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.InsightsDataGather, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, insightsDataGather *configv1alpha1.InsightsDataGatherApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.InsightsDataGather, err error)
InsightsDataGatherExpansion
}
// insightsDataGathers implements InsightsDataGatherInterface
type insightsDataGathers struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1alpha1.InsightsDataGather, *v1alpha1.InsightsDataGatherList, *configv1alpha1.InsightsDataGatherApplyConfiguration]
}
// newInsightsDataGathers returns a InsightsDataGathers
func newInsightsDataGathers(c *ConfigV1alpha1Client) *insightsDataGathers {
return &insightsDataGathers{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1alpha1.InsightsDataGather, *v1alpha1.InsightsDataGatherList, *configv1alpha1.InsightsDataGatherApplyConfiguration](
+ "insightsdatagathers",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1alpha1.InsightsDataGather { return &v1alpha1.InsightsDataGather{} },
+ func() *v1alpha1.InsightsDataGatherList { return &v1alpha1.InsightsDataGatherList{} }),
}
}
-
-// Get takes name of the insightsDataGather, and returns the corresponding insightsDataGather object, and an error if there is any.
-func (c *insightsDataGathers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.InsightsDataGather, err error) {
- result = &v1alpha1.InsightsDataGather{}
- err = c.client.Get().
- Resource("insightsdatagathers").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of InsightsDataGathers that match those selectors.
-func (c *insightsDataGathers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.InsightsDataGatherList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1alpha1.InsightsDataGatherList{}
- err = c.client.Get().
- Resource("insightsdatagathers").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested insightsDataGathers.
-func (c *insightsDataGathers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("insightsdatagathers").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a insightsDataGather and creates it. Returns the server's representation of the insightsDataGather, and an error, if there is any.
-func (c *insightsDataGathers) Create(ctx context.Context, insightsDataGather *v1alpha1.InsightsDataGather, opts v1.CreateOptions) (result *v1alpha1.InsightsDataGather, err error) {
- result = &v1alpha1.InsightsDataGather{}
- err = c.client.Post().
- Resource("insightsdatagathers").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(insightsDataGather).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a insightsDataGather and updates it. Returns the server's representation of the insightsDataGather, and an error, if there is any.
-func (c *insightsDataGathers) Update(ctx context.Context, insightsDataGather *v1alpha1.InsightsDataGather, opts v1.UpdateOptions) (result *v1alpha1.InsightsDataGather, err error) {
- result = &v1alpha1.InsightsDataGather{}
- err = c.client.Put().
- Resource("insightsdatagathers").
- Name(insightsDataGather.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(insightsDataGather).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *insightsDataGathers) UpdateStatus(ctx context.Context, insightsDataGather *v1alpha1.InsightsDataGather, opts v1.UpdateOptions) (result *v1alpha1.InsightsDataGather, err error) {
- result = &v1alpha1.InsightsDataGather{}
- err = c.client.Put().
- Resource("insightsdatagathers").
- Name(insightsDataGather.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(insightsDataGather).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the insightsDataGather and deletes it. Returns an error if one occurs.
-func (c *insightsDataGathers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
- return c.client.Delete().
- Resource("insightsdatagathers").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *insightsDataGathers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("insightsdatagathers").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched insightsDataGather.
-func (c *insightsDataGathers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.InsightsDataGather, err error) {
- result = &v1alpha1.InsightsDataGather{}
- err = c.client.Patch(pt).
- Resource("insightsdatagathers").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied insightsDataGather.
-func (c *insightsDataGathers) Apply(ctx context.Context, insightsDataGather *configv1alpha1.InsightsDataGatherApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.InsightsDataGather, err error) {
- if insightsDataGather == nil {
- return nil, fmt.Errorf("insightsDataGather provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(insightsDataGather)
- if err != nil {
- return nil, err
- }
- name := insightsDataGather.Name
- if name == nil {
- return nil, fmt.Errorf("insightsDataGather.Name must be provided to Apply")
- }
- result = &v1alpha1.InsightsDataGather{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("insightsdatagathers").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *insightsDataGathers) ApplyStatus(ctx context.Context, insightsDataGather *configv1alpha1.InsightsDataGatherApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.InsightsDataGather, err error) {
- if insightsDataGather == nil {
- return nil, fmt.Errorf("insightsDataGather provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(insightsDataGather)
- if err != nil {
- return nil, err
- }
-
- name := insightsDataGather.Name
- if name == nil {
- return nil, fmt.Errorf("insightsDataGather.Name must be provided to Apply")
- }
-
- result = &v1alpha1.InsightsDataGather{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("insightsdatagathers").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/factory.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/factory.go
index 0607e96c87..2ecff4860a 100644
--- a/vendor/github.com/openshift/client-go/config/informers/externalversions/factory.go
+++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/factory.go
@@ -212,6 +212,7 @@ type SharedInformerFactory interface {
// Start initializes all requested informers. They are handled in goroutines
// which run until the stop channel gets closed.
+ // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync.
Start(stopCh <-chan struct{})
// Shutdown marks a factory as shutting down. At that point no new
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/apiserver.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/apiserver.go
index 247e40017b..456d544063 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/apiserver.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/apiserver.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type APIServerLister interface {
// aPIServerLister implements the APIServerLister interface.
type aPIServerLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.APIServer]
}
// NewAPIServerLister returns a new APIServerLister.
func NewAPIServerLister(indexer cache.Indexer) APIServerLister {
- return &aPIServerLister{indexer: indexer}
-}
-
-// List lists all APIServers in the indexer.
-func (s *aPIServerLister) List(selector labels.Selector) (ret []*v1.APIServer, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.APIServer))
- })
- return ret, err
-}
-
-// Get retrieves the APIServer from the index for a given name.
-func (s *aPIServerLister) Get(name string) (*v1.APIServer, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("apiserver"), name)
- }
- return obj.(*v1.APIServer), nil
+ return &aPIServerLister{listers.New[*v1.APIServer](indexer, v1.Resource("apiserver"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/authentication.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/authentication.go
index 99cc824851..c048da0e1b 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/authentication.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/authentication.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type AuthenticationLister interface {
// authenticationLister implements the AuthenticationLister interface.
type authenticationLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Authentication]
}
// NewAuthenticationLister returns a new AuthenticationLister.
func NewAuthenticationLister(indexer cache.Indexer) AuthenticationLister {
- return &authenticationLister{indexer: indexer}
-}
-
-// List lists all Authentications in the indexer.
-func (s *authenticationLister) List(selector labels.Selector) (ret []*v1.Authentication, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Authentication))
- })
- return ret, err
-}
-
-// Get retrieves the Authentication from the index for a given name.
-func (s *authenticationLister) Get(name string) (*v1.Authentication, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("authentication"), name)
- }
- return obj.(*v1.Authentication), nil
+ return &authenticationLister{listers.New[*v1.Authentication](indexer, v1.Resource("authentication"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/build.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/build.go
index 77a1a36ff8..c4fcae5d9c 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/build.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/build.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type BuildLister interface {
// buildLister implements the BuildLister interface.
type buildLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Build]
}
// NewBuildLister returns a new BuildLister.
func NewBuildLister(indexer cache.Indexer) BuildLister {
- return &buildLister{indexer: indexer}
-}
-
-// List lists all Builds in the indexer.
-func (s *buildLister) List(selector labels.Selector) (ret []*v1.Build, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Build))
- })
- return ret, err
-}
-
-// Get retrieves the Build from the index for a given name.
-func (s *buildLister) Get(name string) (*v1.Build, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("build"), name)
- }
- return obj.(*v1.Build), nil
+ return &buildLister{listers.New[*v1.Build](indexer, v1.Resource("build"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/clusteroperator.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/clusteroperator.go
index e4c95773a0..d9ba7e8aab 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/clusteroperator.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/clusteroperator.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type ClusterOperatorLister interface {
// clusterOperatorLister implements the ClusterOperatorLister interface.
type clusterOperatorLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.ClusterOperator]
}
// NewClusterOperatorLister returns a new ClusterOperatorLister.
func NewClusterOperatorLister(indexer cache.Indexer) ClusterOperatorLister {
- return &clusterOperatorLister{indexer: indexer}
-}
-
-// List lists all ClusterOperators in the indexer.
-func (s *clusterOperatorLister) List(selector labels.Selector) (ret []*v1.ClusterOperator, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.ClusterOperator))
- })
- return ret, err
-}
-
-// Get retrieves the ClusterOperator from the index for a given name.
-func (s *clusterOperatorLister) Get(name string) (*v1.ClusterOperator, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("clusteroperator"), name)
- }
- return obj.(*v1.ClusterOperator), nil
+ return &clusterOperatorLister{listers.New[*v1.ClusterOperator](indexer, v1.Resource("clusteroperator"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/clusterversion.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/clusterversion.go
index ab309a1b20..d052480907 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/clusterversion.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/clusterversion.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type ClusterVersionLister interface {
// clusterVersionLister implements the ClusterVersionLister interface.
type clusterVersionLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.ClusterVersion]
}
// NewClusterVersionLister returns a new ClusterVersionLister.
func NewClusterVersionLister(indexer cache.Indexer) ClusterVersionLister {
- return &clusterVersionLister{indexer: indexer}
-}
-
-// List lists all ClusterVersions in the indexer.
-func (s *clusterVersionLister) List(selector labels.Selector) (ret []*v1.ClusterVersion, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.ClusterVersion))
- })
- return ret, err
-}
-
-// Get retrieves the ClusterVersion from the index for a given name.
-func (s *clusterVersionLister) Get(name string) (*v1.ClusterVersion, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("clusterversion"), name)
- }
- return obj.(*v1.ClusterVersion), nil
+ return &clusterVersionLister{listers.New[*v1.ClusterVersion](indexer, v1.Resource("clusterversion"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/console.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/console.go
index daaf7aa92f..192798555c 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/console.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/console.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type ConsoleLister interface {
// consoleLister implements the ConsoleLister interface.
type consoleLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Console]
}
// NewConsoleLister returns a new ConsoleLister.
func NewConsoleLister(indexer cache.Indexer) ConsoleLister {
- return &consoleLister{indexer: indexer}
-}
-
-// List lists all Consoles in the indexer.
-func (s *consoleLister) List(selector labels.Selector) (ret []*v1.Console, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Console))
- })
- return ret, err
-}
-
-// Get retrieves the Console from the index for a given name.
-func (s *consoleLister) Get(name string) (*v1.Console, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("console"), name)
- }
- return obj.(*v1.Console), nil
+ return &consoleLister{listers.New[*v1.Console](indexer, v1.Resource("console"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/dns.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/dns.go
index 89441b3a9d..85dd5e4baf 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/dns.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/dns.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type DNSLister interface {
// dNSLister implements the DNSLister interface.
type dNSLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.DNS]
}
// NewDNSLister returns a new DNSLister.
func NewDNSLister(indexer cache.Indexer) DNSLister {
- return &dNSLister{indexer: indexer}
-}
-
-// List lists all DNSes in the indexer.
-func (s *dNSLister) List(selector labels.Selector) (ret []*v1.DNS, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.DNS))
- })
- return ret, err
-}
-
-// Get retrieves the DNS from the index for a given name.
-func (s *dNSLister) Get(name string) (*v1.DNS, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("dns"), name)
- }
- return obj.(*v1.DNS), nil
+ return &dNSLister{listers.New[*v1.DNS](indexer, v1.Resource("dns"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/featuregate.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/featuregate.go
index 4c796e80ff..a2bcacff60 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/featuregate.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/featuregate.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type FeatureGateLister interface {
// featureGateLister implements the FeatureGateLister interface.
type featureGateLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.FeatureGate]
}
// NewFeatureGateLister returns a new FeatureGateLister.
func NewFeatureGateLister(indexer cache.Indexer) FeatureGateLister {
- return &featureGateLister{indexer: indexer}
-}
-
-// List lists all FeatureGates in the indexer.
-func (s *featureGateLister) List(selector labels.Selector) (ret []*v1.FeatureGate, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.FeatureGate))
- })
- return ret, err
-}
-
-// Get retrieves the FeatureGate from the index for a given name.
-func (s *featureGateLister) Get(name string) (*v1.FeatureGate, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("featuregate"), name)
- }
- return obj.(*v1.FeatureGate), nil
+ return &featureGateLister{listers.New[*v1.FeatureGate](indexer, v1.Resource("featuregate"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/image.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/image.go
index f563f919a4..908753f35c 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/image.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/image.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type ImageLister interface {
// imageLister implements the ImageLister interface.
type imageLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Image]
}
// NewImageLister returns a new ImageLister.
func NewImageLister(indexer cache.Indexer) ImageLister {
- return &imageLister{indexer: indexer}
-}
-
-// List lists all Images in the indexer.
-func (s *imageLister) List(selector labels.Selector) (ret []*v1.Image, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Image))
- })
- return ret, err
-}
-
-// Get retrieves the Image from the index for a given name.
-func (s *imageLister) Get(name string) (*v1.Image, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("image"), name)
- }
- return obj.(*v1.Image), nil
+ return &imageLister{listers.New[*v1.Image](indexer, v1.Resource("image"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/imagecontentpolicy.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/imagecontentpolicy.go
index c9dadb9235..edad83a7b2 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/imagecontentpolicy.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/imagecontentpolicy.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type ImageContentPolicyLister interface {
// imageContentPolicyLister implements the ImageContentPolicyLister interface.
type imageContentPolicyLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.ImageContentPolicy]
}
// NewImageContentPolicyLister returns a new ImageContentPolicyLister.
func NewImageContentPolicyLister(indexer cache.Indexer) ImageContentPolicyLister {
- return &imageContentPolicyLister{indexer: indexer}
-}
-
-// List lists all ImageContentPolicies in the indexer.
-func (s *imageContentPolicyLister) List(selector labels.Selector) (ret []*v1.ImageContentPolicy, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.ImageContentPolicy))
- })
- return ret, err
-}
-
-// Get retrieves the ImageContentPolicy from the index for a given name.
-func (s *imageContentPolicyLister) Get(name string) (*v1.ImageContentPolicy, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("imagecontentpolicy"), name)
- }
- return obj.(*v1.ImageContentPolicy), nil
+ return &imageContentPolicyLister{listers.New[*v1.ImageContentPolicy](indexer, v1.Resource("imagecontentpolicy"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/imagedigestmirrorset.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/imagedigestmirrorset.go
index 03c0e72d2d..6639b7cc0b 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/imagedigestmirrorset.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/imagedigestmirrorset.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type ImageDigestMirrorSetLister interface {
// imageDigestMirrorSetLister implements the ImageDigestMirrorSetLister interface.
type imageDigestMirrorSetLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.ImageDigestMirrorSet]
}
// NewImageDigestMirrorSetLister returns a new ImageDigestMirrorSetLister.
func NewImageDigestMirrorSetLister(indexer cache.Indexer) ImageDigestMirrorSetLister {
- return &imageDigestMirrorSetLister{indexer: indexer}
-}
-
-// List lists all ImageDigestMirrorSets in the indexer.
-func (s *imageDigestMirrorSetLister) List(selector labels.Selector) (ret []*v1.ImageDigestMirrorSet, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.ImageDigestMirrorSet))
- })
- return ret, err
-}
-
-// Get retrieves the ImageDigestMirrorSet from the index for a given name.
-func (s *imageDigestMirrorSetLister) Get(name string) (*v1.ImageDigestMirrorSet, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("imagedigestmirrorset"), name)
- }
- return obj.(*v1.ImageDigestMirrorSet), nil
+ return &imageDigestMirrorSetLister{listers.New[*v1.ImageDigestMirrorSet](indexer, v1.Resource("imagedigestmirrorset"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/imagetagmirrorset.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/imagetagmirrorset.go
index 57b4431c02..8605b7e786 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/imagetagmirrorset.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/imagetagmirrorset.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type ImageTagMirrorSetLister interface {
// imageTagMirrorSetLister implements the ImageTagMirrorSetLister interface.
type imageTagMirrorSetLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.ImageTagMirrorSet]
}
// NewImageTagMirrorSetLister returns a new ImageTagMirrorSetLister.
func NewImageTagMirrorSetLister(indexer cache.Indexer) ImageTagMirrorSetLister {
- return &imageTagMirrorSetLister{indexer: indexer}
-}
-
-// List lists all ImageTagMirrorSets in the indexer.
-func (s *imageTagMirrorSetLister) List(selector labels.Selector) (ret []*v1.ImageTagMirrorSet, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.ImageTagMirrorSet))
- })
- return ret, err
-}
-
-// Get retrieves the ImageTagMirrorSet from the index for a given name.
-func (s *imageTagMirrorSetLister) Get(name string) (*v1.ImageTagMirrorSet, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("imagetagmirrorset"), name)
- }
- return obj.(*v1.ImageTagMirrorSet), nil
+ return &imageTagMirrorSetLister{listers.New[*v1.ImageTagMirrorSet](indexer, v1.Resource("imagetagmirrorset"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/infrastructure.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/infrastructure.go
index 33f4b229e2..db1e7725a9 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/infrastructure.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/infrastructure.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type InfrastructureLister interface {
// infrastructureLister implements the InfrastructureLister interface.
type infrastructureLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Infrastructure]
}
// NewInfrastructureLister returns a new InfrastructureLister.
func NewInfrastructureLister(indexer cache.Indexer) InfrastructureLister {
- return &infrastructureLister{indexer: indexer}
-}
-
-// List lists all Infrastructures in the indexer.
-func (s *infrastructureLister) List(selector labels.Selector) (ret []*v1.Infrastructure, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Infrastructure))
- })
- return ret, err
-}
-
-// Get retrieves the Infrastructure from the index for a given name.
-func (s *infrastructureLister) Get(name string) (*v1.Infrastructure, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("infrastructure"), name)
- }
- return obj.(*v1.Infrastructure), nil
+ return &infrastructureLister{listers.New[*v1.Infrastructure](indexer, v1.Resource("infrastructure"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/ingress.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/ingress.go
index 78b0fd1254..de29c3f1aa 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/ingress.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/ingress.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type IngressLister interface {
// ingressLister implements the IngressLister interface.
type ingressLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Ingress]
}
// NewIngressLister returns a new IngressLister.
func NewIngressLister(indexer cache.Indexer) IngressLister {
- return &ingressLister{indexer: indexer}
-}
-
-// List lists all Ingresses in the indexer.
-func (s *ingressLister) List(selector labels.Selector) (ret []*v1.Ingress, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Ingress))
- })
- return ret, err
-}
-
-// Get retrieves the Ingress from the index for a given name.
-func (s *ingressLister) Get(name string) (*v1.Ingress, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("ingress"), name)
- }
- return obj.(*v1.Ingress), nil
+ return &ingressLister{listers.New[*v1.Ingress](indexer, v1.Resource("ingress"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/network.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/network.go
index 174fdb45b7..d71892d6c0 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/network.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/network.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type NetworkLister interface {
// networkLister implements the NetworkLister interface.
type networkLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Network]
}
// NewNetworkLister returns a new NetworkLister.
func NewNetworkLister(indexer cache.Indexer) NetworkLister {
- return &networkLister{indexer: indexer}
-}
-
-// List lists all Networks in the indexer.
-func (s *networkLister) List(selector labels.Selector) (ret []*v1.Network, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Network))
- })
- return ret, err
-}
-
-// Get retrieves the Network from the index for a given name.
-func (s *networkLister) Get(name string) (*v1.Network, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("network"), name)
- }
- return obj.(*v1.Network), nil
+ return &networkLister{listers.New[*v1.Network](indexer, v1.Resource("network"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/node.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/node.go
index b35c27117d..08e3236703 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/node.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/node.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type NodeLister interface {
// nodeLister implements the NodeLister interface.
type nodeLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Node]
}
// NewNodeLister returns a new NodeLister.
func NewNodeLister(indexer cache.Indexer) NodeLister {
- return &nodeLister{indexer: indexer}
-}
-
-// List lists all Nodes in the indexer.
-func (s *nodeLister) List(selector labels.Selector) (ret []*v1.Node, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Node))
- })
- return ret, err
-}
-
-// Get retrieves the Node from the index for a given name.
-func (s *nodeLister) Get(name string) (*v1.Node, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("node"), name)
- }
- return obj.(*v1.Node), nil
+ return &nodeLister{listers.New[*v1.Node](indexer, v1.Resource("node"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/oauth.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/oauth.go
index 8d9882471b..abfa6cc2a5 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/oauth.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/oauth.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type OAuthLister interface {
// oAuthLister implements the OAuthLister interface.
type oAuthLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.OAuth]
}
// NewOAuthLister returns a new OAuthLister.
func NewOAuthLister(indexer cache.Indexer) OAuthLister {
- return &oAuthLister{indexer: indexer}
-}
-
-// List lists all OAuths in the indexer.
-func (s *oAuthLister) List(selector labels.Selector) (ret []*v1.OAuth, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.OAuth))
- })
- return ret, err
-}
-
-// Get retrieves the OAuth from the index for a given name.
-func (s *oAuthLister) Get(name string) (*v1.OAuth, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("oauth"), name)
- }
- return obj.(*v1.OAuth), nil
+ return &oAuthLister{listers.New[*v1.OAuth](indexer, v1.Resource("oauth"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/operatorhub.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/operatorhub.go
index b69a49471c..e4b0e47122 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/operatorhub.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/operatorhub.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type OperatorHubLister interface {
// operatorHubLister implements the OperatorHubLister interface.
type operatorHubLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.OperatorHub]
}
// NewOperatorHubLister returns a new OperatorHubLister.
func NewOperatorHubLister(indexer cache.Indexer) OperatorHubLister {
- return &operatorHubLister{indexer: indexer}
-}
-
-// List lists all OperatorHubs in the indexer.
-func (s *operatorHubLister) List(selector labels.Selector) (ret []*v1.OperatorHub, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.OperatorHub))
- })
- return ret, err
-}
-
-// Get retrieves the OperatorHub from the index for a given name.
-func (s *operatorHubLister) Get(name string) (*v1.OperatorHub, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("operatorhub"), name)
- }
- return obj.(*v1.OperatorHub), nil
+ return &operatorHubLister{listers.New[*v1.OperatorHub](indexer, v1.Resource("operatorhub"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/project.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/project.go
index 30273ba6be..67a1ee3234 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/project.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/project.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type ProjectLister interface {
// projectLister implements the ProjectLister interface.
type projectLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Project]
}
// NewProjectLister returns a new ProjectLister.
func NewProjectLister(indexer cache.Indexer) ProjectLister {
- return &projectLister{indexer: indexer}
-}
-
-// List lists all Projects in the indexer.
-func (s *projectLister) List(selector labels.Selector) (ret []*v1.Project, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Project))
- })
- return ret, err
-}
-
-// Get retrieves the Project from the index for a given name.
-func (s *projectLister) Get(name string) (*v1.Project, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("project"), name)
- }
- return obj.(*v1.Project), nil
+ return &projectLister{listers.New[*v1.Project](indexer, v1.Resource("project"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/proxy.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/proxy.go
index 8ecb633c3e..39837c2f6f 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/proxy.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/proxy.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type ProxyLister interface {
// proxyLister implements the ProxyLister interface.
type proxyLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Proxy]
}
// NewProxyLister returns a new ProxyLister.
func NewProxyLister(indexer cache.Indexer) ProxyLister {
- return &proxyLister{indexer: indexer}
-}
-
-// List lists all Proxies in the indexer.
-func (s *proxyLister) List(selector labels.Selector) (ret []*v1.Proxy, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Proxy))
- })
- return ret, err
-}
-
-// Get retrieves the Proxy from the index for a given name.
-func (s *proxyLister) Get(name string) (*v1.Proxy, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("proxy"), name)
- }
- return obj.(*v1.Proxy), nil
+ return &proxyLister{listers.New[*v1.Proxy](indexer, v1.Resource("proxy"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/scheduler.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/scheduler.go
index 3e2f81ea44..6f95e0254a 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1/scheduler.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/scheduler.go
@@ -4,8 +4,8 @@ package v1
import (
v1 "github.com/openshift/api/config/v1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type SchedulerLister interface {
// schedulerLister implements the SchedulerLister interface.
type schedulerLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1.Scheduler]
}
// NewSchedulerLister returns a new SchedulerLister.
func NewSchedulerLister(indexer cache.Indexer) SchedulerLister {
- return &schedulerLister{indexer: indexer}
-}
-
-// List lists all Schedulers in the indexer.
-func (s *schedulerLister) List(selector labels.Selector) (ret []*v1.Scheduler, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1.Scheduler))
- })
- return ret, err
-}
-
-// Get retrieves the Scheduler from the index for a given name.
-func (s *schedulerLister) Get(name string) (*v1.Scheduler, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1.Resource("scheduler"), name)
- }
- return obj.(*v1.Scheduler), nil
+ return &schedulerLister{listers.New[*v1.Scheduler](indexer, v1.Resource("scheduler"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/backup.go b/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/backup.go
index 0ee7bee660..c7d3ba5466 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/backup.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/backup.go
@@ -4,8 +4,8 @@ package v1alpha1
import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type BackupLister interface {
// backupLister implements the BackupLister interface.
type backupLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1alpha1.Backup]
}
// NewBackupLister returns a new BackupLister.
func NewBackupLister(indexer cache.Indexer) BackupLister {
- return &backupLister{indexer: indexer}
-}
-
-// List lists all Backups in the indexer.
-func (s *backupLister) List(selector labels.Selector) (ret []*v1alpha1.Backup, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.Backup))
- })
- return ret, err
-}
-
-// Get retrieves the Backup from the index for a given name.
-func (s *backupLister) Get(name string) (*v1alpha1.Backup, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1alpha1.Resource("backup"), name)
- }
- return obj.(*v1alpha1.Backup), nil
+ return &backupLister{listers.New[*v1alpha1.Backup](indexer, v1alpha1.Resource("backup"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/clusterimagepolicy.go b/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/clusterimagepolicy.go
index 80fe45e1ef..ab909818ee 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/clusterimagepolicy.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/clusterimagepolicy.go
@@ -4,8 +4,8 @@ package v1alpha1
import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type ClusterImagePolicyLister interface {
// clusterImagePolicyLister implements the ClusterImagePolicyLister interface.
type clusterImagePolicyLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1alpha1.ClusterImagePolicy]
}
// NewClusterImagePolicyLister returns a new ClusterImagePolicyLister.
func NewClusterImagePolicyLister(indexer cache.Indexer) ClusterImagePolicyLister {
- return &clusterImagePolicyLister{indexer: indexer}
-}
-
-// List lists all ClusterImagePolicies in the indexer.
-func (s *clusterImagePolicyLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterImagePolicy, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.ClusterImagePolicy))
- })
- return ret, err
-}
-
-// Get retrieves the ClusterImagePolicy from the index for a given name.
-func (s *clusterImagePolicyLister) Get(name string) (*v1alpha1.ClusterImagePolicy, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1alpha1.Resource("clusterimagepolicy"), name)
- }
- return obj.(*v1alpha1.ClusterImagePolicy), nil
+ return &clusterImagePolicyLister{listers.New[*v1alpha1.ClusterImagePolicy](indexer, v1alpha1.Resource("clusterimagepolicy"))}
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/imagepolicy.go b/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/imagepolicy.go
index 4071711abc..e5aa271616 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/imagepolicy.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/imagepolicy.go
@@ -4,8 +4,8 @@ package v1alpha1
import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -22,25 +22,17 @@ type ImagePolicyLister interface {
// imagePolicyLister implements the ImagePolicyLister interface.
type imagePolicyLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1alpha1.ImagePolicy]
}
// NewImagePolicyLister returns a new ImagePolicyLister.
func NewImagePolicyLister(indexer cache.Indexer) ImagePolicyLister {
- return &imagePolicyLister{indexer: indexer}
-}
-
-// List lists all ImagePolicies in the indexer.
-func (s *imagePolicyLister) List(selector labels.Selector) (ret []*v1alpha1.ImagePolicy, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.ImagePolicy))
- })
- return ret, err
+ return &imagePolicyLister{listers.New[*v1alpha1.ImagePolicy](indexer, v1alpha1.Resource("imagepolicy"))}
}
// ImagePolicies returns an object that can list and get ImagePolicies.
func (s *imagePolicyLister) ImagePolicies(namespace string) ImagePolicyNamespaceLister {
- return imagePolicyNamespaceLister{indexer: s.indexer, namespace: namespace}
+ return imagePolicyNamespaceLister{listers.NewNamespaced[*v1alpha1.ImagePolicy](s.ResourceIndexer, namespace)}
}
// ImagePolicyNamespaceLister helps list and get ImagePolicies.
@@ -58,26 +50,5 @@ type ImagePolicyNamespaceLister interface {
// imagePolicyNamespaceLister implements the ImagePolicyNamespaceLister
// interface.
type imagePolicyNamespaceLister struct {
- indexer cache.Indexer
- namespace string
-}
-
-// List lists all ImagePolicies in the indexer for a given namespace.
-func (s imagePolicyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ImagePolicy, err error) {
- err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.ImagePolicy))
- })
- return ret, err
-}
-
-// Get retrieves the ImagePolicy from the indexer for a given namespace and name.
-func (s imagePolicyNamespaceLister) Get(name string) (*v1alpha1.ImagePolicy, error) {
- obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1alpha1.Resource("imagepolicy"), name)
- }
- return obj.(*v1alpha1.ImagePolicy), nil
+ listers.ResourceIndexer[*v1alpha1.ImagePolicy]
}
diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/insightsdatagather.go b/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/insightsdatagather.go
index 887f066e40..4885030b91 100644
--- a/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/insightsdatagather.go
+++ b/vendor/github.com/openshift/client-go/config/listers/config/v1alpha1/insightsdatagather.go
@@ -4,8 +4,8 @@ package v1alpha1
import (
v1alpha1 "github.com/openshift/api/config/v1alpha1"
- "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/listers"
"k8s.io/client-go/tools/cache"
)
@@ -23,30 +23,10 @@ type InsightsDataGatherLister interface {
// insightsDataGatherLister implements the InsightsDataGatherLister interface.
type insightsDataGatherLister struct {
- indexer cache.Indexer
+ listers.ResourceIndexer[*v1alpha1.InsightsDataGather]
}
// NewInsightsDataGatherLister returns a new InsightsDataGatherLister.
func NewInsightsDataGatherLister(indexer cache.Indexer) InsightsDataGatherLister {
- return &insightsDataGatherLister{indexer: indexer}
-}
-
-// List lists all InsightsDataGathers in the indexer.
-func (s *insightsDataGatherLister) List(selector labels.Selector) (ret []*v1alpha1.InsightsDataGather, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.InsightsDataGather))
- })
- return ret, err
-}
-
-// Get retrieves the InsightsDataGather from the index for a given name.
-func (s *insightsDataGatherLister) Get(name string) (*v1alpha1.InsightsDataGather, error) {
- obj, exists, err := s.indexer.GetByKey(name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1alpha1.Resource("insightsdatagather"), name)
- }
- return obj.(*v1alpha1.InsightsDataGather), nil
+ return &insightsDataGatherLister{listers.New[*v1alpha1.InsightsDataGather](indexer, v1alpha1.Resource("insightsdatagather"))}
}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/image.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/image.go
index a18bea3155..baddceac6c 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/image.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/image.go
@@ -12,7 +12,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ImageApplyConfiguration represents an declarative configuration of the Image type for use
+// ImageApplyConfiguration represents a declarative configuration of the Image type for use
// with apply.
type ImageApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -29,7 +29,7 @@ type ImageApplyConfiguration struct {
DockerImageManifests []ImageManifestApplyConfiguration `json:"dockerImageManifests,omitempty"`
}
-// Image constructs an declarative configuration of the Image type for use with
+// Image constructs a declarative configuration of the Image type for use with
// apply.
func Image(name string) *ImageApplyConfiguration {
b := &ImageApplyConfiguration{}
@@ -328,3 +328,9 @@ func (b *ImageApplyConfiguration) WithDockerImageManifests(values ...*ImageManif
}
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ImageApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagelayer.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagelayer.go
index e03e79a315..09dc0f931f 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagelayer.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagelayer.go
@@ -2,7 +2,7 @@
package v1
-// ImageLayerApplyConfiguration represents an declarative configuration of the ImageLayer type for use
+// ImageLayerApplyConfiguration represents a declarative configuration of the ImageLayer type for use
// with apply.
type ImageLayerApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -10,7 +10,7 @@ type ImageLayerApplyConfiguration struct {
MediaType *string `json:"mediaType,omitempty"`
}
-// ImageLayerApplyConfiguration constructs an declarative configuration of the ImageLayer type for use with
+// ImageLayerApplyConfiguration constructs a declarative configuration of the ImageLayer type for use with
// apply.
func ImageLayer() *ImageLayerApplyConfiguration {
return &ImageLayerApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagelookuppolicy.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagelookuppolicy.go
index db4336f308..ecc95d10b1 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagelookuppolicy.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagelookuppolicy.go
@@ -2,13 +2,13 @@
package v1
-// ImageLookupPolicyApplyConfiguration represents an declarative configuration of the ImageLookupPolicy type for use
+// ImageLookupPolicyApplyConfiguration represents a declarative configuration of the ImageLookupPolicy type for use
// with apply.
type ImageLookupPolicyApplyConfiguration struct {
Local *bool `json:"local,omitempty"`
}
-// ImageLookupPolicyApplyConfiguration constructs an declarative configuration of the ImageLookupPolicy type for use with
+// ImageLookupPolicyApplyConfiguration constructs a declarative configuration of the ImageLookupPolicy type for use with
// apply.
func ImageLookupPolicy() *ImageLookupPolicyApplyConfiguration {
return &ImageLookupPolicyApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagemanifest.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagemanifest.go
index 34f0ac8eeb..5368f96a66 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagemanifest.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagemanifest.go
@@ -2,7 +2,7 @@
package v1
-// ImageManifestApplyConfiguration represents an declarative configuration of the ImageManifest type for use
+// ImageManifestApplyConfiguration represents a declarative configuration of the ImageManifest type for use
// with apply.
type ImageManifestApplyConfiguration struct {
Digest *string `json:"digest,omitempty"`
@@ -13,7 +13,7 @@ type ImageManifestApplyConfiguration struct {
Variant *string `json:"variant,omitempty"`
}
-// ImageManifestApplyConfiguration constructs an declarative configuration of the ImageManifest type for use with
+// ImageManifestApplyConfiguration constructs a declarative configuration of the ImageManifest type for use with
// apply.
func ImageManifest() *ImageManifestApplyConfiguration {
return &ImageManifestApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagesignature.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagesignature.go
index f3995b240b..d12f832660 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagesignature.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagesignature.go
@@ -8,7 +8,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ImageSignatureApplyConfiguration represents an declarative configuration of the ImageSignature type for use
+// ImageSignatureApplyConfiguration represents a declarative configuration of the ImageSignature type for use
// with apply.
type ImageSignatureApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -23,7 +23,7 @@ type ImageSignatureApplyConfiguration struct {
IssuedTo *SignatureSubjectApplyConfiguration `json:"issuedTo,omitempty"`
}
-// ImageSignature constructs an declarative configuration of the ImageSignature type for use with
+// ImageSignature constructs a declarative configuration of the ImageSignature type for use with
// apply.
func ImageSignature(name string) *ImageSignatureApplyConfiguration {
b := &ImageSignatureApplyConfiguration{}
@@ -267,3 +267,9 @@ func (b *ImageSignatureApplyConfiguration) WithIssuedTo(value *SignatureSubjectA
b.IssuedTo = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ImageSignatureApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestream.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestream.go
index 0d72f0cf8d..d003455851 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestream.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestream.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ImageStreamApplyConfiguration represents an declarative configuration of the ImageStream type for use
+// ImageStreamApplyConfiguration represents a declarative configuration of the ImageStream type for use
// with apply.
type ImageStreamApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ImageStreamApplyConfiguration struct {
Status *ImageStreamStatusApplyConfiguration `json:"status,omitempty"`
}
-// ImageStream constructs an declarative configuration of the ImageStream type for use with
+// ImageStream constructs a declarative configuration of the ImageStream type for use with
// apply.
func ImageStream(name, namespace string) *ImageStreamApplyConfiguration {
b := &ImageStreamApplyConfiguration{}
@@ -240,3 +240,9 @@ func (b *ImageStreamApplyConfiguration) WithStatus(value *ImageStreamStatusApply
b.Status = value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ImageStreamApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreammapping.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreammapping.go
index 627b657f14..56a1e24fce 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreammapping.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreammapping.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// ImageStreamMappingApplyConfiguration represents an declarative configuration of the ImageStreamMapping type for use
+// ImageStreamMappingApplyConfiguration represents a declarative configuration of the ImageStreamMapping type for use
// with apply.
type ImageStreamMappingApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type ImageStreamMappingApplyConfiguration struct {
Tag *string `json:"tag,omitempty"`
}
-// ImageStreamMapping constructs an declarative configuration of the ImageStreamMapping type for use with
+// ImageStreamMapping constructs a declarative configuration of the ImageStreamMapping type for use with
// apply.
func ImageStreamMapping(name, namespace string) *ImageStreamMappingApplyConfiguration {
b := &ImageStreamMappingApplyConfiguration{}
@@ -240,3 +240,9 @@ func (b *ImageStreamMappingApplyConfiguration) WithTag(value string) *ImageStrea
b.Tag = &value
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ImageStreamMappingApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreamspec.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreamspec.go
index 5239862b74..09d777f173 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreamspec.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreamspec.go
@@ -2,7 +2,7 @@
package v1
-// ImageStreamSpecApplyConfiguration represents an declarative configuration of the ImageStreamSpec type for use
+// ImageStreamSpecApplyConfiguration represents a declarative configuration of the ImageStreamSpec type for use
// with apply.
type ImageStreamSpecApplyConfiguration struct {
LookupPolicy *ImageLookupPolicyApplyConfiguration `json:"lookupPolicy,omitempty"`
@@ -10,7 +10,7 @@ type ImageStreamSpecApplyConfiguration struct {
Tags []TagReferenceApplyConfiguration `json:"tags,omitempty"`
}
-// ImageStreamSpecApplyConfiguration constructs an declarative configuration of the ImageStreamSpec type for use with
+// ImageStreamSpecApplyConfiguration constructs a declarative configuration of the ImageStreamSpec type for use with
// apply.
func ImageStreamSpec() *ImageStreamSpecApplyConfiguration {
return &ImageStreamSpecApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreamstatus.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreamstatus.go
index 4035e77879..e2ab24aa8c 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreamstatus.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/imagestreamstatus.go
@@ -2,7 +2,7 @@
package v1
-// ImageStreamStatusApplyConfiguration represents an declarative configuration of the ImageStreamStatus type for use
+// ImageStreamStatusApplyConfiguration represents a declarative configuration of the ImageStreamStatus type for use
// with apply.
type ImageStreamStatusApplyConfiguration struct {
DockerImageRepository *string `json:"dockerImageRepository,omitempty"`
@@ -10,7 +10,7 @@ type ImageStreamStatusApplyConfiguration struct {
Tags []NamedTagEventListApplyConfiguration `json:"tags,omitempty"`
}
-// ImageStreamStatusApplyConfiguration constructs an declarative configuration of the ImageStreamStatus type for use with
+// ImageStreamStatusApplyConfiguration constructs a declarative configuration of the ImageStreamStatus type for use with
// apply.
func ImageStreamStatus() *ImageStreamStatusApplyConfiguration {
return &ImageStreamStatusApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/namedtageventlist.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/namedtageventlist.go
index 9c00746eda..92b096aad0 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/namedtageventlist.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/namedtageventlist.go
@@ -2,7 +2,7 @@
package v1
-// NamedTagEventListApplyConfiguration represents an declarative configuration of the NamedTagEventList type for use
+// NamedTagEventListApplyConfiguration represents a declarative configuration of the NamedTagEventList type for use
// with apply.
type NamedTagEventListApplyConfiguration struct {
Tag *string `json:"tag,omitempty"`
@@ -10,7 +10,7 @@ type NamedTagEventListApplyConfiguration struct {
Conditions []TagEventConditionApplyConfiguration `json:"conditions,omitempty"`
}
-// NamedTagEventListApplyConfiguration constructs an declarative configuration of the NamedTagEventList type for use with
+// NamedTagEventListApplyConfiguration constructs a declarative configuration of the NamedTagEventList type for use with
// apply.
func NamedTagEventList() *NamedTagEventListApplyConfiguration {
return &NamedTagEventListApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturecondition.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturecondition.go
index 5b98b799b0..23f05b9c4d 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturecondition.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturecondition.go
@@ -8,7 +8,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// SignatureConditionApplyConfiguration represents an declarative configuration of the SignatureCondition type for use
+// SignatureConditionApplyConfiguration represents a declarative configuration of the SignatureCondition type for use
// with apply.
type SignatureConditionApplyConfiguration struct {
Type *v1.SignatureConditionType `json:"type,omitempty"`
@@ -19,7 +19,7 @@ type SignatureConditionApplyConfiguration struct {
Message *string `json:"message,omitempty"`
}
-// SignatureConditionApplyConfiguration constructs an declarative configuration of the SignatureCondition type for use with
+// SignatureConditionApplyConfiguration constructs a declarative configuration of the SignatureCondition type for use with
// apply.
func SignatureCondition() *SignatureConditionApplyConfiguration {
return &SignatureConditionApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturegenericentity.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturegenericentity.go
index ab0b0faaa6..1e40e2ab19 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturegenericentity.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturegenericentity.go
@@ -2,14 +2,14 @@
package v1
-// SignatureGenericEntityApplyConfiguration represents an declarative configuration of the SignatureGenericEntity type for use
+// SignatureGenericEntityApplyConfiguration represents a declarative configuration of the SignatureGenericEntity type for use
// with apply.
type SignatureGenericEntityApplyConfiguration struct {
Organization *string `json:"organization,omitempty"`
CommonName *string `json:"commonName,omitempty"`
}
-// SignatureGenericEntityApplyConfiguration constructs an declarative configuration of the SignatureGenericEntity type for use with
+// SignatureGenericEntityApplyConfiguration constructs a declarative configuration of the SignatureGenericEntity type for use with
// apply.
func SignatureGenericEntity() *SignatureGenericEntityApplyConfiguration {
return &SignatureGenericEntityApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signatureissuer.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signatureissuer.go
index 7b7f7fdccd..3ec7c7bbda 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signatureissuer.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signatureissuer.go
@@ -2,13 +2,13 @@
package v1
-// SignatureIssuerApplyConfiguration represents an declarative configuration of the SignatureIssuer type for use
+// SignatureIssuerApplyConfiguration represents a declarative configuration of the SignatureIssuer type for use
// with apply.
type SignatureIssuerApplyConfiguration struct {
SignatureGenericEntityApplyConfiguration `json:",inline"`
}
-// SignatureIssuerApplyConfiguration constructs an declarative configuration of the SignatureIssuer type for use with
+// SignatureIssuerApplyConfiguration constructs a declarative configuration of the SignatureIssuer type for use with
// apply.
func SignatureIssuer() *SignatureIssuerApplyConfiguration {
return &SignatureIssuerApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturesubject.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturesubject.go
index 9ce1519759..3506d98a84 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturesubject.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/signaturesubject.go
@@ -2,14 +2,14 @@
package v1
-// SignatureSubjectApplyConfiguration represents an declarative configuration of the SignatureSubject type for use
+// SignatureSubjectApplyConfiguration represents a declarative configuration of the SignatureSubject type for use
// with apply.
type SignatureSubjectApplyConfiguration struct {
SignatureGenericEntityApplyConfiguration `json:",inline"`
PublicKeyID *string `json:"publicKeyID,omitempty"`
}
-// SignatureSubjectApplyConfiguration constructs an declarative configuration of the SignatureSubject type for use with
+// SignatureSubjectApplyConfiguration constructs a declarative configuration of the SignatureSubject type for use with
// apply.
func SignatureSubject() *SignatureSubjectApplyConfiguration {
return &SignatureSubjectApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagevent.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagevent.go
index cc7722e2d5..0187ab87a5 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagevent.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagevent.go
@@ -6,7 +6,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// TagEventApplyConfiguration represents an declarative configuration of the TagEvent type for use
+// TagEventApplyConfiguration represents a declarative configuration of the TagEvent type for use
// with apply.
type TagEventApplyConfiguration struct {
Created *v1.Time `json:"created,omitempty"`
@@ -15,7 +15,7 @@ type TagEventApplyConfiguration struct {
Generation *int64 `json:"generation,omitempty"`
}
-// TagEventApplyConfiguration constructs an declarative configuration of the TagEvent type for use with
+// TagEventApplyConfiguration constructs a declarative configuration of the TagEvent type for use with
// apply.
func TagEvent() *TagEventApplyConfiguration {
return &TagEventApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tageventcondition.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tageventcondition.go
index 107560f1f1..b25af86456 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tageventcondition.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tageventcondition.go
@@ -8,7 +8,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// TagEventConditionApplyConfiguration represents an declarative configuration of the TagEventCondition type for use
+// TagEventConditionApplyConfiguration represents a declarative configuration of the TagEventCondition type for use
// with apply.
type TagEventConditionApplyConfiguration struct {
Type *v1.TagEventConditionType `json:"type,omitempty"`
@@ -19,7 +19,7 @@ type TagEventConditionApplyConfiguration struct {
Generation *int64 `json:"generation,omitempty"`
}
-// TagEventConditionApplyConfiguration constructs an declarative configuration of the TagEventCondition type for use with
+// TagEventConditionApplyConfiguration constructs a declarative configuration of the TagEventCondition type for use with
// apply.
func TagEventCondition() *TagEventConditionApplyConfiguration {
return &TagEventConditionApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagimportpolicy.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagimportpolicy.go
index bb1f7e4d6a..1ce15353d5 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagimportpolicy.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagimportpolicy.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/image/v1"
)
-// TagImportPolicyApplyConfiguration represents an declarative configuration of the TagImportPolicy type for use
+// TagImportPolicyApplyConfiguration represents a declarative configuration of the TagImportPolicy type for use
// with apply.
type TagImportPolicyApplyConfiguration struct {
Insecure *bool `json:"insecure,omitempty"`
@@ -14,7 +14,7 @@ type TagImportPolicyApplyConfiguration struct {
ImportMode *v1.ImportModeType `json:"importMode,omitempty"`
}
-// TagImportPolicyApplyConfiguration constructs an declarative configuration of the TagImportPolicy type for use with
+// TagImportPolicyApplyConfiguration constructs a declarative configuration of the TagImportPolicy type for use with
// apply.
func TagImportPolicy() *TagImportPolicyApplyConfiguration {
return &TagImportPolicyApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagreference.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagreference.go
index 77c6e11636..3ec958d374 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagreference.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagreference.go
@@ -6,7 +6,7 @@ import (
v1 "k8s.io/api/core/v1"
)
-// TagReferenceApplyConfiguration represents an declarative configuration of the TagReference type for use
+// TagReferenceApplyConfiguration represents a declarative configuration of the TagReference type for use
// with apply.
type TagReferenceApplyConfiguration struct {
Name *string `json:"name,omitempty"`
@@ -18,7 +18,7 @@ type TagReferenceApplyConfiguration struct {
ReferencePolicy *TagReferencePolicyApplyConfiguration `json:"referencePolicy,omitempty"`
}
-// TagReferenceApplyConfiguration constructs an declarative configuration of the TagReference type for use with
+// TagReferenceApplyConfiguration constructs a declarative configuration of the TagReference type for use with
// apply.
func TagReference() *TagReferenceApplyConfiguration {
return &TagReferenceApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagreferencepolicy.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagreferencepolicy.go
index 4476d00998..06d739753c 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagreferencepolicy.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/image/v1/tagreferencepolicy.go
@@ -6,13 +6,13 @@ import (
v1 "github.com/openshift/api/image/v1"
)
-// TagReferencePolicyApplyConfiguration represents an declarative configuration of the TagReferencePolicy type for use
+// TagReferencePolicyApplyConfiguration represents a declarative configuration of the TagReferencePolicy type for use
// with apply.
type TagReferencePolicyApplyConfiguration struct {
Type *v1.TagReferencePolicyType `json:"type,omitempty"`
}
-// TagReferencePolicyApplyConfiguration constructs an declarative configuration of the TagReferencePolicy type for use with
+// TagReferencePolicyApplyConfiguration constructs a declarative configuration of the TagReferencePolicy type for use with
// apply.
func TagReferencePolicy() *TagReferencePolicyApplyConfiguration {
return &TagReferencePolicyApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/image/applyconfigurations/internal/internal.go b/vendor/github.com/openshift/client-go/image/applyconfigurations/internal/internal.go
index c3ab732d7f..a66912f382 100644
--- a/vendor/github.com/openshift/client-go/image/applyconfigurations/internal/internal.go
+++ b/vendor/github.com/openshift/client-go/image/applyconfigurations/internal/internal.go
@@ -53,7 +53,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: dockerImageMetadata
type:
namedType: __untyped_atomic_
- default: {}
- name: dockerImageMetadataVersion
type:
scalar: string
@@ -277,11 +276,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: lastProbeTime
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
- default: {}
- name: lastTransitionTime
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
- default: {}
- name: message
type:
scalar: string
@@ -324,7 +321,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: created
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
- default: {}
- name: dockerImageReference
type:
scalar: string
@@ -347,7 +343,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: lastTransitionTime
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
- default: {}
- name: message
type:
scalar: string
@@ -482,7 +477,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: creationTimestamp
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
- default: {}
- name: deletionGracePeriodSeconds
type:
scalar: numeric
diff --git a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/image.go b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/image.go
index b65e75e36a..5cf011812d 100644
--- a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/image.go
+++ b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/image.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/image/v1"
imagev1 "github.com/openshift/client-go/image/applyconfigurations/image/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImagesGetter has a method to return a ImageInterface.
@@ -39,143 +36,18 @@ type ImageInterface interface {
// images implements ImageInterface
type images struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.Image, *v1.ImageList, *imagev1.ImageApplyConfiguration]
}
// newImages returns a Images
func newImages(c *ImageV1Client) *images {
return &images{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.Image, *v1.ImageList, *imagev1.ImageApplyConfiguration](
+ "images",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.Image { return &v1.Image{} },
+ func() *v1.ImageList { return &v1.ImageList{} }),
}
}
-
-// Get takes name of the image, and returns the corresponding image object, and an error if there is any.
-func (c *images) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Image, err error) {
- result = &v1.Image{}
- err = c.client.Get().
- Resource("images").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Images that match those selectors.
-func (c *images) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ImageList{}
- err = c.client.Get().
- Resource("images").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested images.
-func (c *images) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("images").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a image and creates it. Returns the server's representation of the image, and an error, if there is any.
-func (c *images) Create(ctx context.Context, image *v1.Image, opts metav1.CreateOptions) (result *v1.Image, err error) {
- result = &v1.Image{}
- err = c.client.Post().
- Resource("images").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(image).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a image and updates it. Returns the server's representation of the image, and an error, if there is any.
-func (c *images) Update(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (result *v1.Image, err error) {
- result = &v1.Image{}
- err = c.client.Put().
- Resource("images").
- Name(image.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(image).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the image and deletes it. Returns an error if one occurs.
-func (c *images) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("images").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *images) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("images").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched image.
-func (c *images) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Image, err error) {
- result = &v1.Image{}
- err = c.client.Patch(pt).
- Resource("images").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied image.
-func (c *images) Apply(ctx context.Context, image *imagev1.ImageApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Image, err error) {
- if image == nil {
- return nil, fmt.Errorf("image provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(image)
- if err != nil {
- return nil, err
- }
- name := image.Name
- if name == nil {
- return nil, fmt.Errorf("image.Name must be provided to Apply")
- }
- result = &v1.Image{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("images").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagesignature.go b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagesignature.go
index 195b8f3717..8e643c9242 100644
--- a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagesignature.go
+++ b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagesignature.go
@@ -8,7 +8,7 @@ import (
v1 "github.com/openshift/api/image/v1"
scheme "github.com/openshift/client-go/image/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImageSignaturesGetter has a method to return a ImageSignatureInterface.
@@ -26,34 +26,17 @@ type ImageSignatureInterface interface {
// imageSignatures implements ImageSignatureInterface
type imageSignatures struct {
- client rest.Interface
+ *gentype.Client[*v1.ImageSignature]
}
// newImageSignatures returns a ImageSignatures
func newImageSignatures(c *ImageV1Client) *imageSignatures {
return &imageSignatures{
- client: c.RESTClient(),
+ gentype.NewClient[*v1.ImageSignature](
+ "imagesignatures",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.ImageSignature { return &v1.ImageSignature{} }),
}
}
-
-// Create takes the representation of a imageSignature and creates it. Returns the server's representation of the imageSignature, and an error, if there is any.
-func (c *imageSignatures) Create(ctx context.Context, imageSignature *v1.ImageSignature, opts metav1.CreateOptions) (result *v1.ImageSignature, err error) {
- result = &v1.ImageSignature{}
- err = c.client.Post().
- Resource("imagesignatures").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageSignature).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the imageSignature and deletes it. Returns an error if one occurs.
-func (c *imageSignatures) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("imagesignatures").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
diff --git a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestream.go b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestream.go
index 7c00e2fc63..49c841e2b4 100644
--- a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestream.go
+++ b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestream.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/image/v1"
imagev1 "github.com/openshift/client-go/image/applyconfigurations/image/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImageStreamsGetter has a method to return a ImageStreamInterface.
@@ -27,6 +24,7 @@ type ImageStreamsGetter interface {
type ImageStreamInterface interface {
Create(ctx context.Context, imageStream *v1.ImageStream, opts metav1.CreateOptions) (*v1.ImageStream, error)
Update(ctx context.Context, imageStream *v1.ImageStream, opts metav1.UpdateOptions) (*v1.ImageStream, error)
+ // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, imageStream *v1.ImageStream, opts metav1.UpdateOptions) (*v1.ImageStream, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
@@ -35,6 +33,7 @@ type ImageStreamInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImageStream, err error)
Apply(ctx context.Context, imageStream *imagev1.ImageStreamApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageStream, err error)
+ // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, imageStream *imagev1.ImageStreamApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageStream, err error)
Secrets(ctx context.Context, imageStreamName string, options metav1.GetOptions) (*v1.SecretList, error)
Layers(ctx context.Context, imageStreamName string, options metav1.GetOptions) (*v1.ImageStreamLayers, error)
@@ -44,209 +43,27 @@ type ImageStreamInterface interface {
// imageStreams implements ImageStreamInterface
type imageStreams struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithListAndApply[*v1.ImageStream, *v1.ImageStreamList, *imagev1.ImageStreamApplyConfiguration]
}
// newImageStreams returns a ImageStreams
func newImageStreams(c *ImageV1Client, namespace string) *imageStreams {
return &imageStreams{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithListAndApply[*v1.ImageStream, *v1.ImageStreamList, *imagev1.ImageStreamApplyConfiguration](
+ "imagestreams",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1.ImageStream { return &v1.ImageStream{} },
+ func() *v1.ImageStreamList { return &v1.ImageStreamList{} }),
}
}
-// Get takes name of the imageStream, and returns the corresponding imageStream object, and an error if there is any.
-func (c *imageStreams) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ImageStream, err error) {
- result = &v1.ImageStream{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("imagestreams").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ImageStreams that match those selectors.
-func (c *imageStreams) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageStreamList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ImageStreamList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("imagestreams").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested imageStreams.
-func (c *imageStreams) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("imagestreams").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a imageStream and creates it. Returns the server's representation of the imageStream, and an error, if there is any.
-func (c *imageStreams) Create(ctx context.Context, imageStream *v1.ImageStream, opts metav1.CreateOptions) (result *v1.ImageStream, err error) {
- result = &v1.ImageStream{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("imagestreams").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageStream).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a imageStream and updates it. Returns the server's representation of the imageStream, and an error, if there is any.
-func (c *imageStreams) Update(ctx context.Context, imageStream *v1.ImageStream, opts metav1.UpdateOptions) (result *v1.ImageStream, err error) {
- result = &v1.ImageStream{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("imagestreams").
- Name(imageStream.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageStream).
- Do(ctx).
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *imageStreams) UpdateStatus(ctx context.Context, imageStream *v1.ImageStream, opts metav1.UpdateOptions) (result *v1.ImageStream, err error) {
- result = &v1.ImageStream{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("imagestreams").
- Name(imageStream.Name).
- SubResource("status").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageStream).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the imageStream and deletes it. Returns an error if one occurs.
-func (c *imageStreams) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("imagestreams").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *imageStreams) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Namespace(c.ns).
- Resource("imagestreams").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched imageStream.
-func (c *imageStreams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImageStream, err error) {
- result = &v1.ImageStream{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("imagestreams").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied imageStream.
-func (c *imageStreams) Apply(ctx context.Context, imageStream *imagev1.ImageStreamApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageStream, err error) {
- if imageStream == nil {
- return nil, fmt.Errorf("imageStream provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(imageStream)
- if err != nil {
- return nil, err
- }
- name := imageStream.Name
- if name == nil {
- return nil, fmt.Errorf("imageStream.Name must be provided to Apply")
- }
- result = &v1.ImageStream{}
- err = c.client.Patch(types.ApplyPatchType).
- Namespace(c.ns).
- Resource("imagestreams").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// ApplyStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
-func (c *imageStreams) ApplyStatus(ctx context.Context, imageStream *imagev1.ImageStreamApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ImageStream, err error) {
- if imageStream == nil {
- return nil, fmt.Errorf("imageStream provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(imageStream)
- if err != nil {
- return nil, err
- }
-
- name := imageStream.Name
- if name == nil {
- return nil, fmt.Errorf("imageStream.Name must be provided to Apply")
- }
-
- result = &v1.ImageStream{}
- err = c.client.Patch(types.ApplyPatchType).
- Namespace(c.ns).
- Resource("imagestreams").
- Name(*name).
- SubResource("status").
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
// Secrets takes name of the imageStream, and returns the corresponding v1.SecretList object, and an error if there is any.
func (c *imageStreams) Secrets(ctx context.Context, imageStreamName string, options metav1.GetOptions) (result *v1.SecretList, err error) {
result = &v1.SecretList{}
- err = c.client.Get().
- Namespace(c.ns).
+ err = c.GetClient().Get().
+ Namespace(c.GetNamespace()).
Resource("imagestreams").
Name(imageStreamName).
SubResource("secrets").
@@ -259,8 +76,8 @@ func (c *imageStreams) Secrets(ctx context.Context, imageStreamName string, opti
// Layers takes name of the imageStream, and returns the corresponding v1.ImageStreamLayers object, and an error if there is any.
func (c *imageStreams) Layers(ctx context.Context, imageStreamName string, options metav1.GetOptions) (result *v1.ImageStreamLayers, err error) {
result = &v1.ImageStreamLayers{}
- err = c.client.Get().
- Namespace(c.ns).
+ err = c.GetClient().Get().
+ Namespace(c.GetNamespace()).
Resource("imagestreams").
Name(imageStreamName).
SubResource("layers").
diff --git a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamimage.go b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamimage.go
index 79f46753a7..947240b125 100644
--- a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamimage.go
+++ b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamimage.go
@@ -8,7 +8,7 @@ import (
imagev1 "github.com/openshift/api/image/v1"
scheme "github.com/openshift/client-go/image/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImageStreamImagesGetter has a method to return a ImageStreamImageInterface.
@@ -25,27 +25,17 @@ type ImageStreamImageInterface interface {
// imageStreamImages implements ImageStreamImageInterface
type imageStreamImages struct {
- client rest.Interface
- ns string
+ *gentype.Client[*imagev1.ImageStreamImage]
}
// newImageStreamImages returns a ImageStreamImages
func newImageStreamImages(c *ImageV1Client, namespace string) *imageStreamImages {
return &imageStreamImages{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClient[*imagev1.ImageStreamImage](
+ "imagestreamimages",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *imagev1.ImageStreamImage { return &imagev1.ImageStreamImage{} }),
}
}
-
-// Get takes name of the imageStreamImage, and returns the corresponding imageStreamImage object, and an error if there is any.
-func (c *imageStreamImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *imagev1.ImageStreamImage, err error) {
- result = &imagev1.ImageStreamImage{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("imagestreamimages").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamimport.go b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamimport.go
index 7c43c951de..730bff723c 100644
--- a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamimport.go
+++ b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamimport.go
@@ -8,7 +8,7 @@ import (
v1 "github.com/openshift/api/image/v1"
scheme "github.com/openshift/client-go/image/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImageStreamImportsGetter has a method to return a ImageStreamImportInterface.
@@ -25,27 +25,17 @@ type ImageStreamImportInterface interface {
// imageStreamImports implements ImageStreamImportInterface
type imageStreamImports struct {
- client rest.Interface
- ns string
+ *gentype.Client[*v1.ImageStreamImport]
}
// newImageStreamImports returns a ImageStreamImports
func newImageStreamImports(c *ImageV1Client, namespace string) *imageStreamImports {
return &imageStreamImports{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClient[*v1.ImageStreamImport](
+ "imagestreamimports",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1.ImageStreamImport { return &v1.ImageStreamImport{} }),
}
}
-
-// Create takes the representation of a imageStreamImport and creates it. Returns the server's representation of the imageStreamImport, and an error, if there is any.
-func (c *imageStreamImports) Create(ctx context.Context, imageStreamImport *v1.ImageStreamImport, opts metav1.CreateOptions) (result *v1.ImageStreamImport, err error) {
- result = &v1.ImageStreamImport{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("imagestreamimports").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageStreamImport).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreammapping.go b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreammapping.go
index b19c110b7c..8405537976 100644
--- a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreammapping.go
+++ b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreammapping.go
@@ -4,15 +4,12 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
imagev1 "github.com/openshift/api/image/v1"
v1 "github.com/openshift/client-go/image/applyconfigurations/image/v1"
scheme "github.com/openshift/client-go/image/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- types "k8s.io/apimachinery/pkg/types"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImageStreamMappingsGetter has a method to return a ImageStreamMappingInterface.
@@ -31,49 +28,26 @@ type ImageStreamMappingInterface interface {
// imageStreamMappings implements ImageStreamMappingInterface
type imageStreamMappings struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithApply[*imagev1.ImageStreamMapping, *v1.ImageStreamMappingApplyConfiguration]
}
// newImageStreamMappings returns a ImageStreamMappings
func newImageStreamMappings(c *ImageV1Client, namespace string) *imageStreamMappings {
return &imageStreamMappings{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithApply[*imagev1.ImageStreamMapping, *v1.ImageStreamMappingApplyConfiguration](
+ "imagestreammappings",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *imagev1.ImageStreamMapping { return &imagev1.ImageStreamMapping{} }),
}
}
-// Apply takes the given apply declarative configuration, applies it and returns the applied imageStreamMapping.
-func (c *imageStreamMappings) Apply(ctx context.Context, imageStreamMapping *v1.ImageStreamMappingApplyConfiguration, opts metav1.ApplyOptions) (result *imagev1.ImageStreamMapping, err error) {
- if imageStreamMapping == nil {
- return nil, fmt.Errorf("imageStreamMapping provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(imageStreamMapping)
- if err != nil {
- return nil, err
- }
- name := imageStreamMapping.Name
- if name == nil {
- return nil, fmt.Errorf("imageStreamMapping.Name must be provided to Apply")
- }
- result = &imagev1.ImageStreamMapping{}
- err = c.client.Patch(types.ApplyPatchType).
- Namespace(c.ns).
- Resource("imagestreammappings").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
// Create takes the representation of a imageStreamMapping and creates it. Returns the server's representation of the status, and an error, if there is any.
func (c *imageStreamMappings) Create(ctx context.Context, imageStreamMapping *imagev1.ImageStreamMapping, opts metav1.CreateOptions) (result *metav1.Status, err error) {
result = &metav1.Status{}
- err = c.client.Post().
- Namespace(c.ns).
+ err = c.GetClient().Post().
+ Namespace(c.GetNamespace()).
Resource("imagestreammappings").
VersionedParams(&opts, scheme.ParameterCodec).
Body(imageStreamMapping).
diff --git a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamtag.go b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamtag.go
index 4ea36ccdc2..8029bc15d1 100644
--- a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamtag.go
+++ b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagestreamtag.go
@@ -4,12 +4,11 @@ package v1
import (
"context"
- "time"
v1 "github.com/openshift/api/image/v1"
scheme "github.com/openshift/client-go/image/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImageStreamTagsGetter has a method to return a ImageStreamTagInterface.
@@ -30,82 +29,18 @@ type ImageStreamTagInterface interface {
// imageStreamTags implements ImageStreamTagInterface
type imageStreamTags struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithList[*v1.ImageStreamTag, *v1.ImageStreamTagList]
}
// newImageStreamTags returns a ImageStreamTags
func newImageStreamTags(c *ImageV1Client, namespace string) *imageStreamTags {
return &imageStreamTags{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithList[*v1.ImageStreamTag, *v1.ImageStreamTagList](
+ "imagestreamtags",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1.ImageStreamTag { return &v1.ImageStreamTag{} },
+ func() *v1.ImageStreamTagList { return &v1.ImageStreamTagList{} }),
}
}
-
-// Get takes name of the imageStreamTag, and returns the corresponding imageStreamTag object, and an error if there is any.
-func (c *imageStreamTags) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ImageStreamTag, err error) {
- result = &v1.ImageStreamTag{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("imagestreamtags").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ImageStreamTags that match those selectors.
-func (c *imageStreamTags) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageStreamTagList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ImageStreamTagList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("imagestreamtags").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Create takes the representation of a imageStreamTag and creates it. Returns the server's representation of the imageStreamTag, and an error, if there is any.
-func (c *imageStreamTags) Create(ctx context.Context, imageStreamTag *v1.ImageStreamTag, opts metav1.CreateOptions) (result *v1.ImageStreamTag, err error) {
- result = &v1.ImageStreamTag{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("imagestreamtags").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageStreamTag).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a imageStreamTag and updates it. Returns the server's representation of the imageStreamTag, and an error, if there is any.
-func (c *imageStreamTags) Update(ctx context.Context, imageStreamTag *v1.ImageStreamTag, opts metav1.UpdateOptions) (result *v1.ImageStreamTag, err error) {
- result = &v1.ImageStreamTag{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("imagestreamtags").
- Name(imageStreamTag.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageStreamTag).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the imageStreamTag and deletes it. Returns an error if one occurs.
-func (c *imageStreamTags) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("imagestreamtags").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
diff --git a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagetag.go b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagetag.go
index a0d80e3ac8..f56c8b8049 100644
--- a/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagetag.go
+++ b/vendor/github.com/openshift/client-go/image/clientset/versioned/typed/image/v1/imagetag.go
@@ -4,12 +4,11 @@ package v1
import (
"context"
- "time"
v1 "github.com/openshift/api/image/v1"
scheme "github.com/openshift/client-go/image/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// ImageTagsGetter has a method to return a ImageTagInterface.
@@ -30,82 +29,18 @@ type ImageTagInterface interface {
// imageTags implements ImageTagInterface
type imageTags struct {
- client rest.Interface
- ns string
+ *gentype.ClientWithList[*v1.ImageTag, *v1.ImageTagList]
}
// newImageTags returns a ImageTags
func newImageTags(c *ImageV1Client, namespace string) *imageTags {
return &imageTags{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClientWithList[*v1.ImageTag, *v1.ImageTagList](
+ "imagetags",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1.ImageTag { return &v1.ImageTag{} },
+ func() *v1.ImageTagList { return &v1.ImageTagList{} }),
}
}
-
-// Get takes name of the imageTag, and returns the corresponding imageTag object, and an error if there is any.
-func (c *imageTags) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ImageTag, err error) {
- result = &v1.ImageTag{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("imagetags").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of ImageTags that match those selectors.
-func (c *imageTags) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageTagList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.ImageTagList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("imagetags").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Create takes the representation of a imageTag and creates it. Returns the server's representation of the imageTag, and an error, if there is any.
-func (c *imageTags) Create(ctx context.Context, imageTag *v1.ImageTag, opts metav1.CreateOptions) (result *v1.ImageTag, err error) {
- result = &v1.ImageTag{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("imagetags").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageTag).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a imageTag and updates it. Returns the server's representation of the imageTag, and an error, if there is any.
-func (c *imageTags) Update(ctx context.Context, imageTag *v1.ImageTag, opts metav1.UpdateOptions) (result *v1.ImageTag, err error) {
- result = &v1.ImageTag{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("imagetags").
- Name(imageTag.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(imageTag).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the imageTag and deletes it. Returns an error if one occurs.
-func (c *imageTags) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("imagetags").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/internal/internal.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/internal/internal.go
new file mode 100644
index 0000000000..2a11bffc77
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/internal/internal.go
@@ -0,0 +1,4360 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package internal
+
+import (
+ "fmt"
+ "sync"
+
+ typed "sigs.k8s.io/structured-merge-diff/v4/typed"
+)
+
+func Parser() *typed.Parser {
+ parserOnce.Do(func() {
+ var err error
+ parser, err = typed.NewParser(schemaYAML)
+ if err != nil {
+ panic(fmt.Sprintf("Failed to parse schema: %v", err))
+ }
+ })
+ return parser
+}
+
+var parserOnce sync.Once
+var parser *typed.Parser
+var schemaYAML = typed.YAMLObject(`types:
+- name: com.github.openshift.api.config.v1.ConfigMapFileReference
+ map:
+ fields:
+ - name: key
+ type:
+ scalar: string
+ - name: name
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.config.v1.ConfigMapNameReference
+ map:
+ fields:
+ - name: name
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.config.v1.CustomTLSProfile
+ map:
+ fields:
+ - name: ciphers
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: minTLSVersion
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.config.v1.IntermediateTLSProfile
+ map:
+ elementType:
+ scalar: untyped
+ list:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+ map:
+ elementType:
+ namedType: __untyped_deduced_
+ elementRelationship: separable
+- name: com.github.openshift.api.config.v1.ModernTLSProfile
+ map:
+ elementType:
+ scalar: untyped
+ list:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+ map:
+ elementType:
+ namedType: __untyped_deduced_
+ elementRelationship: separable
+- name: com.github.openshift.api.config.v1.OldTLSProfile
+ map:
+ elementType:
+ scalar: untyped
+ list:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+ map:
+ elementType:
+ namedType: __untyped_deduced_
+ elementRelationship: separable
+- name: com.github.openshift.api.config.v1.SecretNameReference
+ map:
+ fields:
+ - name: name
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.config.v1.TLSProfileSpec
+ map:
+ fields:
+ - name: ciphers
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: minTLSVersion
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.config.v1.TLSSecurityProfile
+ map:
+ fields:
+ - name: custom
+ type:
+ namedType: com.github.openshift.api.config.v1.CustomTLSProfile
+ - name: intermediate
+ type:
+ namedType: com.github.openshift.api.config.v1.IntermediateTLSProfile
+ - name: modern
+ type:
+ namedType: com.github.openshift.api.config.v1.ModernTLSProfile
+ - name: old
+ type:
+ namedType: com.github.openshift.api.config.v1.OldTLSProfile
+ - name: type
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: type
+ fields:
+ - fieldName: custom
+ discriminatorValue: Custom
+ - fieldName: intermediate
+ discriminatorValue: Intermediate
+ - fieldName: modern
+ discriminatorValue: Modern
+ - fieldName: old
+ discriminatorValue: Old
+- name: com.github.openshift.api.operator.v1.AWSCSIDriverConfigSpec
+ map:
+ fields:
+ - name: efsVolumeMetrics
+ type:
+ namedType: com.github.openshift.api.operator.v1.AWSEFSVolumeMetrics
+ - name: kmsKeyARN
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.AWSClassicLoadBalancerParameters
+ map:
+ fields:
+ - name: connectionIdleTimeout
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: subnets
+ type:
+ namedType: com.github.openshift.api.operator.v1.AWSSubnets
+- name: com.github.openshift.api.operator.v1.AWSEFSVolumeMetrics
+ map:
+ fields:
+ - name: recursiveWalk
+ type:
+ namedType: com.github.openshift.api.operator.v1.AWSEFSVolumeMetricsRecursiveWalkConfig
+ - name: state
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: state
+ fields:
+ - fieldName: recursiveWalk
+ discriminatorValue: RecursiveWalk
+- name: com.github.openshift.api.operator.v1.AWSEFSVolumeMetricsRecursiveWalkConfig
+ map:
+ fields:
+ - name: fsRateLimit
+ type:
+ scalar: numeric
+ - name: refreshPeriodMinutes
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.AWSLoadBalancerParameters
+ map:
+ fields:
+ - name: classicLoadBalancer
+ type:
+ namedType: com.github.openshift.api.operator.v1.AWSClassicLoadBalancerParameters
+ - name: networkLoadBalancer
+ type:
+ namedType: com.github.openshift.api.operator.v1.AWSNetworkLoadBalancerParameters
+ - name: type
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: type
+ fields:
+ - fieldName: classicLoadBalancer
+ discriminatorValue: ClassicLoadBalancerParameters
+ - fieldName: networkLoadBalancer
+ discriminatorValue: NetworkLoadBalancerParameters
+- name: com.github.openshift.api.operator.v1.AWSNetworkLoadBalancerParameters
+ map:
+ fields:
+ - name: eipAllocations
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: subnets
+ type:
+ namedType: com.github.openshift.api.operator.v1.AWSSubnets
+- name: com.github.openshift.api.operator.v1.AWSSubnets
+ map:
+ fields:
+ - name: ids
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: names
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.AccessLogging
+ map:
+ fields:
+ - name: destination
+ type:
+ namedType: com.github.openshift.api.operator.v1.LoggingDestination
+ default: {}
+ - name: httpCaptureCookies
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPCookie
+ elementRelationship: atomic
+ - name: httpCaptureHeaders
+ type:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPHeaders
+ default: {}
+ - name: httpLogFormat
+ type:
+ scalar: string
+ - name: logEmptyRequests
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.AddPage
+ map:
+ fields:
+ - name: disabledActions
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.AdditionalNetworkDefinition
+ map:
+ fields:
+ - name: name
+ type:
+ scalar: string
+ default: ""
+ - name: namespace
+ type:
+ scalar: string
+ - name: rawCNIConfig
+ type:
+ scalar: string
+ - name: simpleMacvlanConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.SimpleMacvlanConfig
+ - name: type
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.AdditionalRoutingCapabilities
+ map:
+ fields:
+ - name: providers
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.Authentication
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.AuthenticationSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.AuthenticationStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.AuthenticationSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.AuthenticationStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: oauthAPIServer
+ type:
+ namedType: com.github.openshift.api.operator.v1.OAuthAPIServerStatus
+ default: {}
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.AzureCSIDriverConfigSpec
+ map:
+ fields:
+ - name: diskEncryptionSet
+ type:
+ namedType: com.github.openshift.api.operator.v1.AzureDiskEncryptionSet
+- name: com.github.openshift.api.operator.v1.AzureDiskEncryptionSet
+ map:
+ fields:
+ - name: name
+ type:
+ scalar: string
+ default: ""
+ - name: resourceGroup
+ type:
+ scalar: string
+ default: ""
+ - name: subscriptionID
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.CSIDriverConfigSpec
+ map:
+ fields:
+ - name: aws
+ type:
+ namedType: com.github.openshift.api.operator.v1.AWSCSIDriverConfigSpec
+ - name: azure
+ type:
+ namedType: com.github.openshift.api.operator.v1.AzureCSIDriverConfigSpec
+ - name: driverType
+ type:
+ scalar: string
+ default: ""
+ - name: gcp
+ type:
+ namedType: com.github.openshift.api.operator.v1.GCPCSIDriverConfigSpec
+ - name: ibmcloud
+ type:
+ namedType: com.github.openshift.api.operator.v1.IBMCloudCSIDriverConfigSpec
+ - name: vSphere
+ type:
+ namedType: com.github.openshift.api.operator.v1.VSphereCSIDriverConfigSpec
+ unions:
+ - discriminator: driverType
+ fields:
+ - fieldName: aws
+ discriminatorValue: AWS
+ - fieldName: azure
+ discriminatorValue: Azure
+ - fieldName: gcp
+ discriminatorValue: GCP
+ - fieldName: ibmcloud
+ discriminatorValue: IBMCloud
+ - fieldName: vSphere
+ discriminatorValue: VSphere
+- name: com.github.openshift.api.operator.v1.CSISnapshotController
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.CSISnapshotControllerSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.CSISnapshotControllerStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.CSISnapshotControllerSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.CSISnapshotControllerStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.Capability
+ map:
+ fields:
+ - name: name
+ type:
+ scalar: string
+ default: ""
+ - name: visibility
+ type:
+ namedType: com.github.openshift.api.operator.v1.CapabilityVisibility
+ default: {}
+- name: com.github.openshift.api.operator.v1.CapabilityVisibility
+ map:
+ fields:
+ - name: state
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: state
+- name: com.github.openshift.api.operator.v1.ClientTLS
+ map:
+ fields:
+ - name: allowedSubjectPatterns
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: clientCA
+ type:
+ namedType: com.github.openshift.api.config.v1.ConfigMapNameReference
+ default: {}
+ - name: clientCertificatePolicy
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.CloudCredential
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.CloudCredentialSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.CloudCredentialStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.CloudCredentialSpec
+ map:
+ fields:
+ - name: credentialsMode
+ type:
+ scalar: string
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.CloudCredentialStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.ClusterCSIDriver
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.ClusterCSIDriverSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.ClusterCSIDriverStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.ClusterCSIDriverSpec
+ map:
+ fields:
+ - name: driverConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.CSIDriverConfigSpec
+ default: {}
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: storageClassState
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.ClusterCSIDriverStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.ClusterNetworkEntry
+ map:
+ fields:
+ - name: cidr
+ type:
+ scalar: string
+ default: ""
+ - name: hostPrefix
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.Config
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.ConfigSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.ConfigStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.ConfigSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.ConfigStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.Console
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.ConsoleSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.ConsoleStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.ConsoleConfigRoute
+ map:
+ fields:
+ - name: hostname
+ type:
+ scalar: string
+ default: ""
+ - name: secret
+ type:
+ namedType: com.github.openshift.api.config.v1.SecretNameReference
+ default: {}
+- name: com.github.openshift.api.operator.v1.ConsoleCustomization
+ map:
+ fields:
+ - name: addPage
+ type:
+ namedType: com.github.openshift.api.operator.v1.AddPage
+ default: {}
+ - name: brand
+ type:
+ scalar: string
+ - name: capabilities
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.Capability
+ elementRelationship: associative
+ keys:
+ - name
+ - name: customLogoFile
+ type:
+ namedType: com.github.openshift.api.config.v1.ConfigMapFileReference
+ default: {}
+ - name: customProductName
+ type:
+ scalar: string
+ - name: developerCatalog
+ type:
+ namedType: com.github.openshift.api.operator.v1.DeveloperConsoleCatalogCustomization
+ default: {}
+ - name: documentationBaseURL
+ type:
+ scalar: string
+ - name: perspectives
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.Perspective
+ elementRelationship: associative
+ keys:
+ - id
+ - name: projectAccess
+ type:
+ namedType: com.github.openshift.api.operator.v1.ProjectAccess
+ default: {}
+ - name: quickStarts
+ type:
+ namedType: com.github.openshift.api.operator.v1.QuickStarts
+ default: {}
+- name: com.github.openshift.api.operator.v1.ConsoleProviders
+ map:
+ fields:
+ - name: statuspage
+ type:
+ namedType: com.github.openshift.api.operator.v1.StatuspageProvider
+- name: com.github.openshift.api.operator.v1.ConsoleSpec
+ map:
+ fields:
+ - name: customization
+ type:
+ namedType: com.github.openshift.api.operator.v1.ConsoleCustomization
+ default: {}
+ - name: ingress
+ type:
+ namedType: com.github.openshift.api.operator.v1.Ingress
+ default: {}
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: plugins
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: providers
+ type:
+ namedType: com.github.openshift.api.operator.v1.ConsoleProviders
+ default: {}
+ - name: route
+ type:
+ namedType: com.github.openshift.api.operator.v1.ConsoleConfigRoute
+ default: {}
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.ConsoleStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.ContainerLoggingDestinationParameters
+ map:
+ fields:
+ - name: maxLength
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.DNS
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.DNSSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.DNSStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.DNSCache
+ map:
+ fields:
+ - name: negativeTTL
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: positiveTTL
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+- name: com.github.openshift.api.operator.v1.DNSNodePlacement
+ map:
+ fields:
+ - name: nodeSelector
+ type:
+ map:
+ elementType:
+ scalar: string
+ - name: tolerations
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.api.core.v1.Toleration
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.DNSOverTLSConfig
+ map:
+ fields:
+ - name: caBundle
+ type:
+ namedType: com.github.openshift.api.config.v1.ConfigMapNameReference
+ default: {}
+ - name: serverName
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.DNSSpec
+ map:
+ fields:
+ - name: cache
+ type:
+ namedType: com.github.openshift.api.operator.v1.DNSCache
+ default: {}
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ - name: nodePlacement
+ type:
+ namedType: com.github.openshift.api.operator.v1.DNSNodePlacement
+ default: {}
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: servers
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.Server
+ elementRelationship: atomic
+ - name: upstreamResolvers
+ type:
+ namedType: com.github.openshift.api.operator.v1.UpstreamResolvers
+ default: {}
+- name: com.github.openshift.api.operator.v1.DNSStatus
+ map:
+ fields:
+ - name: clusterDomain
+ type:
+ scalar: string
+ default: ""
+ - name: clusterIP
+ type:
+ scalar: string
+ default: ""
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+- name: com.github.openshift.api.operator.v1.DNSTransportConfig
+ map:
+ fields:
+ - name: tls
+ type:
+ namedType: com.github.openshift.api.operator.v1.DNSOverTLSConfig
+ - name: transport
+ type:
+ scalar: string
+ unions:
+ - discriminator: transport
+ fields:
+ - fieldName: tls
+ discriminatorValue: TLS
+- name: com.github.openshift.api.operator.v1.DefaultNetworkDefinition
+ map:
+ fields:
+ - name: openshiftSDNConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.OpenShiftSDNConfig
+ - name: ovnKubernetesConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.OVNKubernetesConfig
+ - name: type
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.DeveloperConsoleCatalogCategory
+ map:
+ fields:
+ - name: id
+ type:
+ scalar: string
+ default: ""
+ - name: label
+ type:
+ scalar: string
+ default: ""
+ - name: subcategories
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.DeveloperConsoleCatalogCategoryMeta
+ elementRelationship: atomic
+ - name: tags
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.DeveloperConsoleCatalogCategoryMeta
+ map:
+ fields:
+ - name: id
+ type:
+ scalar: string
+ default: ""
+ - name: label
+ type:
+ scalar: string
+ default: ""
+ - name: tags
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.DeveloperConsoleCatalogCustomization
+ map:
+ fields:
+ - name: categories
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.DeveloperConsoleCatalogCategory
+ elementRelationship: atomic
+ - name: types
+ type:
+ namedType: com.github.openshift.api.operator.v1.DeveloperConsoleCatalogTypes
+ default: {}
+- name: com.github.openshift.api.operator.v1.DeveloperConsoleCatalogTypes
+ map:
+ fields:
+ - name: disabled
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: associative
+ - name: enabled
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: associative
+ - name: state
+ type:
+ scalar: string
+ default: Enabled
+ unions:
+ - discriminator: state
+ fields:
+ - fieldName: disabled
+ discriminatorValue: Disabled
+ - fieldName: enabled
+ discriminatorValue: Enabled
+- name: com.github.openshift.api.operator.v1.EgressIPConfig
+ map:
+ fields:
+ - name: reachabilityTotalTimeoutSeconds
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.EndpointPublishingStrategy
+ map:
+ fields:
+ - name: hostNetwork
+ type:
+ namedType: com.github.openshift.api.operator.v1.HostNetworkStrategy
+ - name: loadBalancer
+ type:
+ namedType: com.github.openshift.api.operator.v1.LoadBalancerStrategy
+ - name: nodePort
+ type:
+ namedType: com.github.openshift.api.operator.v1.NodePortStrategy
+ - name: private
+ type:
+ namedType: com.github.openshift.api.operator.v1.PrivateStrategy
+ - name: type
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: type
+ fields:
+ - fieldName: hostNetwork
+ discriminatorValue: HostNetwork
+ - fieldName: loadBalancer
+ discriminatorValue: LoadBalancer
+ - fieldName: nodePort
+ discriminatorValue: NodePort
+ - fieldName: private
+ discriminatorValue: Private
+- name: com.github.openshift.api.operator.v1.Etcd
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.EtcdSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.EtcdStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.EtcdSpec
+ map:
+ fields:
+ - name: backendQuotaGiB
+ type:
+ scalar: numeric
+ default: 8
+ - name: controlPlaneHardwareSpeed
+ type:
+ scalar: string
+ default: ""
+ - name: failedRevisionLimit
+ type:
+ scalar: numeric
+ - name: forceRedeploymentReason
+ type:
+ scalar: string
+ default: ""
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: succeededRevisionLimit
+ type:
+ scalar: numeric
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.EtcdStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: controlPlaneHardwareSpeed
+ type:
+ scalar: string
+ default: ""
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: latestAvailableRevisionReason
+ type:
+ scalar: string
+ - name: nodeStatuses
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeStatus
+ elementRelationship: associative
+ keys:
+ - nodeName
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.ExportNetworkFlows
+ map:
+ fields:
+ - name: ipfix
+ type:
+ namedType: com.github.openshift.api.operator.v1.IPFIXConfig
+ - name: netFlow
+ type:
+ namedType: com.github.openshift.api.operator.v1.NetFlowConfig
+ - name: sFlow
+ type:
+ namedType: com.github.openshift.api.operator.v1.SFlowConfig
+- name: com.github.openshift.api.operator.v1.FeaturesMigration
+ map:
+ fields:
+ - name: egressFirewall
+ type:
+ scalar: boolean
+ - name: egressIP
+ type:
+ scalar: boolean
+ - name: multicast
+ type:
+ scalar: boolean
+- name: com.github.openshift.api.operator.v1.ForwardPlugin
+ map:
+ fields:
+ - name: policy
+ type:
+ scalar: string
+ - name: protocolStrategy
+ type:
+ scalar: string
+ default: ""
+ - name: transportConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.DNSTransportConfig
+ default: {}
+ - name: upstreams
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.GCPCSIDriverConfigSpec
+ map:
+ fields:
+ - name: kmsKey
+ type:
+ namedType: com.github.openshift.api.operator.v1.GCPKMSKeyReference
+- name: com.github.openshift.api.operator.v1.GCPKMSKeyReference
+ map:
+ fields:
+ - name: keyRing
+ type:
+ scalar: string
+ default: ""
+ - name: location
+ type:
+ scalar: string
+ - name: name
+ type:
+ scalar: string
+ default: ""
+ - name: projectID
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.GCPLoadBalancerParameters
+ map:
+ fields:
+ - name: clientAccess
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.GatewayConfig
+ map:
+ fields:
+ - name: ipForwarding
+ type:
+ scalar: string
+ - name: ipv4
+ type:
+ namedType: com.github.openshift.api.operator.v1.IPv4GatewayConfig
+ default: {}
+ - name: ipv6
+ type:
+ namedType: com.github.openshift.api.operator.v1.IPv6GatewayConfig
+ default: {}
+ - name: routingViaHost
+ type:
+ scalar: boolean
+- name: com.github.openshift.api.operator.v1.GatherStatus
+ map:
+ fields:
+ - name: gatherers
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GathererStatus
+ elementRelationship: atomic
+ - name: lastGatherDuration
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: lastGatherTime
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
+- name: com.github.openshift.api.operator.v1.GathererStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
+ elementRelationship: atomic
+ - name: lastGatherDuration
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: name
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.GenerationStatus
+ map:
+ fields:
+ - name: group
+ type:
+ scalar: string
+ default: ""
+ - name: hash
+ type:
+ scalar: string
+ default: ""
+ - name: lastGeneration
+ type:
+ scalar: numeric
+ default: 0
+ - name: name
+ type:
+ scalar: string
+ default: ""
+ - name: namespace
+ type:
+ scalar: string
+ default: ""
+ - name: resource
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.HTTPCompressionPolicy
+ map:
+ fields:
+ - name: mimeTypes
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: associative
+- name: com.github.openshift.api.operator.v1.HealthCheck
+ map:
+ fields:
+ - name: advisorURI
+ type:
+ scalar: string
+ default: ""
+ - name: description
+ type:
+ scalar: string
+ default: ""
+ - name: state
+ type:
+ scalar: string
+ default: ""
+ - name: totalRisk
+ type:
+ scalar: numeric
+ default: 0
+- name: com.github.openshift.api.operator.v1.HostNetworkStrategy
+ map:
+ fields:
+ - name: httpPort
+ type:
+ scalar: numeric
+ - name: httpsPort
+ type:
+ scalar: numeric
+ - name: protocol
+ type:
+ scalar: string
+ - name: statsPort
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.HybridOverlayConfig
+ map:
+ fields:
+ - name: hybridClusterNetwork
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.ClusterNetworkEntry
+ elementRelationship: atomic
+ - name: hybridOverlayVXLANPort
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.IBMCloudCSIDriverConfigSpec
+ map:
+ fields:
+ - name: encryptionKeyCRN
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.IBMLoadBalancerParameters
+ map:
+ fields:
+ - name: protocol
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.IPAMConfig
+ map:
+ fields:
+ - name: staticIPAMConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.StaticIPAMConfig
+ - name: type
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.IPFIXConfig
+ map:
+ fields:
+ - name: collectors
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.IPsecConfig
+ map:
+ fields:
+ - name: mode
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.IPv4GatewayConfig
+ map:
+ fields:
+ - name: internalMasqueradeSubnet
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.IPv4OVNKubernetesConfig
+ map:
+ fields:
+ - name: internalJoinSubnet
+ type:
+ scalar: string
+ - name: internalTransitSwitchSubnet
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.IPv6GatewayConfig
+ map:
+ fields:
+ - name: internalMasqueradeSubnet
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.IPv6OVNKubernetesConfig
+ map:
+ fields:
+ - name: internalJoinSubnet
+ type:
+ scalar: string
+ - name: internalTransitSwitchSubnet
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.Ingress
+ map:
+ fields:
+ - name: clientDownloadsURL
+ type:
+ scalar: string
+ default: ""
+ - name: consoleURL
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.IngressController
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPCookie
+ map:
+ fields:
+ - name: matchType
+ type:
+ scalar: string
+ - name: maxLength
+ type:
+ scalar: numeric
+ default: 0
+ - name: name
+ type:
+ scalar: string
+ default: ""
+ - name: namePrefix
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: matchType
+ fields:
+ - fieldName: name
+ discriminatorValue: Name
+ - fieldName: namePrefix
+ discriminatorValue: NamePrefix
+- name: com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPHeader
+ map:
+ fields:
+ - name: maxLength
+ type:
+ scalar: numeric
+ default: 0
+ - name: name
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPHeaders
+ map:
+ fields:
+ - name: request
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPHeader
+ elementRelationship: atomic
+ - name: response
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPHeader
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.IngressControllerHTTPHeader
+ map:
+ fields:
+ - name: action
+ type:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerHTTPHeaderActionUnion
+ default: {}
+ - name: name
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.IngressControllerHTTPHeaderActionUnion
+ map:
+ fields:
+ - name: set
+ type:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerSetHTTPHeader
+ - name: type
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: type
+ fields:
+ - fieldName: set
+ discriminatorValue: Set
+- name: com.github.openshift.api.operator.v1.IngressControllerHTTPHeaderActions
+ map:
+ fields:
+ - name: request
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerHTTPHeader
+ elementRelationship: associative
+ keys:
+ - name
+ - name: response
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerHTTPHeader
+ elementRelationship: associative
+ keys:
+ - name
+- name: com.github.openshift.api.operator.v1.IngressControllerHTTPHeaders
+ map:
+ fields:
+ - name: actions
+ type:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerHTTPHeaderActions
+ default: {}
+ - name: forwardedHeaderPolicy
+ type:
+ scalar: string
+ - name: headerNameCaseAdjustments
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: uniqueId
+ type:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerHTTPUniqueIdHeaderPolicy
+ default: {}
+- name: com.github.openshift.api.operator.v1.IngressControllerHTTPUniqueIdHeaderPolicy
+ map:
+ fields:
+ - name: format
+ type:
+ scalar: string
+ - name: name
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.IngressControllerLogging
+ map:
+ fields:
+ - name: access
+ type:
+ namedType: com.github.openshift.api.operator.v1.AccessLogging
+- name: com.github.openshift.api.operator.v1.IngressControllerSetHTTPHeader
+ map:
+ fields:
+ - name: value
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.IngressControllerSpec
+ map:
+ fields:
+ - name: clientTLS
+ type:
+ namedType: com.github.openshift.api.operator.v1.ClientTLS
+ default: {}
+ - name: defaultCertificate
+ type:
+ namedType: io.k8s.api.core.v1.LocalObjectReference
+ - name: domain
+ type:
+ scalar: string
+ - name: endpointPublishingStrategy
+ type:
+ namedType: com.github.openshift.api.operator.v1.EndpointPublishingStrategy
+ - name: httpCompression
+ type:
+ namedType: com.github.openshift.api.operator.v1.HTTPCompressionPolicy
+ default: {}
+ - name: httpEmptyRequestsPolicy
+ type:
+ scalar: string
+ - name: httpErrorCodePages
+ type:
+ namedType: com.github.openshift.api.config.v1.ConfigMapNameReference
+ default: {}
+ - name: httpHeaders
+ type:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerHTTPHeaders
+ - name: logging
+ type:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerLogging
+ - name: namespaceSelector
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
+ - name: nodePlacement
+ type:
+ namedType: com.github.openshift.api.operator.v1.NodePlacement
+ - name: replicas
+ type:
+ scalar: numeric
+ - name: routeAdmission
+ type:
+ namedType: com.github.openshift.api.operator.v1.RouteAdmissionPolicy
+ - name: routeSelector
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
+ - name: tlsSecurityProfile
+ type:
+ namedType: com.github.openshift.api.config.v1.TLSSecurityProfile
+ - name: tuningOptions
+ type:
+ namedType: com.github.openshift.api.operator.v1.IngressControllerTuningOptions
+ default: {}
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.IngressControllerStatus
+ map:
+ fields:
+ - name: availableReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: domain
+ type:
+ scalar: string
+ default: ""
+ - name: endpointPublishingStrategy
+ type:
+ namedType: com.github.openshift.api.operator.v1.EndpointPublishingStrategy
+ - name: namespaceSelector
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: routeSelector
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
+ - name: selector
+ type:
+ scalar: string
+ default: ""
+ - name: tlsProfile
+ type:
+ namedType: com.github.openshift.api.config.v1.TLSProfileSpec
+- name: com.github.openshift.api.operator.v1.IngressControllerTuningOptions
+ map:
+ fields:
+ - name: clientFinTimeout
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: clientTimeout
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: connectTimeout
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: headerBufferBytes
+ type:
+ scalar: numeric
+ - name: headerBufferMaxRewriteBytes
+ type:
+ scalar: numeric
+ - name: healthCheckInterval
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: maxConnections
+ type:
+ scalar: numeric
+ - name: reloadInterval
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: serverFinTimeout
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: serverTimeout
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: threadCount
+ type:
+ scalar: numeric
+ - name: tlsInspectDelay
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ - name: tunnelTimeout
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+- name: com.github.openshift.api.operator.v1.InsightsOperator
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.InsightsOperatorSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.InsightsOperatorStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.InsightsOperatorSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.InsightsOperatorStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: gatherStatus
+ type:
+ namedType: com.github.openshift.api.operator.v1.GatherStatus
+ default: {}
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: insightsReport
+ type:
+ namedType: com.github.openshift.api.operator.v1.InsightsReport
+ default: {}
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.InsightsReport
+ map:
+ fields:
+ - name: downloadedAt
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
+ - name: healthChecks
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.HealthCheck
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.KubeAPIServer
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.KubeAPIServerSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.KubeAPIServerStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.KubeAPIServerSpec
+ map:
+ fields:
+ - name: failedRevisionLimit
+ type:
+ scalar: numeric
+ - name: forceRedeploymentReason
+ type:
+ scalar: string
+ default: ""
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: succeededRevisionLimit
+ type:
+ scalar: numeric
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.KubeAPIServerStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: latestAvailableRevisionReason
+ type:
+ scalar: string
+ - name: nodeStatuses
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeStatus
+ elementRelationship: associative
+ keys:
+ - nodeName
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: serviceAccountIssuers
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.ServiceAccountIssuerStatus
+ elementRelationship: atomic
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.KubeControllerManager
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.KubeControllerManagerSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.KubeControllerManagerStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.KubeControllerManagerSpec
+ map:
+ fields:
+ - name: failedRevisionLimit
+ type:
+ scalar: numeric
+ - name: forceRedeploymentReason
+ type:
+ scalar: string
+ default: ""
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: succeededRevisionLimit
+ type:
+ scalar: numeric
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+ - name: useMoreSecureServiceCA
+ type:
+ scalar: boolean
+ default: false
+- name: com.github.openshift.api.operator.v1.KubeControllerManagerStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: latestAvailableRevisionReason
+ type:
+ scalar: string
+ - name: nodeStatuses
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeStatus
+ elementRelationship: associative
+ keys:
+ - nodeName
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.KubeScheduler
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.KubeSchedulerSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.KubeSchedulerStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.KubeSchedulerSpec
+ map:
+ fields:
+ - name: failedRevisionLimit
+ type:
+ scalar: numeric
+ - name: forceRedeploymentReason
+ type:
+ scalar: string
+ default: ""
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: succeededRevisionLimit
+ type:
+ scalar: numeric
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.KubeSchedulerStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: latestAvailableRevisionReason
+ type:
+ scalar: string
+ - name: nodeStatuses
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeStatus
+ elementRelationship: associative
+ keys:
+ - nodeName
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.KubeStorageVersionMigrator
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.KubeStorageVersionMigratorSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.KubeStorageVersionMigratorStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.KubeStorageVersionMigratorSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.KubeStorageVersionMigratorStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.LoadBalancerStrategy
+ map:
+ fields:
+ - name: allowedSourceRanges
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: dnsManagementPolicy
+ type:
+ scalar: string
+ default: Managed
+ - name: providerParameters
+ type:
+ namedType: com.github.openshift.api.operator.v1.ProviderLoadBalancerParameters
+ - name: scope
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.LoggingDestination
+ map:
+ fields:
+ - name: container
+ type:
+ namedType: com.github.openshift.api.operator.v1.ContainerLoggingDestinationParameters
+ - name: syslog
+ type:
+ namedType: com.github.openshift.api.operator.v1.SyslogLoggingDestinationParameters
+ - name: type
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: type
+ fields:
+ - fieldName: container
+ discriminatorValue: Container
+ - fieldName: syslog
+ discriminatorValue: Syslog
+- name: com.github.openshift.api.operator.v1.MTUMigration
+ map:
+ fields:
+ - name: machine
+ type:
+ namedType: com.github.openshift.api.operator.v1.MTUMigrationValues
+ - name: network
+ type:
+ namedType: com.github.openshift.api.operator.v1.MTUMigrationValues
+- name: com.github.openshift.api.operator.v1.MTUMigrationValues
+ map:
+ fields:
+ - name: from
+ type:
+ scalar: numeric
+ - name: to
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.MachineConfiguration
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.MachineConfigurationSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.MachineConfigurationStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.MachineConfigurationSpec
+ map:
+ fields:
+ - name: failedRevisionLimit
+ type:
+ scalar: numeric
+ - name: forceRedeploymentReason
+ type:
+ scalar: string
+ default: ""
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managedBootImages
+ type:
+ namedType: com.github.openshift.api.operator.v1.ManagedBootImages
+ default: {}
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: nodeDisruptionPolicy
+ type:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig
+ default: {}
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: succeededRevisionLimit
+ type:
+ scalar: numeric
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.MachineConfigurationStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: nodeDisruptionPolicyStatus
+ type:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatus
+ default: {}
+ - name: observedGeneration
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.MachineManager
+ map:
+ fields:
+ - name: apiGroup
+ type:
+ scalar: string
+ default: ""
+ - name: resource
+ type:
+ scalar: string
+ default: ""
+ - name: selection
+ type:
+ namedType: com.github.openshift.api.operator.v1.MachineManagerSelector
+ default: {}
+- name: com.github.openshift.api.operator.v1.MachineManagerSelector
+ map:
+ fields:
+ - name: mode
+ type:
+ scalar: string
+ default: ""
+ - name: partial
+ type:
+ namedType: com.github.openshift.api.operator.v1.PartialSelector
+ unions:
+ - discriminator: mode
+ fields:
+ - fieldName: partial
+ discriminatorValue: Partial
+- name: com.github.openshift.api.operator.v1.ManagedBootImages
+ map:
+ fields:
+ - name: machineManagers
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.MachineManager
+ elementRelationship: associative
+ keys:
+ - resource
+ - apiGroup
+- name: com.github.openshift.api.operator.v1.NetFlowConfig
+ map:
+ fields:
+ - name: collectors
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.Network
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.NetworkSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.NetworkStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.NetworkMigration
+ map:
+ fields:
+ - name: features
+ type:
+ namedType: com.github.openshift.api.operator.v1.FeaturesMigration
+ - name: mode
+ type:
+ scalar: string
+ - name: mtu
+ type:
+ namedType: com.github.openshift.api.operator.v1.MTUMigration
+ - name: networkType
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.NetworkSpec
+ map:
+ fields:
+ - name: additionalNetworks
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.AdditionalNetworkDefinition
+ elementRelationship: associative
+ keys:
+ - name
+ - name: additionalRoutingCapabilities
+ type:
+ namedType: com.github.openshift.api.operator.v1.AdditionalRoutingCapabilities
+ - name: clusterNetwork
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.ClusterNetworkEntry
+ elementRelationship: atomic
+ - name: defaultNetwork
+ type:
+ namedType: com.github.openshift.api.operator.v1.DefaultNetworkDefinition
+ default: {}
+ - name: deployKubeProxy
+ type:
+ scalar: boolean
+ - name: disableMultiNetwork
+ type:
+ scalar: boolean
+ - name: disableNetworkDiagnostics
+ type:
+ scalar: boolean
+ default: false
+ - name: exportNetworkFlows
+ type:
+ namedType: com.github.openshift.api.operator.v1.ExportNetworkFlows
+ - name: kubeProxyConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.ProxyConfig
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: migration
+ type:
+ namedType: com.github.openshift.api.operator.v1.NetworkMigration
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: serviceNetwork
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+ - name: useMultiNetworkPolicy
+ type:
+ scalar: boolean
+- name: com.github.openshift.api.operator.v1.NetworkStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicyClusterStatus
+ map:
+ fields:
+ - name: files
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusFile
+ elementRelationship: associative
+ keys:
+ - path
+ - name: sshkey
+ type:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusSSHKey
+ default: {}
+ - name: units
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusUnit
+ elementRelationship: associative
+ keys:
+ - name
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig
+ map:
+ fields:
+ - name: files
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecFile
+ elementRelationship: associative
+ keys:
+ - path
+ - name: sshkey
+ type:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecSSHKey
+ default: {}
+ - name: units
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecUnit
+ elementRelationship: associative
+ keys:
+ - name
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecAction
+ map:
+ fields:
+ - name: reload
+ type:
+ namedType: com.github.openshift.api.operator.v1.ReloadService
+ - name: restart
+ type:
+ namedType: com.github.openshift.api.operator.v1.RestartService
+ - name: type
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: type
+ fields:
+ - fieldName: reload
+ discriminatorValue: Reload
+ - fieldName: restart
+ discriminatorValue: Restart
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecFile
+ map:
+ fields:
+ - name: actions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecAction
+ elementRelationship: atomic
+ - name: path
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecSSHKey
+ map:
+ fields:
+ - name: actions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecAction
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecUnit
+ map:
+ fields:
+ - name: actions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecAction
+ elementRelationship: atomic
+ - name: name
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatus
+ map:
+ fields:
+ - name: clusterPolicies
+ type:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicyClusterStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusAction
+ map:
+ fields:
+ - name: reload
+ type:
+ namedType: com.github.openshift.api.operator.v1.ReloadService
+ - name: restart
+ type:
+ namedType: com.github.openshift.api.operator.v1.RestartService
+ - name: type
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: type
+ fields:
+ - fieldName: reload
+ discriminatorValue: Reload
+ - fieldName: restart
+ discriminatorValue: Restart
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusFile
+ map:
+ fields:
+ - name: actions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusAction
+ elementRelationship: atomic
+ - name: path
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusSSHKey
+ map:
+ fields:
+ - name: actions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusAction
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusUnit
+ map:
+ fields:
+ - name: actions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusAction
+ elementRelationship: atomic
+ - name: name
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.NodePlacement
+ map:
+ fields:
+ - name: nodeSelector
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
+ - name: tolerations
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.api.core.v1.Toleration
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.NodePortStrategy
+ map:
+ fields:
+ - name: protocol
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.NodeStatus
+ map:
+ fields:
+ - name: currentRevision
+ type:
+ scalar: numeric
+ default: 0
+ - name: lastFailedCount
+ type:
+ scalar: numeric
+ - name: lastFailedReason
+ type:
+ scalar: string
+ - name: lastFailedRevision
+ type:
+ scalar: numeric
+ - name: lastFailedRevisionErrors
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: lastFailedTime
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
+ - name: lastFallbackCount
+ type:
+ scalar: numeric
+ - name: nodeName
+ type:
+ scalar: string
+ default: ""
+ - name: targetRevision
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.OAuthAPIServerStatus
+ map:
+ fields:
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.OLM
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.OLMSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.OLMStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.OLMSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.OLMStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.OVNKubernetesConfig
+ map:
+ fields:
+ - name: egressIPConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.EgressIPConfig
+ default: {}
+ - name: gatewayConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.GatewayConfig
+ - name: genevePort
+ type:
+ scalar: numeric
+ - name: hybridOverlayConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.HybridOverlayConfig
+ - name: ipsecConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.IPsecConfig
+ default:
+ mode: Disabled
+ - name: ipv4
+ type:
+ namedType: com.github.openshift.api.operator.v1.IPv4OVNKubernetesConfig
+ - name: ipv6
+ type:
+ namedType: com.github.openshift.api.operator.v1.IPv6OVNKubernetesConfig
+ - name: mtu
+ type:
+ scalar: numeric
+ - name: policyAuditConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.PolicyAuditConfig
+ - name: routeAdvertisements
+ type:
+ scalar: string
+ - name: v4InternalSubnet
+ type:
+ scalar: string
+ - name: v6InternalSubnet
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.OpenShiftAPIServer
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.OpenShiftAPIServerSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.OpenShiftAPIServerStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.OpenShiftAPIServerSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.OpenShiftAPIServerStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.OpenShiftControllerManager
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.OpenShiftControllerManagerSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.OpenShiftControllerManagerStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.OpenShiftControllerManagerSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.OpenShiftControllerManagerStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.OpenShiftSDNConfig
+ map:
+ fields:
+ - name: enableUnidling
+ type:
+ scalar: boolean
+ - name: mode
+ type:
+ scalar: string
+ default: ""
+ - name: mtu
+ type:
+ scalar: numeric
+ - name: useExternalOpenvswitch
+ type:
+ scalar: boolean
+ - name: vxlanPort
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.OpenStackLoadBalancerParameters
+ map:
+ fields:
+ - name: floatingIP
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.OperatorCondition
+ map:
+ fields:
+ - name: lastTransitionTime
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
+ - name: message
+ type:
+ scalar: string
+ - name: reason
+ type:
+ scalar: string
+ - name: status
+ type:
+ scalar: string
+ default: ""
+ - name: type
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.PartialSelector
+ map:
+ fields:
+ - name: machineResourceSelector
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
+- name: com.github.openshift.api.operator.v1.Perspective
+ map:
+ fields:
+ - name: id
+ type:
+ scalar: string
+ default: ""
+ - name: pinnedResources
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.PinnedResourceReference
+ elementRelationship: atomic
+ - name: visibility
+ type:
+ namedType: com.github.openshift.api.operator.v1.PerspectiveVisibility
+ default: {}
+- name: com.github.openshift.api.operator.v1.PerspectiveVisibility
+ map:
+ fields:
+ - name: accessReview
+ type:
+ namedType: com.github.openshift.api.operator.v1.ResourceAttributesAccessReview
+ - name: state
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: state
+ fields:
+ - fieldName: accessReview
+ discriminatorValue: AccessReview
+- name: com.github.openshift.api.operator.v1.PinnedResourceReference
+ map:
+ fields:
+ - name: group
+ type:
+ scalar: string
+ default: ""
+ - name: resource
+ type:
+ scalar: string
+ default: ""
+ - name: version
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.PolicyAuditConfig
+ map:
+ fields:
+ - name: destination
+ type:
+ scalar: string
+ - name: maxFileSize
+ type:
+ scalar: numeric
+ - name: maxLogFiles
+ type:
+ scalar: numeric
+ - name: rateLimit
+ type:
+ scalar: numeric
+ - name: syslogFacility
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.PrivateStrategy
+ map:
+ fields:
+ - name: protocol
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.ProjectAccess
+ map:
+ fields:
+ - name: availableClusterRoles
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.ProviderLoadBalancerParameters
+ map:
+ fields:
+ - name: aws
+ type:
+ namedType: com.github.openshift.api.operator.v1.AWSLoadBalancerParameters
+ - name: gcp
+ type:
+ namedType: com.github.openshift.api.operator.v1.GCPLoadBalancerParameters
+ - name: ibm
+ type:
+ namedType: com.github.openshift.api.operator.v1.IBMLoadBalancerParameters
+ - name: openstack
+ type:
+ namedType: com.github.openshift.api.operator.v1.OpenStackLoadBalancerParameters
+ - name: type
+ type:
+ scalar: string
+ default: ""
+ unions:
+ - discriminator: type
+ fields:
+ - fieldName: aws
+ discriminatorValue: AWS
+ - fieldName: gcp
+ discriminatorValue: GCP
+ - fieldName: ibm
+ discriminatorValue: IBM
+ - fieldName: openstack
+ discriminatorValue: OpenStack
+- name: com.github.openshift.api.operator.v1.ProxyConfig
+ map:
+ fields:
+ - name: bindAddress
+ type:
+ scalar: string
+ - name: iptablesSyncPeriod
+ type:
+ scalar: string
+ - name: proxyArguments
+ type:
+ map:
+ elementType:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.QuickStarts
+ map:
+ fields:
+ - name: disabled
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.ReloadService
+ map:
+ fields:
+ - name: serviceName
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.ResourceAttributesAccessReview
+ map:
+ fields:
+ - name: missing
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.api.authorization.v1.ResourceAttributes
+ elementRelationship: atomic
+ - name: required
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.api.authorization.v1.ResourceAttributes
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.RestartService
+ map:
+ fields:
+ - name: serviceName
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.RouteAdmissionPolicy
+ map:
+ fields:
+ - name: namespaceOwnership
+ type:
+ scalar: string
+ - name: wildcardPolicy
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.SFlowConfig
+ map:
+ fields:
+ - name: collectors
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.Server
+ map:
+ fields:
+ - name: forwardPlugin
+ type:
+ namedType: com.github.openshift.api.operator.v1.ForwardPlugin
+ default: {}
+ - name: name
+ type:
+ scalar: string
+ default: ""
+ - name: zones
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.ServiceAccountIssuerStatus
+ map:
+ fields:
+ - name: expirationTime
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
+ - name: name
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.ServiceCA
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.ServiceCASpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.ServiceCAStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.ServiceCASpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.ServiceCAStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.ServiceCatalogAPIServer
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.ServiceCatalogAPIServerSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.ServiceCatalogAPIServerStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.ServiceCatalogAPIServerSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.ServiceCatalogAPIServerStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.ServiceCatalogControllerManager
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.ServiceCatalogControllerManagerSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.ServiceCatalogControllerManagerStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.ServiceCatalogControllerManagerSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1.ServiceCatalogControllerManagerStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.SimpleMacvlanConfig
+ map:
+ fields:
+ - name: ipamConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.IPAMConfig
+ - name: master
+ type:
+ scalar: string
+ - name: mode
+ type:
+ scalar: string
+ - name: mtu
+ type:
+ scalar: numeric
+- name: com.github.openshift.api.operator.v1.StaticIPAMAddresses
+ map:
+ fields:
+ - name: address
+ type:
+ scalar: string
+ default: ""
+ - name: gateway
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.StaticIPAMConfig
+ map:
+ fields:
+ - name: addresses
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.StaticIPAMAddresses
+ elementRelationship: atomic
+ - name: dns
+ type:
+ namedType: com.github.openshift.api.operator.v1.StaticIPAMDNS
+ - name: routes
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.StaticIPAMRoutes
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.StaticIPAMDNS
+ map:
+ fields:
+ - name: domain
+ type:
+ scalar: string
+ - name: nameservers
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: search
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.StaticIPAMRoutes
+ map:
+ fields:
+ - name: destination
+ type:
+ scalar: string
+ default: ""
+ - name: gateway
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.StatuspageProvider
+ map:
+ fields:
+ - name: pageID
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.Storage
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1.StorageSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1.StorageStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1.StorageSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+ - name: vsphereStorageDriver
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.StorageStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1.SyslogLoggingDestinationParameters
+ map:
+ fields:
+ - name: address
+ type:
+ scalar: string
+ default: ""
+ - name: facility
+ type:
+ scalar: string
+ - name: maxLength
+ type:
+ scalar: numeric
+ - name: port
+ type:
+ scalar: numeric
+ default: 0
+- name: com.github.openshift.api.operator.v1.Upstream
+ map:
+ fields:
+ - name: address
+ type:
+ scalar: string
+ - name: port
+ type:
+ scalar: numeric
+ - name: type
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1.UpstreamResolvers
+ map:
+ fields:
+ - name: policy
+ type:
+ scalar: string
+ - name: protocolStrategy
+ type:
+ scalar: string
+ default: ""
+ - name: transportConfig
+ type:
+ namedType: com.github.openshift.api.operator.v1.DNSTransportConfig
+ default: {}
+ - name: upstreams
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.Upstream
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1.VSphereCSIDriverConfigSpec
+ map:
+ fields:
+ - name: globalMaxSnapshotsPerBlockVolume
+ type:
+ scalar: numeric
+ - name: granularMaxSnapshotsPerBlockVolumeInVSAN
+ type:
+ scalar: numeric
+ - name: granularMaxSnapshotsPerBlockVolumeInVVOL
+ type:
+ scalar: numeric
+ - name: topologyCategories
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1alpha1.BackupJobReference
+ map:
+ fields:
+ - name: name
+ type:
+ scalar: string
+ default: ""
+ - name: namespace
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1alpha1.EtcdBackup
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1alpha1.EtcdBackupStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupSpec
+ map:
+ fields:
+ - name: pvcName
+ type:
+ scalar: string
+ default: ""
+- name: com.github.openshift.api.operator.v1alpha1.EtcdBackupStatus
+ map:
+ fields:
+ - name: backupJob
+ type:
+ namedType: com.github.openshift.api.operator.v1alpha1.BackupJobReference
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
+ elementRelationship: associative
+ keys:
+ - type
+- name: com.github.openshift.api.operator.v1alpha1.ImageContentSourcePolicy
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1alpha1.ImageContentSourcePolicySpec
+ default: {}
+- name: com.github.openshift.api.operator.v1alpha1.ImageContentSourcePolicySpec
+ map:
+ fields:
+ - name: repositoryDigestMirrors
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1alpha1.RepositoryDigestMirrors
+ elementRelationship: atomic
+- name: com.github.openshift.api.operator.v1alpha1.OLM
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: kind
+ type:
+ scalar: string
+ - name: metadata
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ default: {}
+ - name: spec
+ type:
+ namedType: com.github.openshift.api.operator.v1alpha1.OLMSpec
+ default: {}
+ - name: status
+ type:
+ namedType: com.github.openshift.api.operator.v1alpha1.OLMStatus
+ default: {}
+- name: com.github.openshift.api.operator.v1alpha1.OLMSpec
+ map:
+ fields:
+ - name: logLevel
+ type:
+ scalar: string
+ - name: managementState
+ type:
+ scalar: string
+ default: ""
+ - name: observedConfig
+ type:
+ namedType: __untyped_atomic_
+ - name: operatorLogLevel
+ type:
+ scalar: string
+ - name: unsupportedConfigOverrides
+ type:
+ namedType: __untyped_atomic_
+- name: com.github.openshift.api.operator.v1alpha1.OLMStatus
+ map:
+ fields:
+ - name: conditions
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.OperatorCondition
+ elementRelationship: associative
+ keys:
+ - type
+ - name: generations
+ type:
+ list:
+ elementType:
+ namedType: com.github.openshift.api.operator.v1.GenerationStatus
+ elementRelationship: associative
+ keys:
+ - group
+ - resource
+ - namespace
+ - name
+ - name: latestAvailableRevision
+ type:
+ scalar: numeric
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: readyReplicas
+ type:
+ scalar: numeric
+ default: 0
+ - name: version
+ type:
+ scalar: string
+- name: com.github.openshift.api.operator.v1alpha1.RepositoryDigestMirrors
+ map:
+ fields:
+ - name: mirrors
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+ - name: source
+ type:
+ scalar: string
+ default: ""
+- name: io.k8s.api.authorization.v1.FieldSelectorAttributes
+ map:
+ fields:
+ - name: rawSelector
+ type:
+ scalar: string
+ - name: requirements
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldSelectorRequirement
+ elementRelationship: atomic
+- name: io.k8s.api.authorization.v1.LabelSelectorAttributes
+ map:
+ fields:
+ - name: rawSelector
+ type:
+ scalar: string
+ - name: requirements
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement
+ elementRelationship: atomic
+- name: io.k8s.api.authorization.v1.ResourceAttributes
+ map:
+ fields:
+ - name: fieldSelector
+ type:
+ namedType: io.k8s.api.authorization.v1.FieldSelectorAttributes
+ - name: group
+ type:
+ scalar: string
+ - name: labelSelector
+ type:
+ namedType: io.k8s.api.authorization.v1.LabelSelectorAttributes
+ - name: name
+ type:
+ scalar: string
+ - name: namespace
+ type:
+ scalar: string
+ - name: resource
+ type:
+ scalar: string
+ - name: subresource
+ type:
+ scalar: string
+ - name: verb
+ type:
+ scalar: string
+ - name: version
+ type:
+ scalar: string
+- name: io.k8s.api.core.v1.LocalObjectReference
+ map:
+ fields:
+ - name: name
+ type:
+ scalar: string
+ default: ""
+ elementRelationship: atomic
+- name: io.k8s.api.core.v1.Toleration
+ map:
+ fields:
+ - name: effect
+ type:
+ scalar: string
+ - name: key
+ type:
+ scalar: string
+ - name: operator
+ type:
+ scalar: string
+ - name: tolerationSeconds
+ type:
+ scalar: numeric
+ - name: value
+ type:
+ scalar: string
+- name: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
+ map:
+ fields:
+ - name: lastTransitionTime
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
+ - name: message
+ type:
+ scalar: string
+ default: ""
+ - name: observedGeneration
+ type:
+ scalar: numeric
+ - name: reason
+ type:
+ scalar: string
+ default: ""
+ - name: status
+ type:
+ scalar: string
+ default: ""
+ - name: type
+ type:
+ scalar: string
+ default: ""
+- name: io.k8s.apimachinery.pkg.apis.meta.v1.Duration
+ scalar: string
+- name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldSelectorRequirement
+ map:
+ fields:
+ - name: key
+ type:
+ scalar: string
+ default: ""
+ - name: operator
+ type:
+ scalar: string
+ default: ""
+ - name: values
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1
+ map:
+ elementType:
+ scalar: untyped
+ list:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+ map:
+ elementType:
+ namedType: __untyped_deduced_
+ elementRelationship: separable
+- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
+ map:
+ fields:
+ - name: matchExpressions
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement
+ elementRelationship: atomic
+ - name: matchLabels
+ type:
+ map:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement
+ map:
+ fields:
+ - name: key
+ type:
+ scalar: string
+ default: ""
+ - name: operator
+ type:
+ scalar: string
+ default: ""
+ - name: values
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: atomic
+- name: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ - name: fieldsType
+ type:
+ scalar: string
+ - name: fieldsV1
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1
+ - name: manager
+ type:
+ scalar: string
+ - name: operation
+ type:
+ scalar: string
+ - name: subresource
+ type:
+ scalar: string
+ - name: time
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
+- name: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
+ map:
+ fields:
+ - name: annotations
+ type:
+ map:
+ elementType:
+ scalar: string
+ - name: creationTimestamp
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
+ - name: deletionGracePeriodSeconds
+ type:
+ scalar: numeric
+ - name: deletionTimestamp
+ type:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
+ - name: finalizers
+ type:
+ list:
+ elementType:
+ scalar: string
+ elementRelationship: associative
+ - name: generateName
+ type:
+ scalar: string
+ - name: generation
+ type:
+ scalar: numeric
+ - name: labels
+ type:
+ map:
+ elementType:
+ scalar: string
+ - name: managedFields
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry
+ elementRelationship: atomic
+ - name: name
+ type:
+ scalar: string
+ - name: namespace
+ type:
+ scalar: string
+ - name: ownerReferences
+ type:
+ list:
+ elementType:
+ namedType: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference
+ elementRelationship: associative
+ keys:
+ - uid
+ - name: resourceVersion
+ type:
+ scalar: string
+ - name: selfLink
+ type:
+ scalar: string
+ - name: uid
+ type:
+ scalar: string
+- name: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference
+ map:
+ fields:
+ - name: apiVersion
+ type:
+ scalar: string
+ default: ""
+ - name: blockOwnerDeletion
+ type:
+ scalar: boolean
+ - name: controller
+ type:
+ scalar: boolean
+ - name: kind
+ type:
+ scalar: string
+ default: ""
+ - name: name
+ type:
+ scalar: string
+ default: ""
+ - name: uid
+ type:
+ scalar: string
+ default: ""
+ elementRelationship: atomic
+- name: io.k8s.apimachinery.pkg.apis.meta.v1.Time
+ scalar: untyped
+- name: io.k8s.apimachinery.pkg.runtime.RawExtension
+ map:
+ elementType:
+ scalar: untyped
+ list:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+ map:
+ elementType:
+ namedType: __untyped_deduced_
+ elementRelationship: separable
+- name: __untyped_atomic_
+ scalar: untyped
+ list:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+ map:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+- name: __untyped_deduced_
+ scalar: untyped
+ list:
+ elementType:
+ namedType: __untyped_atomic_
+ elementRelationship: atomic
+ map:
+ elementType:
+ namedType: __untyped_deduced_
+ elementRelationship: separable
+`)
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/accesslogging.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/accesslogging.go
new file mode 100644
index 0000000000..7f74f828c1
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/accesslogging.go
@@ -0,0 +1,68 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// AccessLoggingApplyConfiguration represents a declarative configuration of the AccessLogging type for use
+// with apply.
+type AccessLoggingApplyConfiguration struct {
+ Destination *LoggingDestinationApplyConfiguration `json:"destination,omitempty"`
+ HttpLogFormat *string `json:"httpLogFormat,omitempty"`
+ HTTPCaptureHeaders *IngressControllerCaptureHTTPHeadersApplyConfiguration `json:"httpCaptureHeaders,omitempty"`
+ HTTPCaptureCookies []IngressControllerCaptureHTTPCookieApplyConfiguration `json:"httpCaptureCookies,omitempty"`
+ LogEmptyRequests *operatorv1.LoggingPolicy `json:"logEmptyRequests,omitempty"`
+}
+
+// AccessLoggingApplyConfiguration constructs a declarative configuration of the AccessLogging type for use with
+// apply.
+func AccessLogging() *AccessLoggingApplyConfiguration {
+ return &AccessLoggingApplyConfiguration{}
+}
+
+// WithDestination sets the Destination field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Destination field is set to the value of the last call.
+func (b *AccessLoggingApplyConfiguration) WithDestination(value *LoggingDestinationApplyConfiguration) *AccessLoggingApplyConfiguration {
+ b.Destination = value
+ return b
+}
+
+// WithHttpLogFormat sets the HttpLogFormat field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HttpLogFormat field is set to the value of the last call.
+func (b *AccessLoggingApplyConfiguration) WithHttpLogFormat(value string) *AccessLoggingApplyConfiguration {
+ b.HttpLogFormat = &value
+ return b
+}
+
+// WithHTTPCaptureHeaders sets the HTTPCaptureHeaders field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HTTPCaptureHeaders field is set to the value of the last call.
+func (b *AccessLoggingApplyConfiguration) WithHTTPCaptureHeaders(value *IngressControllerCaptureHTTPHeadersApplyConfiguration) *AccessLoggingApplyConfiguration {
+ b.HTTPCaptureHeaders = value
+ return b
+}
+
+// WithHTTPCaptureCookies adds the given value to the HTTPCaptureCookies field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the HTTPCaptureCookies field.
+func (b *AccessLoggingApplyConfiguration) WithHTTPCaptureCookies(values ...*IngressControllerCaptureHTTPCookieApplyConfiguration) *AccessLoggingApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithHTTPCaptureCookies")
+ }
+ b.HTTPCaptureCookies = append(b.HTTPCaptureCookies, *values[i])
+ }
+ return b
+}
+
+// WithLogEmptyRequests sets the LogEmptyRequests field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogEmptyRequests field is set to the value of the last call.
+func (b *AccessLoggingApplyConfiguration) WithLogEmptyRequests(value operatorv1.LoggingPolicy) *AccessLoggingApplyConfiguration {
+ b.LogEmptyRequests = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/additionalnetworkdefinition.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/additionalnetworkdefinition.go
new file mode 100644
index 0000000000..24508e9161
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/additionalnetworkdefinition.go
@@ -0,0 +1,63 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// AdditionalNetworkDefinitionApplyConfiguration represents a declarative configuration of the AdditionalNetworkDefinition type for use
+// with apply.
+type AdditionalNetworkDefinitionApplyConfiguration struct {
+ Type *v1.NetworkType `json:"type,omitempty"`
+ Name *string `json:"name,omitempty"`
+ Namespace *string `json:"namespace,omitempty"`
+ RawCNIConfig *string `json:"rawCNIConfig,omitempty"`
+ SimpleMacvlanConfig *SimpleMacvlanConfigApplyConfiguration `json:"simpleMacvlanConfig,omitempty"`
+}
+
+// AdditionalNetworkDefinitionApplyConfiguration constructs a declarative configuration of the AdditionalNetworkDefinition type for use with
+// apply.
+func AdditionalNetworkDefinition() *AdditionalNetworkDefinitionApplyConfiguration {
+ return &AdditionalNetworkDefinitionApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *AdditionalNetworkDefinitionApplyConfiguration) WithType(value v1.NetworkType) *AdditionalNetworkDefinitionApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *AdditionalNetworkDefinitionApplyConfiguration) WithName(value string) *AdditionalNetworkDefinitionApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *AdditionalNetworkDefinitionApplyConfiguration) WithNamespace(value string) *AdditionalNetworkDefinitionApplyConfiguration {
+ b.Namespace = &value
+ return b
+}
+
+// WithRawCNIConfig sets the RawCNIConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RawCNIConfig field is set to the value of the last call.
+func (b *AdditionalNetworkDefinitionApplyConfiguration) WithRawCNIConfig(value string) *AdditionalNetworkDefinitionApplyConfiguration {
+ b.RawCNIConfig = &value
+ return b
+}
+
+// WithSimpleMacvlanConfig sets the SimpleMacvlanConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SimpleMacvlanConfig field is set to the value of the last call.
+func (b *AdditionalNetworkDefinitionApplyConfiguration) WithSimpleMacvlanConfig(value *SimpleMacvlanConfigApplyConfiguration) *AdditionalNetworkDefinitionApplyConfiguration {
+ b.SimpleMacvlanConfig = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/additionalroutingcapabilities.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/additionalroutingcapabilities.go
new file mode 100644
index 0000000000..9707fc73be
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/additionalroutingcapabilities.go
@@ -0,0 +1,29 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// AdditionalRoutingCapabilitiesApplyConfiguration represents a declarative configuration of the AdditionalRoutingCapabilities type for use
+// with apply.
+type AdditionalRoutingCapabilitiesApplyConfiguration struct {
+ Providers []v1.RoutingCapabilitiesProvider `json:"providers,omitempty"`
+}
+
+// AdditionalRoutingCapabilitiesApplyConfiguration constructs a declarative configuration of the AdditionalRoutingCapabilities type for use with
+// apply.
+func AdditionalRoutingCapabilities() *AdditionalRoutingCapabilitiesApplyConfiguration {
+ return &AdditionalRoutingCapabilitiesApplyConfiguration{}
+}
+
+// WithProviders adds the given value to the Providers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Providers field.
+func (b *AdditionalRoutingCapabilitiesApplyConfiguration) WithProviders(values ...v1.RoutingCapabilitiesProvider) *AdditionalRoutingCapabilitiesApplyConfiguration {
+ for i := range values {
+ b.Providers = append(b.Providers, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/addpage.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/addpage.go
new file mode 100644
index 0000000000..34fe570b50
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/addpage.go
@@ -0,0 +1,25 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AddPageApplyConfiguration represents a declarative configuration of the AddPage type for use
+// with apply.
+type AddPageApplyConfiguration struct {
+ DisabledActions []string `json:"disabledActions,omitempty"`
+}
+
+// AddPageApplyConfiguration constructs a declarative configuration of the AddPage type for use with
+// apply.
+func AddPage() *AddPageApplyConfiguration {
+ return &AddPageApplyConfiguration{}
+}
+
+// WithDisabledActions adds the given value to the DisabledActions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the DisabledActions field.
+func (b *AddPageApplyConfiguration) WithDisabledActions(values ...string) *AddPageApplyConfiguration {
+ for i := range values {
+ b.DisabledActions = append(b.DisabledActions, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authentication.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authentication.go
new file mode 100644
index 0000000000..c9ac2464b6
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authentication.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// AuthenticationApplyConfiguration represents a declarative configuration of the Authentication type for use
+// with apply.
+type AuthenticationApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *AuthenticationSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *AuthenticationStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// Authentication constructs a declarative configuration of the Authentication type for use with
+// apply.
+func Authentication(name string) *AuthenticationApplyConfiguration {
+ b := &AuthenticationApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("Authentication")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractAuthentication extracts the applied configuration owned by fieldManager from
+// authentication. If no managedFields are found in authentication for fieldManager, a
+// AuthenticationApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// authentication must be a unmodified Authentication API object that was retrieved from the Kubernetes API.
+// ExtractAuthentication provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractAuthentication(authentication *apioperatorv1.Authentication, fieldManager string) (*AuthenticationApplyConfiguration, error) {
+ return extractAuthentication(authentication, fieldManager, "")
+}
+
+// ExtractAuthenticationStatus is the same as ExtractAuthentication except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractAuthenticationStatus(authentication *apioperatorv1.Authentication, fieldManager string) (*AuthenticationApplyConfiguration, error) {
+ return extractAuthentication(authentication, fieldManager, "status")
+}
+
+func extractAuthentication(authentication *apioperatorv1.Authentication, fieldManager string, subresource string) (*AuthenticationApplyConfiguration, error) {
+ b := &AuthenticationApplyConfiguration{}
+ err := managedfields.ExtractInto(authentication, internal.Parser().Type("com.github.openshift.api.operator.v1.Authentication"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(authentication.Name)
+
+ b.WithKind("Authentication")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithKind(value string) *AuthenticationApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithAPIVersion(value string) *AuthenticationApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithName(value string) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithGenerateName(value string) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithNamespace(value string) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithUID(value types.UID) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithResourceVersion(value string) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithGeneration(value int64) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *AuthenticationApplyConfiguration) WithLabels(entries map[string]string) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *AuthenticationApplyConfiguration) WithAnnotations(entries map[string]string) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *AuthenticationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *AuthenticationApplyConfiguration) WithFinalizers(values ...string) *AuthenticationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *AuthenticationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithSpec(value *AuthenticationSpecApplyConfiguration) *AuthenticationApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *AuthenticationApplyConfiguration) WithStatus(value *AuthenticationStatusApplyConfiguration) *AuthenticationApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *AuthenticationApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authenticationspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authenticationspec.go
new file mode 100644
index 0000000000..572a5332a0
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authenticationspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// AuthenticationSpecApplyConfiguration represents a declarative configuration of the AuthenticationSpec type for use
+// with apply.
+type AuthenticationSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// AuthenticationSpecApplyConfiguration constructs a declarative configuration of the AuthenticationSpec type for use with
+// apply.
+func AuthenticationSpec() *AuthenticationSpecApplyConfiguration {
+ return &AuthenticationSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *AuthenticationSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *AuthenticationSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *AuthenticationSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *AuthenticationSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *AuthenticationSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *AuthenticationSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *AuthenticationSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *AuthenticationSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *AuthenticationSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *AuthenticationSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authenticationstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authenticationstatus.go
new file mode 100644
index 0000000000..4f64c5ad3e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authenticationstatus.go
@@ -0,0 +1,82 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AuthenticationStatusApplyConfiguration represents a declarative configuration of the AuthenticationStatus type for use
+// with apply.
+type AuthenticationStatusApplyConfiguration struct {
+ OAuthAPIServer *OAuthAPIServerStatusApplyConfiguration `json:"oauthAPIServer,omitempty"`
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// AuthenticationStatusApplyConfiguration constructs a declarative configuration of the AuthenticationStatus type for use with
+// apply.
+func AuthenticationStatus() *AuthenticationStatusApplyConfiguration {
+ return &AuthenticationStatusApplyConfiguration{}
+}
+
+// WithOAuthAPIServer sets the OAuthAPIServer field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OAuthAPIServer field is set to the value of the last call.
+func (b *AuthenticationStatusApplyConfiguration) WithOAuthAPIServer(value *OAuthAPIServerStatusApplyConfiguration) *AuthenticationStatusApplyConfiguration {
+ b.OAuthAPIServer = value
+ return b
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *AuthenticationStatusApplyConfiguration) WithObservedGeneration(value int64) *AuthenticationStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *AuthenticationStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *AuthenticationStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *AuthenticationStatusApplyConfiguration) WithVersion(value string) *AuthenticationStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *AuthenticationStatusApplyConfiguration) WithReadyReplicas(value int32) *AuthenticationStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *AuthenticationStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *AuthenticationStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *AuthenticationStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *AuthenticationStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsclassicloadbalancerparameters.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsclassicloadbalancerparameters.go
new file mode 100644
index 0000000000..c0b3f0d09c
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsclassicloadbalancerparameters.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// AWSClassicLoadBalancerParametersApplyConfiguration represents a declarative configuration of the AWSClassicLoadBalancerParameters type for use
+// with apply.
+type AWSClassicLoadBalancerParametersApplyConfiguration struct {
+ ConnectionIdleTimeout *v1.Duration `json:"connectionIdleTimeout,omitempty"`
+ Subnets *AWSSubnetsApplyConfiguration `json:"subnets,omitempty"`
+}
+
+// AWSClassicLoadBalancerParametersApplyConfiguration constructs a declarative configuration of the AWSClassicLoadBalancerParameters type for use with
+// apply.
+func AWSClassicLoadBalancerParameters() *AWSClassicLoadBalancerParametersApplyConfiguration {
+ return &AWSClassicLoadBalancerParametersApplyConfiguration{}
+}
+
+// WithConnectionIdleTimeout sets the ConnectionIdleTimeout field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ConnectionIdleTimeout field is set to the value of the last call.
+func (b *AWSClassicLoadBalancerParametersApplyConfiguration) WithConnectionIdleTimeout(value v1.Duration) *AWSClassicLoadBalancerParametersApplyConfiguration {
+ b.ConnectionIdleTimeout = &value
+ return b
+}
+
+// WithSubnets sets the Subnets field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Subnets field is set to the value of the last call.
+func (b *AWSClassicLoadBalancerParametersApplyConfiguration) WithSubnets(value *AWSSubnetsApplyConfiguration) *AWSClassicLoadBalancerParametersApplyConfiguration {
+ b.Subnets = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awscsidriverconfigspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awscsidriverconfigspec.go
new file mode 100644
index 0000000000..5579ef5ee5
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awscsidriverconfigspec.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AWSCSIDriverConfigSpecApplyConfiguration represents a declarative configuration of the AWSCSIDriverConfigSpec type for use
+// with apply.
+type AWSCSIDriverConfigSpecApplyConfiguration struct {
+ KMSKeyARN *string `json:"kmsKeyARN,omitempty"`
+ EFSVolumeMetrics *AWSEFSVolumeMetricsApplyConfiguration `json:"efsVolumeMetrics,omitempty"`
+}
+
+// AWSCSIDriverConfigSpecApplyConfiguration constructs a declarative configuration of the AWSCSIDriverConfigSpec type for use with
+// apply.
+func AWSCSIDriverConfigSpec() *AWSCSIDriverConfigSpecApplyConfiguration {
+ return &AWSCSIDriverConfigSpecApplyConfiguration{}
+}
+
+// WithKMSKeyARN sets the KMSKeyARN field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the KMSKeyARN field is set to the value of the last call.
+func (b *AWSCSIDriverConfigSpecApplyConfiguration) WithKMSKeyARN(value string) *AWSCSIDriverConfigSpecApplyConfiguration {
+ b.KMSKeyARN = &value
+ return b
+}
+
+// WithEFSVolumeMetrics sets the EFSVolumeMetrics field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the EFSVolumeMetrics field is set to the value of the last call.
+func (b *AWSCSIDriverConfigSpecApplyConfiguration) WithEFSVolumeMetrics(value *AWSEFSVolumeMetricsApplyConfiguration) *AWSCSIDriverConfigSpecApplyConfiguration {
+ b.EFSVolumeMetrics = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsefsvolumemetrics.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsefsvolumemetrics.go
new file mode 100644
index 0000000000..16891541f2
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsefsvolumemetrics.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// AWSEFSVolumeMetricsApplyConfiguration represents a declarative configuration of the AWSEFSVolumeMetrics type for use
+// with apply.
+type AWSEFSVolumeMetricsApplyConfiguration struct {
+ State *v1.AWSEFSVolumeMetricsState `json:"state,omitempty"`
+ RecursiveWalk *AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration `json:"recursiveWalk,omitempty"`
+}
+
+// AWSEFSVolumeMetricsApplyConfiguration constructs a declarative configuration of the AWSEFSVolumeMetrics type for use with
+// apply.
+func AWSEFSVolumeMetrics() *AWSEFSVolumeMetricsApplyConfiguration {
+ return &AWSEFSVolumeMetricsApplyConfiguration{}
+}
+
+// WithState sets the State field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the State field is set to the value of the last call.
+func (b *AWSEFSVolumeMetricsApplyConfiguration) WithState(value v1.AWSEFSVolumeMetricsState) *AWSEFSVolumeMetricsApplyConfiguration {
+ b.State = &value
+ return b
+}
+
+// WithRecursiveWalk sets the RecursiveWalk field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RecursiveWalk field is set to the value of the last call.
+func (b *AWSEFSVolumeMetricsApplyConfiguration) WithRecursiveWalk(value *AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration) *AWSEFSVolumeMetricsApplyConfiguration {
+ b.RecursiveWalk = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsefsvolumemetricsrecursivewalkconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsefsvolumemetricsrecursivewalkconfig.go
new file mode 100644
index 0000000000..23d68c209f
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsefsvolumemetricsrecursivewalkconfig.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration represents a declarative configuration of the AWSEFSVolumeMetricsRecursiveWalkConfig type for use
+// with apply.
+type AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration struct {
+ RefreshPeriodMinutes *int32 `json:"refreshPeriodMinutes,omitempty"`
+ FSRateLimit *int32 `json:"fsRateLimit,omitempty"`
+}
+
+// AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration constructs a declarative configuration of the AWSEFSVolumeMetricsRecursiveWalkConfig type for use with
+// apply.
+func AWSEFSVolumeMetricsRecursiveWalkConfig() *AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration {
+ return &AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration{}
+}
+
+// WithRefreshPeriodMinutes sets the RefreshPeriodMinutes field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RefreshPeriodMinutes field is set to the value of the last call.
+func (b *AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration) WithRefreshPeriodMinutes(value int32) *AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration {
+ b.RefreshPeriodMinutes = &value
+ return b
+}
+
+// WithFSRateLimit sets the FSRateLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the FSRateLimit field is set to the value of the last call.
+func (b *AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration) WithFSRateLimit(value int32) *AWSEFSVolumeMetricsRecursiveWalkConfigApplyConfiguration {
+ b.FSRateLimit = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsloadbalancerparameters.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsloadbalancerparameters.go
new file mode 100644
index 0000000000..39599f59ae
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsloadbalancerparameters.go
@@ -0,0 +1,45 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// AWSLoadBalancerParametersApplyConfiguration represents a declarative configuration of the AWSLoadBalancerParameters type for use
+// with apply.
+type AWSLoadBalancerParametersApplyConfiguration struct {
+ Type *v1.AWSLoadBalancerType `json:"type,omitempty"`
+ ClassicLoadBalancerParameters *AWSClassicLoadBalancerParametersApplyConfiguration `json:"classicLoadBalancer,omitempty"`
+ NetworkLoadBalancerParameters *AWSNetworkLoadBalancerParametersApplyConfiguration `json:"networkLoadBalancer,omitempty"`
+}
+
+// AWSLoadBalancerParametersApplyConfiguration constructs a declarative configuration of the AWSLoadBalancerParameters type for use with
+// apply.
+func AWSLoadBalancerParameters() *AWSLoadBalancerParametersApplyConfiguration {
+ return &AWSLoadBalancerParametersApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *AWSLoadBalancerParametersApplyConfiguration) WithType(value v1.AWSLoadBalancerType) *AWSLoadBalancerParametersApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithClassicLoadBalancerParameters sets the ClassicLoadBalancerParameters field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClassicLoadBalancerParameters field is set to the value of the last call.
+func (b *AWSLoadBalancerParametersApplyConfiguration) WithClassicLoadBalancerParameters(value *AWSClassicLoadBalancerParametersApplyConfiguration) *AWSLoadBalancerParametersApplyConfiguration {
+ b.ClassicLoadBalancerParameters = value
+ return b
+}
+
+// WithNetworkLoadBalancerParameters sets the NetworkLoadBalancerParameters field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NetworkLoadBalancerParameters field is set to the value of the last call.
+func (b *AWSLoadBalancerParametersApplyConfiguration) WithNetworkLoadBalancerParameters(value *AWSNetworkLoadBalancerParametersApplyConfiguration) *AWSLoadBalancerParametersApplyConfiguration {
+ b.NetworkLoadBalancerParameters = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsnetworkloadbalancerparameters.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsnetworkloadbalancerparameters.go
new file mode 100644
index 0000000000..c611c53184
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsnetworkloadbalancerparameters.go
@@ -0,0 +1,38 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// AWSNetworkLoadBalancerParametersApplyConfiguration represents a declarative configuration of the AWSNetworkLoadBalancerParameters type for use
+// with apply.
+type AWSNetworkLoadBalancerParametersApplyConfiguration struct {
+ Subnets *AWSSubnetsApplyConfiguration `json:"subnets,omitempty"`
+ EIPAllocations []operatorv1.EIPAllocation `json:"eipAllocations,omitempty"`
+}
+
+// AWSNetworkLoadBalancerParametersApplyConfiguration constructs a declarative configuration of the AWSNetworkLoadBalancerParameters type for use with
+// apply.
+func AWSNetworkLoadBalancerParameters() *AWSNetworkLoadBalancerParametersApplyConfiguration {
+ return &AWSNetworkLoadBalancerParametersApplyConfiguration{}
+}
+
+// WithSubnets sets the Subnets field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Subnets field is set to the value of the last call.
+func (b *AWSNetworkLoadBalancerParametersApplyConfiguration) WithSubnets(value *AWSSubnetsApplyConfiguration) *AWSNetworkLoadBalancerParametersApplyConfiguration {
+ b.Subnets = value
+ return b
+}
+
+// WithEIPAllocations adds the given value to the EIPAllocations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the EIPAllocations field.
+func (b *AWSNetworkLoadBalancerParametersApplyConfiguration) WithEIPAllocations(values ...operatorv1.EIPAllocation) *AWSNetworkLoadBalancerParametersApplyConfiguration {
+ for i := range values {
+ b.EIPAllocations = append(b.EIPAllocations, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awssubnets.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awssubnets.go
new file mode 100644
index 0000000000..8dbc4f6881
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awssubnets.go
@@ -0,0 +1,40 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// AWSSubnetsApplyConfiguration represents a declarative configuration of the AWSSubnets type for use
+// with apply.
+type AWSSubnetsApplyConfiguration struct {
+ IDs []v1.AWSSubnetID `json:"ids,omitempty"`
+ Names []v1.AWSSubnetName `json:"names,omitempty"`
+}
+
+// AWSSubnetsApplyConfiguration constructs a declarative configuration of the AWSSubnets type for use with
+// apply.
+func AWSSubnets() *AWSSubnetsApplyConfiguration {
+ return &AWSSubnetsApplyConfiguration{}
+}
+
+// WithIDs adds the given value to the IDs field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the IDs field.
+func (b *AWSSubnetsApplyConfiguration) WithIDs(values ...v1.AWSSubnetID) *AWSSubnetsApplyConfiguration {
+ for i := range values {
+ b.IDs = append(b.IDs, values[i])
+ }
+ return b
+}
+
+// WithNames adds the given value to the Names field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Names field.
+func (b *AWSSubnetsApplyConfiguration) WithNames(values ...v1.AWSSubnetName) *AWSSubnetsApplyConfiguration {
+ for i := range values {
+ b.Names = append(b.Names, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/azurecsidriverconfigspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/azurecsidriverconfigspec.go
new file mode 100644
index 0000000000..6117a337a4
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/azurecsidriverconfigspec.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AzureCSIDriverConfigSpecApplyConfiguration represents a declarative configuration of the AzureCSIDriverConfigSpec type for use
+// with apply.
+type AzureCSIDriverConfigSpecApplyConfiguration struct {
+ DiskEncryptionSet *AzureDiskEncryptionSetApplyConfiguration `json:"diskEncryptionSet,omitempty"`
+}
+
+// AzureCSIDriverConfigSpecApplyConfiguration constructs a declarative configuration of the AzureCSIDriverConfigSpec type for use with
+// apply.
+func AzureCSIDriverConfigSpec() *AzureCSIDriverConfigSpecApplyConfiguration {
+ return &AzureCSIDriverConfigSpecApplyConfiguration{}
+}
+
+// WithDiskEncryptionSet sets the DiskEncryptionSet field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DiskEncryptionSet field is set to the value of the last call.
+func (b *AzureCSIDriverConfigSpecApplyConfiguration) WithDiskEncryptionSet(value *AzureDiskEncryptionSetApplyConfiguration) *AzureCSIDriverConfigSpecApplyConfiguration {
+ b.DiskEncryptionSet = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/azurediskencryptionset.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/azurediskencryptionset.go
new file mode 100644
index 0000000000..917bf2cfd8
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/azurediskencryptionset.go
@@ -0,0 +1,41 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// AzureDiskEncryptionSetApplyConfiguration represents a declarative configuration of the AzureDiskEncryptionSet type for use
+// with apply.
+type AzureDiskEncryptionSetApplyConfiguration struct {
+ SubscriptionID *string `json:"subscriptionID,omitempty"`
+ ResourceGroup *string `json:"resourceGroup,omitempty"`
+ Name *string `json:"name,omitempty"`
+}
+
+// AzureDiskEncryptionSetApplyConfiguration constructs a declarative configuration of the AzureDiskEncryptionSet type for use with
+// apply.
+func AzureDiskEncryptionSet() *AzureDiskEncryptionSetApplyConfiguration {
+ return &AzureDiskEncryptionSetApplyConfiguration{}
+}
+
+// WithSubscriptionID sets the SubscriptionID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SubscriptionID field is set to the value of the last call.
+func (b *AzureDiskEncryptionSetApplyConfiguration) WithSubscriptionID(value string) *AzureDiskEncryptionSetApplyConfiguration {
+ b.SubscriptionID = &value
+ return b
+}
+
+// WithResourceGroup sets the ResourceGroup field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceGroup field is set to the value of the last call.
+func (b *AzureDiskEncryptionSetApplyConfiguration) WithResourceGroup(value string) *AzureDiskEncryptionSetApplyConfiguration {
+ b.ResourceGroup = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *AzureDiskEncryptionSetApplyConfiguration) WithName(value string) *AzureDiskEncryptionSetApplyConfiguration {
+ b.Name = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/capability.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/capability.go
new file mode 100644
index 0000000000..01d8544b81
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/capability.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// CapabilityApplyConfiguration represents a declarative configuration of the Capability type for use
+// with apply.
+type CapabilityApplyConfiguration struct {
+ Name *v1.ConsoleCapabilityName `json:"name,omitempty"`
+ Visibility *CapabilityVisibilityApplyConfiguration `json:"visibility,omitempty"`
+}
+
+// CapabilityApplyConfiguration constructs a declarative configuration of the Capability type for use with
+// apply.
+func Capability() *CapabilityApplyConfiguration {
+ return &CapabilityApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *CapabilityApplyConfiguration) WithName(value v1.ConsoleCapabilityName) *CapabilityApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithVisibility sets the Visibility field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Visibility field is set to the value of the last call.
+func (b *CapabilityApplyConfiguration) WithVisibility(value *CapabilityVisibilityApplyConfiguration) *CapabilityApplyConfiguration {
+ b.Visibility = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/capabilityvisibility.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/capabilityvisibility.go
new file mode 100644
index 0000000000..a5779ead32
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/capabilityvisibility.go
@@ -0,0 +1,27 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// CapabilityVisibilityApplyConfiguration represents a declarative configuration of the CapabilityVisibility type for use
+// with apply.
+type CapabilityVisibilityApplyConfiguration struct {
+ State *v1.CapabilityState `json:"state,omitempty"`
+}
+
+// CapabilityVisibilityApplyConfiguration constructs a declarative configuration of the CapabilityVisibility type for use with
+// apply.
+func CapabilityVisibility() *CapabilityVisibilityApplyConfiguration {
+ return &CapabilityVisibilityApplyConfiguration{}
+}
+
+// WithState sets the State field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the State field is set to the value of the last call.
+func (b *CapabilityVisibilityApplyConfiguration) WithState(value v1.CapabilityState) *CapabilityVisibilityApplyConfiguration {
+ b.State = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clienttls.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clienttls.go
new file mode 100644
index 0000000000..5617c1b0bf
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clienttls.go
@@ -0,0 +1,48 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ configv1 "github.com/openshift/api/config/v1"
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// ClientTLSApplyConfiguration represents a declarative configuration of the ClientTLS type for use
+// with apply.
+type ClientTLSApplyConfiguration struct {
+ ClientCertificatePolicy *v1.ClientCertificatePolicy `json:"clientCertificatePolicy,omitempty"`
+ ClientCA *configv1.ConfigMapNameReference `json:"clientCA,omitempty"`
+ AllowedSubjectPatterns []string `json:"allowedSubjectPatterns,omitempty"`
+}
+
+// ClientTLSApplyConfiguration constructs a declarative configuration of the ClientTLS type for use with
+// apply.
+func ClientTLS() *ClientTLSApplyConfiguration {
+ return &ClientTLSApplyConfiguration{}
+}
+
+// WithClientCertificatePolicy sets the ClientCertificatePolicy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClientCertificatePolicy field is set to the value of the last call.
+func (b *ClientTLSApplyConfiguration) WithClientCertificatePolicy(value v1.ClientCertificatePolicy) *ClientTLSApplyConfiguration {
+ b.ClientCertificatePolicy = &value
+ return b
+}
+
+// WithClientCA sets the ClientCA field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClientCA field is set to the value of the last call.
+func (b *ClientTLSApplyConfiguration) WithClientCA(value configv1.ConfigMapNameReference) *ClientTLSApplyConfiguration {
+ b.ClientCA = &value
+ return b
+}
+
+// WithAllowedSubjectPatterns adds the given value to the AllowedSubjectPatterns field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the AllowedSubjectPatterns field.
+func (b *ClientTLSApplyConfiguration) WithAllowedSubjectPatterns(values ...string) *ClientTLSApplyConfiguration {
+ for i := range values {
+ b.AllowedSubjectPatterns = append(b.AllowedSubjectPatterns, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredential.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredential.go
new file mode 100644
index 0000000000..80824b5393
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredential.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// CloudCredentialApplyConfiguration represents a declarative configuration of the CloudCredential type for use
+// with apply.
+type CloudCredentialApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *CloudCredentialSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *CloudCredentialStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// CloudCredential constructs a declarative configuration of the CloudCredential type for use with
+// apply.
+func CloudCredential(name string) *CloudCredentialApplyConfiguration {
+ b := &CloudCredentialApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("CloudCredential")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractCloudCredential extracts the applied configuration owned by fieldManager from
+// cloudCredential. If no managedFields are found in cloudCredential for fieldManager, a
+// CloudCredentialApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// cloudCredential must be a unmodified CloudCredential API object that was retrieved from the Kubernetes API.
+// ExtractCloudCredential provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractCloudCredential(cloudCredential *apioperatorv1.CloudCredential, fieldManager string) (*CloudCredentialApplyConfiguration, error) {
+ return extractCloudCredential(cloudCredential, fieldManager, "")
+}
+
+// ExtractCloudCredentialStatus is the same as ExtractCloudCredential except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractCloudCredentialStatus(cloudCredential *apioperatorv1.CloudCredential, fieldManager string) (*CloudCredentialApplyConfiguration, error) {
+ return extractCloudCredential(cloudCredential, fieldManager, "status")
+}
+
+func extractCloudCredential(cloudCredential *apioperatorv1.CloudCredential, fieldManager string, subresource string) (*CloudCredentialApplyConfiguration, error) {
+ b := &CloudCredentialApplyConfiguration{}
+ err := managedfields.ExtractInto(cloudCredential, internal.Parser().Type("com.github.openshift.api.operator.v1.CloudCredential"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(cloudCredential.Name)
+
+ b.WithKind("CloudCredential")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithKind(value string) *CloudCredentialApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithAPIVersion(value string) *CloudCredentialApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithName(value string) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithGenerateName(value string) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithNamespace(value string) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithUID(value types.UID) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithResourceVersion(value string) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithGeneration(value int64) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *CloudCredentialApplyConfiguration) WithLabels(entries map[string]string) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *CloudCredentialApplyConfiguration) WithAnnotations(entries map[string]string) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *CloudCredentialApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *CloudCredentialApplyConfiguration) WithFinalizers(values ...string) *CloudCredentialApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *CloudCredentialApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithSpec(value *CloudCredentialSpecApplyConfiguration) *CloudCredentialApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *CloudCredentialApplyConfiguration) WithStatus(value *CloudCredentialStatusApplyConfiguration) *CloudCredentialApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *CloudCredentialApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredentialspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredentialspec.go
new file mode 100644
index 0000000000..98f36a12b9
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredentialspec.go
@@ -0,0 +1,69 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// CloudCredentialSpecApplyConfiguration represents a declarative configuration of the CloudCredentialSpec type for use
+// with apply.
+type CloudCredentialSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+ CredentialsMode *operatorv1.CloudCredentialsMode `json:"credentialsMode,omitempty"`
+}
+
+// CloudCredentialSpecApplyConfiguration constructs a declarative configuration of the CloudCredentialSpec type for use with
+// apply.
+func CloudCredentialSpec() *CloudCredentialSpecApplyConfiguration {
+ return &CloudCredentialSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *CloudCredentialSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *CloudCredentialSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *CloudCredentialSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *CloudCredentialSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *CloudCredentialSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *CloudCredentialSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *CloudCredentialSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *CloudCredentialSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *CloudCredentialSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *CloudCredentialSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithCredentialsMode sets the CredentialsMode field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CredentialsMode field is set to the value of the last call.
+func (b *CloudCredentialSpecApplyConfiguration) WithCredentialsMode(value operatorv1.CloudCredentialsMode) *CloudCredentialSpecApplyConfiguration {
+ b.CredentialsMode = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredentialstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredentialstatus.go
new file mode 100644
index 0000000000..f02c542c4b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredentialstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// CloudCredentialStatusApplyConfiguration represents a declarative configuration of the CloudCredentialStatus type for use
+// with apply.
+type CloudCredentialStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// CloudCredentialStatusApplyConfiguration constructs a declarative configuration of the CloudCredentialStatus type for use with
+// apply.
+func CloudCredentialStatus() *CloudCredentialStatusApplyConfiguration {
+ return &CloudCredentialStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *CloudCredentialStatusApplyConfiguration) WithObservedGeneration(value int64) *CloudCredentialStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *CloudCredentialStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *CloudCredentialStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *CloudCredentialStatusApplyConfiguration) WithVersion(value string) *CloudCredentialStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *CloudCredentialStatusApplyConfiguration) WithReadyReplicas(value int32) *CloudCredentialStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *CloudCredentialStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *CloudCredentialStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *CloudCredentialStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *CloudCredentialStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriver.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriver.go
new file mode 100644
index 0000000000..3df2ac8f6f
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriver.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// ClusterCSIDriverApplyConfiguration represents a declarative configuration of the ClusterCSIDriver type for use
+// with apply.
+type ClusterCSIDriverApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *ClusterCSIDriverSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *ClusterCSIDriverStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// ClusterCSIDriver constructs a declarative configuration of the ClusterCSIDriver type for use with
+// apply.
+func ClusterCSIDriver(name string) *ClusterCSIDriverApplyConfiguration {
+ b := &ClusterCSIDriverApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("ClusterCSIDriver")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractClusterCSIDriver extracts the applied configuration owned by fieldManager from
+// clusterCSIDriver. If no managedFields are found in clusterCSIDriver for fieldManager, a
+// ClusterCSIDriverApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// clusterCSIDriver must be a unmodified ClusterCSIDriver API object that was retrieved from the Kubernetes API.
+// ExtractClusterCSIDriver provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractClusterCSIDriver(clusterCSIDriver *apioperatorv1.ClusterCSIDriver, fieldManager string) (*ClusterCSIDriverApplyConfiguration, error) {
+ return extractClusterCSIDriver(clusterCSIDriver, fieldManager, "")
+}
+
+// ExtractClusterCSIDriverStatus is the same as ExtractClusterCSIDriver except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractClusterCSIDriverStatus(clusterCSIDriver *apioperatorv1.ClusterCSIDriver, fieldManager string) (*ClusterCSIDriverApplyConfiguration, error) {
+ return extractClusterCSIDriver(clusterCSIDriver, fieldManager, "status")
+}
+
+func extractClusterCSIDriver(clusterCSIDriver *apioperatorv1.ClusterCSIDriver, fieldManager string, subresource string) (*ClusterCSIDriverApplyConfiguration, error) {
+ b := &ClusterCSIDriverApplyConfiguration{}
+ err := managedfields.ExtractInto(clusterCSIDriver, internal.Parser().Type("com.github.openshift.api.operator.v1.ClusterCSIDriver"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(clusterCSIDriver.Name)
+
+ b.WithKind("ClusterCSIDriver")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithKind(value string) *ClusterCSIDriverApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithAPIVersion(value string) *ClusterCSIDriverApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithName(value string) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithGenerateName(value string) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithNamespace(value string) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithUID(value types.UID) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithResourceVersion(value string) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithGeneration(value int64) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *ClusterCSIDriverApplyConfiguration) WithLabels(entries map[string]string) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *ClusterCSIDriverApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *ClusterCSIDriverApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *ClusterCSIDriverApplyConfiguration) WithFinalizers(values ...string) *ClusterCSIDriverApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *ClusterCSIDriverApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithSpec(value *ClusterCSIDriverSpecApplyConfiguration) *ClusterCSIDriverApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *ClusterCSIDriverApplyConfiguration) WithStatus(value *ClusterCSIDriverStatusApplyConfiguration) *ClusterCSIDriverApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ClusterCSIDriverApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriverspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriverspec.go
new file mode 100644
index 0000000000..a5837a95c2
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriverspec.go
@@ -0,0 +1,78 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// ClusterCSIDriverSpecApplyConfiguration represents a declarative configuration of the ClusterCSIDriverSpec type for use
+// with apply.
+type ClusterCSIDriverSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+ StorageClassState *operatorv1.StorageClassStateName `json:"storageClassState,omitempty"`
+ DriverConfig *CSIDriverConfigSpecApplyConfiguration `json:"driverConfig,omitempty"`
+}
+
+// ClusterCSIDriverSpecApplyConfiguration constructs a declarative configuration of the ClusterCSIDriverSpec type for use with
+// apply.
+func ClusterCSIDriverSpec() *ClusterCSIDriverSpecApplyConfiguration {
+ return &ClusterCSIDriverSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *ClusterCSIDriverSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *ClusterCSIDriverSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *ClusterCSIDriverSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *ClusterCSIDriverSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *ClusterCSIDriverSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *ClusterCSIDriverSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *ClusterCSIDriverSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *ClusterCSIDriverSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *ClusterCSIDriverSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *ClusterCSIDriverSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithStorageClassState sets the StorageClassState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the StorageClassState field is set to the value of the last call.
+func (b *ClusterCSIDriverSpecApplyConfiguration) WithStorageClassState(value operatorv1.StorageClassStateName) *ClusterCSIDriverSpecApplyConfiguration {
+ b.StorageClassState = &value
+ return b
+}
+
+// WithDriverConfig sets the DriverConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DriverConfig field is set to the value of the last call.
+func (b *ClusterCSIDriverSpecApplyConfiguration) WithDriverConfig(value *CSIDriverConfigSpecApplyConfiguration) *ClusterCSIDriverSpecApplyConfiguration {
+ b.DriverConfig = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriverstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriverstatus.go
new file mode 100644
index 0000000000..ba2c1ee9d4
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriverstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ClusterCSIDriverStatusApplyConfiguration represents a declarative configuration of the ClusterCSIDriverStatus type for use
+// with apply.
+type ClusterCSIDriverStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// ClusterCSIDriverStatusApplyConfiguration constructs a declarative configuration of the ClusterCSIDriverStatus type for use with
+// apply.
+func ClusterCSIDriverStatus() *ClusterCSIDriverStatusApplyConfiguration {
+ return &ClusterCSIDriverStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *ClusterCSIDriverStatusApplyConfiguration) WithObservedGeneration(value int64) *ClusterCSIDriverStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *ClusterCSIDriverStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *ClusterCSIDriverStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *ClusterCSIDriverStatusApplyConfiguration) WithVersion(value string) *ClusterCSIDriverStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *ClusterCSIDriverStatusApplyConfiguration) WithReadyReplicas(value int32) *ClusterCSIDriverStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *ClusterCSIDriverStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *ClusterCSIDriverStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *ClusterCSIDriverStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *ClusterCSIDriverStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clusternetworkentry.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clusternetworkentry.go
new file mode 100644
index 0000000000..ac180f893d
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clusternetworkentry.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ClusterNetworkEntryApplyConfiguration represents a declarative configuration of the ClusterNetworkEntry type for use
+// with apply.
+type ClusterNetworkEntryApplyConfiguration struct {
+ CIDR *string `json:"cidr,omitempty"`
+ HostPrefix *uint32 `json:"hostPrefix,omitempty"`
+}
+
+// ClusterNetworkEntryApplyConfiguration constructs a declarative configuration of the ClusterNetworkEntry type for use with
+// apply.
+func ClusterNetworkEntry() *ClusterNetworkEntryApplyConfiguration {
+ return &ClusterNetworkEntryApplyConfiguration{}
+}
+
+// WithCIDR sets the CIDR field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CIDR field is set to the value of the last call.
+func (b *ClusterNetworkEntryApplyConfiguration) WithCIDR(value string) *ClusterNetworkEntryApplyConfiguration {
+ b.CIDR = &value
+ return b
+}
+
+// WithHostPrefix sets the HostPrefix field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HostPrefix field is set to the value of the last call.
+func (b *ClusterNetworkEntryApplyConfiguration) WithHostPrefix(value uint32) *ClusterNetworkEntryApplyConfiguration {
+ b.HostPrefix = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/config.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/config.go
new file mode 100644
index 0000000000..7dd7d64d5e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/config.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// ConfigApplyConfiguration represents a declarative configuration of the Config type for use
+// with apply.
+type ConfigApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *ConfigSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *ConfigStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// Config constructs a declarative configuration of the Config type for use with
+// apply.
+func Config(name string) *ConfigApplyConfiguration {
+ b := &ConfigApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("Config")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractConfig extracts the applied configuration owned by fieldManager from
+// config. If no managedFields are found in config for fieldManager, a
+// ConfigApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// config must be a unmodified Config API object that was retrieved from the Kubernetes API.
+// ExtractConfig provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractConfig(config *apioperatorv1.Config, fieldManager string) (*ConfigApplyConfiguration, error) {
+ return extractConfig(config, fieldManager, "")
+}
+
+// ExtractConfigStatus is the same as ExtractConfig except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractConfigStatus(config *apioperatorv1.Config, fieldManager string) (*ConfigApplyConfiguration, error) {
+ return extractConfig(config, fieldManager, "status")
+}
+
+func extractConfig(config *apioperatorv1.Config, fieldManager string, subresource string) (*ConfigApplyConfiguration, error) {
+ b := &ConfigApplyConfiguration{}
+ err := managedfields.ExtractInto(config, internal.Parser().Type("com.github.openshift.api.operator.v1.Config"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(config.Name)
+
+ b.WithKind("Config")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithKind(value string) *ConfigApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithAPIVersion(value string) *ConfigApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithName(value string) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithGenerateName(value string) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithNamespace(value string) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithUID(value types.UID) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithResourceVersion(value string) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithGeneration(value int64) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *ConfigApplyConfiguration) WithLabels(entries map[string]string) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *ConfigApplyConfiguration) WithAnnotations(entries map[string]string) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *ConfigApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *ConfigApplyConfiguration) WithFinalizers(values ...string) *ConfigApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *ConfigApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithSpec(value *ConfigSpecApplyConfiguration) *ConfigApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *ConfigApplyConfiguration) WithStatus(value *ConfigStatusApplyConfiguration) *ConfigApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ConfigApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/configspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/configspec.go
new file mode 100644
index 0000000000..b5c044dce9
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/configspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// ConfigSpecApplyConfiguration represents a declarative configuration of the ConfigSpec type for use
+// with apply.
+type ConfigSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// ConfigSpecApplyConfiguration constructs a declarative configuration of the ConfigSpec type for use with
+// apply.
+func ConfigSpec() *ConfigSpecApplyConfiguration {
+ return &ConfigSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *ConfigSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *ConfigSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *ConfigSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *ConfigSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *ConfigSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *ConfigSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *ConfigSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *ConfigSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *ConfigSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *ConfigSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/configstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/configstatus.go
new file mode 100644
index 0000000000..b151b4e8a1
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/configstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ConfigStatusApplyConfiguration represents a declarative configuration of the ConfigStatus type for use
+// with apply.
+type ConfigStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// ConfigStatusApplyConfiguration constructs a declarative configuration of the ConfigStatus type for use with
+// apply.
+func ConfigStatus() *ConfigStatusApplyConfiguration {
+ return &ConfigStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *ConfigStatusApplyConfiguration) WithObservedGeneration(value int64) *ConfigStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *ConfigStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *ConfigStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *ConfigStatusApplyConfiguration) WithVersion(value string) *ConfigStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *ConfigStatusApplyConfiguration) WithReadyReplicas(value int32) *ConfigStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *ConfigStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *ConfigStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *ConfigStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *ConfigStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/console.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/console.go
new file mode 100644
index 0000000000..dd7bf4a3d8
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/console.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// ConsoleApplyConfiguration represents a declarative configuration of the Console type for use
+// with apply.
+type ConsoleApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *ConsoleSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *ConsoleStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// Console constructs a declarative configuration of the Console type for use with
+// apply.
+func Console(name string) *ConsoleApplyConfiguration {
+ b := &ConsoleApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("Console")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractConsole extracts the applied configuration owned by fieldManager from
+// console. If no managedFields are found in console for fieldManager, a
+// ConsoleApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// console must be a unmodified Console API object that was retrieved from the Kubernetes API.
+// ExtractConsole provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractConsole(console *apioperatorv1.Console, fieldManager string) (*ConsoleApplyConfiguration, error) {
+ return extractConsole(console, fieldManager, "")
+}
+
+// ExtractConsoleStatus is the same as ExtractConsole except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractConsoleStatus(console *apioperatorv1.Console, fieldManager string) (*ConsoleApplyConfiguration, error) {
+ return extractConsole(console, fieldManager, "status")
+}
+
+func extractConsole(console *apioperatorv1.Console, fieldManager string, subresource string) (*ConsoleApplyConfiguration, error) {
+ b := &ConsoleApplyConfiguration{}
+ err := managedfields.ExtractInto(console, internal.Parser().Type("com.github.openshift.api.operator.v1.Console"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(console.Name)
+
+ b.WithKind("Console")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithKind(value string) *ConsoleApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithAPIVersion(value string) *ConsoleApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithName(value string) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithGenerateName(value string) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithNamespace(value string) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithUID(value types.UID) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithResourceVersion(value string) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithGeneration(value int64) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *ConsoleApplyConfiguration) WithLabels(entries map[string]string) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *ConsoleApplyConfiguration) WithAnnotations(entries map[string]string) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *ConsoleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *ConsoleApplyConfiguration) WithFinalizers(values ...string) *ConsoleApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *ConsoleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithSpec(value *ConsoleSpecApplyConfiguration) *ConsoleApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *ConsoleApplyConfiguration) WithStatus(value *ConsoleStatusApplyConfiguration) *ConsoleApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ConsoleApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consoleconfigroute.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consoleconfigroute.go
new file mode 100644
index 0000000000..d8a9310f6a
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consoleconfigroute.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/config/v1"
+)
+
+// ConsoleConfigRouteApplyConfiguration represents a declarative configuration of the ConsoleConfigRoute type for use
+// with apply.
+type ConsoleConfigRouteApplyConfiguration struct {
+ Hostname *string `json:"hostname,omitempty"`
+ Secret *v1.SecretNameReference `json:"secret,omitempty"`
+}
+
+// ConsoleConfigRouteApplyConfiguration constructs a declarative configuration of the ConsoleConfigRoute type for use with
+// apply.
+func ConsoleConfigRoute() *ConsoleConfigRouteApplyConfiguration {
+ return &ConsoleConfigRouteApplyConfiguration{}
+}
+
+// WithHostname sets the Hostname field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Hostname field is set to the value of the last call.
+func (b *ConsoleConfigRouteApplyConfiguration) WithHostname(value string) *ConsoleConfigRouteApplyConfiguration {
+ b.Hostname = &value
+ return b
+}
+
+// WithSecret sets the Secret field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Secret field is set to the value of the last call.
+func (b *ConsoleConfigRouteApplyConfiguration) WithSecret(value v1.SecretNameReference) *ConsoleConfigRouteApplyConfiguration {
+ b.Secret = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolecustomization.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolecustomization.go
new file mode 100644
index 0000000000..2868e17d71
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolecustomization.go
@@ -0,0 +1,119 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ configv1 "github.com/openshift/api/config/v1"
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// ConsoleCustomizationApplyConfiguration represents a declarative configuration of the ConsoleCustomization type for use
+// with apply.
+type ConsoleCustomizationApplyConfiguration struct {
+ Capabilities []CapabilityApplyConfiguration `json:"capabilities,omitempty"`
+ Brand *operatorv1.Brand `json:"brand,omitempty"`
+ DocumentationBaseURL *string `json:"documentationBaseURL,omitempty"`
+ CustomProductName *string `json:"customProductName,omitempty"`
+ CustomLogoFile *configv1.ConfigMapFileReference `json:"customLogoFile,omitempty"`
+ DeveloperCatalog *DeveloperConsoleCatalogCustomizationApplyConfiguration `json:"developerCatalog,omitempty"`
+ ProjectAccess *ProjectAccessApplyConfiguration `json:"projectAccess,omitempty"`
+ QuickStarts *QuickStartsApplyConfiguration `json:"quickStarts,omitempty"`
+ AddPage *AddPageApplyConfiguration `json:"addPage,omitempty"`
+ Perspectives []PerspectiveApplyConfiguration `json:"perspectives,omitempty"`
+}
+
+// ConsoleCustomizationApplyConfiguration constructs a declarative configuration of the ConsoleCustomization type for use with
+// apply.
+func ConsoleCustomization() *ConsoleCustomizationApplyConfiguration {
+ return &ConsoleCustomizationApplyConfiguration{}
+}
+
+// WithCapabilities adds the given value to the Capabilities field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Capabilities field.
+func (b *ConsoleCustomizationApplyConfiguration) WithCapabilities(values ...*CapabilityApplyConfiguration) *ConsoleCustomizationApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithCapabilities")
+ }
+ b.Capabilities = append(b.Capabilities, *values[i])
+ }
+ return b
+}
+
+// WithBrand sets the Brand field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Brand field is set to the value of the last call.
+func (b *ConsoleCustomizationApplyConfiguration) WithBrand(value operatorv1.Brand) *ConsoleCustomizationApplyConfiguration {
+ b.Brand = &value
+ return b
+}
+
+// WithDocumentationBaseURL sets the DocumentationBaseURL field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DocumentationBaseURL field is set to the value of the last call.
+func (b *ConsoleCustomizationApplyConfiguration) WithDocumentationBaseURL(value string) *ConsoleCustomizationApplyConfiguration {
+ b.DocumentationBaseURL = &value
+ return b
+}
+
+// WithCustomProductName sets the CustomProductName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CustomProductName field is set to the value of the last call.
+func (b *ConsoleCustomizationApplyConfiguration) WithCustomProductName(value string) *ConsoleCustomizationApplyConfiguration {
+ b.CustomProductName = &value
+ return b
+}
+
+// WithCustomLogoFile sets the CustomLogoFile field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CustomLogoFile field is set to the value of the last call.
+func (b *ConsoleCustomizationApplyConfiguration) WithCustomLogoFile(value configv1.ConfigMapFileReference) *ConsoleCustomizationApplyConfiguration {
+ b.CustomLogoFile = &value
+ return b
+}
+
+// WithDeveloperCatalog sets the DeveloperCatalog field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeveloperCatalog field is set to the value of the last call.
+func (b *ConsoleCustomizationApplyConfiguration) WithDeveloperCatalog(value *DeveloperConsoleCatalogCustomizationApplyConfiguration) *ConsoleCustomizationApplyConfiguration {
+ b.DeveloperCatalog = value
+ return b
+}
+
+// WithProjectAccess sets the ProjectAccess field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ProjectAccess field is set to the value of the last call.
+func (b *ConsoleCustomizationApplyConfiguration) WithProjectAccess(value *ProjectAccessApplyConfiguration) *ConsoleCustomizationApplyConfiguration {
+ b.ProjectAccess = value
+ return b
+}
+
+// WithQuickStarts sets the QuickStarts field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the QuickStarts field is set to the value of the last call.
+func (b *ConsoleCustomizationApplyConfiguration) WithQuickStarts(value *QuickStartsApplyConfiguration) *ConsoleCustomizationApplyConfiguration {
+ b.QuickStarts = value
+ return b
+}
+
+// WithAddPage sets the AddPage field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the AddPage field is set to the value of the last call.
+func (b *ConsoleCustomizationApplyConfiguration) WithAddPage(value *AddPageApplyConfiguration) *ConsoleCustomizationApplyConfiguration {
+ b.AddPage = value
+ return b
+}
+
+// WithPerspectives adds the given value to the Perspectives field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Perspectives field.
+func (b *ConsoleCustomizationApplyConfiguration) WithPerspectives(values ...*PerspectiveApplyConfiguration) *ConsoleCustomizationApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithPerspectives")
+ }
+ b.Perspectives = append(b.Perspectives, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consoleproviders.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consoleproviders.go
new file mode 100644
index 0000000000..97281e5c56
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consoleproviders.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ConsoleProvidersApplyConfiguration represents a declarative configuration of the ConsoleProviders type for use
+// with apply.
+type ConsoleProvidersApplyConfiguration struct {
+ Statuspage *StatuspageProviderApplyConfiguration `json:"statuspage,omitempty"`
+}
+
+// ConsoleProvidersApplyConfiguration constructs a declarative configuration of the ConsoleProviders type for use with
+// apply.
+func ConsoleProviders() *ConsoleProvidersApplyConfiguration {
+ return &ConsoleProvidersApplyConfiguration{}
+}
+
+// WithStatuspage sets the Statuspage field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Statuspage field is set to the value of the last call.
+func (b *ConsoleProvidersApplyConfiguration) WithStatuspage(value *StatuspageProviderApplyConfiguration) *ConsoleProvidersApplyConfiguration {
+ b.Statuspage = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolespec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolespec.go
new file mode 100644
index 0000000000..421ff84e2b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolespec.go
@@ -0,0 +1,107 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// ConsoleSpecApplyConfiguration represents a declarative configuration of the ConsoleSpec type for use
+// with apply.
+type ConsoleSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+ Customization *ConsoleCustomizationApplyConfiguration `json:"customization,omitempty"`
+ Providers *ConsoleProvidersApplyConfiguration `json:"providers,omitempty"`
+ Route *ConsoleConfigRouteApplyConfiguration `json:"route,omitempty"`
+ Plugins []string `json:"plugins,omitempty"`
+ Ingress *IngressApplyConfiguration `json:"ingress,omitempty"`
+}
+
+// ConsoleSpecApplyConfiguration constructs a declarative configuration of the ConsoleSpec type for use with
+// apply.
+func ConsoleSpec() *ConsoleSpecApplyConfiguration {
+ return &ConsoleSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *ConsoleSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *ConsoleSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *ConsoleSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *ConsoleSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *ConsoleSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *ConsoleSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *ConsoleSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *ConsoleSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *ConsoleSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *ConsoleSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithCustomization sets the Customization field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Customization field is set to the value of the last call.
+func (b *ConsoleSpecApplyConfiguration) WithCustomization(value *ConsoleCustomizationApplyConfiguration) *ConsoleSpecApplyConfiguration {
+ b.Customization = value
+ return b
+}
+
+// WithProviders sets the Providers field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Providers field is set to the value of the last call.
+func (b *ConsoleSpecApplyConfiguration) WithProviders(value *ConsoleProvidersApplyConfiguration) *ConsoleSpecApplyConfiguration {
+ b.Providers = value
+ return b
+}
+
+// WithRoute sets the Route field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Route field is set to the value of the last call.
+func (b *ConsoleSpecApplyConfiguration) WithRoute(value *ConsoleConfigRouteApplyConfiguration) *ConsoleSpecApplyConfiguration {
+ b.Route = value
+ return b
+}
+
+// WithPlugins adds the given value to the Plugins field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Plugins field.
+func (b *ConsoleSpecApplyConfiguration) WithPlugins(values ...string) *ConsoleSpecApplyConfiguration {
+ for i := range values {
+ b.Plugins = append(b.Plugins, values[i])
+ }
+ return b
+}
+
+// WithIngress sets the Ingress field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Ingress field is set to the value of the last call.
+func (b *ConsoleSpecApplyConfiguration) WithIngress(value *IngressApplyConfiguration) *ConsoleSpecApplyConfiguration {
+ b.Ingress = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolestatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolestatus.go
new file mode 100644
index 0000000000..c6330be35d
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolestatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ConsoleStatusApplyConfiguration represents a declarative configuration of the ConsoleStatus type for use
+// with apply.
+type ConsoleStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// ConsoleStatusApplyConfiguration constructs a declarative configuration of the ConsoleStatus type for use with
+// apply.
+func ConsoleStatus() *ConsoleStatusApplyConfiguration {
+ return &ConsoleStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *ConsoleStatusApplyConfiguration) WithObservedGeneration(value int64) *ConsoleStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *ConsoleStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *ConsoleStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *ConsoleStatusApplyConfiguration) WithVersion(value string) *ConsoleStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *ConsoleStatusApplyConfiguration) WithReadyReplicas(value int32) *ConsoleStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *ConsoleStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *ConsoleStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *ConsoleStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *ConsoleStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/containerloggingdestinationparameters.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/containerloggingdestinationparameters.go
new file mode 100644
index 0000000000..633bbca1a6
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/containerloggingdestinationparameters.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ContainerLoggingDestinationParametersApplyConfiguration represents a declarative configuration of the ContainerLoggingDestinationParameters type for use
+// with apply.
+type ContainerLoggingDestinationParametersApplyConfiguration struct {
+ MaxLength *int32 `json:"maxLength,omitempty"`
+}
+
+// ContainerLoggingDestinationParametersApplyConfiguration constructs a declarative configuration of the ContainerLoggingDestinationParameters type for use with
+// apply.
+func ContainerLoggingDestinationParameters() *ContainerLoggingDestinationParametersApplyConfiguration {
+ return &ContainerLoggingDestinationParametersApplyConfiguration{}
+}
+
+// WithMaxLength sets the MaxLength field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MaxLength field is set to the value of the last call.
+func (b *ContainerLoggingDestinationParametersApplyConfiguration) WithMaxLength(value int32) *ContainerLoggingDestinationParametersApplyConfiguration {
+ b.MaxLength = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csidriverconfigspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csidriverconfigspec.go
new file mode 100644
index 0000000000..887cf604e8
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csidriverconfigspec.go
@@ -0,0 +1,72 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// CSIDriverConfigSpecApplyConfiguration represents a declarative configuration of the CSIDriverConfigSpec type for use
+// with apply.
+type CSIDriverConfigSpecApplyConfiguration struct {
+ DriverType *v1.CSIDriverType `json:"driverType,omitempty"`
+ AWS *AWSCSIDriverConfigSpecApplyConfiguration `json:"aws,omitempty"`
+ Azure *AzureCSIDriverConfigSpecApplyConfiguration `json:"azure,omitempty"`
+ GCP *GCPCSIDriverConfigSpecApplyConfiguration `json:"gcp,omitempty"`
+ IBMCloud *IBMCloudCSIDriverConfigSpecApplyConfiguration `json:"ibmcloud,omitempty"`
+ VSphere *VSphereCSIDriverConfigSpecApplyConfiguration `json:"vSphere,omitempty"`
+}
+
+// CSIDriverConfigSpecApplyConfiguration constructs a declarative configuration of the CSIDriverConfigSpec type for use with
+// apply.
+func CSIDriverConfigSpec() *CSIDriverConfigSpecApplyConfiguration {
+ return &CSIDriverConfigSpecApplyConfiguration{}
+}
+
+// WithDriverType sets the DriverType field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DriverType field is set to the value of the last call.
+func (b *CSIDriverConfigSpecApplyConfiguration) WithDriverType(value v1.CSIDriverType) *CSIDriverConfigSpecApplyConfiguration {
+ b.DriverType = &value
+ return b
+}
+
+// WithAWS sets the AWS field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the AWS field is set to the value of the last call.
+func (b *CSIDriverConfigSpecApplyConfiguration) WithAWS(value *AWSCSIDriverConfigSpecApplyConfiguration) *CSIDriverConfigSpecApplyConfiguration {
+ b.AWS = value
+ return b
+}
+
+// WithAzure sets the Azure field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Azure field is set to the value of the last call.
+func (b *CSIDriverConfigSpecApplyConfiguration) WithAzure(value *AzureCSIDriverConfigSpecApplyConfiguration) *CSIDriverConfigSpecApplyConfiguration {
+ b.Azure = value
+ return b
+}
+
+// WithGCP sets the GCP field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GCP field is set to the value of the last call.
+func (b *CSIDriverConfigSpecApplyConfiguration) WithGCP(value *GCPCSIDriverConfigSpecApplyConfiguration) *CSIDriverConfigSpecApplyConfiguration {
+ b.GCP = value
+ return b
+}
+
+// WithIBMCloud sets the IBMCloud field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IBMCloud field is set to the value of the last call.
+func (b *CSIDriverConfigSpecApplyConfiguration) WithIBMCloud(value *IBMCloudCSIDriverConfigSpecApplyConfiguration) *CSIDriverConfigSpecApplyConfiguration {
+ b.IBMCloud = value
+ return b
+}
+
+// WithVSphere sets the VSphere field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the VSphere field is set to the value of the last call.
+func (b *CSIDriverConfigSpecApplyConfiguration) WithVSphere(value *VSphereCSIDriverConfigSpecApplyConfiguration) *CSIDriverConfigSpecApplyConfiguration {
+ b.VSphere = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontroller.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontroller.go
new file mode 100644
index 0000000000..035aee886e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontroller.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// CSISnapshotControllerApplyConfiguration represents a declarative configuration of the CSISnapshotController type for use
+// with apply.
+type CSISnapshotControllerApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *CSISnapshotControllerSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *CSISnapshotControllerStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// CSISnapshotController constructs a declarative configuration of the CSISnapshotController type for use with
+// apply.
+func CSISnapshotController(name string) *CSISnapshotControllerApplyConfiguration {
+ b := &CSISnapshotControllerApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("CSISnapshotController")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractCSISnapshotController extracts the applied configuration owned by fieldManager from
+// cSISnapshotController. If no managedFields are found in cSISnapshotController for fieldManager, a
+// CSISnapshotControllerApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// cSISnapshotController must be a unmodified CSISnapshotController API object that was retrieved from the Kubernetes API.
+// ExtractCSISnapshotController provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractCSISnapshotController(cSISnapshotController *apioperatorv1.CSISnapshotController, fieldManager string) (*CSISnapshotControllerApplyConfiguration, error) {
+ return extractCSISnapshotController(cSISnapshotController, fieldManager, "")
+}
+
+// ExtractCSISnapshotControllerStatus is the same as ExtractCSISnapshotController except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractCSISnapshotControllerStatus(cSISnapshotController *apioperatorv1.CSISnapshotController, fieldManager string) (*CSISnapshotControllerApplyConfiguration, error) {
+ return extractCSISnapshotController(cSISnapshotController, fieldManager, "status")
+}
+
+func extractCSISnapshotController(cSISnapshotController *apioperatorv1.CSISnapshotController, fieldManager string, subresource string) (*CSISnapshotControllerApplyConfiguration, error) {
+ b := &CSISnapshotControllerApplyConfiguration{}
+ err := managedfields.ExtractInto(cSISnapshotController, internal.Parser().Type("com.github.openshift.api.operator.v1.CSISnapshotController"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(cSISnapshotController.Name)
+
+ b.WithKind("CSISnapshotController")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithKind(value string) *CSISnapshotControllerApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithAPIVersion(value string) *CSISnapshotControllerApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithName(value string) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithGenerateName(value string) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithNamespace(value string) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithUID(value types.UID) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithResourceVersion(value string) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithGeneration(value int64) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *CSISnapshotControllerApplyConfiguration) WithLabels(entries map[string]string) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *CSISnapshotControllerApplyConfiguration) WithAnnotations(entries map[string]string) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *CSISnapshotControllerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *CSISnapshotControllerApplyConfiguration) WithFinalizers(values ...string) *CSISnapshotControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *CSISnapshotControllerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithSpec(value *CSISnapshotControllerSpecApplyConfiguration) *CSISnapshotControllerApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *CSISnapshotControllerApplyConfiguration) WithStatus(value *CSISnapshotControllerStatusApplyConfiguration) *CSISnapshotControllerApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *CSISnapshotControllerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontrollerspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontrollerspec.go
new file mode 100644
index 0000000000..e614041cbd
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontrollerspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// CSISnapshotControllerSpecApplyConfiguration represents a declarative configuration of the CSISnapshotControllerSpec type for use
+// with apply.
+type CSISnapshotControllerSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// CSISnapshotControllerSpecApplyConfiguration constructs a declarative configuration of the CSISnapshotControllerSpec type for use with
+// apply.
+func CSISnapshotControllerSpec() *CSISnapshotControllerSpecApplyConfiguration {
+ return &CSISnapshotControllerSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *CSISnapshotControllerSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *CSISnapshotControllerSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *CSISnapshotControllerSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *CSISnapshotControllerSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *CSISnapshotControllerSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *CSISnapshotControllerSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *CSISnapshotControllerSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *CSISnapshotControllerSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *CSISnapshotControllerSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *CSISnapshotControllerSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontrollerstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontrollerstatus.go
new file mode 100644
index 0000000000..d3fa5d05c1
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontrollerstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// CSISnapshotControllerStatusApplyConfiguration represents a declarative configuration of the CSISnapshotControllerStatus type for use
+// with apply.
+type CSISnapshotControllerStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// CSISnapshotControllerStatusApplyConfiguration constructs a declarative configuration of the CSISnapshotControllerStatus type for use with
+// apply.
+func CSISnapshotControllerStatus() *CSISnapshotControllerStatusApplyConfiguration {
+ return &CSISnapshotControllerStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *CSISnapshotControllerStatusApplyConfiguration) WithObservedGeneration(value int64) *CSISnapshotControllerStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *CSISnapshotControllerStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *CSISnapshotControllerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *CSISnapshotControllerStatusApplyConfiguration) WithVersion(value string) *CSISnapshotControllerStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *CSISnapshotControllerStatusApplyConfiguration) WithReadyReplicas(value int32) *CSISnapshotControllerStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *CSISnapshotControllerStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *CSISnapshotControllerStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *CSISnapshotControllerStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *CSISnapshotControllerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/defaultnetworkdefinition.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/defaultnetworkdefinition.go
new file mode 100644
index 0000000000..c8689ee187
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/defaultnetworkdefinition.go
@@ -0,0 +1,45 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// DefaultNetworkDefinitionApplyConfiguration represents a declarative configuration of the DefaultNetworkDefinition type for use
+// with apply.
+type DefaultNetworkDefinitionApplyConfiguration struct {
+ Type *v1.NetworkType `json:"type,omitempty"`
+ OpenShiftSDNConfig *OpenShiftSDNConfigApplyConfiguration `json:"openshiftSDNConfig,omitempty"`
+ OVNKubernetesConfig *OVNKubernetesConfigApplyConfiguration `json:"ovnKubernetesConfig,omitempty"`
+}
+
+// DefaultNetworkDefinitionApplyConfiguration constructs a declarative configuration of the DefaultNetworkDefinition type for use with
+// apply.
+func DefaultNetworkDefinition() *DefaultNetworkDefinitionApplyConfiguration {
+ return &DefaultNetworkDefinitionApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *DefaultNetworkDefinitionApplyConfiguration) WithType(value v1.NetworkType) *DefaultNetworkDefinitionApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithOpenShiftSDNConfig sets the OpenShiftSDNConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OpenShiftSDNConfig field is set to the value of the last call.
+func (b *DefaultNetworkDefinitionApplyConfiguration) WithOpenShiftSDNConfig(value *OpenShiftSDNConfigApplyConfiguration) *DefaultNetworkDefinitionApplyConfiguration {
+ b.OpenShiftSDNConfig = value
+ return b
+}
+
+// WithOVNKubernetesConfig sets the OVNKubernetesConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OVNKubernetesConfig field is set to the value of the last call.
+func (b *DefaultNetworkDefinitionApplyConfiguration) WithOVNKubernetesConfig(value *OVNKubernetesConfigApplyConfiguration) *DefaultNetworkDefinitionApplyConfiguration {
+ b.OVNKubernetesConfig = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcategory.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcategory.go
new file mode 100644
index 0000000000..3aa286ff1b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcategory.go
@@ -0,0 +1,55 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// DeveloperConsoleCatalogCategoryApplyConfiguration represents a declarative configuration of the DeveloperConsoleCatalogCategory type for use
+// with apply.
+type DeveloperConsoleCatalogCategoryApplyConfiguration struct {
+ DeveloperConsoleCatalogCategoryMetaApplyConfiguration `json:",inline"`
+ Subcategories []DeveloperConsoleCatalogCategoryMetaApplyConfiguration `json:"subcategories,omitempty"`
+}
+
+// DeveloperConsoleCatalogCategoryApplyConfiguration constructs a declarative configuration of the DeveloperConsoleCatalogCategory type for use with
+// apply.
+func DeveloperConsoleCatalogCategory() *DeveloperConsoleCatalogCategoryApplyConfiguration {
+ return &DeveloperConsoleCatalogCategoryApplyConfiguration{}
+}
+
+// WithID sets the ID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ID field is set to the value of the last call.
+func (b *DeveloperConsoleCatalogCategoryApplyConfiguration) WithID(value string) *DeveloperConsoleCatalogCategoryApplyConfiguration {
+ b.ID = &value
+ return b
+}
+
+// WithLabel sets the Label field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Label field is set to the value of the last call.
+func (b *DeveloperConsoleCatalogCategoryApplyConfiguration) WithLabel(value string) *DeveloperConsoleCatalogCategoryApplyConfiguration {
+ b.Label = &value
+ return b
+}
+
+// WithTags adds the given value to the Tags field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Tags field.
+func (b *DeveloperConsoleCatalogCategoryApplyConfiguration) WithTags(values ...string) *DeveloperConsoleCatalogCategoryApplyConfiguration {
+ for i := range values {
+ b.Tags = append(b.Tags, values[i])
+ }
+ return b
+}
+
+// WithSubcategories adds the given value to the Subcategories field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Subcategories field.
+func (b *DeveloperConsoleCatalogCategoryApplyConfiguration) WithSubcategories(values ...*DeveloperConsoleCatalogCategoryMetaApplyConfiguration) *DeveloperConsoleCatalogCategoryApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithSubcategories")
+ }
+ b.Subcategories = append(b.Subcategories, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcategorymeta.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcategorymeta.go
new file mode 100644
index 0000000000..ce6e7fdda4
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcategorymeta.go
@@ -0,0 +1,43 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// DeveloperConsoleCatalogCategoryMetaApplyConfiguration represents a declarative configuration of the DeveloperConsoleCatalogCategoryMeta type for use
+// with apply.
+type DeveloperConsoleCatalogCategoryMetaApplyConfiguration struct {
+ ID *string `json:"id,omitempty"`
+ Label *string `json:"label,omitempty"`
+ Tags []string `json:"tags,omitempty"`
+}
+
+// DeveloperConsoleCatalogCategoryMetaApplyConfiguration constructs a declarative configuration of the DeveloperConsoleCatalogCategoryMeta type for use with
+// apply.
+func DeveloperConsoleCatalogCategoryMeta() *DeveloperConsoleCatalogCategoryMetaApplyConfiguration {
+ return &DeveloperConsoleCatalogCategoryMetaApplyConfiguration{}
+}
+
+// WithID sets the ID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ID field is set to the value of the last call.
+func (b *DeveloperConsoleCatalogCategoryMetaApplyConfiguration) WithID(value string) *DeveloperConsoleCatalogCategoryMetaApplyConfiguration {
+ b.ID = &value
+ return b
+}
+
+// WithLabel sets the Label field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Label field is set to the value of the last call.
+func (b *DeveloperConsoleCatalogCategoryMetaApplyConfiguration) WithLabel(value string) *DeveloperConsoleCatalogCategoryMetaApplyConfiguration {
+ b.Label = &value
+ return b
+}
+
+// WithTags adds the given value to the Tags field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Tags field.
+func (b *DeveloperConsoleCatalogCategoryMetaApplyConfiguration) WithTags(values ...string) *DeveloperConsoleCatalogCategoryMetaApplyConfiguration {
+ for i := range values {
+ b.Tags = append(b.Tags, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcustomization.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcustomization.go
new file mode 100644
index 0000000000..fcbc810995
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcustomization.go
@@ -0,0 +1,37 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// DeveloperConsoleCatalogCustomizationApplyConfiguration represents a declarative configuration of the DeveloperConsoleCatalogCustomization type for use
+// with apply.
+type DeveloperConsoleCatalogCustomizationApplyConfiguration struct {
+ Categories []DeveloperConsoleCatalogCategoryApplyConfiguration `json:"categories,omitempty"`
+ Types *DeveloperConsoleCatalogTypesApplyConfiguration `json:"types,omitempty"`
+}
+
+// DeveloperConsoleCatalogCustomizationApplyConfiguration constructs a declarative configuration of the DeveloperConsoleCatalogCustomization type for use with
+// apply.
+func DeveloperConsoleCatalogCustomization() *DeveloperConsoleCatalogCustomizationApplyConfiguration {
+ return &DeveloperConsoleCatalogCustomizationApplyConfiguration{}
+}
+
+// WithCategories adds the given value to the Categories field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Categories field.
+func (b *DeveloperConsoleCatalogCustomizationApplyConfiguration) WithCategories(values ...*DeveloperConsoleCatalogCategoryApplyConfiguration) *DeveloperConsoleCatalogCustomizationApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithCategories")
+ }
+ b.Categories = append(b.Categories, *values[i])
+ }
+ return b
+}
+
+// WithTypes sets the Types field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Types field is set to the value of the last call.
+func (b *DeveloperConsoleCatalogCustomizationApplyConfiguration) WithTypes(value *DeveloperConsoleCatalogTypesApplyConfiguration) *DeveloperConsoleCatalogCustomizationApplyConfiguration {
+ b.Types = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogtypes.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogtypes.go
new file mode 100644
index 0000000000..439dafbf45
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogtypes.go
@@ -0,0 +1,45 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// DeveloperConsoleCatalogTypesApplyConfiguration represents a declarative configuration of the DeveloperConsoleCatalogTypes type for use
+// with apply.
+type DeveloperConsoleCatalogTypesApplyConfiguration struct {
+ State *v1.CatalogTypesState `json:"state,omitempty"`
+ Enabled *[]string `json:"enabled,omitempty"`
+ Disabled *[]string `json:"disabled,omitempty"`
+}
+
+// DeveloperConsoleCatalogTypesApplyConfiguration constructs a declarative configuration of the DeveloperConsoleCatalogTypes type for use with
+// apply.
+func DeveloperConsoleCatalogTypes() *DeveloperConsoleCatalogTypesApplyConfiguration {
+ return &DeveloperConsoleCatalogTypesApplyConfiguration{}
+}
+
+// WithState sets the State field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the State field is set to the value of the last call.
+func (b *DeveloperConsoleCatalogTypesApplyConfiguration) WithState(value v1.CatalogTypesState) *DeveloperConsoleCatalogTypesApplyConfiguration {
+ b.State = &value
+ return b
+}
+
+// WithEnabled sets the Enabled field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Enabled field is set to the value of the last call.
+func (b *DeveloperConsoleCatalogTypesApplyConfiguration) WithEnabled(value []string) *DeveloperConsoleCatalogTypesApplyConfiguration {
+ b.Enabled = &value
+ return b
+}
+
+// WithDisabled sets the Disabled field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Disabled field is set to the value of the last call.
+func (b *DeveloperConsoleCatalogTypesApplyConfiguration) WithDisabled(value []string) *DeveloperConsoleCatalogTypesApplyConfiguration {
+ b.Disabled = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dns.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dns.go
new file mode 100644
index 0000000000..0e31c5af93
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dns.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// DNSApplyConfiguration represents a declarative configuration of the DNS type for use
+// with apply.
+type DNSApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *DNSSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *DNSStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// DNS constructs a declarative configuration of the DNS type for use with
+// apply.
+func DNS(name string) *DNSApplyConfiguration {
+ b := &DNSApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("DNS")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractDNS extracts the applied configuration owned by fieldManager from
+// dNS. If no managedFields are found in dNS for fieldManager, a
+// DNSApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// dNS must be a unmodified DNS API object that was retrieved from the Kubernetes API.
+// ExtractDNS provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractDNS(dNS *apioperatorv1.DNS, fieldManager string) (*DNSApplyConfiguration, error) {
+ return extractDNS(dNS, fieldManager, "")
+}
+
+// ExtractDNSStatus is the same as ExtractDNS except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractDNSStatus(dNS *apioperatorv1.DNS, fieldManager string) (*DNSApplyConfiguration, error) {
+ return extractDNS(dNS, fieldManager, "status")
+}
+
+func extractDNS(dNS *apioperatorv1.DNS, fieldManager string, subresource string) (*DNSApplyConfiguration, error) {
+ b := &DNSApplyConfiguration{}
+ err := managedfields.ExtractInto(dNS, internal.Parser().Type("com.github.openshift.api.operator.v1.DNS"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(dNS.Name)
+
+ b.WithKind("DNS")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithKind(value string) *DNSApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithAPIVersion(value string) *DNSApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithName(value string) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithGenerateName(value string) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithNamespace(value string) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithUID(value types.UID) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithResourceVersion(value string) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithGeneration(value int64) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *DNSApplyConfiguration) WithLabels(entries map[string]string) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *DNSApplyConfiguration) WithAnnotations(entries map[string]string) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *DNSApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *DNSApplyConfiguration) WithFinalizers(values ...string) *DNSApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *DNSApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithSpec(value *DNSSpecApplyConfiguration) *DNSApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *DNSApplyConfiguration) WithStatus(value *DNSStatusApplyConfiguration) *DNSApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *DNSApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnscache.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnscache.go
new file mode 100644
index 0000000000..4a387f634a
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnscache.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// DNSCacheApplyConfiguration represents a declarative configuration of the DNSCache type for use
+// with apply.
+type DNSCacheApplyConfiguration struct {
+ PositiveTTL *v1.Duration `json:"positiveTTL,omitempty"`
+ NegativeTTL *v1.Duration `json:"negativeTTL,omitempty"`
+}
+
+// DNSCacheApplyConfiguration constructs a declarative configuration of the DNSCache type for use with
+// apply.
+func DNSCache() *DNSCacheApplyConfiguration {
+ return &DNSCacheApplyConfiguration{}
+}
+
+// WithPositiveTTL sets the PositiveTTL field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the PositiveTTL field is set to the value of the last call.
+func (b *DNSCacheApplyConfiguration) WithPositiveTTL(value v1.Duration) *DNSCacheApplyConfiguration {
+ b.PositiveTTL = &value
+ return b
+}
+
+// WithNegativeTTL sets the NegativeTTL field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NegativeTTL field is set to the value of the last call.
+func (b *DNSCacheApplyConfiguration) WithNegativeTTL(value v1.Duration) *DNSCacheApplyConfiguration {
+ b.NegativeTTL = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsnodeplacement.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsnodeplacement.go
new file mode 100644
index 0000000000..1c941d66e3
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsnodeplacement.go
@@ -0,0 +1,44 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/api/core/v1"
+)
+
+// DNSNodePlacementApplyConfiguration represents a declarative configuration of the DNSNodePlacement type for use
+// with apply.
+type DNSNodePlacementApplyConfiguration struct {
+ NodeSelector map[string]string `json:"nodeSelector,omitempty"`
+ Tolerations []v1.Toleration `json:"tolerations,omitempty"`
+}
+
+// DNSNodePlacementApplyConfiguration constructs a declarative configuration of the DNSNodePlacement type for use with
+// apply.
+func DNSNodePlacement() *DNSNodePlacementApplyConfiguration {
+ return &DNSNodePlacementApplyConfiguration{}
+}
+
+// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the NodeSelector field,
+// overwriting an existing map entries in NodeSelector field with the same key.
+func (b *DNSNodePlacementApplyConfiguration) WithNodeSelector(entries map[string]string) *DNSNodePlacementApplyConfiguration {
+ if b.NodeSelector == nil && len(entries) > 0 {
+ b.NodeSelector = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.NodeSelector[k] = v
+ }
+ return b
+}
+
+// WithTolerations adds the given value to the Tolerations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Tolerations field.
+func (b *DNSNodePlacementApplyConfiguration) WithTolerations(values ...v1.Toleration) *DNSNodePlacementApplyConfiguration {
+ for i := range values {
+ b.Tolerations = append(b.Tolerations, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsovertlsconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsovertlsconfig.go
new file mode 100644
index 0000000000..7e6ff33d64
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsovertlsconfig.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/config/v1"
+)
+
+// DNSOverTLSConfigApplyConfiguration represents a declarative configuration of the DNSOverTLSConfig type for use
+// with apply.
+type DNSOverTLSConfigApplyConfiguration struct {
+ ServerName *string `json:"serverName,omitempty"`
+ CABundle *v1.ConfigMapNameReference `json:"caBundle,omitempty"`
+}
+
+// DNSOverTLSConfigApplyConfiguration constructs a declarative configuration of the DNSOverTLSConfig type for use with
+// apply.
+func DNSOverTLSConfig() *DNSOverTLSConfigApplyConfiguration {
+ return &DNSOverTLSConfigApplyConfiguration{}
+}
+
+// WithServerName sets the ServerName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ServerName field is set to the value of the last call.
+func (b *DNSOverTLSConfigApplyConfiguration) WithServerName(value string) *DNSOverTLSConfigApplyConfiguration {
+ b.ServerName = &value
+ return b
+}
+
+// WithCABundle sets the CABundle field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CABundle field is set to the value of the last call.
+func (b *DNSOverTLSConfigApplyConfiguration) WithCABundle(value v1.ConfigMapNameReference) *DNSOverTLSConfigApplyConfiguration {
+ b.CABundle = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsspec.go
new file mode 100644
index 0000000000..2016291891
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsspec.go
@@ -0,0 +1,86 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// DNSSpecApplyConfiguration represents a declarative configuration of the DNSSpec type for use
+// with apply.
+type DNSSpecApplyConfiguration struct {
+ Servers []ServerApplyConfiguration `json:"servers,omitempty"`
+ UpstreamResolvers *UpstreamResolversApplyConfiguration `json:"upstreamResolvers,omitempty"`
+ NodePlacement *DNSNodePlacementApplyConfiguration `json:"nodePlacement,omitempty"`
+ ManagementState *operatorv1.ManagementState `json:"managementState,omitempty"`
+ OperatorLogLevel *operatorv1.DNSLogLevel `json:"operatorLogLevel,omitempty"`
+ LogLevel *operatorv1.DNSLogLevel `json:"logLevel,omitempty"`
+ Cache *DNSCacheApplyConfiguration `json:"cache,omitempty"`
+}
+
+// DNSSpecApplyConfiguration constructs a declarative configuration of the DNSSpec type for use with
+// apply.
+func DNSSpec() *DNSSpecApplyConfiguration {
+ return &DNSSpecApplyConfiguration{}
+}
+
+// WithServers adds the given value to the Servers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Servers field.
+func (b *DNSSpecApplyConfiguration) WithServers(values ...*ServerApplyConfiguration) *DNSSpecApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithServers")
+ }
+ b.Servers = append(b.Servers, *values[i])
+ }
+ return b
+}
+
+// WithUpstreamResolvers sets the UpstreamResolvers field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UpstreamResolvers field is set to the value of the last call.
+func (b *DNSSpecApplyConfiguration) WithUpstreamResolvers(value *UpstreamResolversApplyConfiguration) *DNSSpecApplyConfiguration {
+ b.UpstreamResolvers = value
+ return b
+}
+
+// WithNodePlacement sets the NodePlacement field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NodePlacement field is set to the value of the last call.
+func (b *DNSSpecApplyConfiguration) WithNodePlacement(value *DNSNodePlacementApplyConfiguration) *DNSSpecApplyConfiguration {
+ b.NodePlacement = value
+ return b
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *DNSSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *DNSSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *DNSSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.DNSLogLevel) *DNSSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *DNSSpecApplyConfiguration) WithLogLevel(value operatorv1.DNSLogLevel) *DNSSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithCache sets the Cache field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Cache field is set to the value of the last call.
+func (b *DNSSpecApplyConfiguration) WithCache(value *DNSCacheApplyConfiguration) *DNSSpecApplyConfiguration {
+ b.Cache = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsstatus.go
new file mode 100644
index 0000000000..9c86669318
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsstatus.go
@@ -0,0 +1,46 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// DNSStatusApplyConfiguration represents a declarative configuration of the DNSStatus type for use
+// with apply.
+type DNSStatusApplyConfiguration struct {
+ ClusterIP *string `json:"clusterIP,omitempty"`
+ ClusterDomain *string `json:"clusterDomain,omitempty"`
+ Conditions []OperatorConditionApplyConfiguration `json:"conditions,omitempty"`
+}
+
+// DNSStatusApplyConfiguration constructs a declarative configuration of the DNSStatus type for use with
+// apply.
+func DNSStatus() *DNSStatusApplyConfiguration {
+ return &DNSStatusApplyConfiguration{}
+}
+
+// WithClusterIP sets the ClusterIP field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClusterIP field is set to the value of the last call.
+func (b *DNSStatusApplyConfiguration) WithClusterIP(value string) *DNSStatusApplyConfiguration {
+ b.ClusterIP = &value
+ return b
+}
+
+// WithClusterDomain sets the ClusterDomain field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClusterDomain field is set to the value of the last call.
+func (b *DNSStatusApplyConfiguration) WithClusterDomain(value string) *DNSStatusApplyConfiguration {
+ b.ClusterDomain = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *DNSStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *DNSStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnstransportconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnstransportconfig.go
new file mode 100644
index 0000000000..52bc39563b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnstransportconfig.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// DNSTransportConfigApplyConfiguration represents a declarative configuration of the DNSTransportConfig type for use
+// with apply.
+type DNSTransportConfigApplyConfiguration struct {
+ Transport *v1.DNSTransport `json:"transport,omitempty"`
+ TLS *DNSOverTLSConfigApplyConfiguration `json:"tls,omitempty"`
+}
+
+// DNSTransportConfigApplyConfiguration constructs a declarative configuration of the DNSTransportConfig type for use with
+// apply.
+func DNSTransportConfig() *DNSTransportConfigApplyConfiguration {
+ return &DNSTransportConfigApplyConfiguration{}
+}
+
+// WithTransport sets the Transport field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Transport field is set to the value of the last call.
+func (b *DNSTransportConfigApplyConfiguration) WithTransport(value v1.DNSTransport) *DNSTransportConfigApplyConfiguration {
+ b.Transport = &value
+ return b
+}
+
+// WithTLS sets the TLS field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TLS field is set to the value of the last call.
+func (b *DNSTransportConfigApplyConfiguration) WithTLS(value *DNSOverTLSConfigApplyConfiguration) *DNSTransportConfigApplyConfiguration {
+ b.TLS = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/egressipconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/egressipconfig.go
new file mode 100644
index 0000000000..f8c2cbeeed
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/egressipconfig.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// EgressIPConfigApplyConfiguration represents a declarative configuration of the EgressIPConfig type for use
+// with apply.
+type EgressIPConfigApplyConfiguration struct {
+ ReachabilityTotalTimeoutSeconds *uint32 `json:"reachabilityTotalTimeoutSeconds,omitempty"`
+}
+
+// EgressIPConfigApplyConfiguration constructs a declarative configuration of the EgressIPConfig type for use with
+// apply.
+func EgressIPConfig() *EgressIPConfigApplyConfiguration {
+ return &EgressIPConfigApplyConfiguration{}
+}
+
+// WithReachabilityTotalTimeoutSeconds sets the ReachabilityTotalTimeoutSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReachabilityTotalTimeoutSeconds field is set to the value of the last call.
+func (b *EgressIPConfigApplyConfiguration) WithReachabilityTotalTimeoutSeconds(value uint32) *EgressIPConfigApplyConfiguration {
+ b.ReachabilityTotalTimeoutSeconds = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/endpointpublishingstrategy.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/endpointpublishingstrategy.go
new file mode 100644
index 0000000000..876f91e975
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/endpointpublishingstrategy.go
@@ -0,0 +1,63 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// EndpointPublishingStrategyApplyConfiguration represents a declarative configuration of the EndpointPublishingStrategy type for use
+// with apply.
+type EndpointPublishingStrategyApplyConfiguration struct {
+ Type *v1.EndpointPublishingStrategyType `json:"type,omitempty"`
+ LoadBalancer *LoadBalancerStrategyApplyConfiguration `json:"loadBalancer,omitempty"`
+ HostNetwork *HostNetworkStrategyApplyConfiguration `json:"hostNetwork,omitempty"`
+ Private *PrivateStrategyApplyConfiguration `json:"private,omitempty"`
+ NodePort *NodePortStrategyApplyConfiguration `json:"nodePort,omitempty"`
+}
+
+// EndpointPublishingStrategyApplyConfiguration constructs a declarative configuration of the EndpointPublishingStrategy type for use with
+// apply.
+func EndpointPublishingStrategy() *EndpointPublishingStrategyApplyConfiguration {
+ return &EndpointPublishingStrategyApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *EndpointPublishingStrategyApplyConfiguration) WithType(value v1.EndpointPublishingStrategyType) *EndpointPublishingStrategyApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithLoadBalancer sets the LoadBalancer field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LoadBalancer field is set to the value of the last call.
+func (b *EndpointPublishingStrategyApplyConfiguration) WithLoadBalancer(value *LoadBalancerStrategyApplyConfiguration) *EndpointPublishingStrategyApplyConfiguration {
+ b.LoadBalancer = value
+ return b
+}
+
+// WithHostNetwork sets the HostNetwork field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HostNetwork field is set to the value of the last call.
+func (b *EndpointPublishingStrategyApplyConfiguration) WithHostNetwork(value *HostNetworkStrategyApplyConfiguration) *EndpointPublishingStrategyApplyConfiguration {
+ b.HostNetwork = value
+ return b
+}
+
+// WithPrivate sets the Private field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Private field is set to the value of the last call.
+func (b *EndpointPublishingStrategyApplyConfiguration) WithPrivate(value *PrivateStrategyApplyConfiguration) *EndpointPublishingStrategyApplyConfiguration {
+ b.Private = value
+ return b
+}
+
+// WithNodePort sets the NodePort field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NodePort field is set to the value of the last call.
+func (b *EndpointPublishingStrategyApplyConfiguration) WithNodePort(value *NodePortStrategyApplyConfiguration) *EndpointPublishingStrategyApplyConfiguration {
+ b.NodePort = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcd.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcd.go
new file mode 100644
index 0000000000..bf091f4e64
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcd.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// EtcdApplyConfiguration represents a declarative configuration of the Etcd type for use
+// with apply.
+type EtcdApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *EtcdSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *EtcdStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// Etcd constructs a declarative configuration of the Etcd type for use with
+// apply.
+func Etcd(name string) *EtcdApplyConfiguration {
+ b := &EtcdApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("Etcd")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractEtcd extracts the applied configuration owned by fieldManager from
+// etcd. If no managedFields are found in etcd for fieldManager, a
+// EtcdApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// etcd must be a unmodified Etcd API object that was retrieved from the Kubernetes API.
+// ExtractEtcd provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractEtcd(etcd *apioperatorv1.Etcd, fieldManager string) (*EtcdApplyConfiguration, error) {
+ return extractEtcd(etcd, fieldManager, "")
+}
+
+// ExtractEtcdStatus is the same as ExtractEtcd except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractEtcdStatus(etcd *apioperatorv1.Etcd, fieldManager string) (*EtcdApplyConfiguration, error) {
+ return extractEtcd(etcd, fieldManager, "status")
+}
+
+func extractEtcd(etcd *apioperatorv1.Etcd, fieldManager string, subresource string) (*EtcdApplyConfiguration, error) {
+ b := &EtcdApplyConfiguration{}
+ err := managedfields.ExtractInto(etcd, internal.Parser().Type("com.github.openshift.api.operator.v1.Etcd"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(etcd.Name)
+
+ b.WithKind("Etcd")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithKind(value string) *EtcdApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithAPIVersion(value string) *EtcdApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithName(value string) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithGenerateName(value string) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithNamespace(value string) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithUID(value types.UID) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithResourceVersion(value string) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithGeneration(value int64) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *EtcdApplyConfiguration) WithLabels(entries map[string]string) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *EtcdApplyConfiguration) WithAnnotations(entries map[string]string) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *EtcdApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *EtcdApplyConfiguration) WithFinalizers(values ...string) *EtcdApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *EtcdApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithSpec(value *EtcdSpecApplyConfiguration) *EtcdApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *EtcdApplyConfiguration) WithStatus(value *EtcdStatusApplyConfiguration) *EtcdApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *EtcdApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcdspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcdspec.go
new file mode 100644
index 0000000000..49a3055c2b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcdspec.go
@@ -0,0 +1,102 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// EtcdSpecApplyConfiguration represents a declarative configuration of the EtcdSpec type for use
+// with apply.
+type EtcdSpecApplyConfiguration struct {
+ StaticPodOperatorSpecApplyConfiguration `json:",inline"`
+ HardwareSpeed *operatorv1.ControlPlaneHardwareSpeed `json:"controlPlaneHardwareSpeed,omitempty"`
+ BackendQuotaGiB *int32 `json:"backendQuotaGiB,omitempty"`
+}
+
+// EtcdSpecApplyConfiguration constructs a declarative configuration of the EtcdSpec type for use with
+// apply.
+func EtcdSpec() *EtcdSpecApplyConfiguration {
+ return &EtcdSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *EtcdSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *EtcdSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *EtcdSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *EtcdSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *EtcdSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *EtcdSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *EtcdSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *EtcdSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *EtcdSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *EtcdSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithForceRedeploymentReason sets the ForceRedeploymentReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ForceRedeploymentReason field is set to the value of the last call.
+func (b *EtcdSpecApplyConfiguration) WithForceRedeploymentReason(value string) *EtcdSpecApplyConfiguration {
+ b.ForceRedeploymentReason = &value
+ return b
+}
+
+// WithFailedRevisionLimit sets the FailedRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the FailedRevisionLimit field is set to the value of the last call.
+func (b *EtcdSpecApplyConfiguration) WithFailedRevisionLimit(value int32) *EtcdSpecApplyConfiguration {
+ b.FailedRevisionLimit = &value
+ return b
+}
+
+// WithSucceededRevisionLimit sets the SucceededRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SucceededRevisionLimit field is set to the value of the last call.
+func (b *EtcdSpecApplyConfiguration) WithSucceededRevisionLimit(value int32) *EtcdSpecApplyConfiguration {
+ b.SucceededRevisionLimit = &value
+ return b
+}
+
+// WithHardwareSpeed sets the HardwareSpeed field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HardwareSpeed field is set to the value of the last call.
+func (b *EtcdSpecApplyConfiguration) WithHardwareSpeed(value operatorv1.ControlPlaneHardwareSpeed) *EtcdSpecApplyConfiguration {
+ b.HardwareSpeed = &value
+ return b
+}
+
+// WithBackendQuotaGiB sets the BackendQuotaGiB field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the BackendQuotaGiB field is set to the value of the last call.
+func (b *EtcdSpecApplyConfiguration) WithBackendQuotaGiB(value int32) *EtcdSpecApplyConfiguration {
+ b.BackendQuotaGiB = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcdstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcdstatus.go
new file mode 100644
index 0000000000..7d545a9009
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcdstatus.go
@@ -0,0 +1,107 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// EtcdStatusApplyConfiguration represents a declarative configuration of the EtcdStatus type for use
+// with apply.
+type EtcdStatusApplyConfiguration struct {
+ StaticPodOperatorStatusApplyConfiguration `json:",inline"`
+ HardwareSpeed *operatorv1.ControlPlaneHardwareSpeed `json:"controlPlaneHardwareSpeed,omitempty"`
+}
+
+// EtcdStatusApplyConfiguration constructs a declarative configuration of the EtcdStatus type for use with
+// apply.
+func EtcdStatus() *EtcdStatusApplyConfiguration {
+ return &EtcdStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *EtcdStatusApplyConfiguration) WithObservedGeneration(value int64) *EtcdStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *EtcdStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *EtcdStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *EtcdStatusApplyConfiguration) WithVersion(value string) *EtcdStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *EtcdStatusApplyConfiguration) WithReadyReplicas(value int32) *EtcdStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *EtcdStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *EtcdStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *EtcdStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *EtcdStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
+
+// WithLatestAvailableRevisionReason sets the LatestAvailableRevisionReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevisionReason field is set to the value of the last call.
+func (b *EtcdStatusApplyConfiguration) WithLatestAvailableRevisionReason(value string) *EtcdStatusApplyConfiguration {
+ b.LatestAvailableRevisionReason = &value
+ return b
+}
+
+// WithNodeStatuses adds the given value to the NodeStatuses field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the NodeStatuses field.
+func (b *EtcdStatusApplyConfiguration) WithNodeStatuses(values ...*NodeStatusApplyConfiguration) *EtcdStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithNodeStatuses")
+ }
+ b.NodeStatuses = append(b.NodeStatuses, *values[i])
+ }
+ return b
+}
+
+// WithHardwareSpeed sets the HardwareSpeed field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HardwareSpeed field is set to the value of the last call.
+func (b *EtcdStatusApplyConfiguration) WithHardwareSpeed(value operatorv1.ControlPlaneHardwareSpeed) *EtcdStatusApplyConfiguration {
+ b.HardwareSpeed = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/exportnetworkflows.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/exportnetworkflows.go
new file mode 100644
index 0000000000..2a41522482
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/exportnetworkflows.go
@@ -0,0 +1,41 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ExportNetworkFlowsApplyConfiguration represents a declarative configuration of the ExportNetworkFlows type for use
+// with apply.
+type ExportNetworkFlowsApplyConfiguration struct {
+ NetFlow *NetFlowConfigApplyConfiguration `json:"netFlow,omitempty"`
+ SFlow *SFlowConfigApplyConfiguration `json:"sFlow,omitempty"`
+ IPFIX *IPFIXConfigApplyConfiguration `json:"ipfix,omitempty"`
+}
+
+// ExportNetworkFlowsApplyConfiguration constructs a declarative configuration of the ExportNetworkFlows type for use with
+// apply.
+func ExportNetworkFlows() *ExportNetworkFlowsApplyConfiguration {
+ return &ExportNetworkFlowsApplyConfiguration{}
+}
+
+// WithNetFlow sets the NetFlow field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NetFlow field is set to the value of the last call.
+func (b *ExportNetworkFlowsApplyConfiguration) WithNetFlow(value *NetFlowConfigApplyConfiguration) *ExportNetworkFlowsApplyConfiguration {
+ b.NetFlow = value
+ return b
+}
+
+// WithSFlow sets the SFlow field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SFlow field is set to the value of the last call.
+func (b *ExportNetworkFlowsApplyConfiguration) WithSFlow(value *SFlowConfigApplyConfiguration) *ExportNetworkFlowsApplyConfiguration {
+ b.SFlow = value
+ return b
+}
+
+// WithIPFIX sets the IPFIX field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IPFIX field is set to the value of the last call.
+func (b *ExportNetworkFlowsApplyConfiguration) WithIPFIX(value *IPFIXConfigApplyConfiguration) *ExportNetworkFlowsApplyConfiguration {
+ b.IPFIX = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/featuresmigration.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/featuresmigration.go
new file mode 100644
index 0000000000..aec6910799
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/featuresmigration.go
@@ -0,0 +1,41 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// FeaturesMigrationApplyConfiguration represents a declarative configuration of the FeaturesMigration type for use
+// with apply.
+type FeaturesMigrationApplyConfiguration struct {
+ EgressIP *bool `json:"egressIP,omitempty"`
+ EgressFirewall *bool `json:"egressFirewall,omitempty"`
+ Multicast *bool `json:"multicast,omitempty"`
+}
+
+// FeaturesMigrationApplyConfiguration constructs a declarative configuration of the FeaturesMigration type for use with
+// apply.
+func FeaturesMigration() *FeaturesMigrationApplyConfiguration {
+ return &FeaturesMigrationApplyConfiguration{}
+}
+
+// WithEgressIP sets the EgressIP field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the EgressIP field is set to the value of the last call.
+func (b *FeaturesMigrationApplyConfiguration) WithEgressIP(value bool) *FeaturesMigrationApplyConfiguration {
+ b.EgressIP = &value
+ return b
+}
+
+// WithEgressFirewall sets the EgressFirewall field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the EgressFirewall field is set to the value of the last call.
+func (b *FeaturesMigrationApplyConfiguration) WithEgressFirewall(value bool) *FeaturesMigrationApplyConfiguration {
+ b.EgressFirewall = &value
+ return b
+}
+
+// WithMulticast sets the Multicast field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Multicast field is set to the value of the last call.
+func (b *FeaturesMigrationApplyConfiguration) WithMulticast(value bool) *FeaturesMigrationApplyConfiguration {
+ b.Multicast = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/forwardplugin.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/forwardplugin.go
new file mode 100644
index 0000000000..d6c8d3bbc3
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/forwardplugin.go
@@ -0,0 +1,56 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// ForwardPluginApplyConfiguration represents a declarative configuration of the ForwardPlugin type for use
+// with apply.
+type ForwardPluginApplyConfiguration struct {
+ Upstreams []string `json:"upstreams,omitempty"`
+ Policy *v1.ForwardingPolicy `json:"policy,omitempty"`
+ TransportConfig *DNSTransportConfigApplyConfiguration `json:"transportConfig,omitempty"`
+ ProtocolStrategy *v1.ProtocolStrategy `json:"protocolStrategy,omitempty"`
+}
+
+// ForwardPluginApplyConfiguration constructs a declarative configuration of the ForwardPlugin type for use with
+// apply.
+func ForwardPlugin() *ForwardPluginApplyConfiguration {
+ return &ForwardPluginApplyConfiguration{}
+}
+
+// WithUpstreams adds the given value to the Upstreams field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Upstreams field.
+func (b *ForwardPluginApplyConfiguration) WithUpstreams(values ...string) *ForwardPluginApplyConfiguration {
+ for i := range values {
+ b.Upstreams = append(b.Upstreams, values[i])
+ }
+ return b
+}
+
+// WithPolicy sets the Policy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Policy field is set to the value of the last call.
+func (b *ForwardPluginApplyConfiguration) WithPolicy(value v1.ForwardingPolicy) *ForwardPluginApplyConfiguration {
+ b.Policy = &value
+ return b
+}
+
+// WithTransportConfig sets the TransportConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TransportConfig field is set to the value of the last call.
+func (b *ForwardPluginApplyConfiguration) WithTransportConfig(value *DNSTransportConfigApplyConfiguration) *ForwardPluginApplyConfiguration {
+ b.TransportConfig = value
+ return b
+}
+
+// WithProtocolStrategy sets the ProtocolStrategy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ProtocolStrategy field is set to the value of the last call.
+func (b *ForwardPluginApplyConfiguration) WithProtocolStrategy(value v1.ProtocolStrategy) *ForwardPluginApplyConfiguration {
+ b.ProtocolStrategy = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gatewayconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gatewayconfig.go
new file mode 100644
index 0000000000..54fe274317
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gatewayconfig.go
@@ -0,0 +1,54 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// GatewayConfigApplyConfiguration represents a declarative configuration of the GatewayConfig type for use
+// with apply.
+type GatewayConfigApplyConfiguration struct {
+ RoutingViaHost *bool `json:"routingViaHost,omitempty"`
+ IPForwarding *v1.IPForwardingMode `json:"ipForwarding,omitempty"`
+ IPv4 *IPv4GatewayConfigApplyConfiguration `json:"ipv4,omitempty"`
+ IPv6 *IPv6GatewayConfigApplyConfiguration `json:"ipv6,omitempty"`
+}
+
+// GatewayConfigApplyConfiguration constructs a declarative configuration of the GatewayConfig type for use with
+// apply.
+func GatewayConfig() *GatewayConfigApplyConfiguration {
+ return &GatewayConfigApplyConfiguration{}
+}
+
+// WithRoutingViaHost sets the RoutingViaHost field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RoutingViaHost field is set to the value of the last call.
+func (b *GatewayConfigApplyConfiguration) WithRoutingViaHost(value bool) *GatewayConfigApplyConfiguration {
+ b.RoutingViaHost = &value
+ return b
+}
+
+// WithIPForwarding sets the IPForwarding field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IPForwarding field is set to the value of the last call.
+func (b *GatewayConfigApplyConfiguration) WithIPForwarding(value v1.IPForwardingMode) *GatewayConfigApplyConfiguration {
+ b.IPForwarding = &value
+ return b
+}
+
+// WithIPv4 sets the IPv4 field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IPv4 field is set to the value of the last call.
+func (b *GatewayConfigApplyConfiguration) WithIPv4(value *IPv4GatewayConfigApplyConfiguration) *GatewayConfigApplyConfiguration {
+ b.IPv4 = value
+ return b
+}
+
+// WithIPv6 sets the IPv6 field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IPv6 field is set to the value of the last call.
+func (b *GatewayConfigApplyConfiguration) WithIPv6(value *IPv6GatewayConfigApplyConfiguration) *GatewayConfigApplyConfiguration {
+ b.IPv6 = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gathererstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gathererstatus.go
new file mode 100644
index 0000000000..a0d62445e9
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gathererstatus.go
@@ -0,0 +1,51 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// GathererStatusApplyConfiguration represents a declarative configuration of the GathererStatus type for use
+// with apply.
+type GathererStatusApplyConfiguration struct {
+ Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
+ Name *string `json:"name,omitempty"`
+ LastGatherDuration *metav1.Duration `json:"lastGatherDuration,omitempty"`
+}
+
+// GathererStatusApplyConfiguration constructs a declarative configuration of the GathererStatus type for use with
+// apply.
+func GathererStatus() *GathererStatusApplyConfiguration {
+ return &GathererStatusApplyConfiguration{}
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *GathererStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *GathererStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *GathererStatusApplyConfiguration) WithName(value string) *GathererStatusApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithLastGatherDuration sets the LastGatherDuration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LastGatherDuration field is set to the value of the last call.
+func (b *GathererStatusApplyConfiguration) WithLastGatherDuration(value metav1.Duration) *GathererStatusApplyConfiguration {
+ b.LastGatherDuration = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gatherstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gatherstatus.go
new file mode 100644
index 0000000000..4139675467
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gatherstatus.go
@@ -0,0 +1,50 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// GatherStatusApplyConfiguration represents a declarative configuration of the GatherStatus type for use
+// with apply.
+type GatherStatusApplyConfiguration struct {
+ LastGatherTime *v1.Time `json:"lastGatherTime,omitempty"`
+ LastGatherDuration *v1.Duration `json:"lastGatherDuration,omitempty"`
+ Gatherers []GathererStatusApplyConfiguration `json:"gatherers,omitempty"`
+}
+
+// GatherStatusApplyConfiguration constructs a declarative configuration of the GatherStatus type for use with
+// apply.
+func GatherStatus() *GatherStatusApplyConfiguration {
+ return &GatherStatusApplyConfiguration{}
+}
+
+// WithLastGatherTime sets the LastGatherTime field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LastGatherTime field is set to the value of the last call.
+func (b *GatherStatusApplyConfiguration) WithLastGatherTime(value v1.Time) *GatherStatusApplyConfiguration {
+ b.LastGatherTime = &value
+ return b
+}
+
+// WithLastGatherDuration sets the LastGatherDuration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LastGatherDuration field is set to the value of the last call.
+func (b *GatherStatusApplyConfiguration) WithLastGatherDuration(value v1.Duration) *GatherStatusApplyConfiguration {
+ b.LastGatherDuration = &value
+ return b
+}
+
+// WithGatherers adds the given value to the Gatherers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Gatherers field.
+func (b *GatherStatusApplyConfiguration) WithGatherers(values ...*GathererStatusApplyConfiguration) *GatherStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGatherers")
+ }
+ b.Gatherers = append(b.Gatherers, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcpcsidriverconfigspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcpcsidriverconfigspec.go
new file mode 100644
index 0000000000..e8a6d3c783
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcpcsidriverconfigspec.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// GCPCSIDriverConfigSpecApplyConfiguration represents a declarative configuration of the GCPCSIDriverConfigSpec type for use
+// with apply.
+type GCPCSIDriverConfigSpecApplyConfiguration struct {
+ KMSKey *GCPKMSKeyReferenceApplyConfiguration `json:"kmsKey,omitempty"`
+}
+
+// GCPCSIDriverConfigSpecApplyConfiguration constructs a declarative configuration of the GCPCSIDriverConfigSpec type for use with
+// apply.
+func GCPCSIDriverConfigSpec() *GCPCSIDriverConfigSpecApplyConfiguration {
+ return &GCPCSIDriverConfigSpecApplyConfiguration{}
+}
+
+// WithKMSKey sets the KMSKey field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the KMSKey field is set to the value of the last call.
+func (b *GCPCSIDriverConfigSpecApplyConfiguration) WithKMSKey(value *GCPKMSKeyReferenceApplyConfiguration) *GCPCSIDriverConfigSpecApplyConfiguration {
+ b.KMSKey = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcpkmskeyreference.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcpkmskeyreference.go
new file mode 100644
index 0000000000..f443b5a59f
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcpkmskeyreference.go
@@ -0,0 +1,50 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// GCPKMSKeyReferenceApplyConfiguration represents a declarative configuration of the GCPKMSKeyReference type for use
+// with apply.
+type GCPKMSKeyReferenceApplyConfiguration struct {
+ Name *string `json:"name,omitempty"`
+ KeyRing *string `json:"keyRing,omitempty"`
+ ProjectID *string `json:"projectID,omitempty"`
+ Location *string `json:"location,omitempty"`
+}
+
+// GCPKMSKeyReferenceApplyConfiguration constructs a declarative configuration of the GCPKMSKeyReference type for use with
+// apply.
+func GCPKMSKeyReference() *GCPKMSKeyReferenceApplyConfiguration {
+ return &GCPKMSKeyReferenceApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *GCPKMSKeyReferenceApplyConfiguration) WithName(value string) *GCPKMSKeyReferenceApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithKeyRing sets the KeyRing field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the KeyRing field is set to the value of the last call.
+func (b *GCPKMSKeyReferenceApplyConfiguration) WithKeyRing(value string) *GCPKMSKeyReferenceApplyConfiguration {
+ b.KeyRing = &value
+ return b
+}
+
+// WithProjectID sets the ProjectID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ProjectID field is set to the value of the last call.
+func (b *GCPKMSKeyReferenceApplyConfiguration) WithProjectID(value string) *GCPKMSKeyReferenceApplyConfiguration {
+ b.ProjectID = &value
+ return b
+}
+
+// WithLocation sets the Location field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Location field is set to the value of the last call.
+func (b *GCPKMSKeyReferenceApplyConfiguration) WithLocation(value string) *GCPKMSKeyReferenceApplyConfiguration {
+ b.Location = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcploadbalancerparameters.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcploadbalancerparameters.go
new file mode 100644
index 0000000000..a5e0306c44
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcploadbalancerparameters.go
@@ -0,0 +1,27 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// GCPLoadBalancerParametersApplyConfiguration represents a declarative configuration of the GCPLoadBalancerParameters type for use
+// with apply.
+type GCPLoadBalancerParametersApplyConfiguration struct {
+ ClientAccess *v1.GCPClientAccess `json:"clientAccess,omitempty"`
+}
+
+// GCPLoadBalancerParametersApplyConfiguration constructs a declarative configuration of the GCPLoadBalancerParameters type for use with
+// apply.
+func GCPLoadBalancerParameters() *GCPLoadBalancerParametersApplyConfiguration {
+ return &GCPLoadBalancerParametersApplyConfiguration{}
+}
+
+// WithClientAccess sets the ClientAccess field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClientAccess field is set to the value of the last call.
+func (b *GCPLoadBalancerParametersApplyConfiguration) WithClientAccess(value v1.GCPClientAccess) *GCPLoadBalancerParametersApplyConfiguration {
+ b.ClientAccess = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/generationstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/generationstatus.go
new file mode 100644
index 0000000000..074b33869b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/generationstatus.go
@@ -0,0 +1,68 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// GenerationStatusApplyConfiguration represents a declarative configuration of the GenerationStatus type for use
+// with apply.
+type GenerationStatusApplyConfiguration struct {
+ Group *string `json:"group,omitempty"`
+ Resource *string `json:"resource,omitempty"`
+ Namespace *string `json:"namespace,omitempty"`
+ Name *string `json:"name,omitempty"`
+ LastGeneration *int64 `json:"lastGeneration,omitempty"`
+ Hash *string `json:"hash,omitempty"`
+}
+
+// GenerationStatusApplyConfiguration constructs a declarative configuration of the GenerationStatus type for use with
+// apply.
+func GenerationStatus() *GenerationStatusApplyConfiguration {
+ return &GenerationStatusApplyConfiguration{}
+}
+
+// WithGroup sets the Group field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Group field is set to the value of the last call.
+func (b *GenerationStatusApplyConfiguration) WithGroup(value string) *GenerationStatusApplyConfiguration {
+ b.Group = &value
+ return b
+}
+
+// WithResource sets the Resource field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Resource field is set to the value of the last call.
+func (b *GenerationStatusApplyConfiguration) WithResource(value string) *GenerationStatusApplyConfiguration {
+ b.Resource = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *GenerationStatusApplyConfiguration) WithNamespace(value string) *GenerationStatusApplyConfiguration {
+ b.Namespace = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *GenerationStatusApplyConfiguration) WithName(value string) *GenerationStatusApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithLastGeneration sets the LastGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LastGeneration field is set to the value of the last call.
+func (b *GenerationStatusApplyConfiguration) WithLastGeneration(value int64) *GenerationStatusApplyConfiguration {
+ b.LastGeneration = &value
+ return b
+}
+
+// WithHash sets the Hash field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Hash field is set to the value of the last call.
+func (b *GenerationStatusApplyConfiguration) WithHash(value string) *GenerationStatusApplyConfiguration {
+ b.Hash = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/healthcheck.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/healthcheck.go
new file mode 100644
index 0000000000..4b8d600ba0
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/healthcheck.go
@@ -0,0 +1,54 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// HealthCheckApplyConfiguration represents a declarative configuration of the HealthCheck type for use
+// with apply.
+type HealthCheckApplyConfiguration struct {
+ Description *string `json:"description,omitempty"`
+ TotalRisk *int32 `json:"totalRisk,omitempty"`
+ AdvisorURI *string `json:"advisorURI,omitempty"`
+ State *v1.HealthCheckState `json:"state,omitempty"`
+}
+
+// HealthCheckApplyConfiguration constructs a declarative configuration of the HealthCheck type for use with
+// apply.
+func HealthCheck() *HealthCheckApplyConfiguration {
+ return &HealthCheckApplyConfiguration{}
+}
+
+// WithDescription sets the Description field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Description field is set to the value of the last call.
+func (b *HealthCheckApplyConfiguration) WithDescription(value string) *HealthCheckApplyConfiguration {
+ b.Description = &value
+ return b
+}
+
+// WithTotalRisk sets the TotalRisk field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TotalRisk field is set to the value of the last call.
+func (b *HealthCheckApplyConfiguration) WithTotalRisk(value int32) *HealthCheckApplyConfiguration {
+ b.TotalRisk = &value
+ return b
+}
+
+// WithAdvisorURI sets the AdvisorURI field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the AdvisorURI field is set to the value of the last call.
+func (b *HealthCheckApplyConfiguration) WithAdvisorURI(value string) *HealthCheckApplyConfiguration {
+ b.AdvisorURI = &value
+ return b
+}
+
+// WithState sets the State field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the State field is set to the value of the last call.
+func (b *HealthCheckApplyConfiguration) WithState(value v1.HealthCheckState) *HealthCheckApplyConfiguration {
+ b.State = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/hostnetworkstrategy.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/hostnetworkstrategy.go
new file mode 100644
index 0000000000..2b7e1aadb7
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/hostnetworkstrategy.go
@@ -0,0 +1,54 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// HostNetworkStrategyApplyConfiguration represents a declarative configuration of the HostNetworkStrategy type for use
+// with apply.
+type HostNetworkStrategyApplyConfiguration struct {
+ Protocol *v1.IngressControllerProtocol `json:"protocol,omitempty"`
+ HTTPPort *int32 `json:"httpPort,omitempty"`
+ HTTPSPort *int32 `json:"httpsPort,omitempty"`
+ StatsPort *int32 `json:"statsPort,omitempty"`
+}
+
+// HostNetworkStrategyApplyConfiguration constructs a declarative configuration of the HostNetworkStrategy type for use with
+// apply.
+func HostNetworkStrategy() *HostNetworkStrategyApplyConfiguration {
+ return &HostNetworkStrategyApplyConfiguration{}
+}
+
+// WithProtocol sets the Protocol field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Protocol field is set to the value of the last call.
+func (b *HostNetworkStrategyApplyConfiguration) WithProtocol(value v1.IngressControllerProtocol) *HostNetworkStrategyApplyConfiguration {
+ b.Protocol = &value
+ return b
+}
+
+// WithHTTPPort sets the HTTPPort field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HTTPPort field is set to the value of the last call.
+func (b *HostNetworkStrategyApplyConfiguration) WithHTTPPort(value int32) *HostNetworkStrategyApplyConfiguration {
+ b.HTTPPort = &value
+ return b
+}
+
+// WithHTTPSPort sets the HTTPSPort field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HTTPSPort field is set to the value of the last call.
+func (b *HostNetworkStrategyApplyConfiguration) WithHTTPSPort(value int32) *HostNetworkStrategyApplyConfiguration {
+ b.HTTPSPort = &value
+ return b
+}
+
+// WithStatsPort sets the StatsPort field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the StatsPort field is set to the value of the last call.
+func (b *HostNetworkStrategyApplyConfiguration) WithStatsPort(value int32) *HostNetworkStrategyApplyConfiguration {
+ b.StatsPort = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/httpcompressionpolicy.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/httpcompressionpolicy.go
new file mode 100644
index 0000000000..2a1b2022a0
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/httpcompressionpolicy.go
@@ -0,0 +1,29 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// HTTPCompressionPolicyApplyConfiguration represents a declarative configuration of the HTTPCompressionPolicy type for use
+// with apply.
+type HTTPCompressionPolicyApplyConfiguration struct {
+ MimeTypes []v1.CompressionMIMEType `json:"mimeTypes,omitempty"`
+}
+
+// HTTPCompressionPolicyApplyConfiguration constructs a declarative configuration of the HTTPCompressionPolicy type for use with
+// apply.
+func HTTPCompressionPolicy() *HTTPCompressionPolicyApplyConfiguration {
+ return &HTTPCompressionPolicyApplyConfiguration{}
+}
+
+// WithMimeTypes adds the given value to the MimeTypes field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the MimeTypes field.
+func (b *HTTPCompressionPolicyApplyConfiguration) WithMimeTypes(values ...v1.CompressionMIMEType) *HTTPCompressionPolicyApplyConfiguration {
+ for i := range values {
+ b.MimeTypes = append(b.MimeTypes, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/hybridoverlayconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/hybridoverlayconfig.go
new file mode 100644
index 0000000000..71bd65561c
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/hybridoverlayconfig.go
@@ -0,0 +1,37 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// HybridOverlayConfigApplyConfiguration represents a declarative configuration of the HybridOverlayConfig type for use
+// with apply.
+type HybridOverlayConfigApplyConfiguration struct {
+ HybridClusterNetwork []ClusterNetworkEntryApplyConfiguration `json:"hybridClusterNetwork,omitempty"`
+ HybridOverlayVXLANPort *uint32 `json:"hybridOverlayVXLANPort,omitempty"`
+}
+
+// HybridOverlayConfigApplyConfiguration constructs a declarative configuration of the HybridOverlayConfig type for use with
+// apply.
+func HybridOverlayConfig() *HybridOverlayConfigApplyConfiguration {
+ return &HybridOverlayConfigApplyConfiguration{}
+}
+
+// WithHybridClusterNetwork adds the given value to the HybridClusterNetwork field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the HybridClusterNetwork field.
+func (b *HybridOverlayConfigApplyConfiguration) WithHybridClusterNetwork(values ...*ClusterNetworkEntryApplyConfiguration) *HybridOverlayConfigApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithHybridClusterNetwork")
+ }
+ b.HybridClusterNetwork = append(b.HybridClusterNetwork, *values[i])
+ }
+ return b
+}
+
+// WithHybridOverlayVXLANPort sets the HybridOverlayVXLANPort field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HybridOverlayVXLANPort field is set to the value of the last call.
+func (b *HybridOverlayConfigApplyConfiguration) WithHybridOverlayVXLANPort(value uint32) *HybridOverlayConfigApplyConfiguration {
+ b.HybridOverlayVXLANPort = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ibmcloudcsidriverconfigspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ibmcloudcsidriverconfigspec.go
new file mode 100644
index 0000000000..56069b7c1c
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ibmcloudcsidriverconfigspec.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IBMCloudCSIDriverConfigSpecApplyConfiguration represents a declarative configuration of the IBMCloudCSIDriverConfigSpec type for use
+// with apply.
+type IBMCloudCSIDriverConfigSpecApplyConfiguration struct {
+ EncryptionKeyCRN *string `json:"encryptionKeyCRN,omitempty"`
+}
+
+// IBMCloudCSIDriverConfigSpecApplyConfiguration constructs a declarative configuration of the IBMCloudCSIDriverConfigSpec type for use with
+// apply.
+func IBMCloudCSIDriverConfigSpec() *IBMCloudCSIDriverConfigSpecApplyConfiguration {
+ return &IBMCloudCSIDriverConfigSpecApplyConfiguration{}
+}
+
+// WithEncryptionKeyCRN sets the EncryptionKeyCRN field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the EncryptionKeyCRN field is set to the value of the last call.
+func (b *IBMCloudCSIDriverConfigSpecApplyConfiguration) WithEncryptionKeyCRN(value string) *IBMCloudCSIDriverConfigSpecApplyConfiguration {
+ b.EncryptionKeyCRN = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ibmloadbalancerparameters.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ibmloadbalancerparameters.go
new file mode 100644
index 0000000000..e60ab354eb
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ibmloadbalancerparameters.go
@@ -0,0 +1,27 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// IBMLoadBalancerParametersApplyConfiguration represents a declarative configuration of the IBMLoadBalancerParameters type for use
+// with apply.
+type IBMLoadBalancerParametersApplyConfiguration struct {
+ Protocol *v1.IngressControllerProtocol `json:"protocol,omitempty"`
+}
+
+// IBMLoadBalancerParametersApplyConfiguration constructs a declarative configuration of the IBMLoadBalancerParameters type for use with
+// apply.
+func IBMLoadBalancerParameters() *IBMLoadBalancerParametersApplyConfiguration {
+ return &IBMLoadBalancerParametersApplyConfiguration{}
+}
+
+// WithProtocol sets the Protocol field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Protocol field is set to the value of the last call.
+func (b *IBMLoadBalancerParametersApplyConfiguration) WithProtocol(value v1.IngressControllerProtocol) *IBMLoadBalancerParametersApplyConfiguration {
+ b.Protocol = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingress.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingress.go
new file mode 100644
index 0000000000..2993a361fa
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingress.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IngressApplyConfiguration represents a declarative configuration of the Ingress type for use
+// with apply.
+type IngressApplyConfiguration struct {
+ ConsoleURL *string `json:"consoleURL,omitempty"`
+ ClientDownloadsURL *string `json:"clientDownloadsURL,omitempty"`
+}
+
+// IngressApplyConfiguration constructs a declarative configuration of the Ingress type for use with
+// apply.
+func Ingress() *IngressApplyConfiguration {
+ return &IngressApplyConfiguration{}
+}
+
+// WithConsoleURL sets the ConsoleURL field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ConsoleURL field is set to the value of the last call.
+func (b *IngressApplyConfiguration) WithConsoleURL(value string) *IngressApplyConfiguration {
+ b.ConsoleURL = &value
+ return b
+}
+
+// WithClientDownloadsURL sets the ClientDownloadsURL field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClientDownloadsURL field is set to the value of the last call.
+func (b *IngressApplyConfiguration) WithClientDownloadsURL(value string) *IngressApplyConfiguration {
+ b.ClientDownloadsURL = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontroller.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontroller.go
new file mode 100644
index 0000000000..a37177b676
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontroller.go
@@ -0,0 +1,248 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// IngressControllerApplyConfiguration represents a declarative configuration of the IngressController type for use
+// with apply.
+type IngressControllerApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *IngressControllerSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *IngressControllerStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// IngressController constructs a declarative configuration of the IngressController type for use with
+// apply.
+func IngressController(name, namespace string) *IngressControllerApplyConfiguration {
+ b := &IngressControllerApplyConfiguration{}
+ b.WithName(name)
+ b.WithNamespace(namespace)
+ b.WithKind("IngressController")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractIngressController extracts the applied configuration owned by fieldManager from
+// ingressController. If no managedFields are found in ingressController for fieldManager, a
+// IngressControllerApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// ingressController must be a unmodified IngressController API object that was retrieved from the Kubernetes API.
+// ExtractIngressController provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractIngressController(ingressController *apioperatorv1.IngressController, fieldManager string) (*IngressControllerApplyConfiguration, error) {
+ return extractIngressController(ingressController, fieldManager, "")
+}
+
+// ExtractIngressControllerStatus is the same as ExtractIngressController except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractIngressControllerStatus(ingressController *apioperatorv1.IngressController, fieldManager string) (*IngressControllerApplyConfiguration, error) {
+ return extractIngressController(ingressController, fieldManager, "status")
+}
+
+func extractIngressController(ingressController *apioperatorv1.IngressController, fieldManager string, subresource string) (*IngressControllerApplyConfiguration, error) {
+ b := &IngressControllerApplyConfiguration{}
+ err := managedfields.ExtractInto(ingressController, internal.Parser().Type("com.github.openshift.api.operator.v1.IngressController"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(ingressController.Name)
+ b.WithNamespace(ingressController.Namespace)
+
+ b.WithKind("IngressController")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithKind(value string) *IngressControllerApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithAPIVersion(value string) *IngressControllerApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithName(value string) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithGenerateName(value string) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithNamespace(value string) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithUID(value types.UID) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithResourceVersion(value string) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithGeneration(value int64) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *IngressControllerApplyConfiguration) WithLabels(entries map[string]string) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *IngressControllerApplyConfiguration) WithAnnotations(entries map[string]string) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *IngressControllerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *IngressControllerApplyConfiguration) WithFinalizers(values ...string) *IngressControllerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *IngressControllerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithSpec(value *IngressControllerSpecApplyConfiguration) *IngressControllerApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *IngressControllerApplyConfiguration) WithStatus(value *IngressControllerStatusApplyConfiguration) *IngressControllerApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *IngressControllerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpcookie.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpcookie.go
new file mode 100644
index 0000000000..fd345b6430
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpcookie.go
@@ -0,0 +1,52 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// IngressControllerCaptureHTTPCookieApplyConfiguration represents a declarative configuration of the IngressControllerCaptureHTTPCookie type for use
+// with apply.
+type IngressControllerCaptureHTTPCookieApplyConfiguration struct {
+ IngressControllerCaptureHTTPCookieUnionApplyConfiguration `json:",inline"`
+ MaxLength *int `json:"maxLength,omitempty"`
+}
+
+// IngressControllerCaptureHTTPCookieApplyConfiguration constructs a declarative configuration of the IngressControllerCaptureHTTPCookie type for use with
+// apply.
+func IngressControllerCaptureHTTPCookie() *IngressControllerCaptureHTTPCookieApplyConfiguration {
+ return &IngressControllerCaptureHTTPCookieApplyConfiguration{}
+}
+
+// WithMatchType sets the MatchType field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MatchType field is set to the value of the last call.
+func (b *IngressControllerCaptureHTTPCookieApplyConfiguration) WithMatchType(value operatorv1.CookieMatchType) *IngressControllerCaptureHTTPCookieApplyConfiguration {
+ b.MatchType = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *IngressControllerCaptureHTTPCookieApplyConfiguration) WithName(value string) *IngressControllerCaptureHTTPCookieApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithNamePrefix sets the NamePrefix field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NamePrefix field is set to the value of the last call.
+func (b *IngressControllerCaptureHTTPCookieApplyConfiguration) WithNamePrefix(value string) *IngressControllerCaptureHTTPCookieApplyConfiguration {
+ b.NamePrefix = &value
+ return b
+}
+
+// WithMaxLength sets the MaxLength field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MaxLength field is set to the value of the last call.
+func (b *IngressControllerCaptureHTTPCookieApplyConfiguration) WithMaxLength(value int) *IngressControllerCaptureHTTPCookieApplyConfiguration {
+ b.MaxLength = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpcookieunion.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpcookieunion.go
new file mode 100644
index 0000000000..57f9fb590e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpcookieunion.go
@@ -0,0 +1,45 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// IngressControllerCaptureHTTPCookieUnionApplyConfiguration represents a declarative configuration of the IngressControllerCaptureHTTPCookieUnion type for use
+// with apply.
+type IngressControllerCaptureHTTPCookieUnionApplyConfiguration struct {
+ MatchType *v1.CookieMatchType `json:"matchType,omitempty"`
+ Name *string `json:"name,omitempty"`
+ NamePrefix *string `json:"namePrefix,omitempty"`
+}
+
+// IngressControllerCaptureHTTPCookieUnionApplyConfiguration constructs a declarative configuration of the IngressControllerCaptureHTTPCookieUnion type for use with
+// apply.
+func IngressControllerCaptureHTTPCookieUnion() *IngressControllerCaptureHTTPCookieUnionApplyConfiguration {
+ return &IngressControllerCaptureHTTPCookieUnionApplyConfiguration{}
+}
+
+// WithMatchType sets the MatchType field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MatchType field is set to the value of the last call.
+func (b *IngressControllerCaptureHTTPCookieUnionApplyConfiguration) WithMatchType(value v1.CookieMatchType) *IngressControllerCaptureHTTPCookieUnionApplyConfiguration {
+ b.MatchType = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *IngressControllerCaptureHTTPCookieUnionApplyConfiguration) WithName(value string) *IngressControllerCaptureHTTPCookieUnionApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithNamePrefix sets the NamePrefix field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NamePrefix field is set to the value of the last call.
+func (b *IngressControllerCaptureHTTPCookieUnionApplyConfiguration) WithNamePrefix(value string) *IngressControllerCaptureHTTPCookieUnionApplyConfiguration {
+ b.NamePrefix = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpheader.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpheader.go
new file mode 100644
index 0000000000..88b2166b71
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpheader.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IngressControllerCaptureHTTPHeaderApplyConfiguration represents a declarative configuration of the IngressControllerCaptureHTTPHeader type for use
+// with apply.
+type IngressControllerCaptureHTTPHeaderApplyConfiguration struct {
+ Name *string `json:"name,omitempty"`
+ MaxLength *int `json:"maxLength,omitempty"`
+}
+
+// IngressControllerCaptureHTTPHeaderApplyConfiguration constructs a declarative configuration of the IngressControllerCaptureHTTPHeader type for use with
+// apply.
+func IngressControllerCaptureHTTPHeader() *IngressControllerCaptureHTTPHeaderApplyConfiguration {
+ return &IngressControllerCaptureHTTPHeaderApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *IngressControllerCaptureHTTPHeaderApplyConfiguration) WithName(value string) *IngressControllerCaptureHTTPHeaderApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithMaxLength sets the MaxLength field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MaxLength field is set to the value of the last call.
+func (b *IngressControllerCaptureHTTPHeaderApplyConfiguration) WithMaxLength(value int) *IngressControllerCaptureHTTPHeaderApplyConfiguration {
+ b.MaxLength = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpheaders.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpheaders.go
new file mode 100644
index 0000000000..02f7173cf0
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpheaders.go
@@ -0,0 +1,42 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IngressControllerCaptureHTTPHeadersApplyConfiguration represents a declarative configuration of the IngressControllerCaptureHTTPHeaders type for use
+// with apply.
+type IngressControllerCaptureHTTPHeadersApplyConfiguration struct {
+ Request []IngressControllerCaptureHTTPHeaderApplyConfiguration `json:"request,omitempty"`
+ Response []IngressControllerCaptureHTTPHeaderApplyConfiguration `json:"response,omitempty"`
+}
+
+// IngressControllerCaptureHTTPHeadersApplyConfiguration constructs a declarative configuration of the IngressControllerCaptureHTTPHeaders type for use with
+// apply.
+func IngressControllerCaptureHTTPHeaders() *IngressControllerCaptureHTTPHeadersApplyConfiguration {
+ return &IngressControllerCaptureHTTPHeadersApplyConfiguration{}
+}
+
+// WithRequest adds the given value to the Request field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Request field.
+func (b *IngressControllerCaptureHTTPHeadersApplyConfiguration) WithRequest(values ...*IngressControllerCaptureHTTPHeaderApplyConfiguration) *IngressControllerCaptureHTTPHeadersApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithRequest")
+ }
+ b.Request = append(b.Request, *values[i])
+ }
+ return b
+}
+
+// WithResponse adds the given value to the Response field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Response field.
+func (b *IngressControllerCaptureHTTPHeadersApplyConfiguration) WithResponse(values ...*IngressControllerCaptureHTTPHeaderApplyConfiguration) *IngressControllerCaptureHTTPHeadersApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithResponse")
+ }
+ b.Response = append(b.Response, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheader.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheader.go
new file mode 100644
index 0000000000..f09d725b15
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheader.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IngressControllerHTTPHeaderApplyConfiguration represents a declarative configuration of the IngressControllerHTTPHeader type for use
+// with apply.
+type IngressControllerHTTPHeaderApplyConfiguration struct {
+ Name *string `json:"name,omitempty"`
+ Action *IngressControllerHTTPHeaderActionUnionApplyConfiguration `json:"action,omitempty"`
+}
+
+// IngressControllerHTTPHeaderApplyConfiguration constructs a declarative configuration of the IngressControllerHTTPHeader type for use with
+// apply.
+func IngressControllerHTTPHeader() *IngressControllerHTTPHeaderApplyConfiguration {
+ return &IngressControllerHTTPHeaderApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *IngressControllerHTTPHeaderApplyConfiguration) WithName(value string) *IngressControllerHTTPHeaderApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithAction sets the Action field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Action field is set to the value of the last call.
+func (b *IngressControllerHTTPHeaderApplyConfiguration) WithAction(value *IngressControllerHTTPHeaderActionUnionApplyConfiguration) *IngressControllerHTTPHeaderApplyConfiguration {
+ b.Action = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaderactions.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaderactions.go
new file mode 100644
index 0000000000..aa4b176c4e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaderactions.go
@@ -0,0 +1,42 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IngressControllerHTTPHeaderActionsApplyConfiguration represents a declarative configuration of the IngressControllerHTTPHeaderActions type for use
+// with apply.
+type IngressControllerHTTPHeaderActionsApplyConfiguration struct {
+ Response []IngressControllerHTTPHeaderApplyConfiguration `json:"response,omitempty"`
+ Request []IngressControllerHTTPHeaderApplyConfiguration `json:"request,omitempty"`
+}
+
+// IngressControllerHTTPHeaderActionsApplyConfiguration constructs a declarative configuration of the IngressControllerHTTPHeaderActions type for use with
+// apply.
+func IngressControllerHTTPHeaderActions() *IngressControllerHTTPHeaderActionsApplyConfiguration {
+ return &IngressControllerHTTPHeaderActionsApplyConfiguration{}
+}
+
+// WithResponse adds the given value to the Response field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Response field.
+func (b *IngressControllerHTTPHeaderActionsApplyConfiguration) WithResponse(values ...*IngressControllerHTTPHeaderApplyConfiguration) *IngressControllerHTTPHeaderActionsApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithResponse")
+ }
+ b.Response = append(b.Response, *values[i])
+ }
+ return b
+}
+
+// WithRequest adds the given value to the Request field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Request field.
+func (b *IngressControllerHTTPHeaderActionsApplyConfiguration) WithRequest(values ...*IngressControllerHTTPHeaderApplyConfiguration) *IngressControllerHTTPHeaderActionsApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithRequest")
+ }
+ b.Request = append(b.Request, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaderactionunion.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaderactionunion.go
new file mode 100644
index 0000000000..2c5a51ffec
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaderactionunion.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// IngressControllerHTTPHeaderActionUnionApplyConfiguration represents a declarative configuration of the IngressControllerHTTPHeaderActionUnion type for use
+// with apply.
+type IngressControllerHTTPHeaderActionUnionApplyConfiguration struct {
+ Type *v1.IngressControllerHTTPHeaderActionType `json:"type,omitempty"`
+ Set *IngressControllerSetHTTPHeaderApplyConfiguration `json:"set,omitempty"`
+}
+
+// IngressControllerHTTPHeaderActionUnionApplyConfiguration constructs a declarative configuration of the IngressControllerHTTPHeaderActionUnion type for use with
+// apply.
+func IngressControllerHTTPHeaderActionUnion() *IngressControllerHTTPHeaderActionUnionApplyConfiguration {
+ return &IngressControllerHTTPHeaderActionUnionApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *IngressControllerHTTPHeaderActionUnionApplyConfiguration) WithType(value v1.IngressControllerHTTPHeaderActionType) *IngressControllerHTTPHeaderActionUnionApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithSet sets the Set field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Set field is set to the value of the last call.
+func (b *IngressControllerHTTPHeaderActionUnionApplyConfiguration) WithSet(value *IngressControllerSetHTTPHeaderApplyConfiguration) *IngressControllerHTTPHeaderActionUnionApplyConfiguration {
+ b.Set = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaders.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaders.go
new file mode 100644
index 0000000000..f1381d7a79
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaders.go
@@ -0,0 +1,56 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// IngressControllerHTTPHeadersApplyConfiguration represents a declarative configuration of the IngressControllerHTTPHeaders type for use
+// with apply.
+type IngressControllerHTTPHeadersApplyConfiguration struct {
+ ForwardedHeaderPolicy *v1.IngressControllerHTTPHeaderPolicy `json:"forwardedHeaderPolicy,omitempty"`
+ UniqueId *IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration `json:"uniqueId,omitempty"`
+ HeaderNameCaseAdjustments []v1.IngressControllerHTTPHeaderNameCaseAdjustment `json:"headerNameCaseAdjustments,omitempty"`
+ Actions *IngressControllerHTTPHeaderActionsApplyConfiguration `json:"actions,omitempty"`
+}
+
+// IngressControllerHTTPHeadersApplyConfiguration constructs a declarative configuration of the IngressControllerHTTPHeaders type for use with
+// apply.
+func IngressControllerHTTPHeaders() *IngressControllerHTTPHeadersApplyConfiguration {
+ return &IngressControllerHTTPHeadersApplyConfiguration{}
+}
+
+// WithForwardedHeaderPolicy sets the ForwardedHeaderPolicy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ForwardedHeaderPolicy field is set to the value of the last call.
+func (b *IngressControllerHTTPHeadersApplyConfiguration) WithForwardedHeaderPolicy(value v1.IngressControllerHTTPHeaderPolicy) *IngressControllerHTTPHeadersApplyConfiguration {
+ b.ForwardedHeaderPolicy = &value
+ return b
+}
+
+// WithUniqueId sets the UniqueId field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UniqueId field is set to the value of the last call.
+func (b *IngressControllerHTTPHeadersApplyConfiguration) WithUniqueId(value *IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration) *IngressControllerHTTPHeadersApplyConfiguration {
+ b.UniqueId = value
+ return b
+}
+
+// WithHeaderNameCaseAdjustments adds the given value to the HeaderNameCaseAdjustments field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the HeaderNameCaseAdjustments field.
+func (b *IngressControllerHTTPHeadersApplyConfiguration) WithHeaderNameCaseAdjustments(values ...v1.IngressControllerHTTPHeaderNameCaseAdjustment) *IngressControllerHTTPHeadersApplyConfiguration {
+ for i := range values {
+ b.HeaderNameCaseAdjustments = append(b.HeaderNameCaseAdjustments, values[i])
+ }
+ return b
+}
+
+// WithActions sets the Actions field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Actions field is set to the value of the last call.
+func (b *IngressControllerHTTPHeadersApplyConfiguration) WithActions(value *IngressControllerHTTPHeaderActionsApplyConfiguration) *IngressControllerHTTPHeadersApplyConfiguration {
+ b.Actions = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpuniqueidheaderpolicy.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpuniqueidheaderpolicy.go
new file mode 100644
index 0000000000..ecd183654a
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpuniqueidheaderpolicy.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration represents a declarative configuration of the IngressControllerHTTPUniqueIdHeaderPolicy type for use
+// with apply.
+type IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration struct {
+ Name *string `json:"name,omitempty"`
+ Format *string `json:"format,omitempty"`
+}
+
+// IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration constructs a declarative configuration of the IngressControllerHTTPUniqueIdHeaderPolicy type for use with
+// apply.
+func IngressControllerHTTPUniqueIdHeaderPolicy() *IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration {
+ return &IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration) WithName(value string) *IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithFormat sets the Format field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Format field is set to the value of the last call.
+func (b *IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration) WithFormat(value string) *IngressControllerHTTPUniqueIdHeaderPolicyApplyConfiguration {
+ b.Format = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerlogging.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerlogging.go
new file mode 100644
index 0000000000..881cf27f97
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerlogging.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IngressControllerLoggingApplyConfiguration represents a declarative configuration of the IngressControllerLogging type for use
+// with apply.
+type IngressControllerLoggingApplyConfiguration struct {
+ Access *AccessLoggingApplyConfiguration `json:"access,omitempty"`
+}
+
+// IngressControllerLoggingApplyConfiguration constructs a declarative configuration of the IngressControllerLogging type for use with
+// apply.
+func IngressControllerLogging() *IngressControllerLoggingApplyConfiguration {
+ return &IngressControllerLoggingApplyConfiguration{}
+}
+
+// WithAccess sets the Access field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Access field is set to the value of the last call.
+func (b *IngressControllerLoggingApplyConfiguration) WithAccess(value *AccessLoggingApplyConfiguration) *IngressControllerLoggingApplyConfiguration {
+ b.Access = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollersethttpheader.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollersethttpheader.go
new file mode 100644
index 0000000000..edad60be8e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollersethttpheader.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IngressControllerSetHTTPHeaderApplyConfiguration represents a declarative configuration of the IngressControllerSetHTTPHeader type for use
+// with apply.
+type IngressControllerSetHTTPHeaderApplyConfiguration struct {
+ Value *string `json:"value,omitempty"`
+}
+
+// IngressControllerSetHTTPHeaderApplyConfiguration constructs a declarative configuration of the IngressControllerSetHTTPHeader type for use with
+// apply.
+func IngressControllerSetHTTPHeader() *IngressControllerSetHTTPHeaderApplyConfiguration {
+ return &IngressControllerSetHTTPHeaderApplyConfiguration{}
+}
+
+// WithValue sets the Value field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Value field is set to the value of the last call.
+func (b *IngressControllerSetHTTPHeaderApplyConfiguration) WithValue(value string) *IngressControllerSetHTTPHeaderApplyConfiguration {
+ b.Value = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerspec.go
new file mode 100644
index 0000000000..fc57030c73
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerspec.go
@@ -0,0 +1,175 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/config/v1"
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ corev1 "k8s.io/api/core/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// IngressControllerSpecApplyConfiguration represents a declarative configuration of the IngressControllerSpec type for use
+// with apply.
+type IngressControllerSpecApplyConfiguration struct {
+ Domain *string `json:"domain,omitempty"`
+ HttpErrorCodePages *v1.ConfigMapNameReference `json:"httpErrorCodePages,omitempty"`
+ Replicas *int32 `json:"replicas,omitempty"`
+ EndpointPublishingStrategy *EndpointPublishingStrategyApplyConfiguration `json:"endpointPublishingStrategy,omitempty"`
+ DefaultCertificate *corev1.LocalObjectReference `json:"defaultCertificate,omitempty"`
+ NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
+ RouteSelector *metav1.LabelSelectorApplyConfiguration `json:"routeSelector,omitempty"`
+ NodePlacement *NodePlacementApplyConfiguration `json:"nodePlacement,omitempty"`
+ TLSSecurityProfile *v1.TLSSecurityProfile `json:"tlsSecurityProfile,omitempty"`
+ ClientTLS *ClientTLSApplyConfiguration `json:"clientTLS,omitempty"`
+ RouteAdmission *RouteAdmissionPolicyApplyConfiguration `json:"routeAdmission,omitempty"`
+ Logging *IngressControllerLoggingApplyConfiguration `json:"logging,omitempty"`
+ HTTPHeaders *IngressControllerHTTPHeadersApplyConfiguration `json:"httpHeaders,omitempty"`
+ HTTPEmptyRequestsPolicy *apioperatorv1.HTTPEmptyRequestsPolicy `json:"httpEmptyRequestsPolicy,omitempty"`
+ TuningOptions *IngressControllerTuningOptionsApplyConfiguration `json:"tuningOptions,omitempty"`
+ UnsupportedConfigOverrides *runtime.RawExtension `json:"unsupportedConfigOverrides,omitempty"`
+ HTTPCompression *HTTPCompressionPolicyApplyConfiguration `json:"httpCompression,omitempty"`
+}
+
+// IngressControllerSpecApplyConfiguration constructs a declarative configuration of the IngressControllerSpec type for use with
+// apply.
+func IngressControllerSpec() *IngressControllerSpecApplyConfiguration {
+ return &IngressControllerSpecApplyConfiguration{}
+}
+
+// WithDomain sets the Domain field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Domain field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithDomain(value string) *IngressControllerSpecApplyConfiguration {
+ b.Domain = &value
+ return b
+}
+
+// WithHttpErrorCodePages sets the HttpErrorCodePages field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HttpErrorCodePages field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithHttpErrorCodePages(value v1.ConfigMapNameReference) *IngressControllerSpecApplyConfiguration {
+ b.HttpErrorCodePages = &value
+ return b
+}
+
+// WithReplicas sets the Replicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Replicas field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithReplicas(value int32) *IngressControllerSpecApplyConfiguration {
+ b.Replicas = &value
+ return b
+}
+
+// WithEndpointPublishingStrategy sets the EndpointPublishingStrategy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the EndpointPublishingStrategy field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithEndpointPublishingStrategy(value *EndpointPublishingStrategyApplyConfiguration) *IngressControllerSpecApplyConfiguration {
+ b.EndpointPublishingStrategy = value
+ return b
+}
+
+// WithDefaultCertificate sets the DefaultCertificate field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DefaultCertificate field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithDefaultCertificate(value corev1.LocalObjectReference) *IngressControllerSpecApplyConfiguration {
+ b.DefaultCertificate = &value
+ return b
+}
+
+// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NamespaceSelector field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *IngressControllerSpecApplyConfiguration {
+ b.NamespaceSelector = value
+ return b
+}
+
+// WithRouteSelector sets the RouteSelector field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RouteSelector field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithRouteSelector(value *metav1.LabelSelectorApplyConfiguration) *IngressControllerSpecApplyConfiguration {
+ b.RouteSelector = value
+ return b
+}
+
+// WithNodePlacement sets the NodePlacement field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NodePlacement field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithNodePlacement(value *NodePlacementApplyConfiguration) *IngressControllerSpecApplyConfiguration {
+ b.NodePlacement = value
+ return b
+}
+
+// WithTLSSecurityProfile sets the TLSSecurityProfile field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TLSSecurityProfile field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithTLSSecurityProfile(value v1.TLSSecurityProfile) *IngressControllerSpecApplyConfiguration {
+ b.TLSSecurityProfile = &value
+ return b
+}
+
+// WithClientTLS sets the ClientTLS field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClientTLS field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithClientTLS(value *ClientTLSApplyConfiguration) *IngressControllerSpecApplyConfiguration {
+ b.ClientTLS = value
+ return b
+}
+
+// WithRouteAdmission sets the RouteAdmission field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RouteAdmission field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithRouteAdmission(value *RouteAdmissionPolicyApplyConfiguration) *IngressControllerSpecApplyConfiguration {
+ b.RouteAdmission = value
+ return b
+}
+
+// WithLogging sets the Logging field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Logging field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithLogging(value *IngressControllerLoggingApplyConfiguration) *IngressControllerSpecApplyConfiguration {
+ b.Logging = value
+ return b
+}
+
+// WithHTTPHeaders sets the HTTPHeaders field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HTTPHeaders field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithHTTPHeaders(value *IngressControllerHTTPHeadersApplyConfiguration) *IngressControllerSpecApplyConfiguration {
+ b.HTTPHeaders = value
+ return b
+}
+
+// WithHTTPEmptyRequestsPolicy sets the HTTPEmptyRequestsPolicy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HTTPEmptyRequestsPolicy field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithHTTPEmptyRequestsPolicy(value apioperatorv1.HTTPEmptyRequestsPolicy) *IngressControllerSpecApplyConfiguration {
+ b.HTTPEmptyRequestsPolicy = &value
+ return b
+}
+
+// WithTuningOptions sets the TuningOptions field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TuningOptions field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithTuningOptions(value *IngressControllerTuningOptionsApplyConfiguration) *IngressControllerSpecApplyConfiguration {
+ b.TuningOptions = value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *IngressControllerSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithHTTPCompression sets the HTTPCompression field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HTTPCompression field is set to the value of the last call.
+func (b *IngressControllerSpecApplyConfiguration) WithHTTPCompression(value *HTTPCompressionPolicyApplyConfiguration) *IngressControllerSpecApplyConfiguration {
+ b.HTTPCompression = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerstatus.go
new file mode 100644
index 0000000000..2e558388d6
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerstatus.go
@@ -0,0 +1,105 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ configv1 "github.com/openshift/api/config/v1"
+ metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// IngressControllerStatusApplyConfiguration represents a declarative configuration of the IngressControllerStatus type for use
+// with apply.
+type IngressControllerStatusApplyConfiguration struct {
+ AvailableReplicas *int32 `json:"availableReplicas,omitempty"`
+ Selector *string `json:"selector,omitempty"`
+ Domain *string `json:"domain,omitempty"`
+ EndpointPublishingStrategy *EndpointPublishingStrategyApplyConfiguration `json:"endpointPublishingStrategy,omitempty"`
+ Conditions []OperatorConditionApplyConfiguration `json:"conditions,omitempty"`
+ TLSProfile *configv1.TLSProfileSpec `json:"tlsProfile,omitempty"`
+ ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
+ NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
+ RouteSelector *metav1.LabelSelectorApplyConfiguration `json:"routeSelector,omitempty"`
+}
+
+// IngressControllerStatusApplyConfiguration constructs a declarative configuration of the IngressControllerStatus type for use with
+// apply.
+func IngressControllerStatus() *IngressControllerStatusApplyConfiguration {
+ return &IngressControllerStatusApplyConfiguration{}
+}
+
+// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the AvailableReplicas field is set to the value of the last call.
+func (b *IngressControllerStatusApplyConfiguration) WithAvailableReplicas(value int32) *IngressControllerStatusApplyConfiguration {
+ b.AvailableReplicas = &value
+ return b
+}
+
+// WithSelector sets the Selector field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Selector field is set to the value of the last call.
+func (b *IngressControllerStatusApplyConfiguration) WithSelector(value string) *IngressControllerStatusApplyConfiguration {
+ b.Selector = &value
+ return b
+}
+
+// WithDomain sets the Domain field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Domain field is set to the value of the last call.
+func (b *IngressControllerStatusApplyConfiguration) WithDomain(value string) *IngressControllerStatusApplyConfiguration {
+ b.Domain = &value
+ return b
+}
+
+// WithEndpointPublishingStrategy sets the EndpointPublishingStrategy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the EndpointPublishingStrategy field is set to the value of the last call.
+func (b *IngressControllerStatusApplyConfiguration) WithEndpointPublishingStrategy(value *EndpointPublishingStrategyApplyConfiguration) *IngressControllerStatusApplyConfiguration {
+ b.EndpointPublishingStrategy = value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *IngressControllerStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *IngressControllerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithTLSProfile sets the TLSProfile field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TLSProfile field is set to the value of the last call.
+func (b *IngressControllerStatusApplyConfiguration) WithTLSProfile(value configv1.TLSProfileSpec) *IngressControllerStatusApplyConfiguration {
+ b.TLSProfile = &value
+ return b
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *IngressControllerStatusApplyConfiguration) WithObservedGeneration(value int64) *IngressControllerStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NamespaceSelector field is set to the value of the last call.
+func (b *IngressControllerStatusApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *IngressControllerStatusApplyConfiguration {
+ b.NamespaceSelector = value
+ return b
+}
+
+// WithRouteSelector sets the RouteSelector field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RouteSelector field is set to the value of the last call.
+func (b *IngressControllerStatusApplyConfiguration) WithRouteSelector(value *metav1.LabelSelectorApplyConfiguration) *IngressControllerStatusApplyConfiguration {
+ b.RouteSelector = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollertuningoptions.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollertuningoptions.go
new file mode 100644
index 0000000000..39a4ef113c
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollertuningoptions.go
@@ -0,0 +1,135 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// IngressControllerTuningOptionsApplyConfiguration represents a declarative configuration of the IngressControllerTuningOptions type for use
+// with apply.
+type IngressControllerTuningOptionsApplyConfiguration struct {
+ HeaderBufferBytes *int32 `json:"headerBufferBytes,omitempty"`
+ HeaderBufferMaxRewriteBytes *int32 `json:"headerBufferMaxRewriteBytes,omitempty"`
+ ThreadCount *int32 `json:"threadCount,omitempty"`
+ ClientTimeout *v1.Duration `json:"clientTimeout,omitempty"`
+ ClientFinTimeout *v1.Duration `json:"clientFinTimeout,omitempty"`
+ ServerTimeout *v1.Duration `json:"serverTimeout,omitempty"`
+ ServerFinTimeout *v1.Duration `json:"serverFinTimeout,omitempty"`
+ TunnelTimeout *v1.Duration `json:"tunnelTimeout,omitempty"`
+ ConnectTimeout *v1.Duration `json:"connectTimeout,omitempty"`
+ TLSInspectDelay *v1.Duration `json:"tlsInspectDelay,omitempty"`
+ HealthCheckInterval *v1.Duration `json:"healthCheckInterval,omitempty"`
+ MaxConnections *int32 `json:"maxConnections,omitempty"`
+ ReloadInterval *v1.Duration `json:"reloadInterval,omitempty"`
+}
+
+// IngressControllerTuningOptionsApplyConfiguration constructs a declarative configuration of the IngressControllerTuningOptions type for use with
+// apply.
+func IngressControllerTuningOptions() *IngressControllerTuningOptionsApplyConfiguration {
+ return &IngressControllerTuningOptionsApplyConfiguration{}
+}
+
+// WithHeaderBufferBytes sets the HeaderBufferBytes field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HeaderBufferBytes field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithHeaderBufferBytes(value int32) *IngressControllerTuningOptionsApplyConfiguration {
+ b.HeaderBufferBytes = &value
+ return b
+}
+
+// WithHeaderBufferMaxRewriteBytes sets the HeaderBufferMaxRewriteBytes field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HeaderBufferMaxRewriteBytes field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithHeaderBufferMaxRewriteBytes(value int32) *IngressControllerTuningOptionsApplyConfiguration {
+ b.HeaderBufferMaxRewriteBytes = &value
+ return b
+}
+
+// WithThreadCount sets the ThreadCount field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ThreadCount field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithThreadCount(value int32) *IngressControllerTuningOptionsApplyConfiguration {
+ b.ThreadCount = &value
+ return b
+}
+
+// WithClientTimeout sets the ClientTimeout field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClientTimeout field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithClientTimeout(value v1.Duration) *IngressControllerTuningOptionsApplyConfiguration {
+ b.ClientTimeout = &value
+ return b
+}
+
+// WithClientFinTimeout sets the ClientFinTimeout field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClientFinTimeout field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithClientFinTimeout(value v1.Duration) *IngressControllerTuningOptionsApplyConfiguration {
+ b.ClientFinTimeout = &value
+ return b
+}
+
+// WithServerTimeout sets the ServerTimeout field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ServerTimeout field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithServerTimeout(value v1.Duration) *IngressControllerTuningOptionsApplyConfiguration {
+ b.ServerTimeout = &value
+ return b
+}
+
+// WithServerFinTimeout sets the ServerFinTimeout field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ServerFinTimeout field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithServerFinTimeout(value v1.Duration) *IngressControllerTuningOptionsApplyConfiguration {
+ b.ServerFinTimeout = &value
+ return b
+}
+
+// WithTunnelTimeout sets the TunnelTimeout field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TunnelTimeout field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithTunnelTimeout(value v1.Duration) *IngressControllerTuningOptionsApplyConfiguration {
+ b.TunnelTimeout = &value
+ return b
+}
+
+// WithConnectTimeout sets the ConnectTimeout field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ConnectTimeout field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithConnectTimeout(value v1.Duration) *IngressControllerTuningOptionsApplyConfiguration {
+ b.ConnectTimeout = &value
+ return b
+}
+
+// WithTLSInspectDelay sets the TLSInspectDelay field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TLSInspectDelay field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithTLSInspectDelay(value v1.Duration) *IngressControllerTuningOptionsApplyConfiguration {
+ b.TLSInspectDelay = &value
+ return b
+}
+
+// WithHealthCheckInterval sets the HealthCheckInterval field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HealthCheckInterval field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithHealthCheckInterval(value v1.Duration) *IngressControllerTuningOptionsApplyConfiguration {
+ b.HealthCheckInterval = &value
+ return b
+}
+
+// WithMaxConnections sets the MaxConnections field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MaxConnections field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithMaxConnections(value int32) *IngressControllerTuningOptionsApplyConfiguration {
+ b.MaxConnections = &value
+ return b
+}
+
+// WithReloadInterval sets the ReloadInterval field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReloadInterval field is set to the value of the last call.
+func (b *IngressControllerTuningOptionsApplyConfiguration) WithReloadInterval(value v1.Duration) *IngressControllerTuningOptionsApplyConfiguration {
+ b.ReloadInterval = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperator.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperator.go
new file mode 100644
index 0000000000..1b3d80040d
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperator.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// InsightsOperatorApplyConfiguration represents a declarative configuration of the InsightsOperator type for use
+// with apply.
+type InsightsOperatorApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *InsightsOperatorSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *InsightsOperatorStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// InsightsOperator constructs a declarative configuration of the InsightsOperator type for use with
+// apply.
+func InsightsOperator(name string) *InsightsOperatorApplyConfiguration {
+ b := &InsightsOperatorApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("InsightsOperator")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractInsightsOperator extracts the applied configuration owned by fieldManager from
+// insightsOperator. If no managedFields are found in insightsOperator for fieldManager, a
+// InsightsOperatorApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// insightsOperator must be a unmodified InsightsOperator API object that was retrieved from the Kubernetes API.
+// ExtractInsightsOperator provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractInsightsOperator(insightsOperator *apioperatorv1.InsightsOperator, fieldManager string) (*InsightsOperatorApplyConfiguration, error) {
+ return extractInsightsOperator(insightsOperator, fieldManager, "")
+}
+
+// ExtractInsightsOperatorStatus is the same as ExtractInsightsOperator except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractInsightsOperatorStatus(insightsOperator *apioperatorv1.InsightsOperator, fieldManager string) (*InsightsOperatorApplyConfiguration, error) {
+ return extractInsightsOperator(insightsOperator, fieldManager, "status")
+}
+
+func extractInsightsOperator(insightsOperator *apioperatorv1.InsightsOperator, fieldManager string, subresource string) (*InsightsOperatorApplyConfiguration, error) {
+ b := &InsightsOperatorApplyConfiguration{}
+ err := managedfields.ExtractInto(insightsOperator, internal.Parser().Type("com.github.openshift.api.operator.v1.InsightsOperator"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(insightsOperator.Name)
+
+ b.WithKind("InsightsOperator")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithKind(value string) *InsightsOperatorApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithAPIVersion(value string) *InsightsOperatorApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithName(value string) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithGenerateName(value string) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithNamespace(value string) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithUID(value types.UID) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithResourceVersion(value string) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithGeneration(value int64) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithCreationTimestamp(value metav1.Time) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *InsightsOperatorApplyConfiguration) WithLabels(entries map[string]string) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *InsightsOperatorApplyConfiguration) WithAnnotations(entries map[string]string) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *InsightsOperatorApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *InsightsOperatorApplyConfiguration) WithFinalizers(values ...string) *InsightsOperatorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *InsightsOperatorApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithSpec(value *InsightsOperatorSpecApplyConfiguration) *InsightsOperatorApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *InsightsOperatorApplyConfiguration) WithStatus(value *InsightsOperatorStatusApplyConfiguration) *InsightsOperatorApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *InsightsOperatorApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperatorspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperatorspec.go
new file mode 100644
index 0000000000..4f9b356a9d
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperatorspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// InsightsOperatorSpecApplyConfiguration represents a declarative configuration of the InsightsOperatorSpec type for use
+// with apply.
+type InsightsOperatorSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// InsightsOperatorSpecApplyConfiguration constructs a declarative configuration of the InsightsOperatorSpec type for use with
+// apply.
+func InsightsOperatorSpec() *InsightsOperatorSpecApplyConfiguration {
+ return &InsightsOperatorSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *InsightsOperatorSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *InsightsOperatorSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *InsightsOperatorSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *InsightsOperatorSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *InsightsOperatorSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *InsightsOperatorSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *InsightsOperatorSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *InsightsOperatorSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *InsightsOperatorSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *InsightsOperatorSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperatorstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperatorstatus.go
new file mode 100644
index 0000000000..2cb67f8daf
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperatorstatus.go
@@ -0,0 +1,91 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// InsightsOperatorStatusApplyConfiguration represents a declarative configuration of the InsightsOperatorStatus type for use
+// with apply.
+type InsightsOperatorStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+ GatherStatus *GatherStatusApplyConfiguration `json:"gatherStatus,omitempty"`
+ InsightsReport *InsightsReportApplyConfiguration `json:"insightsReport,omitempty"`
+}
+
+// InsightsOperatorStatusApplyConfiguration constructs a declarative configuration of the InsightsOperatorStatus type for use with
+// apply.
+func InsightsOperatorStatus() *InsightsOperatorStatusApplyConfiguration {
+ return &InsightsOperatorStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *InsightsOperatorStatusApplyConfiguration) WithObservedGeneration(value int64) *InsightsOperatorStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *InsightsOperatorStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *InsightsOperatorStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *InsightsOperatorStatusApplyConfiguration) WithVersion(value string) *InsightsOperatorStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *InsightsOperatorStatusApplyConfiguration) WithReadyReplicas(value int32) *InsightsOperatorStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *InsightsOperatorStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *InsightsOperatorStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *InsightsOperatorStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *InsightsOperatorStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
+
+// WithGatherStatus sets the GatherStatus field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GatherStatus field is set to the value of the last call.
+func (b *InsightsOperatorStatusApplyConfiguration) WithGatherStatus(value *GatherStatusApplyConfiguration) *InsightsOperatorStatusApplyConfiguration {
+ b.GatherStatus = value
+ return b
+}
+
+// WithInsightsReport sets the InsightsReport field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the InsightsReport field is set to the value of the last call.
+func (b *InsightsOperatorStatusApplyConfiguration) WithInsightsReport(value *InsightsReportApplyConfiguration) *InsightsOperatorStatusApplyConfiguration {
+ b.InsightsReport = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsreport.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsreport.go
new file mode 100644
index 0000000000..63de379da6
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsreport.go
@@ -0,0 +1,41 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// InsightsReportApplyConfiguration represents a declarative configuration of the InsightsReport type for use
+// with apply.
+type InsightsReportApplyConfiguration struct {
+ DownloadedAt *v1.Time `json:"downloadedAt,omitempty"`
+ HealthChecks []HealthCheckApplyConfiguration `json:"healthChecks,omitempty"`
+}
+
+// InsightsReportApplyConfiguration constructs a declarative configuration of the InsightsReport type for use with
+// apply.
+func InsightsReport() *InsightsReportApplyConfiguration {
+ return &InsightsReportApplyConfiguration{}
+}
+
+// WithDownloadedAt sets the DownloadedAt field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DownloadedAt field is set to the value of the last call.
+func (b *InsightsReportApplyConfiguration) WithDownloadedAt(value v1.Time) *InsightsReportApplyConfiguration {
+ b.DownloadedAt = &value
+ return b
+}
+
+// WithHealthChecks adds the given value to the HealthChecks field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the HealthChecks field.
+func (b *InsightsReportApplyConfiguration) WithHealthChecks(values ...*HealthCheckApplyConfiguration) *InsightsReportApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithHealthChecks")
+ }
+ b.HealthChecks = append(b.HealthChecks, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipamconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipamconfig.go
new file mode 100644
index 0000000000..ad8f7bfc96
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipamconfig.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// IPAMConfigApplyConfiguration represents a declarative configuration of the IPAMConfig type for use
+// with apply.
+type IPAMConfigApplyConfiguration struct {
+ Type *v1.IPAMType `json:"type,omitempty"`
+ StaticIPAMConfig *StaticIPAMConfigApplyConfiguration `json:"staticIPAMConfig,omitempty"`
+}
+
+// IPAMConfigApplyConfiguration constructs a declarative configuration of the IPAMConfig type for use with
+// apply.
+func IPAMConfig() *IPAMConfigApplyConfiguration {
+ return &IPAMConfigApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *IPAMConfigApplyConfiguration) WithType(value v1.IPAMType) *IPAMConfigApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithStaticIPAMConfig sets the StaticIPAMConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the StaticIPAMConfig field is set to the value of the last call.
+func (b *IPAMConfigApplyConfiguration) WithStaticIPAMConfig(value *StaticIPAMConfigApplyConfiguration) *IPAMConfigApplyConfiguration {
+ b.StaticIPAMConfig = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipfixconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipfixconfig.go
new file mode 100644
index 0000000000..52334e2ac4
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipfixconfig.go
@@ -0,0 +1,29 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// IPFIXConfigApplyConfiguration represents a declarative configuration of the IPFIXConfig type for use
+// with apply.
+type IPFIXConfigApplyConfiguration struct {
+ Collectors []v1.IPPort `json:"collectors,omitempty"`
+}
+
+// IPFIXConfigApplyConfiguration constructs a declarative configuration of the IPFIXConfig type for use with
+// apply.
+func IPFIXConfig() *IPFIXConfigApplyConfiguration {
+ return &IPFIXConfigApplyConfiguration{}
+}
+
+// WithCollectors adds the given value to the Collectors field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Collectors field.
+func (b *IPFIXConfigApplyConfiguration) WithCollectors(values ...v1.IPPort) *IPFIXConfigApplyConfiguration {
+ for i := range values {
+ b.Collectors = append(b.Collectors, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipsecconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipsecconfig.go
new file mode 100644
index 0000000000..ebe738b9f9
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipsecconfig.go
@@ -0,0 +1,27 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// IPsecConfigApplyConfiguration represents a declarative configuration of the IPsecConfig type for use
+// with apply.
+type IPsecConfigApplyConfiguration struct {
+ Mode *v1.IPsecMode `json:"mode,omitempty"`
+}
+
+// IPsecConfigApplyConfiguration constructs a declarative configuration of the IPsecConfig type for use with
+// apply.
+func IPsecConfig() *IPsecConfigApplyConfiguration {
+ return &IPsecConfigApplyConfiguration{}
+}
+
+// WithMode sets the Mode field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Mode field is set to the value of the last call.
+func (b *IPsecConfigApplyConfiguration) WithMode(value v1.IPsecMode) *IPsecConfigApplyConfiguration {
+ b.Mode = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv4gatewayconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv4gatewayconfig.go
new file mode 100644
index 0000000000..951ea7aedc
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv4gatewayconfig.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IPv4GatewayConfigApplyConfiguration represents a declarative configuration of the IPv4GatewayConfig type for use
+// with apply.
+type IPv4GatewayConfigApplyConfiguration struct {
+ InternalMasqueradeSubnet *string `json:"internalMasqueradeSubnet,omitempty"`
+}
+
+// IPv4GatewayConfigApplyConfiguration constructs a declarative configuration of the IPv4GatewayConfig type for use with
+// apply.
+func IPv4GatewayConfig() *IPv4GatewayConfigApplyConfiguration {
+ return &IPv4GatewayConfigApplyConfiguration{}
+}
+
+// WithInternalMasqueradeSubnet sets the InternalMasqueradeSubnet field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the InternalMasqueradeSubnet field is set to the value of the last call.
+func (b *IPv4GatewayConfigApplyConfiguration) WithInternalMasqueradeSubnet(value string) *IPv4GatewayConfigApplyConfiguration {
+ b.InternalMasqueradeSubnet = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv4ovnkubernetesconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv4ovnkubernetesconfig.go
new file mode 100644
index 0000000000..74cdef5248
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv4ovnkubernetesconfig.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IPv4OVNKubernetesConfigApplyConfiguration represents a declarative configuration of the IPv4OVNKubernetesConfig type for use
+// with apply.
+type IPv4OVNKubernetesConfigApplyConfiguration struct {
+ InternalTransitSwitchSubnet *string `json:"internalTransitSwitchSubnet,omitempty"`
+ InternalJoinSubnet *string `json:"internalJoinSubnet,omitempty"`
+}
+
+// IPv4OVNKubernetesConfigApplyConfiguration constructs a declarative configuration of the IPv4OVNKubernetesConfig type for use with
+// apply.
+func IPv4OVNKubernetesConfig() *IPv4OVNKubernetesConfigApplyConfiguration {
+ return &IPv4OVNKubernetesConfigApplyConfiguration{}
+}
+
+// WithInternalTransitSwitchSubnet sets the InternalTransitSwitchSubnet field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the InternalTransitSwitchSubnet field is set to the value of the last call.
+func (b *IPv4OVNKubernetesConfigApplyConfiguration) WithInternalTransitSwitchSubnet(value string) *IPv4OVNKubernetesConfigApplyConfiguration {
+ b.InternalTransitSwitchSubnet = &value
+ return b
+}
+
+// WithInternalJoinSubnet sets the InternalJoinSubnet field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the InternalJoinSubnet field is set to the value of the last call.
+func (b *IPv4OVNKubernetesConfigApplyConfiguration) WithInternalJoinSubnet(value string) *IPv4OVNKubernetesConfigApplyConfiguration {
+ b.InternalJoinSubnet = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv6gatewayconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv6gatewayconfig.go
new file mode 100644
index 0000000000..66436ec789
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv6gatewayconfig.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IPv6GatewayConfigApplyConfiguration represents a declarative configuration of the IPv6GatewayConfig type for use
+// with apply.
+type IPv6GatewayConfigApplyConfiguration struct {
+ InternalMasqueradeSubnet *string `json:"internalMasqueradeSubnet,omitempty"`
+}
+
+// IPv6GatewayConfigApplyConfiguration constructs a declarative configuration of the IPv6GatewayConfig type for use with
+// apply.
+func IPv6GatewayConfig() *IPv6GatewayConfigApplyConfiguration {
+ return &IPv6GatewayConfigApplyConfiguration{}
+}
+
+// WithInternalMasqueradeSubnet sets the InternalMasqueradeSubnet field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the InternalMasqueradeSubnet field is set to the value of the last call.
+func (b *IPv6GatewayConfigApplyConfiguration) WithInternalMasqueradeSubnet(value string) *IPv6GatewayConfigApplyConfiguration {
+ b.InternalMasqueradeSubnet = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv6ovnkubernetesconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv6ovnkubernetesconfig.go
new file mode 100644
index 0000000000..64deec5c10
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv6ovnkubernetesconfig.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// IPv6OVNKubernetesConfigApplyConfiguration represents a declarative configuration of the IPv6OVNKubernetesConfig type for use
+// with apply.
+type IPv6OVNKubernetesConfigApplyConfiguration struct {
+ InternalTransitSwitchSubnet *string `json:"internalTransitSwitchSubnet,omitempty"`
+ InternalJoinSubnet *string `json:"internalJoinSubnet,omitempty"`
+}
+
+// IPv6OVNKubernetesConfigApplyConfiguration constructs a declarative configuration of the IPv6OVNKubernetesConfig type for use with
+// apply.
+func IPv6OVNKubernetesConfig() *IPv6OVNKubernetesConfigApplyConfiguration {
+ return &IPv6OVNKubernetesConfigApplyConfiguration{}
+}
+
+// WithInternalTransitSwitchSubnet sets the InternalTransitSwitchSubnet field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the InternalTransitSwitchSubnet field is set to the value of the last call.
+func (b *IPv6OVNKubernetesConfigApplyConfiguration) WithInternalTransitSwitchSubnet(value string) *IPv6OVNKubernetesConfigApplyConfiguration {
+ b.InternalTransitSwitchSubnet = &value
+ return b
+}
+
+// WithInternalJoinSubnet sets the InternalJoinSubnet field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the InternalJoinSubnet field is set to the value of the last call.
+func (b *IPv6OVNKubernetesConfigApplyConfiguration) WithInternalJoinSubnet(value string) *IPv6OVNKubernetesConfigApplyConfiguration {
+ b.InternalJoinSubnet = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserver.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserver.go
new file mode 100644
index 0000000000..d4ee463df5
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserver.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// KubeAPIServerApplyConfiguration represents a declarative configuration of the KubeAPIServer type for use
+// with apply.
+type KubeAPIServerApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *KubeAPIServerSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *KubeAPIServerStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// KubeAPIServer constructs a declarative configuration of the KubeAPIServer type for use with
+// apply.
+func KubeAPIServer(name string) *KubeAPIServerApplyConfiguration {
+ b := &KubeAPIServerApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("KubeAPIServer")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractKubeAPIServer extracts the applied configuration owned by fieldManager from
+// kubeAPIServer. If no managedFields are found in kubeAPIServer for fieldManager, a
+// KubeAPIServerApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// kubeAPIServer must be a unmodified KubeAPIServer API object that was retrieved from the Kubernetes API.
+// ExtractKubeAPIServer provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractKubeAPIServer(kubeAPIServer *apioperatorv1.KubeAPIServer, fieldManager string) (*KubeAPIServerApplyConfiguration, error) {
+ return extractKubeAPIServer(kubeAPIServer, fieldManager, "")
+}
+
+// ExtractKubeAPIServerStatus is the same as ExtractKubeAPIServer except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractKubeAPIServerStatus(kubeAPIServer *apioperatorv1.KubeAPIServer, fieldManager string) (*KubeAPIServerApplyConfiguration, error) {
+ return extractKubeAPIServer(kubeAPIServer, fieldManager, "status")
+}
+
+func extractKubeAPIServer(kubeAPIServer *apioperatorv1.KubeAPIServer, fieldManager string, subresource string) (*KubeAPIServerApplyConfiguration, error) {
+ b := &KubeAPIServerApplyConfiguration{}
+ err := managedfields.ExtractInto(kubeAPIServer, internal.Parser().Type("com.github.openshift.api.operator.v1.KubeAPIServer"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(kubeAPIServer.Name)
+
+ b.WithKind("KubeAPIServer")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithKind(value string) *KubeAPIServerApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithAPIVersion(value string) *KubeAPIServerApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithName(value string) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithGenerateName(value string) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithNamespace(value string) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithUID(value types.UID) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithResourceVersion(value string) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithGeneration(value int64) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *KubeAPIServerApplyConfiguration) WithLabels(entries map[string]string) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *KubeAPIServerApplyConfiguration) WithAnnotations(entries map[string]string) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *KubeAPIServerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *KubeAPIServerApplyConfiguration) WithFinalizers(values ...string) *KubeAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *KubeAPIServerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithSpec(value *KubeAPIServerSpecApplyConfiguration) *KubeAPIServerApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *KubeAPIServerApplyConfiguration) WithStatus(value *KubeAPIServerStatusApplyConfiguration) *KubeAPIServerApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *KubeAPIServerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserverspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserverspec.go
new file mode 100644
index 0000000000..dba25a5cd4
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserverspec.go
@@ -0,0 +1,84 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// KubeAPIServerSpecApplyConfiguration represents a declarative configuration of the KubeAPIServerSpec type for use
+// with apply.
+type KubeAPIServerSpecApplyConfiguration struct {
+ StaticPodOperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// KubeAPIServerSpecApplyConfiguration constructs a declarative configuration of the KubeAPIServerSpec type for use with
+// apply.
+func KubeAPIServerSpec() *KubeAPIServerSpecApplyConfiguration {
+ return &KubeAPIServerSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *KubeAPIServerSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *KubeAPIServerSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *KubeAPIServerSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *KubeAPIServerSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *KubeAPIServerSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *KubeAPIServerSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *KubeAPIServerSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *KubeAPIServerSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *KubeAPIServerSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *KubeAPIServerSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithForceRedeploymentReason sets the ForceRedeploymentReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ForceRedeploymentReason field is set to the value of the last call.
+func (b *KubeAPIServerSpecApplyConfiguration) WithForceRedeploymentReason(value string) *KubeAPIServerSpecApplyConfiguration {
+ b.ForceRedeploymentReason = &value
+ return b
+}
+
+// WithFailedRevisionLimit sets the FailedRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the FailedRevisionLimit field is set to the value of the last call.
+func (b *KubeAPIServerSpecApplyConfiguration) WithFailedRevisionLimit(value int32) *KubeAPIServerSpecApplyConfiguration {
+ b.FailedRevisionLimit = &value
+ return b
+}
+
+// WithSucceededRevisionLimit sets the SucceededRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SucceededRevisionLimit field is set to the value of the last call.
+func (b *KubeAPIServerSpecApplyConfiguration) WithSucceededRevisionLimit(value int32) *KubeAPIServerSpecApplyConfiguration {
+ b.SucceededRevisionLimit = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserverstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserverstatus.go
new file mode 100644
index 0000000000..033be6dbae
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserverstatus.go
@@ -0,0 +1,108 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// KubeAPIServerStatusApplyConfiguration represents a declarative configuration of the KubeAPIServerStatus type for use
+// with apply.
+type KubeAPIServerStatusApplyConfiguration struct {
+ StaticPodOperatorStatusApplyConfiguration `json:",inline"`
+ ServiceAccountIssuers []ServiceAccountIssuerStatusApplyConfiguration `json:"serviceAccountIssuers,omitempty"`
+}
+
+// KubeAPIServerStatusApplyConfiguration constructs a declarative configuration of the KubeAPIServerStatus type for use with
+// apply.
+func KubeAPIServerStatus() *KubeAPIServerStatusApplyConfiguration {
+ return &KubeAPIServerStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *KubeAPIServerStatusApplyConfiguration) WithObservedGeneration(value int64) *KubeAPIServerStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *KubeAPIServerStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *KubeAPIServerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *KubeAPIServerStatusApplyConfiguration) WithVersion(value string) *KubeAPIServerStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *KubeAPIServerStatusApplyConfiguration) WithReadyReplicas(value int32) *KubeAPIServerStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *KubeAPIServerStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *KubeAPIServerStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *KubeAPIServerStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *KubeAPIServerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
+
+// WithLatestAvailableRevisionReason sets the LatestAvailableRevisionReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevisionReason field is set to the value of the last call.
+func (b *KubeAPIServerStatusApplyConfiguration) WithLatestAvailableRevisionReason(value string) *KubeAPIServerStatusApplyConfiguration {
+ b.LatestAvailableRevisionReason = &value
+ return b
+}
+
+// WithNodeStatuses adds the given value to the NodeStatuses field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the NodeStatuses field.
+func (b *KubeAPIServerStatusApplyConfiguration) WithNodeStatuses(values ...*NodeStatusApplyConfiguration) *KubeAPIServerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithNodeStatuses")
+ }
+ b.NodeStatuses = append(b.NodeStatuses, *values[i])
+ }
+ return b
+}
+
+// WithServiceAccountIssuers adds the given value to the ServiceAccountIssuers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the ServiceAccountIssuers field.
+func (b *KubeAPIServerStatusApplyConfiguration) WithServiceAccountIssuers(values ...*ServiceAccountIssuerStatusApplyConfiguration) *KubeAPIServerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithServiceAccountIssuers")
+ }
+ b.ServiceAccountIssuers = append(b.ServiceAccountIssuers, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanager.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanager.go
new file mode 100644
index 0000000000..d67f73dff9
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanager.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// KubeControllerManagerApplyConfiguration represents a declarative configuration of the KubeControllerManager type for use
+// with apply.
+type KubeControllerManagerApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *KubeControllerManagerSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *KubeControllerManagerStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// KubeControllerManager constructs a declarative configuration of the KubeControllerManager type for use with
+// apply.
+func KubeControllerManager(name string) *KubeControllerManagerApplyConfiguration {
+ b := &KubeControllerManagerApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("KubeControllerManager")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractKubeControllerManager extracts the applied configuration owned by fieldManager from
+// kubeControllerManager. If no managedFields are found in kubeControllerManager for fieldManager, a
+// KubeControllerManagerApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// kubeControllerManager must be a unmodified KubeControllerManager API object that was retrieved from the Kubernetes API.
+// ExtractKubeControllerManager provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractKubeControllerManager(kubeControllerManager *apioperatorv1.KubeControllerManager, fieldManager string) (*KubeControllerManagerApplyConfiguration, error) {
+ return extractKubeControllerManager(kubeControllerManager, fieldManager, "")
+}
+
+// ExtractKubeControllerManagerStatus is the same as ExtractKubeControllerManager except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractKubeControllerManagerStatus(kubeControllerManager *apioperatorv1.KubeControllerManager, fieldManager string) (*KubeControllerManagerApplyConfiguration, error) {
+ return extractKubeControllerManager(kubeControllerManager, fieldManager, "status")
+}
+
+func extractKubeControllerManager(kubeControllerManager *apioperatorv1.KubeControllerManager, fieldManager string, subresource string) (*KubeControllerManagerApplyConfiguration, error) {
+ b := &KubeControllerManagerApplyConfiguration{}
+ err := managedfields.ExtractInto(kubeControllerManager, internal.Parser().Type("com.github.openshift.api.operator.v1.KubeControllerManager"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(kubeControllerManager.Name)
+
+ b.WithKind("KubeControllerManager")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithKind(value string) *KubeControllerManagerApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithAPIVersion(value string) *KubeControllerManagerApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithName(value string) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithGenerateName(value string) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithNamespace(value string) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithUID(value types.UID) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithResourceVersion(value string) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithGeneration(value int64) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *KubeControllerManagerApplyConfiguration) WithLabels(entries map[string]string) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *KubeControllerManagerApplyConfiguration) WithAnnotations(entries map[string]string) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *KubeControllerManagerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *KubeControllerManagerApplyConfiguration) WithFinalizers(values ...string) *KubeControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *KubeControllerManagerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithSpec(value *KubeControllerManagerSpecApplyConfiguration) *KubeControllerManagerApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *KubeControllerManagerApplyConfiguration) WithStatus(value *KubeControllerManagerStatusApplyConfiguration) *KubeControllerManagerApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *KubeControllerManagerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanagerspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanagerspec.go
new file mode 100644
index 0000000000..2e2923af0e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanagerspec.go
@@ -0,0 +1,93 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// KubeControllerManagerSpecApplyConfiguration represents a declarative configuration of the KubeControllerManagerSpec type for use
+// with apply.
+type KubeControllerManagerSpecApplyConfiguration struct {
+ StaticPodOperatorSpecApplyConfiguration `json:",inline"`
+ UseMoreSecureServiceCA *bool `json:"useMoreSecureServiceCA,omitempty"`
+}
+
+// KubeControllerManagerSpecApplyConfiguration constructs a declarative configuration of the KubeControllerManagerSpec type for use with
+// apply.
+func KubeControllerManagerSpec() *KubeControllerManagerSpecApplyConfiguration {
+ return &KubeControllerManagerSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *KubeControllerManagerSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *KubeControllerManagerSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *KubeControllerManagerSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *KubeControllerManagerSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *KubeControllerManagerSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *KubeControllerManagerSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *KubeControllerManagerSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *KubeControllerManagerSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *KubeControllerManagerSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *KubeControllerManagerSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithForceRedeploymentReason sets the ForceRedeploymentReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ForceRedeploymentReason field is set to the value of the last call.
+func (b *KubeControllerManagerSpecApplyConfiguration) WithForceRedeploymentReason(value string) *KubeControllerManagerSpecApplyConfiguration {
+ b.ForceRedeploymentReason = &value
+ return b
+}
+
+// WithFailedRevisionLimit sets the FailedRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the FailedRevisionLimit field is set to the value of the last call.
+func (b *KubeControllerManagerSpecApplyConfiguration) WithFailedRevisionLimit(value int32) *KubeControllerManagerSpecApplyConfiguration {
+ b.FailedRevisionLimit = &value
+ return b
+}
+
+// WithSucceededRevisionLimit sets the SucceededRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SucceededRevisionLimit field is set to the value of the last call.
+func (b *KubeControllerManagerSpecApplyConfiguration) WithSucceededRevisionLimit(value int32) *KubeControllerManagerSpecApplyConfiguration {
+ b.SucceededRevisionLimit = &value
+ return b
+}
+
+// WithUseMoreSecureServiceCA sets the UseMoreSecureServiceCA field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UseMoreSecureServiceCA field is set to the value of the last call.
+func (b *KubeControllerManagerSpecApplyConfiguration) WithUseMoreSecureServiceCA(value bool) *KubeControllerManagerSpecApplyConfiguration {
+ b.UseMoreSecureServiceCA = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanagerstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanagerstatus.go
new file mode 100644
index 0000000000..5c11f66226
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanagerstatus.go
@@ -0,0 +1,94 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// KubeControllerManagerStatusApplyConfiguration represents a declarative configuration of the KubeControllerManagerStatus type for use
+// with apply.
+type KubeControllerManagerStatusApplyConfiguration struct {
+ StaticPodOperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// KubeControllerManagerStatusApplyConfiguration constructs a declarative configuration of the KubeControllerManagerStatus type for use with
+// apply.
+func KubeControllerManagerStatus() *KubeControllerManagerStatusApplyConfiguration {
+ return &KubeControllerManagerStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *KubeControllerManagerStatusApplyConfiguration) WithObservedGeneration(value int64) *KubeControllerManagerStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *KubeControllerManagerStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *KubeControllerManagerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *KubeControllerManagerStatusApplyConfiguration) WithVersion(value string) *KubeControllerManagerStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *KubeControllerManagerStatusApplyConfiguration) WithReadyReplicas(value int32) *KubeControllerManagerStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *KubeControllerManagerStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *KubeControllerManagerStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *KubeControllerManagerStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *KubeControllerManagerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
+
+// WithLatestAvailableRevisionReason sets the LatestAvailableRevisionReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevisionReason field is set to the value of the last call.
+func (b *KubeControllerManagerStatusApplyConfiguration) WithLatestAvailableRevisionReason(value string) *KubeControllerManagerStatusApplyConfiguration {
+ b.LatestAvailableRevisionReason = &value
+ return b
+}
+
+// WithNodeStatuses adds the given value to the NodeStatuses field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the NodeStatuses field.
+func (b *KubeControllerManagerStatusApplyConfiguration) WithNodeStatuses(values ...*NodeStatusApplyConfiguration) *KubeControllerManagerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithNodeStatuses")
+ }
+ b.NodeStatuses = append(b.NodeStatuses, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubescheduler.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubescheduler.go
new file mode 100644
index 0000000000..27f969980a
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubescheduler.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// KubeSchedulerApplyConfiguration represents a declarative configuration of the KubeScheduler type for use
+// with apply.
+type KubeSchedulerApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *KubeSchedulerSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *KubeSchedulerStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// KubeScheduler constructs a declarative configuration of the KubeScheduler type for use with
+// apply.
+func KubeScheduler(name string) *KubeSchedulerApplyConfiguration {
+ b := &KubeSchedulerApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("KubeScheduler")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractKubeScheduler extracts the applied configuration owned by fieldManager from
+// kubeScheduler. If no managedFields are found in kubeScheduler for fieldManager, a
+// KubeSchedulerApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// kubeScheduler must be a unmodified KubeScheduler API object that was retrieved from the Kubernetes API.
+// ExtractKubeScheduler provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractKubeScheduler(kubeScheduler *apioperatorv1.KubeScheduler, fieldManager string) (*KubeSchedulerApplyConfiguration, error) {
+ return extractKubeScheduler(kubeScheduler, fieldManager, "")
+}
+
+// ExtractKubeSchedulerStatus is the same as ExtractKubeScheduler except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractKubeSchedulerStatus(kubeScheduler *apioperatorv1.KubeScheduler, fieldManager string) (*KubeSchedulerApplyConfiguration, error) {
+ return extractKubeScheduler(kubeScheduler, fieldManager, "status")
+}
+
+func extractKubeScheduler(kubeScheduler *apioperatorv1.KubeScheduler, fieldManager string, subresource string) (*KubeSchedulerApplyConfiguration, error) {
+ b := &KubeSchedulerApplyConfiguration{}
+ err := managedfields.ExtractInto(kubeScheduler, internal.Parser().Type("com.github.openshift.api.operator.v1.KubeScheduler"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(kubeScheduler.Name)
+
+ b.WithKind("KubeScheduler")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithKind(value string) *KubeSchedulerApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithAPIVersion(value string) *KubeSchedulerApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithName(value string) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithGenerateName(value string) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithNamespace(value string) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithUID(value types.UID) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithResourceVersion(value string) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithGeneration(value int64) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *KubeSchedulerApplyConfiguration) WithLabels(entries map[string]string) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *KubeSchedulerApplyConfiguration) WithAnnotations(entries map[string]string) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *KubeSchedulerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *KubeSchedulerApplyConfiguration) WithFinalizers(values ...string) *KubeSchedulerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *KubeSchedulerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithSpec(value *KubeSchedulerSpecApplyConfiguration) *KubeSchedulerApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *KubeSchedulerApplyConfiguration) WithStatus(value *KubeSchedulerStatusApplyConfiguration) *KubeSchedulerApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *KubeSchedulerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeschedulerspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeschedulerspec.go
new file mode 100644
index 0000000000..44d8eeab22
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeschedulerspec.go
@@ -0,0 +1,84 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// KubeSchedulerSpecApplyConfiguration represents a declarative configuration of the KubeSchedulerSpec type for use
+// with apply.
+type KubeSchedulerSpecApplyConfiguration struct {
+ StaticPodOperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// KubeSchedulerSpecApplyConfiguration constructs a declarative configuration of the KubeSchedulerSpec type for use with
+// apply.
+func KubeSchedulerSpec() *KubeSchedulerSpecApplyConfiguration {
+ return &KubeSchedulerSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *KubeSchedulerSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *KubeSchedulerSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *KubeSchedulerSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *KubeSchedulerSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *KubeSchedulerSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *KubeSchedulerSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *KubeSchedulerSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *KubeSchedulerSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *KubeSchedulerSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *KubeSchedulerSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithForceRedeploymentReason sets the ForceRedeploymentReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ForceRedeploymentReason field is set to the value of the last call.
+func (b *KubeSchedulerSpecApplyConfiguration) WithForceRedeploymentReason(value string) *KubeSchedulerSpecApplyConfiguration {
+ b.ForceRedeploymentReason = &value
+ return b
+}
+
+// WithFailedRevisionLimit sets the FailedRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the FailedRevisionLimit field is set to the value of the last call.
+func (b *KubeSchedulerSpecApplyConfiguration) WithFailedRevisionLimit(value int32) *KubeSchedulerSpecApplyConfiguration {
+ b.FailedRevisionLimit = &value
+ return b
+}
+
+// WithSucceededRevisionLimit sets the SucceededRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SucceededRevisionLimit field is set to the value of the last call.
+func (b *KubeSchedulerSpecApplyConfiguration) WithSucceededRevisionLimit(value int32) *KubeSchedulerSpecApplyConfiguration {
+ b.SucceededRevisionLimit = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeschedulerstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeschedulerstatus.go
new file mode 100644
index 0000000000..e6784996f4
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeschedulerstatus.go
@@ -0,0 +1,94 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// KubeSchedulerStatusApplyConfiguration represents a declarative configuration of the KubeSchedulerStatus type for use
+// with apply.
+type KubeSchedulerStatusApplyConfiguration struct {
+ StaticPodOperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// KubeSchedulerStatusApplyConfiguration constructs a declarative configuration of the KubeSchedulerStatus type for use with
+// apply.
+func KubeSchedulerStatus() *KubeSchedulerStatusApplyConfiguration {
+ return &KubeSchedulerStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *KubeSchedulerStatusApplyConfiguration) WithObservedGeneration(value int64) *KubeSchedulerStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *KubeSchedulerStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *KubeSchedulerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *KubeSchedulerStatusApplyConfiguration) WithVersion(value string) *KubeSchedulerStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *KubeSchedulerStatusApplyConfiguration) WithReadyReplicas(value int32) *KubeSchedulerStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *KubeSchedulerStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *KubeSchedulerStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *KubeSchedulerStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *KubeSchedulerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
+
+// WithLatestAvailableRevisionReason sets the LatestAvailableRevisionReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevisionReason field is set to the value of the last call.
+func (b *KubeSchedulerStatusApplyConfiguration) WithLatestAvailableRevisionReason(value string) *KubeSchedulerStatusApplyConfiguration {
+ b.LatestAvailableRevisionReason = &value
+ return b
+}
+
+// WithNodeStatuses adds the given value to the NodeStatuses field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the NodeStatuses field.
+func (b *KubeSchedulerStatusApplyConfiguration) WithNodeStatuses(values ...*NodeStatusApplyConfiguration) *KubeSchedulerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithNodeStatuses")
+ }
+ b.NodeStatuses = append(b.NodeStatuses, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigrator.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigrator.go
new file mode 100644
index 0000000000..d0f693f9d0
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigrator.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// KubeStorageVersionMigratorApplyConfiguration represents a declarative configuration of the KubeStorageVersionMigrator type for use
+// with apply.
+type KubeStorageVersionMigratorApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *KubeStorageVersionMigratorSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *KubeStorageVersionMigratorStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// KubeStorageVersionMigrator constructs a declarative configuration of the KubeStorageVersionMigrator type for use with
+// apply.
+func KubeStorageVersionMigrator(name string) *KubeStorageVersionMigratorApplyConfiguration {
+ b := &KubeStorageVersionMigratorApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("KubeStorageVersionMigrator")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractKubeStorageVersionMigrator extracts the applied configuration owned by fieldManager from
+// kubeStorageVersionMigrator. If no managedFields are found in kubeStorageVersionMigrator for fieldManager, a
+// KubeStorageVersionMigratorApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// kubeStorageVersionMigrator must be a unmodified KubeStorageVersionMigrator API object that was retrieved from the Kubernetes API.
+// ExtractKubeStorageVersionMigrator provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractKubeStorageVersionMigrator(kubeStorageVersionMigrator *apioperatorv1.KubeStorageVersionMigrator, fieldManager string) (*KubeStorageVersionMigratorApplyConfiguration, error) {
+ return extractKubeStorageVersionMigrator(kubeStorageVersionMigrator, fieldManager, "")
+}
+
+// ExtractKubeStorageVersionMigratorStatus is the same as ExtractKubeStorageVersionMigrator except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractKubeStorageVersionMigratorStatus(kubeStorageVersionMigrator *apioperatorv1.KubeStorageVersionMigrator, fieldManager string) (*KubeStorageVersionMigratorApplyConfiguration, error) {
+ return extractKubeStorageVersionMigrator(kubeStorageVersionMigrator, fieldManager, "status")
+}
+
+func extractKubeStorageVersionMigrator(kubeStorageVersionMigrator *apioperatorv1.KubeStorageVersionMigrator, fieldManager string, subresource string) (*KubeStorageVersionMigratorApplyConfiguration, error) {
+ b := &KubeStorageVersionMigratorApplyConfiguration{}
+ err := managedfields.ExtractInto(kubeStorageVersionMigrator, internal.Parser().Type("com.github.openshift.api.operator.v1.KubeStorageVersionMigrator"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(kubeStorageVersionMigrator.Name)
+
+ b.WithKind("KubeStorageVersionMigrator")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithKind(value string) *KubeStorageVersionMigratorApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithAPIVersion(value string) *KubeStorageVersionMigratorApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithName(value string) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithGenerateName(value string) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithNamespace(value string) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithUID(value types.UID) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithResourceVersion(value string) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithGeneration(value int64) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithCreationTimestamp(value metav1.Time) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithLabels(entries map[string]string) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithAnnotations(entries map[string]string) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithFinalizers(values ...string) *KubeStorageVersionMigratorApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *KubeStorageVersionMigratorApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithSpec(value *KubeStorageVersionMigratorSpecApplyConfiguration) *KubeStorageVersionMigratorApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorApplyConfiguration) WithStatus(value *KubeStorageVersionMigratorStatusApplyConfiguration) *KubeStorageVersionMigratorApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *KubeStorageVersionMigratorApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigratorspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigratorspec.go
new file mode 100644
index 0000000000..94e5576594
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigratorspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// KubeStorageVersionMigratorSpecApplyConfiguration represents a declarative configuration of the KubeStorageVersionMigratorSpec type for use
+// with apply.
+type KubeStorageVersionMigratorSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// KubeStorageVersionMigratorSpecApplyConfiguration constructs a declarative configuration of the KubeStorageVersionMigratorSpec type for use with
+// apply.
+func KubeStorageVersionMigratorSpec() *KubeStorageVersionMigratorSpecApplyConfiguration {
+ return &KubeStorageVersionMigratorSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *KubeStorageVersionMigratorSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *KubeStorageVersionMigratorSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *KubeStorageVersionMigratorSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *KubeStorageVersionMigratorSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *KubeStorageVersionMigratorSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigratorstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigratorstatus.go
new file mode 100644
index 0000000000..438067c251
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigratorstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// KubeStorageVersionMigratorStatusApplyConfiguration represents a declarative configuration of the KubeStorageVersionMigratorStatus type for use
+// with apply.
+type KubeStorageVersionMigratorStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// KubeStorageVersionMigratorStatusApplyConfiguration constructs a declarative configuration of the KubeStorageVersionMigratorStatus type for use with
+// apply.
+func KubeStorageVersionMigratorStatus() *KubeStorageVersionMigratorStatusApplyConfiguration {
+ return &KubeStorageVersionMigratorStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorStatusApplyConfiguration) WithObservedGeneration(value int64) *KubeStorageVersionMigratorStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *KubeStorageVersionMigratorStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *KubeStorageVersionMigratorStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorStatusApplyConfiguration) WithVersion(value string) *KubeStorageVersionMigratorStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorStatusApplyConfiguration) WithReadyReplicas(value int32) *KubeStorageVersionMigratorStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *KubeStorageVersionMigratorStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *KubeStorageVersionMigratorStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *KubeStorageVersionMigratorStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *KubeStorageVersionMigratorStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/loadbalancerstrategy.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/loadbalancerstrategy.go
new file mode 100644
index 0000000000..46941714c0
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/loadbalancerstrategy.go
@@ -0,0 +1,56 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// LoadBalancerStrategyApplyConfiguration represents a declarative configuration of the LoadBalancerStrategy type for use
+// with apply.
+type LoadBalancerStrategyApplyConfiguration struct {
+ Scope *v1.LoadBalancerScope `json:"scope,omitempty"`
+ AllowedSourceRanges []v1.CIDR `json:"allowedSourceRanges,omitempty"`
+ ProviderParameters *ProviderLoadBalancerParametersApplyConfiguration `json:"providerParameters,omitempty"`
+ DNSManagementPolicy *v1.LoadBalancerDNSManagementPolicy `json:"dnsManagementPolicy,omitempty"`
+}
+
+// LoadBalancerStrategyApplyConfiguration constructs a declarative configuration of the LoadBalancerStrategy type for use with
+// apply.
+func LoadBalancerStrategy() *LoadBalancerStrategyApplyConfiguration {
+ return &LoadBalancerStrategyApplyConfiguration{}
+}
+
+// WithScope sets the Scope field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Scope field is set to the value of the last call.
+func (b *LoadBalancerStrategyApplyConfiguration) WithScope(value v1.LoadBalancerScope) *LoadBalancerStrategyApplyConfiguration {
+ b.Scope = &value
+ return b
+}
+
+// WithAllowedSourceRanges adds the given value to the AllowedSourceRanges field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the AllowedSourceRanges field.
+func (b *LoadBalancerStrategyApplyConfiguration) WithAllowedSourceRanges(values ...v1.CIDR) *LoadBalancerStrategyApplyConfiguration {
+ for i := range values {
+ b.AllowedSourceRanges = append(b.AllowedSourceRanges, values[i])
+ }
+ return b
+}
+
+// WithProviderParameters sets the ProviderParameters field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ProviderParameters field is set to the value of the last call.
+func (b *LoadBalancerStrategyApplyConfiguration) WithProviderParameters(value *ProviderLoadBalancerParametersApplyConfiguration) *LoadBalancerStrategyApplyConfiguration {
+ b.ProviderParameters = value
+ return b
+}
+
+// WithDNSManagementPolicy sets the DNSManagementPolicy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DNSManagementPolicy field is set to the value of the last call.
+func (b *LoadBalancerStrategyApplyConfiguration) WithDNSManagementPolicy(value v1.LoadBalancerDNSManagementPolicy) *LoadBalancerStrategyApplyConfiguration {
+ b.DNSManagementPolicy = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/loggingdestination.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/loggingdestination.go
new file mode 100644
index 0000000000..de06e9cc4c
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/loggingdestination.go
@@ -0,0 +1,45 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// LoggingDestinationApplyConfiguration represents a declarative configuration of the LoggingDestination type for use
+// with apply.
+type LoggingDestinationApplyConfiguration struct {
+ Type *v1.LoggingDestinationType `json:"type,omitempty"`
+ Syslog *SyslogLoggingDestinationParametersApplyConfiguration `json:"syslog,omitempty"`
+ Container *ContainerLoggingDestinationParametersApplyConfiguration `json:"container,omitempty"`
+}
+
+// LoggingDestinationApplyConfiguration constructs a declarative configuration of the LoggingDestination type for use with
+// apply.
+func LoggingDestination() *LoggingDestinationApplyConfiguration {
+ return &LoggingDestinationApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *LoggingDestinationApplyConfiguration) WithType(value v1.LoggingDestinationType) *LoggingDestinationApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithSyslog sets the Syslog field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Syslog field is set to the value of the last call.
+func (b *LoggingDestinationApplyConfiguration) WithSyslog(value *SyslogLoggingDestinationParametersApplyConfiguration) *LoggingDestinationApplyConfiguration {
+ b.Syslog = value
+ return b
+}
+
+// WithContainer sets the Container field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Container field is set to the value of the last call.
+func (b *LoggingDestinationApplyConfiguration) WithContainer(value *ContainerLoggingDestinationParametersApplyConfiguration) *LoggingDestinationApplyConfiguration {
+ b.Container = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfiguration.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfiguration.go
new file mode 100644
index 0000000000..36b1d6d237
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfiguration.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// MachineConfigurationApplyConfiguration represents a declarative configuration of the MachineConfiguration type for use
+// with apply.
+type MachineConfigurationApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *MachineConfigurationSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *MachineConfigurationStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// MachineConfiguration constructs a declarative configuration of the MachineConfiguration type for use with
+// apply.
+func MachineConfiguration(name string) *MachineConfigurationApplyConfiguration {
+ b := &MachineConfigurationApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("MachineConfiguration")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractMachineConfiguration extracts the applied configuration owned by fieldManager from
+// machineConfiguration. If no managedFields are found in machineConfiguration for fieldManager, a
+// MachineConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// machineConfiguration must be a unmodified MachineConfiguration API object that was retrieved from the Kubernetes API.
+// ExtractMachineConfiguration provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractMachineConfiguration(machineConfiguration *apioperatorv1.MachineConfiguration, fieldManager string) (*MachineConfigurationApplyConfiguration, error) {
+ return extractMachineConfiguration(machineConfiguration, fieldManager, "")
+}
+
+// ExtractMachineConfigurationStatus is the same as ExtractMachineConfiguration except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractMachineConfigurationStatus(machineConfiguration *apioperatorv1.MachineConfiguration, fieldManager string) (*MachineConfigurationApplyConfiguration, error) {
+ return extractMachineConfiguration(machineConfiguration, fieldManager, "status")
+}
+
+func extractMachineConfiguration(machineConfiguration *apioperatorv1.MachineConfiguration, fieldManager string, subresource string) (*MachineConfigurationApplyConfiguration, error) {
+ b := &MachineConfigurationApplyConfiguration{}
+ err := managedfields.ExtractInto(machineConfiguration, internal.Parser().Type("com.github.openshift.api.operator.v1.MachineConfiguration"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(machineConfiguration.Name)
+
+ b.WithKind("MachineConfiguration")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithKind(value string) *MachineConfigurationApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithAPIVersion(value string) *MachineConfigurationApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithName(value string) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithGenerateName(value string) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithNamespace(value string) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithUID(value types.UID) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithResourceVersion(value string) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithGeneration(value int64) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *MachineConfigurationApplyConfiguration) WithLabels(entries map[string]string) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *MachineConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *MachineConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *MachineConfigurationApplyConfiguration) WithFinalizers(values ...string) *MachineConfigurationApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *MachineConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithSpec(value *MachineConfigurationSpecApplyConfiguration) *MachineConfigurationApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *MachineConfigurationApplyConfiguration) WithStatus(value *MachineConfigurationStatusApplyConfiguration) *MachineConfigurationApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *MachineConfigurationApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfigurationspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfigurationspec.go
new file mode 100644
index 0000000000..416406329b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfigurationspec.go
@@ -0,0 +1,102 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// MachineConfigurationSpecApplyConfiguration represents a declarative configuration of the MachineConfigurationSpec type for use
+// with apply.
+type MachineConfigurationSpecApplyConfiguration struct {
+ StaticPodOperatorSpecApplyConfiguration `json:",inline"`
+ ManagedBootImages *ManagedBootImagesApplyConfiguration `json:"managedBootImages,omitempty"`
+ NodeDisruptionPolicy *NodeDisruptionPolicyConfigApplyConfiguration `json:"nodeDisruptionPolicy,omitempty"`
+}
+
+// MachineConfigurationSpecApplyConfiguration constructs a declarative configuration of the MachineConfigurationSpec type for use with
+// apply.
+func MachineConfigurationSpec() *MachineConfigurationSpecApplyConfiguration {
+ return &MachineConfigurationSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *MachineConfigurationSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *MachineConfigurationSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *MachineConfigurationSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *MachineConfigurationSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *MachineConfigurationSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *MachineConfigurationSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *MachineConfigurationSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *MachineConfigurationSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *MachineConfigurationSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *MachineConfigurationSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithForceRedeploymentReason sets the ForceRedeploymentReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ForceRedeploymentReason field is set to the value of the last call.
+func (b *MachineConfigurationSpecApplyConfiguration) WithForceRedeploymentReason(value string) *MachineConfigurationSpecApplyConfiguration {
+ b.ForceRedeploymentReason = &value
+ return b
+}
+
+// WithFailedRevisionLimit sets the FailedRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the FailedRevisionLimit field is set to the value of the last call.
+func (b *MachineConfigurationSpecApplyConfiguration) WithFailedRevisionLimit(value int32) *MachineConfigurationSpecApplyConfiguration {
+ b.FailedRevisionLimit = &value
+ return b
+}
+
+// WithSucceededRevisionLimit sets the SucceededRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SucceededRevisionLimit field is set to the value of the last call.
+func (b *MachineConfigurationSpecApplyConfiguration) WithSucceededRevisionLimit(value int32) *MachineConfigurationSpecApplyConfiguration {
+ b.SucceededRevisionLimit = &value
+ return b
+}
+
+// WithManagedBootImages sets the ManagedBootImages field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagedBootImages field is set to the value of the last call.
+func (b *MachineConfigurationSpecApplyConfiguration) WithManagedBootImages(value *ManagedBootImagesApplyConfiguration) *MachineConfigurationSpecApplyConfiguration {
+ b.ManagedBootImages = value
+ return b
+}
+
+// WithNodeDisruptionPolicy sets the NodeDisruptionPolicy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NodeDisruptionPolicy field is set to the value of the last call.
+func (b *MachineConfigurationSpecApplyConfiguration) WithNodeDisruptionPolicy(value *NodeDisruptionPolicyConfigApplyConfiguration) *MachineConfigurationSpecApplyConfiguration {
+ b.NodeDisruptionPolicy = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfigurationstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfigurationstatus.go
new file mode 100644
index 0000000000..95956ac09d
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfigurationstatus.go
@@ -0,0 +1,50 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// MachineConfigurationStatusApplyConfiguration represents a declarative configuration of the MachineConfigurationStatus type for use
+// with apply.
+type MachineConfigurationStatusApplyConfiguration struct {
+ ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
+ Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
+ NodeDisruptionPolicyStatus *NodeDisruptionPolicyStatusApplyConfiguration `json:"nodeDisruptionPolicyStatus,omitempty"`
+}
+
+// MachineConfigurationStatusApplyConfiguration constructs a declarative configuration of the MachineConfigurationStatus type for use with
+// apply.
+func MachineConfigurationStatus() *MachineConfigurationStatusApplyConfiguration {
+ return &MachineConfigurationStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *MachineConfigurationStatusApplyConfiguration) WithObservedGeneration(value int64) *MachineConfigurationStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *MachineConfigurationStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *MachineConfigurationStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithNodeDisruptionPolicyStatus sets the NodeDisruptionPolicyStatus field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NodeDisruptionPolicyStatus field is set to the value of the last call.
+func (b *MachineConfigurationStatusApplyConfiguration) WithNodeDisruptionPolicyStatus(value *NodeDisruptionPolicyStatusApplyConfiguration) *MachineConfigurationStatusApplyConfiguration {
+ b.NodeDisruptionPolicyStatus = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machinemanager.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machinemanager.go
new file mode 100644
index 0000000000..2764cecdc7
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machinemanager.go
@@ -0,0 +1,45 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// MachineManagerApplyConfiguration represents a declarative configuration of the MachineManager type for use
+// with apply.
+type MachineManagerApplyConfiguration struct {
+ Resource *v1.MachineManagerMachineSetsResourceType `json:"resource,omitempty"`
+ APIGroup *v1.MachineManagerMachineSetsAPIGroupType `json:"apiGroup,omitempty"`
+ Selection *MachineManagerSelectorApplyConfiguration `json:"selection,omitempty"`
+}
+
+// MachineManagerApplyConfiguration constructs a declarative configuration of the MachineManager type for use with
+// apply.
+func MachineManager() *MachineManagerApplyConfiguration {
+ return &MachineManagerApplyConfiguration{}
+}
+
+// WithResource sets the Resource field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Resource field is set to the value of the last call.
+func (b *MachineManagerApplyConfiguration) WithResource(value v1.MachineManagerMachineSetsResourceType) *MachineManagerApplyConfiguration {
+ b.Resource = &value
+ return b
+}
+
+// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIGroup field is set to the value of the last call.
+func (b *MachineManagerApplyConfiguration) WithAPIGroup(value v1.MachineManagerMachineSetsAPIGroupType) *MachineManagerApplyConfiguration {
+ b.APIGroup = &value
+ return b
+}
+
+// WithSelection sets the Selection field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Selection field is set to the value of the last call.
+func (b *MachineManagerApplyConfiguration) WithSelection(value *MachineManagerSelectorApplyConfiguration) *MachineManagerApplyConfiguration {
+ b.Selection = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machinemanagerselector.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machinemanagerselector.go
new file mode 100644
index 0000000000..ef88c772f9
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machinemanagerselector.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// MachineManagerSelectorApplyConfiguration represents a declarative configuration of the MachineManagerSelector type for use
+// with apply.
+type MachineManagerSelectorApplyConfiguration struct {
+ Mode *v1.MachineManagerSelectorMode `json:"mode,omitempty"`
+ Partial *PartialSelectorApplyConfiguration `json:"partial,omitempty"`
+}
+
+// MachineManagerSelectorApplyConfiguration constructs a declarative configuration of the MachineManagerSelector type for use with
+// apply.
+func MachineManagerSelector() *MachineManagerSelectorApplyConfiguration {
+ return &MachineManagerSelectorApplyConfiguration{}
+}
+
+// WithMode sets the Mode field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Mode field is set to the value of the last call.
+func (b *MachineManagerSelectorApplyConfiguration) WithMode(value v1.MachineManagerSelectorMode) *MachineManagerSelectorApplyConfiguration {
+ b.Mode = &value
+ return b
+}
+
+// WithPartial sets the Partial field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Partial field is set to the value of the last call.
+func (b *MachineManagerSelectorApplyConfiguration) WithPartial(value *PartialSelectorApplyConfiguration) *MachineManagerSelectorApplyConfiguration {
+ b.Partial = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/managedbootimages.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/managedbootimages.go
new file mode 100644
index 0000000000..aa8f94463b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/managedbootimages.go
@@ -0,0 +1,28 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ManagedBootImagesApplyConfiguration represents a declarative configuration of the ManagedBootImages type for use
+// with apply.
+type ManagedBootImagesApplyConfiguration struct {
+ MachineManagers []MachineManagerApplyConfiguration `json:"machineManagers,omitempty"`
+}
+
+// ManagedBootImagesApplyConfiguration constructs a declarative configuration of the ManagedBootImages type for use with
+// apply.
+func ManagedBootImages() *ManagedBootImagesApplyConfiguration {
+ return &ManagedBootImagesApplyConfiguration{}
+}
+
+// WithMachineManagers adds the given value to the MachineManagers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the MachineManagers field.
+func (b *ManagedBootImagesApplyConfiguration) WithMachineManagers(values ...*MachineManagerApplyConfiguration) *ManagedBootImagesApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithMachineManagers")
+ }
+ b.MachineManagers = append(b.MachineManagers, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/mtumigration.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/mtumigration.go
new file mode 100644
index 0000000000..9db99100ee
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/mtumigration.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// MTUMigrationApplyConfiguration represents a declarative configuration of the MTUMigration type for use
+// with apply.
+type MTUMigrationApplyConfiguration struct {
+ Network *MTUMigrationValuesApplyConfiguration `json:"network,omitempty"`
+ Machine *MTUMigrationValuesApplyConfiguration `json:"machine,omitempty"`
+}
+
+// MTUMigrationApplyConfiguration constructs a declarative configuration of the MTUMigration type for use with
+// apply.
+func MTUMigration() *MTUMigrationApplyConfiguration {
+ return &MTUMigrationApplyConfiguration{}
+}
+
+// WithNetwork sets the Network field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Network field is set to the value of the last call.
+func (b *MTUMigrationApplyConfiguration) WithNetwork(value *MTUMigrationValuesApplyConfiguration) *MTUMigrationApplyConfiguration {
+ b.Network = value
+ return b
+}
+
+// WithMachine sets the Machine field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Machine field is set to the value of the last call.
+func (b *MTUMigrationApplyConfiguration) WithMachine(value *MTUMigrationValuesApplyConfiguration) *MTUMigrationApplyConfiguration {
+ b.Machine = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/mtumigrationvalues.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/mtumigrationvalues.go
new file mode 100644
index 0000000000..8d346f25f4
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/mtumigrationvalues.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// MTUMigrationValuesApplyConfiguration represents a declarative configuration of the MTUMigrationValues type for use
+// with apply.
+type MTUMigrationValuesApplyConfiguration struct {
+ To *uint32 `json:"to,omitempty"`
+ From *uint32 `json:"from,omitempty"`
+}
+
+// MTUMigrationValuesApplyConfiguration constructs a declarative configuration of the MTUMigrationValues type for use with
+// apply.
+func MTUMigrationValues() *MTUMigrationValuesApplyConfiguration {
+ return &MTUMigrationValuesApplyConfiguration{}
+}
+
+// WithTo sets the To field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the To field is set to the value of the last call.
+func (b *MTUMigrationValuesApplyConfiguration) WithTo(value uint32) *MTUMigrationValuesApplyConfiguration {
+ b.To = &value
+ return b
+}
+
+// WithFrom sets the From field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the From field is set to the value of the last call.
+func (b *MTUMigrationValuesApplyConfiguration) WithFrom(value uint32) *MTUMigrationValuesApplyConfiguration {
+ b.From = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/netflowconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/netflowconfig.go
new file mode 100644
index 0000000000..34d2bb365a
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/netflowconfig.go
@@ -0,0 +1,29 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// NetFlowConfigApplyConfiguration represents a declarative configuration of the NetFlowConfig type for use
+// with apply.
+type NetFlowConfigApplyConfiguration struct {
+ Collectors []v1.IPPort `json:"collectors,omitempty"`
+}
+
+// NetFlowConfigApplyConfiguration constructs a declarative configuration of the NetFlowConfig type for use with
+// apply.
+func NetFlowConfig() *NetFlowConfigApplyConfiguration {
+ return &NetFlowConfigApplyConfiguration{}
+}
+
+// WithCollectors adds the given value to the Collectors field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Collectors field.
+func (b *NetFlowConfigApplyConfiguration) WithCollectors(values ...v1.IPPort) *NetFlowConfigApplyConfiguration {
+ for i := range values {
+ b.Collectors = append(b.Collectors, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/network.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/network.go
new file mode 100644
index 0000000000..fd66e0065f
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/network.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// NetworkApplyConfiguration represents a declarative configuration of the Network type for use
+// with apply.
+type NetworkApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *NetworkSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *NetworkStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// Network constructs a declarative configuration of the Network type for use with
+// apply.
+func Network(name string) *NetworkApplyConfiguration {
+ b := &NetworkApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("Network")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractNetwork extracts the applied configuration owned by fieldManager from
+// network. If no managedFields are found in network for fieldManager, a
+// NetworkApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// network must be a unmodified Network API object that was retrieved from the Kubernetes API.
+// ExtractNetwork provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractNetwork(network *apioperatorv1.Network, fieldManager string) (*NetworkApplyConfiguration, error) {
+ return extractNetwork(network, fieldManager, "")
+}
+
+// ExtractNetworkStatus is the same as ExtractNetwork except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractNetworkStatus(network *apioperatorv1.Network, fieldManager string) (*NetworkApplyConfiguration, error) {
+ return extractNetwork(network, fieldManager, "status")
+}
+
+func extractNetwork(network *apioperatorv1.Network, fieldManager string, subresource string) (*NetworkApplyConfiguration, error) {
+ b := &NetworkApplyConfiguration{}
+ err := managedfields.ExtractInto(network, internal.Parser().Type("com.github.openshift.api.operator.v1.Network"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(network.Name)
+
+ b.WithKind("Network")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithKind(value string) *NetworkApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithAPIVersion(value string) *NetworkApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithName(value string) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithGenerateName(value string) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithNamespace(value string) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithUID(value types.UID) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithResourceVersion(value string) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithGeneration(value int64) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithCreationTimestamp(value metav1.Time) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *NetworkApplyConfiguration) WithLabels(entries map[string]string) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *NetworkApplyConfiguration) WithAnnotations(entries map[string]string) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *NetworkApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *NetworkApplyConfiguration) WithFinalizers(values ...string) *NetworkApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *NetworkApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithSpec(value *NetworkSpecApplyConfiguration) *NetworkApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *NetworkApplyConfiguration) WithStatus(value *NetworkStatusApplyConfiguration) *NetworkApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *NetworkApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkmigration.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkmigration.go
new file mode 100644
index 0000000000..bf753bb177
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkmigration.go
@@ -0,0 +1,54 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// NetworkMigrationApplyConfiguration represents a declarative configuration of the NetworkMigration type for use
+// with apply.
+type NetworkMigrationApplyConfiguration struct {
+ MTU *MTUMigrationApplyConfiguration `json:"mtu,omitempty"`
+ NetworkType *string `json:"networkType,omitempty"`
+ Features *FeaturesMigrationApplyConfiguration `json:"features,omitempty"`
+ Mode *operatorv1.NetworkMigrationMode `json:"mode,omitempty"`
+}
+
+// NetworkMigrationApplyConfiguration constructs a declarative configuration of the NetworkMigration type for use with
+// apply.
+func NetworkMigration() *NetworkMigrationApplyConfiguration {
+ return &NetworkMigrationApplyConfiguration{}
+}
+
+// WithMTU sets the MTU field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MTU field is set to the value of the last call.
+func (b *NetworkMigrationApplyConfiguration) WithMTU(value *MTUMigrationApplyConfiguration) *NetworkMigrationApplyConfiguration {
+ b.MTU = value
+ return b
+}
+
+// WithNetworkType sets the NetworkType field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NetworkType field is set to the value of the last call.
+func (b *NetworkMigrationApplyConfiguration) WithNetworkType(value string) *NetworkMigrationApplyConfiguration {
+ b.NetworkType = &value
+ return b
+}
+
+// WithFeatures sets the Features field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Features field is set to the value of the last call.
+func (b *NetworkMigrationApplyConfiguration) WithFeatures(value *FeaturesMigrationApplyConfiguration) *NetworkMigrationApplyConfiguration {
+ b.Features = value
+ return b
+}
+
+// WithMode sets the Mode field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Mode field is set to the value of the last call.
+func (b *NetworkMigrationApplyConfiguration) WithMode(value operatorv1.NetworkMigrationMode) *NetworkMigrationApplyConfiguration {
+ b.Mode = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkspec.go
new file mode 100644
index 0000000000..a134395427
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkspec.go
@@ -0,0 +1,180 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// NetworkSpecApplyConfiguration represents a declarative configuration of the NetworkSpec type for use
+// with apply.
+type NetworkSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+ ClusterNetwork []ClusterNetworkEntryApplyConfiguration `json:"clusterNetwork,omitempty"`
+ ServiceNetwork []string `json:"serviceNetwork,omitempty"`
+ DefaultNetwork *DefaultNetworkDefinitionApplyConfiguration `json:"defaultNetwork,omitempty"`
+ AdditionalNetworks []AdditionalNetworkDefinitionApplyConfiguration `json:"additionalNetworks,omitempty"`
+ DisableMultiNetwork *bool `json:"disableMultiNetwork,omitempty"`
+ UseMultiNetworkPolicy *bool `json:"useMultiNetworkPolicy,omitempty"`
+ DeployKubeProxy *bool `json:"deployKubeProxy,omitempty"`
+ DisableNetworkDiagnostics *bool `json:"disableNetworkDiagnostics,omitempty"`
+ KubeProxyConfig *ProxyConfigApplyConfiguration `json:"kubeProxyConfig,omitempty"`
+ ExportNetworkFlows *ExportNetworkFlowsApplyConfiguration `json:"exportNetworkFlows,omitempty"`
+ Migration *NetworkMigrationApplyConfiguration `json:"migration,omitempty"`
+ AdditionalRoutingCapabilities *AdditionalRoutingCapabilitiesApplyConfiguration `json:"additionalRoutingCapabilities,omitempty"`
+}
+
+// NetworkSpecApplyConfiguration constructs a declarative configuration of the NetworkSpec type for use with
+// apply.
+func NetworkSpec() *NetworkSpecApplyConfiguration {
+ return &NetworkSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *NetworkSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *NetworkSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *NetworkSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *NetworkSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *NetworkSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithClusterNetwork adds the given value to the ClusterNetwork field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the ClusterNetwork field.
+func (b *NetworkSpecApplyConfiguration) WithClusterNetwork(values ...*ClusterNetworkEntryApplyConfiguration) *NetworkSpecApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithClusterNetwork")
+ }
+ b.ClusterNetwork = append(b.ClusterNetwork, *values[i])
+ }
+ return b
+}
+
+// WithServiceNetwork adds the given value to the ServiceNetwork field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the ServiceNetwork field.
+func (b *NetworkSpecApplyConfiguration) WithServiceNetwork(values ...string) *NetworkSpecApplyConfiguration {
+ for i := range values {
+ b.ServiceNetwork = append(b.ServiceNetwork, values[i])
+ }
+ return b
+}
+
+// WithDefaultNetwork sets the DefaultNetwork field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DefaultNetwork field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithDefaultNetwork(value *DefaultNetworkDefinitionApplyConfiguration) *NetworkSpecApplyConfiguration {
+ b.DefaultNetwork = value
+ return b
+}
+
+// WithAdditionalNetworks adds the given value to the AdditionalNetworks field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the AdditionalNetworks field.
+func (b *NetworkSpecApplyConfiguration) WithAdditionalNetworks(values ...*AdditionalNetworkDefinitionApplyConfiguration) *NetworkSpecApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithAdditionalNetworks")
+ }
+ b.AdditionalNetworks = append(b.AdditionalNetworks, *values[i])
+ }
+ return b
+}
+
+// WithDisableMultiNetwork sets the DisableMultiNetwork field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DisableMultiNetwork field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithDisableMultiNetwork(value bool) *NetworkSpecApplyConfiguration {
+ b.DisableMultiNetwork = &value
+ return b
+}
+
+// WithUseMultiNetworkPolicy sets the UseMultiNetworkPolicy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UseMultiNetworkPolicy field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithUseMultiNetworkPolicy(value bool) *NetworkSpecApplyConfiguration {
+ b.UseMultiNetworkPolicy = &value
+ return b
+}
+
+// WithDeployKubeProxy sets the DeployKubeProxy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeployKubeProxy field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithDeployKubeProxy(value bool) *NetworkSpecApplyConfiguration {
+ b.DeployKubeProxy = &value
+ return b
+}
+
+// WithDisableNetworkDiagnostics sets the DisableNetworkDiagnostics field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DisableNetworkDiagnostics field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithDisableNetworkDiagnostics(value bool) *NetworkSpecApplyConfiguration {
+ b.DisableNetworkDiagnostics = &value
+ return b
+}
+
+// WithKubeProxyConfig sets the KubeProxyConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the KubeProxyConfig field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithKubeProxyConfig(value *ProxyConfigApplyConfiguration) *NetworkSpecApplyConfiguration {
+ b.KubeProxyConfig = value
+ return b
+}
+
+// WithExportNetworkFlows sets the ExportNetworkFlows field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ExportNetworkFlows field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithExportNetworkFlows(value *ExportNetworkFlowsApplyConfiguration) *NetworkSpecApplyConfiguration {
+ b.ExportNetworkFlows = value
+ return b
+}
+
+// WithMigration sets the Migration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Migration field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithMigration(value *NetworkMigrationApplyConfiguration) *NetworkSpecApplyConfiguration {
+ b.Migration = value
+ return b
+}
+
+// WithAdditionalRoutingCapabilities sets the AdditionalRoutingCapabilities field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the AdditionalRoutingCapabilities field is set to the value of the last call.
+func (b *NetworkSpecApplyConfiguration) WithAdditionalRoutingCapabilities(value *AdditionalRoutingCapabilitiesApplyConfiguration) *NetworkSpecApplyConfiguration {
+ b.AdditionalRoutingCapabilities = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkstatus.go
new file mode 100644
index 0000000000..85d74e0dba
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// NetworkStatusApplyConfiguration represents a declarative configuration of the NetworkStatus type for use
+// with apply.
+type NetworkStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// NetworkStatusApplyConfiguration constructs a declarative configuration of the NetworkStatus type for use with
+// apply.
+func NetworkStatus() *NetworkStatusApplyConfiguration {
+ return &NetworkStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *NetworkStatusApplyConfiguration) WithObservedGeneration(value int64) *NetworkStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *NetworkStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *NetworkStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *NetworkStatusApplyConfiguration) WithVersion(value string) *NetworkStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *NetworkStatusApplyConfiguration) WithReadyReplicas(value int32) *NetworkStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *NetworkStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *NetworkStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *NetworkStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *NetworkStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyclusterstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyclusterstatus.go
new file mode 100644
index 0000000000..1f0d765465
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyclusterstatus.go
@@ -0,0 +1,51 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// NodeDisruptionPolicyClusterStatusApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicyClusterStatus type for use
+// with apply.
+type NodeDisruptionPolicyClusterStatusApplyConfiguration struct {
+ Files []NodeDisruptionPolicyStatusFileApplyConfiguration `json:"files,omitempty"`
+ Units []NodeDisruptionPolicyStatusUnitApplyConfiguration `json:"units,omitempty"`
+ SSHKey *NodeDisruptionPolicyStatusSSHKeyApplyConfiguration `json:"sshkey,omitempty"`
+}
+
+// NodeDisruptionPolicyClusterStatusApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicyClusterStatus type for use with
+// apply.
+func NodeDisruptionPolicyClusterStatus() *NodeDisruptionPolicyClusterStatusApplyConfiguration {
+ return &NodeDisruptionPolicyClusterStatusApplyConfiguration{}
+}
+
+// WithFiles adds the given value to the Files field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Files field.
+func (b *NodeDisruptionPolicyClusterStatusApplyConfiguration) WithFiles(values ...*NodeDisruptionPolicyStatusFileApplyConfiguration) *NodeDisruptionPolicyClusterStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithFiles")
+ }
+ b.Files = append(b.Files, *values[i])
+ }
+ return b
+}
+
+// WithUnits adds the given value to the Units field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Units field.
+func (b *NodeDisruptionPolicyClusterStatusApplyConfiguration) WithUnits(values ...*NodeDisruptionPolicyStatusUnitApplyConfiguration) *NodeDisruptionPolicyClusterStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithUnits")
+ }
+ b.Units = append(b.Units, *values[i])
+ }
+ return b
+}
+
+// WithSSHKey sets the SSHKey field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SSHKey field is set to the value of the last call.
+func (b *NodeDisruptionPolicyClusterStatusApplyConfiguration) WithSSHKey(value *NodeDisruptionPolicyStatusSSHKeyApplyConfiguration) *NodeDisruptionPolicyClusterStatusApplyConfiguration {
+ b.SSHKey = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyconfig.go
new file mode 100644
index 0000000000..92db16f834
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyconfig.go
@@ -0,0 +1,51 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// NodeDisruptionPolicyConfigApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicyConfig type for use
+// with apply.
+type NodeDisruptionPolicyConfigApplyConfiguration struct {
+ Files []NodeDisruptionPolicySpecFileApplyConfiguration `json:"files,omitempty"`
+ Units []NodeDisruptionPolicySpecUnitApplyConfiguration `json:"units,omitempty"`
+ SSHKey *NodeDisruptionPolicySpecSSHKeyApplyConfiguration `json:"sshkey,omitempty"`
+}
+
+// NodeDisruptionPolicyConfigApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicyConfig type for use with
+// apply.
+func NodeDisruptionPolicyConfig() *NodeDisruptionPolicyConfigApplyConfiguration {
+ return &NodeDisruptionPolicyConfigApplyConfiguration{}
+}
+
+// WithFiles adds the given value to the Files field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Files field.
+func (b *NodeDisruptionPolicyConfigApplyConfiguration) WithFiles(values ...*NodeDisruptionPolicySpecFileApplyConfiguration) *NodeDisruptionPolicyConfigApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithFiles")
+ }
+ b.Files = append(b.Files, *values[i])
+ }
+ return b
+}
+
+// WithUnits adds the given value to the Units field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Units field.
+func (b *NodeDisruptionPolicyConfigApplyConfiguration) WithUnits(values ...*NodeDisruptionPolicySpecUnitApplyConfiguration) *NodeDisruptionPolicyConfigApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithUnits")
+ }
+ b.Units = append(b.Units, *values[i])
+ }
+ return b
+}
+
+// WithSSHKey sets the SSHKey field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SSHKey field is set to the value of the last call.
+func (b *NodeDisruptionPolicyConfigApplyConfiguration) WithSSHKey(value *NodeDisruptionPolicySpecSSHKeyApplyConfiguration) *NodeDisruptionPolicyConfigApplyConfiguration {
+ b.SSHKey = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecaction.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecaction.go
new file mode 100644
index 0000000000..fb5fb5443b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecaction.go
@@ -0,0 +1,45 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// NodeDisruptionPolicySpecActionApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicySpecAction type for use
+// with apply.
+type NodeDisruptionPolicySpecActionApplyConfiguration struct {
+ Type *v1.NodeDisruptionPolicySpecActionType `json:"type,omitempty"`
+ Reload *ReloadServiceApplyConfiguration `json:"reload,omitempty"`
+ Restart *RestartServiceApplyConfiguration `json:"restart,omitempty"`
+}
+
+// NodeDisruptionPolicySpecActionApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicySpecAction type for use with
+// apply.
+func NodeDisruptionPolicySpecAction() *NodeDisruptionPolicySpecActionApplyConfiguration {
+ return &NodeDisruptionPolicySpecActionApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *NodeDisruptionPolicySpecActionApplyConfiguration) WithType(value v1.NodeDisruptionPolicySpecActionType) *NodeDisruptionPolicySpecActionApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithReload sets the Reload field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Reload field is set to the value of the last call.
+func (b *NodeDisruptionPolicySpecActionApplyConfiguration) WithReload(value *ReloadServiceApplyConfiguration) *NodeDisruptionPolicySpecActionApplyConfiguration {
+ b.Reload = value
+ return b
+}
+
+// WithRestart sets the Restart field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Restart field is set to the value of the last call.
+func (b *NodeDisruptionPolicySpecActionApplyConfiguration) WithRestart(value *RestartServiceApplyConfiguration) *NodeDisruptionPolicySpecActionApplyConfiguration {
+ b.Restart = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecfile.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecfile.go
new file mode 100644
index 0000000000..85884dc070
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecfile.go
@@ -0,0 +1,37 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// NodeDisruptionPolicySpecFileApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicySpecFile type for use
+// with apply.
+type NodeDisruptionPolicySpecFileApplyConfiguration struct {
+ Path *string `json:"path,omitempty"`
+ Actions []NodeDisruptionPolicySpecActionApplyConfiguration `json:"actions,omitempty"`
+}
+
+// NodeDisruptionPolicySpecFileApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicySpecFile type for use with
+// apply.
+func NodeDisruptionPolicySpecFile() *NodeDisruptionPolicySpecFileApplyConfiguration {
+ return &NodeDisruptionPolicySpecFileApplyConfiguration{}
+}
+
+// WithPath sets the Path field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Path field is set to the value of the last call.
+func (b *NodeDisruptionPolicySpecFileApplyConfiguration) WithPath(value string) *NodeDisruptionPolicySpecFileApplyConfiguration {
+ b.Path = &value
+ return b
+}
+
+// WithActions adds the given value to the Actions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Actions field.
+func (b *NodeDisruptionPolicySpecFileApplyConfiguration) WithActions(values ...*NodeDisruptionPolicySpecActionApplyConfiguration) *NodeDisruptionPolicySpecFileApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithActions")
+ }
+ b.Actions = append(b.Actions, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecsshkey.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecsshkey.go
new file mode 100644
index 0000000000..b7ae1c75ee
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecsshkey.go
@@ -0,0 +1,28 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// NodeDisruptionPolicySpecSSHKeyApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicySpecSSHKey type for use
+// with apply.
+type NodeDisruptionPolicySpecSSHKeyApplyConfiguration struct {
+ Actions []NodeDisruptionPolicySpecActionApplyConfiguration `json:"actions,omitempty"`
+}
+
+// NodeDisruptionPolicySpecSSHKeyApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicySpecSSHKey type for use with
+// apply.
+func NodeDisruptionPolicySpecSSHKey() *NodeDisruptionPolicySpecSSHKeyApplyConfiguration {
+ return &NodeDisruptionPolicySpecSSHKeyApplyConfiguration{}
+}
+
+// WithActions adds the given value to the Actions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Actions field.
+func (b *NodeDisruptionPolicySpecSSHKeyApplyConfiguration) WithActions(values ...*NodeDisruptionPolicySpecActionApplyConfiguration) *NodeDisruptionPolicySpecSSHKeyApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithActions")
+ }
+ b.Actions = append(b.Actions, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecunit.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecunit.go
new file mode 100644
index 0000000000..6f62f343ab
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecunit.go
@@ -0,0 +1,41 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// NodeDisruptionPolicySpecUnitApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicySpecUnit type for use
+// with apply.
+type NodeDisruptionPolicySpecUnitApplyConfiguration struct {
+ Name *v1.NodeDisruptionPolicyServiceName `json:"name,omitempty"`
+ Actions []NodeDisruptionPolicySpecActionApplyConfiguration `json:"actions,omitempty"`
+}
+
+// NodeDisruptionPolicySpecUnitApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicySpecUnit type for use with
+// apply.
+func NodeDisruptionPolicySpecUnit() *NodeDisruptionPolicySpecUnitApplyConfiguration {
+ return &NodeDisruptionPolicySpecUnitApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *NodeDisruptionPolicySpecUnitApplyConfiguration) WithName(value v1.NodeDisruptionPolicyServiceName) *NodeDisruptionPolicySpecUnitApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithActions adds the given value to the Actions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Actions field.
+func (b *NodeDisruptionPolicySpecUnitApplyConfiguration) WithActions(values ...*NodeDisruptionPolicySpecActionApplyConfiguration) *NodeDisruptionPolicySpecUnitApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithActions")
+ }
+ b.Actions = append(b.Actions, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatus.go
new file mode 100644
index 0000000000..cf424c3fc6
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatus.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// NodeDisruptionPolicyStatusApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicyStatus type for use
+// with apply.
+type NodeDisruptionPolicyStatusApplyConfiguration struct {
+ ClusterPolicies *NodeDisruptionPolicyClusterStatusApplyConfiguration `json:"clusterPolicies,omitempty"`
+}
+
+// NodeDisruptionPolicyStatusApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicyStatus type for use with
+// apply.
+func NodeDisruptionPolicyStatus() *NodeDisruptionPolicyStatusApplyConfiguration {
+ return &NodeDisruptionPolicyStatusApplyConfiguration{}
+}
+
+// WithClusterPolicies sets the ClusterPolicies field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ClusterPolicies field is set to the value of the last call.
+func (b *NodeDisruptionPolicyStatusApplyConfiguration) WithClusterPolicies(value *NodeDisruptionPolicyClusterStatusApplyConfiguration) *NodeDisruptionPolicyStatusApplyConfiguration {
+ b.ClusterPolicies = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusaction.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusaction.go
new file mode 100644
index 0000000000..ec621575cb
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusaction.go
@@ -0,0 +1,45 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// NodeDisruptionPolicyStatusActionApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicyStatusAction type for use
+// with apply.
+type NodeDisruptionPolicyStatusActionApplyConfiguration struct {
+ Type *v1.NodeDisruptionPolicyStatusActionType `json:"type,omitempty"`
+ Reload *ReloadServiceApplyConfiguration `json:"reload,omitempty"`
+ Restart *RestartServiceApplyConfiguration `json:"restart,omitempty"`
+}
+
+// NodeDisruptionPolicyStatusActionApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicyStatusAction type for use with
+// apply.
+func NodeDisruptionPolicyStatusAction() *NodeDisruptionPolicyStatusActionApplyConfiguration {
+ return &NodeDisruptionPolicyStatusActionApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *NodeDisruptionPolicyStatusActionApplyConfiguration) WithType(value v1.NodeDisruptionPolicyStatusActionType) *NodeDisruptionPolicyStatusActionApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithReload sets the Reload field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Reload field is set to the value of the last call.
+func (b *NodeDisruptionPolicyStatusActionApplyConfiguration) WithReload(value *ReloadServiceApplyConfiguration) *NodeDisruptionPolicyStatusActionApplyConfiguration {
+ b.Reload = value
+ return b
+}
+
+// WithRestart sets the Restart field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Restart field is set to the value of the last call.
+func (b *NodeDisruptionPolicyStatusActionApplyConfiguration) WithRestart(value *RestartServiceApplyConfiguration) *NodeDisruptionPolicyStatusActionApplyConfiguration {
+ b.Restart = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusfile.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusfile.go
new file mode 100644
index 0000000000..e1a0436f27
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusfile.go
@@ -0,0 +1,37 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// NodeDisruptionPolicyStatusFileApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicyStatusFile type for use
+// with apply.
+type NodeDisruptionPolicyStatusFileApplyConfiguration struct {
+ Path *string `json:"path,omitempty"`
+ Actions []NodeDisruptionPolicyStatusActionApplyConfiguration `json:"actions,omitempty"`
+}
+
+// NodeDisruptionPolicyStatusFileApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicyStatusFile type for use with
+// apply.
+func NodeDisruptionPolicyStatusFile() *NodeDisruptionPolicyStatusFileApplyConfiguration {
+ return &NodeDisruptionPolicyStatusFileApplyConfiguration{}
+}
+
+// WithPath sets the Path field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Path field is set to the value of the last call.
+func (b *NodeDisruptionPolicyStatusFileApplyConfiguration) WithPath(value string) *NodeDisruptionPolicyStatusFileApplyConfiguration {
+ b.Path = &value
+ return b
+}
+
+// WithActions adds the given value to the Actions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Actions field.
+func (b *NodeDisruptionPolicyStatusFileApplyConfiguration) WithActions(values ...*NodeDisruptionPolicyStatusActionApplyConfiguration) *NodeDisruptionPolicyStatusFileApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithActions")
+ }
+ b.Actions = append(b.Actions, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatussshkey.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatussshkey.go
new file mode 100644
index 0000000000..4ad78a79d2
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatussshkey.go
@@ -0,0 +1,28 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// NodeDisruptionPolicyStatusSSHKeyApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicyStatusSSHKey type for use
+// with apply.
+type NodeDisruptionPolicyStatusSSHKeyApplyConfiguration struct {
+ Actions []NodeDisruptionPolicyStatusActionApplyConfiguration `json:"actions,omitempty"`
+}
+
+// NodeDisruptionPolicyStatusSSHKeyApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicyStatusSSHKey type for use with
+// apply.
+func NodeDisruptionPolicyStatusSSHKey() *NodeDisruptionPolicyStatusSSHKeyApplyConfiguration {
+ return &NodeDisruptionPolicyStatusSSHKeyApplyConfiguration{}
+}
+
+// WithActions adds the given value to the Actions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Actions field.
+func (b *NodeDisruptionPolicyStatusSSHKeyApplyConfiguration) WithActions(values ...*NodeDisruptionPolicyStatusActionApplyConfiguration) *NodeDisruptionPolicyStatusSSHKeyApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithActions")
+ }
+ b.Actions = append(b.Actions, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusunit.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusunit.go
new file mode 100644
index 0000000000..f4dd5fac7d
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusunit.go
@@ -0,0 +1,41 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// NodeDisruptionPolicyStatusUnitApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicyStatusUnit type for use
+// with apply.
+type NodeDisruptionPolicyStatusUnitApplyConfiguration struct {
+ Name *v1.NodeDisruptionPolicyServiceName `json:"name,omitempty"`
+ Actions []NodeDisruptionPolicyStatusActionApplyConfiguration `json:"actions,omitempty"`
+}
+
+// NodeDisruptionPolicyStatusUnitApplyConfiguration constructs a declarative configuration of the NodeDisruptionPolicyStatusUnit type for use with
+// apply.
+func NodeDisruptionPolicyStatusUnit() *NodeDisruptionPolicyStatusUnitApplyConfiguration {
+ return &NodeDisruptionPolicyStatusUnitApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *NodeDisruptionPolicyStatusUnitApplyConfiguration) WithName(value v1.NodeDisruptionPolicyServiceName) *NodeDisruptionPolicyStatusUnitApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithActions adds the given value to the Actions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Actions field.
+func (b *NodeDisruptionPolicyStatusUnitApplyConfiguration) WithActions(values ...*NodeDisruptionPolicyStatusActionApplyConfiguration) *NodeDisruptionPolicyStatusUnitApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithActions")
+ }
+ b.Actions = append(b.Actions, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodeplacement.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodeplacement.go
new file mode 100644
index 0000000000..5f387ac712
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodeplacement.go
@@ -0,0 +1,39 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ corev1 "k8s.io/api/core/v1"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// NodePlacementApplyConfiguration represents a declarative configuration of the NodePlacement type for use
+// with apply.
+type NodePlacementApplyConfiguration struct {
+ NodeSelector *v1.LabelSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
+ Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
+}
+
+// NodePlacementApplyConfiguration constructs a declarative configuration of the NodePlacement type for use with
+// apply.
+func NodePlacement() *NodePlacementApplyConfiguration {
+ return &NodePlacementApplyConfiguration{}
+}
+
+// WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NodeSelector field is set to the value of the last call.
+func (b *NodePlacementApplyConfiguration) WithNodeSelector(value *v1.LabelSelectorApplyConfiguration) *NodePlacementApplyConfiguration {
+ b.NodeSelector = value
+ return b
+}
+
+// WithTolerations adds the given value to the Tolerations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Tolerations field.
+func (b *NodePlacementApplyConfiguration) WithTolerations(values ...corev1.Toleration) *NodePlacementApplyConfiguration {
+ for i := range values {
+ b.Tolerations = append(b.Tolerations, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodeportstrategy.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodeportstrategy.go
new file mode 100644
index 0000000000..01167311f6
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodeportstrategy.go
@@ -0,0 +1,27 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// NodePortStrategyApplyConfiguration represents a declarative configuration of the NodePortStrategy type for use
+// with apply.
+type NodePortStrategyApplyConfiguration struct {
+ Protocol *v1.IngressControllerProtocol `json:"protocol,omitempty"`
+}
+
+// NodePortStrategyApplyConfiguration constructs a declarative configuration of the NodePortStrategy type for use with
+// apply.
+func NodePortStrategy() *NodePortStrategyApplyConfiguration {
+ return &NodePortStrategyApplyConfiguration{}
+}
+
+// WithProtocol sets the Protocol field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Protocol field is set to the value of the last call.
+func (b *NodePortStrategyApplyConfiguration) WithProtocol(value v1.IngressControllerProtocol) *NodePortStrategyApplyConfiguration {
+ b.Protocol = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodestatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodestatus.go
new file mode 100644
index 0000000000..b5a3cac334
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodestatus.go
@@ -0,0 +1,101 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// NodeStatusApplyConfiguration represents a declarative configuration of the NodeStatus type for use
+// with apply.
+type NodeStatusApplyConfiguration struct {
+ NodeName *string `json:"nodeName,omitempty"`
+ CurrentRevision *int32 `json:"currentRevision,omitempty"`
+ TargetRevision *int32 `json:"targetRevision,omitempty"`
+ LastFailedRevision *int32 `json:"lastFailedRevision,omitempty"`
+ LastFailedTime *v1.Time `json:"lastFailedTime,omitempty"`
+ LastFailedReason *string `json:"lastFailedReason,omitempty"`
+ LastFailedCount *int `json:"lastFailedCount,omitempty"`
+ LastFallbackCount *int `json:"lastFallbackCount,omitempty"`
+ LastFailedRevisionErrors []string `json:"lastFailedRevisionErrors,omitempty"`
+}
+
+// NodeStatusApplyConfiguration constructs a declarative configuration of the NodeStatus type for use with
+// apply.
+func NodeStatus() *NodeStatusApplyConfiguration {
+ return &NodeStatusApplyConfiguration{}
+}
+
+// WithNodeName sets the NodeName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NodeName field is set to the value of the last call.
+func (b *NodeStatusApplyConfiguration) WithNodeName(value string) *NodeStatusApplyConfiguration {
+ b.NodeName = &value
+ return b
+}
+
+// WithCurrentRevision sets the CurrentRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CurrentRevision field is set to the value of the last call.
+func (b *NodeStatusApplyConfiguration) WithCurrentRevision(value int32) *NodeStatusApplyConfiguration {
+ b.CurrentRevision = &value
+ return b
+}
+
+// WithTargetRevision sets the TargetRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TargetRevision field is set to the value of the last call.
+func (b *NodeStatusApplyConfiguration) WithTargetRevision(value int32) *NodeStatusApplyConfiguration {
+ b.TargetRevision = &value
+ return b
+}
+
+// WithLastFailedRevision sets the LastFailedRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LastFailedRevision field is set to the value of the last call.
+func (b *NodeStatusApplyConfiguration) WithLastFailedRevision(value int32) *NodeStatusApplyConfiguration {
+ b.LastFailedRevision = &value
+ return b
+}
+
+// WithLastFailedTime sets the LastFailedTime field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LastFailedTime field is set to the value of the last call.
+func (b *NodeStatusApplyConfiguration) WithLastFailedTime(value v1.Time) *NodeStatusApplyConfiguration {
+ b.LastFailedTime = &value
+ return b
+}
+
+// WithLastFailedReason sets the LastFailedReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LastFailedReason field is set to the value of the last call.
+func (b *NodeStatusApplyConfiguration) WithLastFailedReason(value string) *NodeStatusApplyConfiguration {
+ b.LastFailedReason = &value
+ return b
+}
+
+// WithLastFailedCount sets the LastFailedCount field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LastFailedCount field is set to the value of the last call.
+func (b *NodeStatusApplyConfiguration) WithLastFailedCount(value int) *NodeStatusApplyConfiguration {
+ b.LastFailedCount = &value
+ return b
+}
+
+// WithLastFallbackCount sets the LastFallbackCount field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LastFallbackCount field is set to the value of the last call.
+func (b *NodeStatusApplyConfiguration) WithLastFallbackCount(value int) *NodeStatusApplyConfiguration {
+ b.LastFallbackCount = &value
+ return b
+}
+
+// WithLastFailedRevisionErrors adds the given value to the LastFailedRevisionErrors field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the LastFailedRevisionErrors field.
+func (b *NodeStatusApplyConfiguration) WithLastFailedRevisionErrors(values ...string) *NodeStatusApplyConfiguration {
+ for i := range values {
+ b.LastFailedRevisionErrors = append(b.LastFailedRevisionErrors, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/oauthapiserverstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/oauthapiserverstatus.go
new file mode 100644
index 0000000000..68f43886aa
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/oauthapiserverstatus.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// OAuthAPIServerStatusApplyConfiguration represents a declarative configuration of the OAuthAPIServerStatus type for use
+// with apply.
+type OAuthAPIServerStatusApplyConfiguration struct {
+ LatestAvailableRevision *int32 `json:"latestAvailableRevision,omitempty"`
+}
+
+// OAuthAPIServerStatusApplyConfiguration constructs a declarative configuration of the OAuthAPIServerStatus type for use with
+// apply.
+func OAuthAPIServerStatus() *OAuthAPIServerStatusApplyConfiguration {
+ return &OAuthAPIServerStatusApplyConfiguration{}
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *OAuthAPIServerStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *OAuthAPIServerStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olm.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olm.go
new file mode 100644
index 0000000000..d1fb739538
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olm.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// OLMApplyConfiguration represents a declarative configuration of the OLM type for use
+// with apply.
+type OLMApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *OLMSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *OLMStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// OLM constructs a declarative configuration of the OLM type for use with
+// apply.
+func OLM(name string) *OLMApplyConfiguration {
+ b := &OLMApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("OLM")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractOLM extracts the applied configuration owned by fieldManager from
+// oLM. If no managedFields are found in oLM for fieldManager, a
+// OLMApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// oLM must be a unmodified OLM API object that was retrieved from the Kubernetes API.
+// ExtractOLM provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractOLM(oLM *apioperatorv1.OLM, fieldManager string) (*OLMApplyConfiguration, error) {
+ return extractOLM(oLM, fieldManager, "")
+}
+
+// ExtractOLMStatus is the same as ExtractOLM except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractOLMStatus(oLM *apioperatorv1.OLM, fieldManager string) (*OLMApplyConfiguration, error) {
+ return extractOLM(oLM, fieldManager, "status")
+}
+
+func extractOLM(oLM *apioperatorv1.OLM, fieldManager string, subresource string) (*OLMApplyConfiguration, error) {
+ b := &OLMApplyConfiguration{}
+ err := managedfields.ExtractInto(oLM, internal.Parser().Type("com.github.openshift.api.operator.v1.OLM"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(oLM.Name)
+
+ b.WithKind("OLM")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithKind(value string) *OLMApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithAPIVersion(value string) *OLMApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithName(value string) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithGenerateName(value string) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithNamespace(value string) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithUID(value types.UID) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithResourceVersion(value string) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithGeneration(value int64) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithCreationTimestamp(value metav1.Time) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *OLMApplyConfiguration) WithLabels(entries map[string]string) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *OLMApplyConfiguration) WithAnnotations(entries map[string]string) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *OLMApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *OLMApplyConfiguration) WithFinalizers(values ...string) *OLMApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *OLMApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithSpec(value *OLMSpecApplyConfiguration) *OLMApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *OLMApplyConfiguration) WithStatus(value *OLMStatusApplyConfiguration) *OLMApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *OLMApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olmspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olmspec.go
new file mode 100644
index 0000000000..6639c0c46c
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olmspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// OLMSpecApplyConfiguration represents a declarative configuration of the OLMSpec type for use
+// with apply.
+type OLMSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// OLMSpecApplyConfiguration constructs a declarative configuration of the OLMSpec type for use with
+// apply.
+func OLMSpec() *OLMSpecApplyConfiguration {
+ return &OLMSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *OLMSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *OLMSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *OLMSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *OLMSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *OLMSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *OLMSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *OLMSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *OLMSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *OLMSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *OLMSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olmstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olmstatus.go
new file mode 100644
index 0000000000..be8e647f3a
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olmstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// OLMStatusApplyConfiguration represents a declarative configuration of the OLMStatus type for use
+// with apply.
+type OLMStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// OLMStatusApplyConfiguration constructs a declarative configuration of the OLMStatus type for use with
+// apply.
+func OLMStatus() *OLMStatusApplyConfiguration {
+ return &OLMStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *OLMStatusApplyConfiguration) WithObservedGeneration(value int64) *OLMStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *OLMStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *OLMStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *OLMStatusApplyConfiguration) WithVersion(value string) *OLMStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *OLMStatusApplyConfiguration) WithReadyReplicas(value int32) *OLMStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *OLMStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *OLMStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *OLMStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *OLMStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserver.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserver.go
new file mode 100644
index 0000000000..34bc2a1b11
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserver.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// OpenShiftAPIServerApplyConfiguration represents a declarative configuration of the OpenShiftAPIServer type for use
+// with apply.
+type OpenShiftAPIServerApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *OpenShiftAPIServerSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *OpenShiftAPIServerStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// OpenShiftAPIServer constructs a declarative configuration of the OpenShiftAPIServer type for use with
+// apply.
+func OpenShiftAPIServer(name string) *OpenShiftAPIServerApplyConfiguration {
+ b := &OpenShiftAPIServerApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("OpenShiftAPIServer")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractOpenShiftAPIServer extracts the applied configuration owned by fieldManager from
+// openShiftAPIServer. If no managedFields are found in openShiftAPIServer for fieldManager, a
+// OpenShiftAPIServerApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// openShiftAPIServer must be a unmodified OpenShiftAPIServer API object that was retrieved from the Kubernetes API.
+// ExtractOpenShiftAPIServer provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractOpenShiftAPIServer(openShiftAPIServer *apioperatorv1.OpenShiftAPIServer, fieldManager string) (*OpenShiftAPIServerApplyConfiguration, error) {
+ return extractOpenShiftAPIServer(openShiftAPIServer, fieldManager, "")
+}
+
+// ExtractOpenShiftAPIServerStatus is the same as ExtractOpenShiftAPIServer except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractOpenShiftAPIServerStatus(openShiftAPIServer *apioperatorv1.OpenShiftAPIServer, fieldManager string) (*OpenShiftAPIServerApplyConfiguration, error) {
+ return extractOpenShiftAPIServer(openShiftAPIServer, fieldManager, "status")
+}
+
+func extractOpenShiftAPIServer(openShiftAPIServer *apioperatorv1.OpenShiftAPIServer, fieldManager string, subresource string) (*OpenShiftAPIServerApplyConfiguration, error) {
+ b := &OpenShiftAPIServerApplyConfiguration{}
+ err := managedfields.ExtractInto(openShiftAPIServer, internal.Parser().Type("com.github.openshift.api.operator.v1.OpenShiftAPIServer"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(openShiftAPIServer.Name)
+
+ b.WithKind("OpenShiftAPIServer")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithKind(value string) *OpenShiftAPIServerApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithAPIVersion(value string) *OpenShiftAPIServerApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithName(value string) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithGenerateName(value string) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithNamespace(value string) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithUID(value types.UID) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithResourceVersion(value string) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithGeneration(value int64) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *OpenShiftAPIServerApplyConfiguration) WithLabels(entries map[string]string) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *OpenShiftAPIServerApplyConfiguration) WithAnnotations(entries map[string]string) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *OpenShiftAPIServerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *OpenShiftAPIServerApplyConfiguration) WithFinalizers(values ...string) *OpenShiftAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *OpenShiftAPIServerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithSpec(value *OpenShiftAPIServerSpecApplyConfiguration) *OpenShiftAPIServerApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *OpenShiftAPIServerApplyConfiguration) WithStatus(value *OpenShiftAPIServerStatusApplyConfiguration) *OpenShiftAPIServerApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *OpenShiftAPIServerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserverspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserverspec.go
new file mode 100644
index 0000000000..1e5545164e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserverspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// OpenShiftAPIServerSpecApplyConfiguration represents a declarative configuration of the OpenShiftAPIServerSpec type for use
+// with apply.
+type OpenShiftAPIServerSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// OpenShiftAPIServerSpecApplyConfiguration constructs a declarative configuration of the OpenShiftAPIServerSpec type for use with
+// apply.
+func OpenShiftAPIServerSpec() *OpenShiftAPIServerSpecApplyConfiguration {
+ return &OpenShiftAPIServerSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *OpenShiftAPIServerSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *OpenShiftAPIServerSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *OpenShiftAPIServerSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *OpenShiftAPIServerSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *OpenShiftAPIServerSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *OpenShiftAPIServerSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *OpenShiftAPIServerSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *OpenShiftAPIServerSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *OpenShiftAPIServerSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *OpenShiftAPIServerSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserverstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserverstatus.go
new file mode 100644
index 0000000000..8abe09c0a2
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserverstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// OpenShiftAPIServerStatusApplyConfiguration represents a declarative configuration of the OpenShiftAPIServerStatus type for use
+// with apply.
+type OpenShiftAPIServerStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// OpenShiftAPIServerStatusApplyConfiguration constructs a declarative configuration of the OpenShiftAPIServerStatus type for use with
+// apply.
+func OpenShiftAPIServerStatus() *OpenShiftAPIServerStatusApplyConfiguration {
+ return &OpenShiftAPIServerStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *OpenShiftAPIServerStatusApplyConfiguration) WithObservedGeneration(value int64) *OpenShiftAPIServerStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *OpenShiftAPIServerStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *OpenShiftAPIServerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *OpenShiftAPIServerStatusApplyConfiguration) WithVersion(value string) *OpenShiftAPIServerStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *OpenShiftAPIServerStatusApplyConfiguration) WithReadyReplicas(value int32) *OpenShiftAPIServerStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *OpenShiftAPIServerStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *OpenShiftAPIServerStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *OpenShiftAPIServerStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *OpenShiftAPIServerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanager.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanager.go
new file mode 100644
index 0000000000..d72eb42c7e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanager.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// OpenShiftControllerManagerApplyConfiguration represents a declarative configuration of the OpenShiftControllerManager type for use
+// with apply.
+type OpenShiftControllerManagerApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *OpenShiftControllerManagerSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *OpenShiftControllerManagerStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// OpenShiftControllerManager constructs a declarative configuration of the OpenShiftControllerManager type for use with
+// apply.
+func OpenShiftControllerManager(name string) *OpenShiftControllerManagerApplyConfiguration {
+ b := &OpenShiftControllerManagerApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("OpenShiftControllerManager")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractOpenShiftControllerManager extracts the applied configuration owned by fieldManager from
+// openShiftControllerManager. If no managedFields are found in openShiftControllerManager for fieldManager, a
+// OpenShiftControllerManagerApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// openShiftControllerManager must be a unmodified OpenShiftControllerManager API object that was retrieved from the Kubernetes API.
+// ExtractOpenShiftControllerManager provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractOpenShiftControllerManager(openShiftControllerManager *apioperatorv1.OpenShiftControllerManager, fieldManager string) (*OpenShiftControllerManagerApplyConfiguration, error) {
+ return extractOpenShiftControllerManager(openShiftControllerManager, fieldManager, "")
+}
+
+// ExtractOpenShiftControllerManagerStatus is the same as ExtractOpenShiftControllerManager except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractOpenShiftControllerManagerStatus(openShiftControllerManager *apioperatorv1.OpenShiftControllerManager, fieldManager string) (*OpenShiftControllerManagerApplyConfiguration, error) {
+ return extractOpenShiftControllerManager(openShiftControllerManager, fieldManager, "status")
+}
+
+func extractOpenShiftControllerManager(openShiftControllerManager *apioperatorv1.OpenShiftControllerManager, fieldManager string, subresource string) (*OpenShiftControllerManagerApplyConfiguration, error) {
+ b := &OpenShiftControllerManagerApplyConfiguration{}
+ err := managedfields.ExtractInto(openShiftControllerManager, internal.Parser().Type("com.github.openshift.api.operator.v1.OpenShiftControllerManager"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(openShiftControllerManager.Name)
+
+ b.WithKind("OpenShiftControllerManager")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithKind(value string) *OpenShiftControllerManagerApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithAPIVersion(value string) *OpenShiftControllerManagerApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithName(value string) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithGenerateName(value string) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithNamespace(value string) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithUID(value types.UID) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithResourceVersion(value string) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithGeneration(value int64) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithLabels(entries map[string]string) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithAnnotations(entries map[string]string) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithFinalizers(values ...string) *OpenShiftControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *OpenShiftControllerManagerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithSpec(value *OpenShiftControllerManagerSpecApplyConfiguration) *OpenShiftControllerManagerApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *OpenShiftControllerManagerApplyConfiguration) WithStatus(value *OpenShiftControllerManagerStatusApplyConfiguration) *OpenShiftControllerManagerApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *OpenShiftControllerManagerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanagerspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanagerspec.go
new file mode 100644
index 0000000000..feea2556f0
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanagerspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// OpenShiftControllerManagerSpecApplyConfiguration represents a declarative configuration of the OpenShiftControllerManagerSpec type for use
+// with apply.
+type OpenShiftControllerManagerSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// OpenShiftControllerManagerSpecApplyConfiguration constructs a declarative configuration of the OpenShiftControllerManagerSpec type for use with
+// apply.
+func OpenShiftControllerManagerSpec() *OpenShiftControllerManagerSpecApplyConfiguration {
+ return &OpenShiftControllerManagerSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *OpenShiftControllerManagerSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *OpenShiftControllerManagerSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *OpenShiftControllerManagerSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *OpenShiftControllerManagerSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *OpenShiftControllerManagerSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *OpenShiftControllerManagerSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *OpenShiftControllerManagerSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *OpenShiftControllerManagerSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *OpenShiftControllerManagerSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *OpenShiftControllerManagerSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanagerstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanagerstatus.go
new file mode 100644
index 0000000000..77cffb09f5
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanagerstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// OpenShiftControllerManagerStatusApplyConfiguration represents a declarative configuration of the OpenShiftControllerManagerStatus type for use
+// with apply.
+type OpenShiftControllerManagerStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// OpenShiftControllerManagerStatusApplyConfiguration constructs a declarative configuration of the OpenShiftControllerManagerStatus type for use with
+// apply.
+func OpenShiftControllerManagerStatus() *OpenShiftControllerManagerStatusApplyConfiguration {
+ return &OpenShiftControllerManagerStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *OpenShiftControllerManagerStatusApplyConfiguration) WithObservedGeneration(value int64) *OpenShiftControllerManagerStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *OpenShiftControllerManagerStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *OpenShiftControllerManagerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *OpenShiftControllerManagerStatusApplyConfiguration) WithVersion(value string) *OpenShiftControllerManagerStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *OpenShiftControllerManagerStatusApplyConfiguration) WithReadyReplicas(value int32) *OpenShiftControllerManagerStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *OpenShiftControllerManagerStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *OpenShiftControllerManagerStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *OpenShiftControllerManagerStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *OpenShiftControllerManagerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftsdnconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftsdnconfig.go
new file mode 100644
index 0000000000..416f9099c3
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftsdnconfig.go
@@ -0,0 +1,63 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// OpenShiftSDNConfigApplyConfiguration represents a declarative configuration of the OpenShiftSDNConfig type for use
+// with apply.
+type OpenShiftSDNConfigApplyConfiguration struct {
+ Mode *v1.SDNMode `json:"mode,omitempty"`
+ VXLANPort *uint32 `json:"vxlanPort,omitempty"`
+ MTU *uint32 `json:"mtu,omitempty"`
+ UseExternalOpenvswitch *bool `json:"useExternalOpenvswitch,omitempty"`
+ EnableUnidling *bool `json:"enableUnidling,omitempty"`
+}
+
+// OpenShiftSDNConfigApplyConfiguration constructs a declarative configuration of the OpenShiftSDNConfig type for use with
+// apply.
+func OpenShiftSDNConfig() *OpenShiftSDNConfigApplyConfiguration {
+ return &OpenShiftSDNConfigApplyConfiguration{}
+}
+
+// WithMode sets the Mode field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Mode field is set to the value of the last call.
+func (b *OpenShiftSDNConfigApplyConfiguration) WithMode(value v1.SDNMode) *OpenShiftSDNConfigApplyConfiguration {
+ b.Mode = &value
+ return b
+}
+
+// WithVXLANPort sets the VXLANPort field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the VXLANPort field is set to the value of the last call.
+func (b *OpenShiftSDNConfigApplyConfiguration) WithVXLANPort(value uint32) *OpenShiftSDNConfigApplyConfiguration {
+ b.VXLANPort = &value
+ return b
+}
+
+// WithMTU sets the MTU field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MTU field is set to the value of the last call.
+func (b *OpenShiftSDNConfigApplyConfiguration) WithMTU(value uint32) *OpenShiftSDNConfigApplyConfiguration {
+ b.MTU = &value
+ return b
+}
+
+// WithUseExternalOpenvswitch sets the UseExternalOpenvswitch field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UseExternalOpenvswitch field is set to the value of the last call.
+func (b *OpenShiftSDNConfigApplyConfiguration) WithUseExternalOpenvswitch(value bool) *OpenShiftSDNConfigApplyConfiguration {
+ b.UseExternalOpenvswitch = &value
+ return b
+}
+
+// WithEnableUnidling sets the EnableUnidling field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the EnableUnidling field is set to the value of the last call.
+func (b *OpenShiftSDNConfigApplyConfiguration) WithEnableUnidling(value bool) *OpenShiftSDNConfigApplyConfiguration {
+ b.EnableUnidling = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openstackloadbalancerparameters.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openstackloadbalancerparameters.go
new file mode 100644
index 0000000000..811b2330b7
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openstackloadbalancerparameters.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// OpenStackLoadBalancerParametersApplyConfiguration represents a declarative configuration of the OpenStackLoadBalancerParameters type for use
+// with apply.
+type OpenStackLoadBalancerParametersApplyConfiguration struct {
+ FloatingIP *string `json:"floatingIP,omitempty"`
+}
+
+// OpenStackLoadBalancerParametersApplyConfiguration constructs a declarative configuration of the OpenStackLoadBalancerParameters type for use with
+// apply.
+func OpenStackLoadBalancerParameters() *OpenStackLoadBalancerParametersApplyConfiguration {
+ return &OpenStackLoadBalancerParametersApplyConfiguration{}
+}
+
+// WithFloatingIP sets the FloatingIP field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the FloatingIP field is set to the value of the last call.
+func (b *OpenStackLoadBalancerParametersApplyConfiguration) WithFloatingIP(value string) *OpenStackLoadBalancerParametersApplyConfiguration {
+ b.FloatingIP = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorcondition.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorcondition.go
new file mode 100644
index 0000000000..974f12d165
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorcondition.go
@@ -0,0 +1,64 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// OperatorConditionApplyConfiguration represents a declarative configuration of the OperatorCondition type for use
+// with apply.
+type OperatorConditionApplyConfiguration struct {
+ Type *string `json:"type,omitempty"`
+ Status *v1.ConditionStatus `json:"status,omitempty"`
+ LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
+ Reason *string `json:"reason,omitempty"`
+ Message *string `json:"message,omitempty"`
+}
+
+// OperatorConditionApplyConfiguration constructs a declarative configuration of the OperatorCondition type for use with
+// apply.
+func OperatorCondition() *OperatorConditionApplyConfiguration {
+ return &OperatorConditionApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *OperatorConditionApplyConfiguration) WithType(value string) *OperatorConditionApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *OperatorConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *OperatorConditionApplyConfiguration {
+ b.Status = &value
+ return b
+}
+
+// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LastTransitionTime field is set to the value of the last call.
+func (b *OperatorConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *OperatorConditionApplyConfiguration {
+ b.LastTransitionTime = &value
+ return b
+}
+
+// WithReason sets the Reason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Reason field is set to the value of the last call.
+func (b *OperatorConditionApplyConfiguration) WithReason(value string) *OperatorConditionApplyConfiguration {
+ b.Reason = &value
+ return b
+}
+
+// WithMessage sets the Message field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Message field is set to the value of the last call.
+func (b *OperatorConditionApplyConfiguration) WithMessage(value string) *OperatorConditionApplyConfiguration {
+ b.Message = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorspec.go
new file mode 100644
index 0000000000..acbba63c5f
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorspec.go
@@ -0,0 +1,64 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// OperatorSpecApplyConfiguration represents a declarative configuration of the OperatorSpec type for use
+// with apply.
+type OperatorSpecApplyConfiguration struct {
+ ManagementState *v1.ManagementState `json:"managementState,omitempty"`
+ LogLevel *v1.LogLevel `json:"logLevel,omitempty"`
+ OperatorLogLevel *v1.LogLevel `json:"operatorLogLevel,omitempty"`
+ UnsupportedConfigOverrides *runtime.RawExtension `json:"unsupportedConfigOverrides,omitempty"`
+ ObservedConfig *runtime.RawExtension `json:"observedConfig,omitempty"`
+}
+
+// OperatorSpecApplyConfiguration constructs a declarative configuration of the OperatorSpec type for use with
+// apply.
+func OperatorSpec() *OperatorSpecApplyConfiguration {
+ return &OperatorSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *OperatorSpecApplyConfiguration) WithManagementState(value v1.ManagementState) *OperatorSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *OperatorSpecApplyConfiguration) WithLogLevel(value v1.LogLevel) *OperatorSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *OperatorSpecApplyConfiguration) WithOperatorLogLevel(value v1.LogLevel) *OperatorSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *OperatorSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *OperatorSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *OperatorSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *OperatorSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorstatus.go
new file mode 100644
index 0000000000..45b43e453a
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorstatus.go
@@ -0,0 +1,78 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// OperatorStatusApplyConfiguration represents a declarative configuration of the OperatorStatus type for use
+// with apply.
+type OperatorStatusApplyConfiguration struct {
+ ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
+ Conditions []OperatorConditionApplyConfiguration `json:"conditions,omitempty"`
+ Version *string `json:"version,omitempty"`
+ ReadyReplicas *int32 `json:"readyReplicas,omitempty"`
+ LatestAvailableRevision *int32 `json:"latestAvailableRevision,omitempty"`
+ Generations []GenerationStatusApplyConfiguration `json:"generations,omitempty"`
+}
+
+// OperatorStatusApplyConfiguration constructs a declarative configuration of the OperatorStatus type for use with
+// apply.
+func OperatorStatus() *OperatorStatusApplyConfiguration {
+ return &OperatorStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *OperatorStatusApplyConfiguration) WithObservedGeneration(value int64) *OperatorStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *OperatorStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *OperatorStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *OperatorStatusApplyConfiguration) WithVersion(value string) *OperatorStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *OperatorStatusApplyConfiguration) WithReadyReplicas(value int32) *OperatorStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *OperatorStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *OperatorStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *OperatorStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *OperatorStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ovnkubernetesconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ovnkubernetesconfig.go
new file mode 100644
index 0000000000..9d878cea91
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ovnkubernetesconfig.go
@@ -0,0 +1,126 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// OVNKubernetesConfigApplyConfiguration represents a declarative configuration of the OVNKubernetesConfig type for use
+// with apply.
+type OVNKubernetesConfigApplyConfiguration struct {
+ MTU *uint32 `json:"mtu,omitempty"`
+ GenevePort *uint32 `json:"genevePort,omitempty"`
+ HybridOverlayConfig *HybridOverlayConfigApplyConfiguration `json:"hybridOverlayConfig,omitempty"`
+ IPsecConfig *IPsecConfigApplyConfiguration `json:"ipsecConfig,omitempty"`
+ PolicyAuditConfig *PolicyAuditConfigApplyConfiguration `json:"policyAuditConfig,omitempty"`
+ GatewayConfig *GatewayConfigApplyConfiguration `json:"gatewayConfig,omitempty"`
+ V4InternalSubnet *string `json:"v4InternalSubnet,omitempty"`
+ V6InternalSubnet *string `json:"v6InternalSubnet,omitempty"`
+ EgressIPConfig *EgressIPConfigApplyConfiguration `json:"egressIPConfig,omitempty"`
+ IPv4 *IPv4OVNKubernetesConfigApplyConfiguration `json:"ipv4,omitempty"`
+ IPv6 *IPv6OVNKubernetesConfigApplyConfiguration `json:"ipv6,omitempty"`
+ RouteAdvertisements *operatorv1.RouteAdvertisementsEnablement `json:"routeAdvertisements,omitempty"`
+}
+
+// OVNKubernetesConfigApplyConfiguration constructs a declarative configuration of the OVNKubernetesConfig type for use with
+// apply.
+func OVNKubernetesConfig() *OVNKubernetesConfigApplyConfiguration {
+ return &OVNKubernetesConfigApplyConfiguration{}
+}
+
+// WithMTU sets the MTU field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MTU field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithMTU(value uint32) *OVNKubernetesConfigApplyConfiguration {
+ b.MTU = &value
+ return b
+}
+
+// WithGenevePort sets the GenevePort field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenevePort field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithGenevePort(value uint32) *OVNKubernetesConfigApplyConfiguration {
+ b.GenevePort = &value
+ return b
+}
+
+// WithHybridOverlayConfig sets the HybridOverlayConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the HybridOverlayConfig field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithHybridOverlayConfig(value *HybridOverlayConfigApplyConfiguration) *OVNKubernetesConfigApplyConfiguration {
+ b.HybridOverlayConfig = value
+ return b
+}
+
+// WithIPsecConfig sets the IPsecConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IPsecConfig field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithIPsecConfig(value *IPsecConfigApplyConfiguration) *OVNKubernetesConfigApplyConfiguration {
+ b.IPsecConfig = value
+ return b
+}
+
+// WithPolicyAuditConfig sets the PolicyAuditConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the PolicyAuditConfig field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithPolicyAuditConfig(value *PolicyAuditConfigApplyConfiguration) *OVNKubernetesConfigApplyConfiguration {
+ b.PolicyAuditConfig = value
+ return b
+}
+
+// WithGatewayConfig sets the GatewayConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GatewayConfig field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithGatewayConfig(value *GatewayConfigApplyConfiguration) *OVNKubernetesConfigApplyConfiguration {
+ b.GatewayConfig = value
+ return b
+}
+
+// WithV4InternalSubnet sets the V4InternalSubnet field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the V4InternalSubnet field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithV4InternalSubnet(value string) *OVNKubernetesConfigApplyConfiguration {
+ b.V4InternalSubnet = &value
+ return b
+}
+
+// WithV6InternalSubnet sets the V6InternalSubnet field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the V6InternalSubnet field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithV6InternalSubnet(value string) *OVNKubernetesConfigApplyConfiguration {
+ b.V6InternalSubnet = &value
+ return b
+}
+
+// WithEgressIPConfig sets the EgressIPConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the EgressIPConfig field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithEgressIPConfig(value *EgressIPConfigApplyConfiguration) *OVNKubernetesConfigApplyConfiguration {
+ b.EgressIPConfig = value
+ return b
+}
+
+// WithIPv4 sets the IPv4 field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IPv4 field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithIPv4(value *IPv4OVNKubernetesConfigApplyConfiguration) *OVNKubernetesConfigApplyConfiguration {
+ b.IPv4 = value
+ return b
+}
+
+// WithIPv6 sets the IPv6 field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IPv6 field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithIPv6(value *IPv6OVNKubernetesConfigApplyConfiguration) *OVNKubernetesConfigApplyConfiguration {
+ b.IPv6 = value
+ return b
+}
+
+// WithRouteAdvertisements sets the RouteAdvertisements field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RouteAdvertisements field is set to the value of the last call.
+func (b *OVNKubernetesConfigApplyConfiguration) WithRouteAdvertisements(value operatorv1.RouteAdvertisementsEnablement) *OVNKubernetesConfigApplyConfiguration {
+ b.RouteAdvertisements = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/partialselector.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/partialselector.go
new file mode 100644
index 0000000000..0403575977
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/partialselector.go
@@ -0,0 +1,27 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// PartialSelectorApplyConfiguration represents a declarative configuration of the PartialSelector type for use
+// with apply.
+type PartialSelectorApplyConfiguration struct {
+ MachineResourceSelector *v1.LabelSelectorApplyConfiguration `json:"machineResourceSelector,omitempty"`
+}
+
+// PartialSelectorApplyConfiguration constructs a declarative configuration of the PartialSelector type for use with
+// apply.
+func PartialSelector() *PartialSelectorApplyConfiguration {
+ return &PartialSelectorApplyConfiguration{}
+}
+
+// WithMachineResourceSelector sets the MachineResourceSelector field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MachineResourceSelector field is set to the value of the last call.
+func (b *PartialSelectorApplyConfiguration) WithMachineResourceSelector(value *v1.LabelSelectorApplyConfiguration) *PartialSelectorApplyConfiguration {
+ b.MachineResourceSelector = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/perspective.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/perspective.go
new file mode 100644
index 0000000000..1e59477b39
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/perspective.go
@@ -0,0 +1,53 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// PerspectiveApplyConfiguration represents a declarative configuration of the Perspective type for use
+// with apply.
+type PerspectiveApplyConfiguration struct {
+ ID *string `json:"id,omitempty"`
+ Visibility *PerspectiveVisibilityApplyConfiguration `json:"visibility,omitempty"`
+ PinnedResources *[]PinnedResourceReferenceApplyConfiguration `json:"pinnedResources,omitempty"`
+}
+
+// PerspectiveApplyConfiguration constructs a declarative configuration of the Perspective type for use with
+// apply.
+func Perspective() *PerspectiveApplyConfiguration {
+ return &PerspectiveApplyConfiguration{}
+}
+
+// WithID sets the ID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ID field is set to the value of the last call.
+func (b *PerspectiveApplyConfiguration) WithID(value string) *PerspectiveApplyConfiguration {
+ b.ID = &value
+ return b
+}
+
+// WithVisibility sets the Visibility field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Visibility field is set to the value of the last call.
+func (b *PerspectiveApplyConfiguration) WithVisibility(value *PerspectiveVisibilityApplyConfiguration) *PerspectiveApplyConfiguration {
+ b.Visibility = value
+ return b
+}
+
+func (b *PerspectiveApplyConfiguration) ensurePinnedResourceReferenceApplyConfigurationExists() {
+ if b.PinnedResources == nil {
+ b.PinnedResources = &[]PinnedResourceReferenceApplyConfiguration{}
+ }
+}
+
+// WithPinnedResources adds the given value to the PinnedResources field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the PinnedResources field.
+func (b *PerspectiveApplyConfiguration) WithPinnedResources(values ...*PinnedResourceReferenceApplyConfiguration) *PerspectiveApplyConfiguration {
+ b.ensurePinnedResourceReferenceApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithPinnedResources")
+ }
+ *b.PinnedResources = append(*b.PinnedResources, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/perspectivevisibility.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/perspectivevisibility.go
new file mode 100644
index 0000000000..1dd11f8000
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/perspectivevisibility.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// PerspectiveVisibilityApplyConfiguration represents a declarative configuration of the PerspectiveVisibility type for use
+// with apply.
+type PerspectiveVisibilityApplyConfiguration struct {
+ State *v1.PerspectiveState `json:"state,omitempty"`
+ AccessReview *ResourceAttributesAccessReviewApplyConfiguration `json:"accessReview,omitempty"`
+}
+
+// PerspectiveVisibilityApplyConfiguration constructs a declarative configuration of the PerspectiveVisibility type for use with
+// apply.
+func PerspectiveVisibility() *PerspectiveVisibilityApplyConfiguration {
+ return &PerspectiveVisibilityApplyConfiguration{}
+}
+
+// WithState sets the State field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the State field is set to the value of the last call.
+func (b *PerspectiveVisibilityApplyConfiguration) WithState(value v1.PerspectiveState) *PerspectiveVisibilityApplyConfiguration {
+ b.State = &value
+ return b
+}
+
+// WithAccessReview sets the AccessReview field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the AccessReview field is set to the value of the last call.
+func (b *PerspectiveVisibilityApplyConfiguration) WithAccessReview(value *ResourceAttributesAccessReviewApplyConfiguration) *PerspectiveVisibilityApplyConfiguration {
+ b.AccessReview = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/pinnedresourcereference.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/pinnedresourcereference.go
new file mode 100644
index 0000000000..7a041847c1
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/pinnedresourcereference.go
@@ -0,0 +1,41 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// PinnedResourceReferenceApplyConfiguration represents a declarative configuration of the PinnedResourceReference type for use
+// with apply.
+type PinnedResourceReferenceApplyConfiguration struct {
+ Group *string `json:"group,omitempty"`
+ Version *string `json:"version,omitempty"`
+ Resource *string `json:"resource,omitempty"`
+}
+
+// PinnedResourceReferenceApplyConfiguration constructs a declarative configuration of the PinnedResourceReference type for use with
+// apply.
+func PinnedResourceReference() *PinnedResourceReferenceApplyConfiguration {
+ return &PinnedResourceReferenceApplyConfiguration{}
+}
+
+// WithGroup sets the Group field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Group field is set to the value of the last call.
+func (b *PinnedResourceReferenceApplyConfiguration) WithGroup(value string) *PinnedResourceReferenceApplyConfiguration {
+ b.Group = &value
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *PinnedResourceReferenceApplyConfiguration) WithVersion(value string) *PinnedResourceReferenceApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithResource sets the Resource field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Resource field is set to the value of the last call.
+func (b *PinnedResourceReferenceApplyConfiguration) WithResource(value string) *PinnedResourceReferenceApplyConfiguration {
+ b.Resource = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/policyauditconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/policyauditconfig.go
new file mode 100644
index 0000000000..2886a4e413
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/policyauditconfig.go
@@ -0,0 +1,59 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// PolicyAuditConfigApplyConfiguration represents a declarative configuration of the PolicyAuditConfig type for use
+// with apply.
+type PolicyAuditConfigApplyConfiguration struct {
+ RateLimit *uint32 `json:"rateLimit,omitempty"`
+ MaxFileSize *uint32 `json:"maxFileSize,omitempty"`
+ MaxLogFiles *int32 `json:"maxLogFiles,omitempty"`
+ Destination *string `json:"destination,omitempty"`
+ SyslogFacility *string `json:"syslogFacility,omitempty"`
+}
+
+// PolicyAuditConfigApplyConfiguration constructs a declarative configuration of the PolicyAuditConfig type for use with
+// apply.
+func PolicyAuditConfig() *PolicyAuditConfigApplyConfiguration {
+ return &PolicyAuditConfigApplyConfiguration{}
+}
+
+// WithRateLimit sets the RateLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RateLimit field is set to the value of the last call.
+func (b *PolicyAuditConfigApplyConfiguration) WithRateLimit(value uint32) *PolicyAuditConfigApplyConfiguration {
+ b.RateLimit = &value
+ return b
+}
+
+// WithMaxFileSize sets the MaxFileSize field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MaxFileSize field is set to the value of the last call.
+func (b *PolicyAuditConfigApplyConfiguration) WithMaxFileSize(value uint32) *PolicyAuditConfigApplyConfiguration {
+ b.MaxFileSize = &value
+ return b
+}
+
+// WithMaxLogFiles sets the MaxLogFiles field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MaxLogFiles field is set to the value of the last call.
+func (b *PolicyAuditConfigApplyConfiguration) WithMaxLogFiles(value int32) *PolicyAuditConfigApplyConfiguration {
+ b.MaxLogFiles = &value
+ return b
+}
+
+// WithDestination sets the Destination field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Destination field is set to the value of the last call.
+func (b *PolicyAuditConfigApplyConfiguration) WithDestination(value string) *PolicyAuditConfigApplyConfiguration {
+ b.Destination = &value
+ return b
+}
+
+// WithSyslogFacility sets the SyslogFacility field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SyslogFacility field is set to the value of the last call.
+func (b *PolicyAuditConfigApplyConfiguration) WithSyslogFacility(value string) *PolicyAuditConfigApplyConfiguration {
+ b.SyslogFacility = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/privatestrategy.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/privatestrategy.go
new file mode 100644
index 0000000000..4154e999d7
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/privatestrategy.go
@@ -0,0 +1,27 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// PrivateStrategyApplyConfiguration represents a declarative configuration of the PrivateStrategy type for use
+// with apply.
+type PrivateStrategyApplyConfiguration struct {
+ Protocol *v1.IngressControllerProtocol `json:"protocol,omitempty"`
+}
+
+// PrivateStrategyApplyConfiguration constructs a declarative configuration of the PrivateStrategy type for use with
+// apply.
+func PrivateStrategy() *PrivateStrategyApplyConfiguration {
+ return &PrivateStrategyApplyConfiguration{}
+}
+
+// WithProtocol sets the Protocol field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Protocol field is set to the value of the last call.
+func (b *PrivateStrategyApplyConfiguration) WithProtocol(value v1.IngressControllerProtocol) *PrivateStrategyApplyConfiguration {
+ b.Protocol = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/projectaccess.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/projectaccess.go
new file mode 100644
index 0000000000..22d5dc4897
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/projectaccess.go
@@ -0,0 +1,25 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ProjectAccessApplyConfiguration represents a declarative configuration of the ProjectAccess type for use
+// with apply.
+type ProjectAccessApplyConfiguration struct {
+ AvailableClusterRoles []string `json:"availableClusterRoles,omitempty"`
+}
+
+// ProjectAccessApplyConfiguration constructs a declarative configuration of the ProjectAccess type for use with
+// apply.
+func ProjectAccess() *ProjectAccessApplyConfiguration {
+ return &ProjectAccessApplyConfiguration{}
+}
+
+// WithAvailableClusterRoles adds the given value to the AvailableClusterRoles field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the AvailableClusterRoles field.
+func (b *ProjectAccessApplyConfiguration) WithAvailableClusterRoles(values ...string) *ProjectAccessApplyConfiguration {
+ for i := range values {
+ b.AvailableClusterRoles = append(b.AvailableClusterRoles, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/providerloadbalancerparameters.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/providerloadbalancerparameters.go
new file mode 100644
index 0000000000..6f86757642
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/providerloadbalancerparameters.go
@@ -0,0 +1,63 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// ProviderLoadBalancerParametersApplyConfiguration represents a declarative configuration of the ProviderLoadBalancerParameters type for use
+// with apply.
+type ProviderLoadBalancerParametersApplyConfiguration struct {
+ Type *v1.LoadBalancerProviderType `json:"type,omitempty"`
+ AWS *AWSLoadBalancerParametersApplyConfiguration `json:"aws,omitempty"`
+ GCP *GCPLoadBalancerParametersApplyConfiguration `json:"gcp,omitempty"`
+ IBM *IBMLoadBalancerParametersApplyConfiguration `json:"ibm,omitempty"`
+ OpenStack *OpenStackLoadBalancerParametersApplyConfiguration `json:"openstack,omitempty"`
+}
+
+// ProviderLoadBalancerParametersApplyConfiguration constructs a declarative configuration of the ProviderLoadBalancerParameters type for use with
+// apply.
+func ProviderLoadBalancerParameters() *ProviderLoadBalancerParametersApplyConfiguration {
+ return &ProviderLoadBalancerParametersApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *ProviderLoadBalancerParametersApplyConfiguration) WithType(value v1.LoadBalancerProviderType) *ProviderLoadBalancerParametersApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithAWS sets the AWS field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the AWS field is set to the value of the last call.
+func (b *ProviderLoadBalancerParametersApplyConfiguration) WithAWS(value *AWSLoadBalancerParametersApplyConfiguration) *ProviderLoadBalancerParametersApplyConfiguration {
+ b.AWS = value
+ return b
+}
+
+// WithGCP sets the GCP field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GCP field is set to the value of the last call.
+func (b *ProviderLoadBalancerParametersApplyConfiguration) WithGCP(value *GCPLoadBalancerParametersApplyConfiguration) *ProviderLoadBalancerParametersApplyConfiguration {
+ b.GCP = value
+ return b
+}
+
+// WithIBM sets the IBM field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IBM field is set to the value of the last call.
+func (b *ProviderLoadBalancerParametersApplyConfiguration) WithIBM(value *IBMLoadBalancerParametersApplyConfiguration) *ProviderLoadBalancerParametersApplyConfiguration {
+ b.IBM = value
+ return b
+}
+
+// WithOpenStack sets the OpenStack field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OpenStack field is set to the value of the last call.
+func (b *ProviderLoadBalancerParametersApplyConfiguration) WithOpenStack(value *OpenStackLoadBalancerParametersApplyConfiguration) *ProviderLoadBalancerParametersApplyConfiguration {
+ b.OpenStack = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/proxyconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/proxyconfig.go
new file mode 100644
index 0000000000..334264d970
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/proxyconfig.go
@@ -0,0 +1,51 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// ProxyConfigApplyConfiguration represents a declarative configuration of the ProxyConfig type for use
+// with apply.
+type ProxyConfigApplyConfiguration struct {
+ IptablesSyncPeriod *string `json:"iptablesSyncPeriod,omitempty"`
+ BindAddress *string `json:"bindAddress,omitempty"`
+ ProxyArguments map[string]v1.ProxyArgumentList `json:"proxyArguments,omitempty"`
+}
+
+// ProxyConfigApplyConfiguration constructs a declarative configuration of the ProxyConfig type for use with
+// apply.
+func ProxyConfig() *ProxyConfigApplyConfiguration {
+ return &ProxyConfigApplyConfiguration{}
+}
+
+// WithIptablesSyncPeriod sets the IptablesSyncPeriod field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IptablesSyncPeriod field is set to the value of the last call.
+func (b *ProxyConfigApplyConfiguration) WithIptablesSyncPeriod(value string) *ProxyConfigApplyConfiguration {
+ b.IptablesSyncPeriod = &value
+ return b
+}
+
+// WithBindAddress sets the BindAddress field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the BindAddress field is set to the value of the last call.
+func (b *ProxyConfigApplyConfiguration) WithBindAddress(value string) *ProxyConfigApplyConfiguration {
+ b.BindAddress = &value
+ return b
+}
+
+// WithProxyArguments puts the entries into the ProxyArguments field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the ProxyArguments field,
+// overwriting an existing map entries in ProxyArguments field with the same key.
+func (b *ProxyConfigApplyConfiguration) WithProxyArguments(entries map[string]v1.ProxyArgumentList) *ProxyConfigApplyConfiguration {
+ if b.ProxyArguments == nil && len(entries) > 0 {
+ b.ProxyArguments = make(map[string]v1.ProxyArgumentList, len(entries))
+ }
+ for k, v := range entries {
+ b.ProxyArguments[k] = v
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/quickstarts.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/quickstarts.go
new file mode 100644
index 0000000000..f32ee57080
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/quickstarts.go
@@ -0,0 +1,25 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// QuickStartsApplyConfiguration represents a declarative configuration of the QuickStarts type for use
+// with apply.
+type QuickStartsApplyConfiguration struct {
+ Disabled []string `json:"disabled,omitempty"`
+}
+
+// QuickStartsApplyConfiguration constructs a declarative configuration of the QuickStarts type for use with
+// apply.
+func QuickStarts() *QuickStartsApplyConfiguration {
+ return &QuickStartsApplyConfiguration{}
+}
+
+// WithDisabled adds the given value to the Disabled field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Disabled field.
+func (b *QuickStartsApplyConfiguration) WithDisabled(values ...string) *QuickStartsApplyConfiguration {
+ for i := range values {
+ b.Disabled = append(b.Disabled, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/reloadservice.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/reloadservice.go
new file mode 100644
index 0000000000..5eb52c9f09
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/reloadservice.go
@@ -0,0 +1,27 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// ReloadServiceApplyConfiguration represents a declarative configuration of the ReloadService type for use
+// with apply.
+type ReloadServiceApplyConfiguration struct {
+ ServiceName *v1.NodeDisruptionPolicyServiceName `json:"serviceName,omitempty"`
+}
+
+// ReloadServiceApplyConfiguration constructs a declarative configuration of the ReloadService type for use with
+// apply.
+func ReloadService() *ReloadServiceApplyConfiguration {
+ return &ReloadServiceApplyConfiguration{}
+}
+
+// WithServiceName sets the ServiceName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ServiceName field is set to the value of the last call.
+func (b *ReloadServiceApplyConfiguration) WithServiceName(value v1.NodeDisruptionPolicyServiceName) *ReloadServiceApplyConfiguration {
+ b.ServiceName = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/resourceattributesaccessreview.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/resourceattributesaccessreview.go
new file mode 100644
index 0000000000..8e4b249663
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/resourceattributesaccessreview.go
@@ -0,0 +1,40 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/api/authorization/v1"
+)
+
+// ResourceAttributesAccessReviewApplyConfiguration represents a declarative configuration of the ResourceAttributesAccessReview type for use
+// with apply.
+type ResourceAttributesAccessReviewApplyConfiguration struct {
+ Required []v1.ResourceAttributes `json:"required,omitempty"`
+ Missing []v1.ResourceAttributes `json:"missing,omitempty"`
+}
+
+// ResourceAttributesAccessReviewApplyConfiguration constructs a declarative configuration of the ResourceAttributesAccessReview type for use with
+// apply.
+func ResourceAttributesAccessReview() *ResourceAttributesAccessReviewApplyConfiguration {
+ return &ResourceAttributesAccessReviewApplyConfiguration{}
+}
+
+// WithRequired adds the given value to the Required field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Required field.
+func (b *ResourceAttributesAccessReviewApplyConfiguration) WithRequired(values ...v1.ResourceAttributes) *ResourceAttributesAccessReviewApplyConfiguration {
+ for i := range values {
+ b.Required = append(b.Required, values[i])
+ }
+ return b
+}
+
+// WithMissing adds the given value to the Missing field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Missing field.
+func (b *ResourceAttributesAccessReviewApplyConfiguration) WithMissing(values ...v1.ResourceAttributes) *ResourceAttributesAccessReviewApplyConfiguration {
+ for i := range values {
+ b.Missing = append(b.Missing, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/restartservice.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/restartservice.go
new file mode 100644
index 0000000000..54b9051a30
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/restartservice.go
@@ -0,0 +1,27 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// RestartServiceApplyConfiguration represents a declarative configuration of the RestartService type for use
+// with apply.
+type RestartServiceApplyConfiguration struct {
+ ServiceName *v1.NodeDisruptionPolicyServiceName `json:"serviceName,omitempty"`
+}
+
+// RestartServiceApplyConfiguration constructs a declarative configuration of the RestartService type for use with
+// apply.
+func RestartService() *RestartServiceApplyConfiguration {
+ return &RestartServiceApplyConfiguration{}
+}
+
+// WithServiceName sets the ServiceName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ServiceName field is set to the value of the last call.
+func (b *RestartServiceApplyConfiguration) WithServiceName(value v1.NodeDisruptionPolicyServiceName) *RestartServiceApplyConfiguration {
+ b.ServiceName = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/routeadmissionpolicy.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/routeadmissionpolicy.go
new file mode 100644
index 0000000000..d513551232
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/routeadmissionpolicy.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// RouteAdmissionPolicyApplyConfiguration represents a declarative configuration of the RouteAdmissionPolicy type for use
+// with apply.
+type RouteAdmissionPolicyApplyConfiguration struct {
+ NamespaceOwnership *v1.NamespaceOwnershipCheck `json:"namespaceOwnership,omitempty"`
+ WildcardPolicy *v1.WildcardPolicy `json:"wildcardPolicy,omitempty"`
+}
+
+// RouteAdmissionPolicyApplyConfiguration constructs a declarative configuration of the RouteAdmissionPolicy type for use with
+// apply.
+func RouteAdmissionPolicy() *RouteAdmissionPolicyApplyConfiguration {
+ return &RouteAdmissionPolicyApplyConfiguration{}
+}
+
+// WithNamespaceOwnership sets the NamespaceOwnership field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the NamespaceOwnership field is set to the value of the last call.
+func (b *RouteAdmissionPolicyApplyConfiguration) WithNamespaceOwnership(value v1.NamespaceOwnershipCheck) *RouteAdmissionPolicyApplyConfiguration {
+ b.NamespaceOwnership = &value
+ return b
+}
+
+// WithWildcardPolicy sets the WildcardPolicy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the WildcardPolicy field is set to the value of the last call.
+func (b *RouteAdmissionPolicyApplyConfiguration) WithWildcardPolicy(value v1.WildcardPolicy) *RouteAdmissionPolicyApplyConfiguration {
+ b.WildcardPolicy = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/server.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/server.go
new file mode 100644
index 0000000000..e0eee5571b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/server.go
@@ -0,0 +1,43 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ServerApplyConfiguration represents a declarative configuration of the Server type for use
+// with apply.
+type ServerApplyConfiguration struct {
+ Name *string `json:"name,omitempty"`
+ Zones []string `json:"zones,omitempty"`
+ ForwardPlugin *ForwardPluginApplyConfiguration `json:"forwardPlugin,omitempty"`
+}
+
+// ServerApplyConfiguration constructs a declarative configuration of the Server type for use with
+// apply.
+func Server() *ServerApplyConfiguration {
+ return &ServerApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *ServerApplyConfiguration) WithName(value string) *ServerApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithZones adds the given value to the Zones field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Zones field.
+func (b *ServerApplyConfiguration) WithZones(values ...string) *ServerApplyConfiguration {
+ for i := range values {
+ b.Zones = append(b.Zones, values[i])
+ }
+ return b
+}
+
+// WithForwardPlugin sets the ForwardPlugin field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ForwardPlugin field is set to the value of the last call.
+func (b *ServerApplyConfiguration) WithForwardPlugin(value *ForwardPluginApplyConfiguration) *ServerApplyConfiguration {
+ b.ForwardPlugin = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/serviceaccountissuerstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/serviceaccountissuerstatus.go
new file mode 100644
index 0000000000..b8962296ff
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/serviceaccountissuerstatus.go
@@ -0,0 +1,36 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// ServiceAccountIssuerStatusApplyConfiguration represents a declarative configuration of the ServiceAccountIssuerStatus type for use
+// with apply.
+type ServiceAccountIssuerStatusApplyConfiguration struct {
+ Name *string `json:"name,omitempty"`
+ ExpirationTime *v1.Time `json:"expirationTime,omitempty"`
+}
+
+// ServiceAccountIssuerStatusApplyConfiguration constructs a declarative configuration of the ServiceAccountIssuerStatus type for use with
+// apply.
+func ServiceAccountIssuerStatus() *ServiceAccountIssuerStatusApplyConfiguration {
+ return &ServiceAccountIssuerStatusApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *ServiceAccountIssuerStatusApplyConfiguration) WithName(value string) *ServiceAccountIssuerStatusApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithExpirationTime sets the ExpirationTime field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ExpirationTime field is set to the value of the last call.
+func (b *ServiceAccountIssuerStatusApplyConfiguration) WithExpirationTime(value v1.Time) *ServiceAccountIssuerStatusApplyConfiguration {
+ b.ExpirationTime = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/serviceca.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/serviceca.go
new file mode 100644
index 0000000000..cceba5d9d8
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/serviceca.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// ServiceCAApplyConfiguration represents a declarative configuration of the ServiceCA type for use
+// with apply.
+type ServiceCAApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *ServiceCASpecApplyConfiguration `json:"spec,omitempty"`
+ Status *ServiceCAStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// ServiceCA constructs a declarative configuration of the ServiceCA type for use with
+// apply.
+func ServiceCA(name string) *ServiceCAApplyConfiguration {
+ b := &ServiceCAApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("ServiceCA")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractServiceCA extracts the applied configuration owned by fieldManager from
+// serviceCA. If no managedFields are found in serviceCA for fieldManager, a
+// ServiceCAApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// serviceCA must be a unmodified ServiceCA API object that was retrieved from the Kubernetes API.
+// ExtractServiceCA provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractServiceCA(serviceCA *apioperatorv1.ServiceCA, fieldManager string) (*ServiceCAApplyConfiguration, error) {
+ return extractServiceCA(serviceCA, fieldManager, "")
+}
+
+// ExtractServiceCAStatus is the same as ExtractServiceCA except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractServiceCAStatus(serviceCA *apioperatorv1.ServiceCA, fieldManager string) (*ServiceCAApplyConfiguration, error) {
+ return extractServiceCA(serviceCA, fieldManager, "status")
+}
+
+func extractServiceCA(serviceCA *apioperatorv1.ServiceCA, fieldManager string, subresource string) (*ServiceCAApplyConfiguration, error) {
+ b := &ServiceCAApplyConfiguration{}
+ err := managedfields.ExtractInto(serviceCA, internal.Parser().Type("com.github.openshift.api.operator.v1.ServiceCA"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(serviceCA.Name)
+
+ b.WithKind("ServiceCA")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithKind(value string) *ServiceCAApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithAPIVersion(value string) *ServiceCAApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithName(value string) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithGenerateName(value string) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithNamespace(value string) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithUID(value types.UID) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithResourceVersion(value string) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithGeneration(value int64) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *ServiceCAApplyConfiguration) WithLabels(entries map[string]string) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *ServiceCAApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *ServiceCAApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *ServiceCAApplyConfiguration) WithFinalizers(values ...string) *ServiceCAApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *ServiceCAApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithSpec(value *ServiceCASpecApplyConfiguration) *ServiceCAApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *ServiceCAApplyConfiguration) WithStatus(value *ServiceCAStatusApplyConfiguration) *ServiceCAApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ServiceCAApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecaspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecaspec.go
new file mode 100644
index 0000000000..c083e932e9
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecaspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// ServiceCASpecApplyConfiguration represents a declarative configuration of the ServiceCASpec type for use
+// with apply.
+type ServiceCASpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// ServiceCASpecApplyConfiguration constructs a declarative configuration of the ServiceCASpec type for use with
+// apply.
+func ServiceCASpec() *ServiceCASpecApplyConfiguration {
+ return &ServiceCASpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *ServiceCASpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *ServiceCASpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *ServiceCASpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *ServiceCASpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *ServiceCASpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *ServiceCASpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *ServiceCASpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *ServiceCASpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *ServiceCASpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *ServiceCASpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecastatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecastatus.go
new file mode 100644
index 0000000000..91fdbaf2d5
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecastatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ServiceCAStatusApplyConfiguration represents a declarative configuration of the ServiceCAStatus type for use
+// with apply.
+type ServiceCAStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// ServiceCAStatusApplyConfiguration constructs a declarative configuration of the ServiceCAStatus type for use with
+// apply.
+func ServiceCAStatus() *ServiceCAStatusApplyConfiguration {
+ return &ServiceCAStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *ServiceCAStatusApplyConfiguration) WithObservedGeneration(value int64) *ServiceCAStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *ServiceCAStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *ServiceCAStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *ServiceCAStatusApplyConfiguration) WithVersion(value string) *ServiceCAStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *ServiceCAStatusApplyConfiguration) WithReadyReplicas(value int32) *ServiceCAStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *ServiceCAStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *ServiceCAStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *ServiceCAStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *ServiceCAStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserver.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserver.go
new file mode 100644
index 0000000000..62bbc16377
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserver.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// ServiceCatalogAPIServerApplyConfiguration represents a declarative configuration of the ServiceCatalogAPIServer type for use
+// with apply.
+type ServiceCatalogAPIServerApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *ServiceCatalogAPIServerSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *ServiceCatalogAPIServerStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// ServiceCatalogAPIServer constructs a declarative configuration of the ServiceCatalogAPIServer type for use with
+// apply.
+func ServiceCatalogAPIServer(name string) *ServiceCatalogAPIServerApplyConfiguration {
+ b := &ServiceCatalogAPIServerApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("ServiceCatalogAPIServer")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractServiceCatalogAPIServer extracts the applied configuration owned by fieldManager from
+// serviceCatalogAPIServer. If no managedFields are found in serviceCatalogAPIServer for fieldManager, a
+// ServiceCatalogAPIServerApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// serviceCatalogAPIServer must be a unmodified ServiceCatalogAPIServer API object that was retrieved from the Kubernetes API.
+// ExtractServiceCatalogAPIServer provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractServiceCatalogAPIServer(serviceCatalogAPIServer *apioperatorv1.ServiceCatalogAPIServer, fieldManager string) (*ServiceCatalogAPIServerApplyConfiguration, error) {
+ return extractServiceCatalogAPIServer(serviceCatalogAPIServer, fieldManager, "")
+}
+
+// ExtractServiceCatalogAPIServerStatus is the same as ExtractServiceCatalogAPIServer except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractServiceCatalogAPIServerStatus(serviceCatalogAPIServer *apioperatorv1.ServiceCatalogAPIServer, fieldManager string) (*ServiceCatalogAPIServerApplyConfiguration, error) {
+ return extractServiceCatalogAPIServer(serviceCatalogAPIServer, fieldManager, "status")
+}
+
+func extractServiceCatalogAPIServer(serviceCatalogAPIServer *apioperatorv1.ServiceCatalogAPIServer, fieldManager string, subresource string) (*ServiceCatalogAPIServerApplyConfiguration, error) {
+ b := &ServiceCatalogAPIServerApplyConfiguration{}
+ err := managedfields.ExtractInto(serviceCatalogAPIServer, internal.Parser().Type("com.github.openshift.api.operator.v1.ServiceCatalogAPIServer"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(serviceCatalogAPIServer.Name)
+
+ b.WithKind("ServiceCatalogAPIServer")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithKind(value string) *ServiceCatalogAPIServerApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithAPIVersion(value string) *ServiceCatalogAPIServerApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithName(value string) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithGenerateName(value string) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithNamespace(value string) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithUID(value types.UID) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithResourceVersion(value string) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithGeneration(value int64) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithLabels(entries map[string]string) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithFinalizers(values ...string) *ServiceCatalogAPIServerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *ServiceCatalogAPIServerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithSpec(value *ServiceCatalogAPIServerSpecApplyConfiguration) *ServiceCatalogAPIServerApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerApplyConfiguration) WithStatus(value *ServiceCatalogAPIServerStatusApplyConfiguration) *ServiceCatalogAPIServerApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ServiceCatalogAPIServerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserverspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserverspec.go
new file mode 100644
index 0000000000..c43a956eba
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserverspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// ServiceCatalogAPIServerSpecApplyConfiguration represents a declarative configuration of the ServiceCatalogAPIServerSpec type for use
+// with apply.
+type ServiceCatalogAPIServerSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// ServiceCatalogAPIServerSpecApplyConfiguration constructs a declarative configuration of the ServiceCatalogAPIServerSpec type for use with
+// apply.
+func ServiceCatalogAPIServerSpec() *ServiceCatalogAPIServerSpecApplyConfiguration {
+ return &ServiceCatalogAPIServerSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *ServiceCatalogAPIServerSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *ServiceCatalogAPIServerSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *ServiceCatalogAPIServerSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *ServiceCatalogAPIServerSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *ServiceCatalogAPIServerSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserverstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserverstatus.go
new file mode 100644
index 0000000000..e7e16aebd9
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserverstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ServiceCatalogAPIServerStatusApplyConfiguration represents a declarative configuration of the ServiceCatalogAPIServerStatus type for use
+// with apply.
+type ServiceCatalogAPIServerStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// ServiceCatalogAPIServerStatusApplyConfiguration constructs a declarative configuration of the ServiceCatalogAPIServerStatus type for use with
+// apply.
+func ServiceCatalogAPIServerStatus() *ServiceCatalogAPIServerStatusApplyConfiguration {
+ return &ServiceCatalogAPIServerStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerStatusApplyConfiguration) WithObservedGeneration(value int64) *ServiceCatalogAPIServerStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *ServiceCatalogAPIServerStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *ServiceCatalogAPIServerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerStatusApplyConfiguration) WithVersion(value string) *ServiceCatalogAPIServerStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerStatusApplyConfiguration) WithReadyReplicas(value int32) *ServiceCatalogAPIServerStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *ServiceCatalogAPIServerStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *ServiceCatalogAPIServerStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *ServiceCatalogAPIServerStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *ServiceCatalogAPIServerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanager.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanager.go
new file mode 100644
index 0000000000..3755bd1c4d
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanager.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// ServiceCatalogControllerManagerApplyConfiguration represents a declarative configuration of the ServiceCatalogControllerManager type for use
+// with apply.
+type ServiceCatalogControllerManagerApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *ServiceCatalogControllerManagerSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *ServiceCatalogControllerManagerStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// ServiceCatalogControllerManager constructs a declarative configuration of the ServiceCatalogControllerManager type for use with
+// apply.
+func ServiceCatalogControllerManager(name string) *ServiceCatalogControllerManagerApplyConfiguration {
+ b := &ServiceCatalogControllerManagerApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("ServiceCatalogControllerManager")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractServiceCatalogControllerManager extracts the applied configuration owned by fieldManager from
+// serviceCatalogControllerManager. If no managedFields are found in serviceCatalogControllerManager for fieldManager, a
+// ServiceCatalogControllerManagerApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// serviceCatalogControllerManager must be a unmodified ServiceCatalogControllerManager API object that was retrieved from the Kubernetes API.
+// ExtractServiceCatalogControllerManager provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractServiceCatalogControllerManager(serviceCatalogControllerManager *apioperatorv1.ServiceCatalogControllerManager, fieldManager string) (*ServiceCatalogControllerManagerApplyConfiguration, error) {
+ return extractServiceCatalogControllerManager(serviceCatalogControllerManager, fieldManager, "")
+}
+
+// ExtractServiceCatalogControllerManagerStatus is the same as ExtractServiceCatalogControllerManager except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractServiceCatalogControllerManagerStatus(serviceCatalogControllerManager *apioperatorv1.ServiceCatalogControllerManager, fieldManager string) (*ServiceCatalogControllerManagerApplyConfiguration, error) {
+ return extractServiceCatalogControllerManager(serviceCatalogControllerManager, fieldManager, "status")
+}
+
+func extractServiceCatalogControllerManager(serviceCatalogControllerManager *apioperatorv1.ServiceCatalogControllerManager, fieldManager string, subresource string) (*ServiceCatalogControllerManagerApplyConfiguration, error) {
+ b := &ServiceCatalogControllerManagerApplyConfiguration{}
+ err := managedfields.ExtractInto(serviceCatalogControllerManager, internal.Parser().Type("com.github.openshift.api.operator.v1.ServiceCatalogControllerManager"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(serviceCatalogControllerManager.Name)
+
+ b.WithKind("ServiceCatalogControllerManager")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithKind(value string) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithAPIVersion(value string) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithName(value string) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithGenerateName(value string) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithNamespace(value string) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithUID(value types.UID) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithResourceVersion(value string) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithGeneration(value int64) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithLabels(entries map[string]string) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithFinalizers(values ...string) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *ServiceCatalogControllerManagerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithSpec(value *ServiceCatalogControllerManagerSpecApplyConfiguration) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) WithStatus(value *ServiceCatalogControllerManagerStatusApplyConfiguration) *ServiceCatalogControllerManagerApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *ServiceCatalogControllerManagerApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanagerspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanagerspec.go
new file mode 100644
index 0000000000..301fd67b58
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanagerspec.go
@@ -0,0 +1,60 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// ServiceCatalogControllerManagerSpecApplyConfiguration represents a declarative configuration of the ServiceCatalogControllerManagerSpec type for use
+// with apply.
+type ServiceCatalogControllerManagerSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+}
+
+// ServiceCatalogControllerManagerSpecApplyConfiguration constructs a declarative configuration of the ServiceCatalogControllerManagerSpec type for use with
+// apply.
+func ServiceCatalogControllerManagerSpec() *ServiceCatalogControllerManagerSpecApplyConfiguration {
+ return &ServiceCatalogControllerManagerSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *ServiceCatalogControllerManagerSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *ServiceCatalogControllerManagerSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *ServiceCatalogControllerManagerSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *ServiceCatalogControllerManagerSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *ServiceCatalogControllerManagerSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanagerstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanagerstatus.go
new file mode 100644
index 0000000000..f01f6f7968
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanagerstatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// ServiceCatalogControllerManagerStatusApplyConfiguration represents a declarative configuration of the ServiceCatalogControllerManagerStatus type for use
+// with apply.
+type ServiceCatalogControllerManagerStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// ServiceCatalogControllerManagerStatusApplyConfiguration constructs a declarative configuration of the ServiceCatalogControllerManagerStatus type for use with
+// apply.
+func ServiceCatalogControllerManagerStatus() *ServiceCatalogControllerManagerStatusApplyConfiguration {
+ return &ServiceCatalogControllerManagerStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerStatusApplyConfiguration) WithObservedGeneration(value int64) *ServiceCatalogControllerManagerStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *ServiceCatalogControllerManagerStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *ServiceCatalogControllerManagerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerStatusApplyConfiguration) WithVersion(value string) *ServiceCatalogControllerManagerStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerStatusApplyConfiguration) WithReadyReplicas(value int32) *ServiceCatalogControllerManagerStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *ServiceCatalogControllerManagerStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *ServiceCatalogControllerManagerStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *ServiceCatalogControllerManagerStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *ServiceCatalogControllerManagerStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/sflowconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/sflowconfig.go
new file mode 100644
index 0000000000..3b03dda228
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/sflowconfig.go
@@ -0,0 +1,29 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// SFlowConfigApplyConfiguration represents a declarative configuration of the SFlowConfig type for use
+// with apply.
+type SFlowConfigApplyConfiguration struct {
+ Collectors []v1.IPPort `json:"collectors,omitempty"`
+}
+
+// SFlowConfigApplyConfiguration constructs a declarative configuration of the SFlowConfig type for use with
+// apply.
+func SFlowConfig() *SFlowConfigApplyConfiguration {
+ return &SFlowConfigApplyConfiguration{}
+}
+
+// WithCollectors adds the given value to the Collectors field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Collectors field.
+func (b *SFlowConfigApplyConfiguration) WithCollectors(values ...v1.IPPort) *SFlowConfigApplyConfiguration {
+ for i := range values {
+ b.Collectors = append(b.Collectors, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/simplemacvlanconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/simplemacvlanconfig.go
new file mode 100644
index 0000000000..2594321af6
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/simplemacvlanconfig.go
@@ -0,0 +1,54 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// SimpleMacvlanConfigApplyConfiguration represents a declarative configuration of the SimpleMacvlanConfig type for use
+// with apply.
+type SimpleMacvlanConfigApplyConfiguration struct {
+ Master *string `json:"master,omitempty"`
+ IPAMConfig *IPAMConfigApplyConfiguration `json:"ipamConfig,omitempty"`
+ Mode *operatorv1.MacvlanMode `json:"mode,omitempty"`
+ MTU *uint32 `json:"mtu,omitempty"`
+}
+
+// SimpleMacvlanConfigApplyConfiguration constructs a declarative configuration of the SimpleMacvlanConfig type for use with
+// apply.
+func SimpleMacvlanConfig() *SimpleMacvlanConfigApplyConfiguration {
+ return &SimpleMacvlanConfigApplyConfiguration{}
+}
+
+// WithMaster sets the Master field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Master field is set to the value of the last call.
+func (b *SimpleMacvlanConfigApplyConfiguration) WithMaster(value string) *SimpleMacvlanConfigApplyConfiguration {
+ b.Master = &value
+ return b
+}
+
+// WithIPAMConfig sets the IPAMConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the IPAMConfig field is set to the value of the last call.
+func (b *SimpleMacvlanConfigApplyConfiguration) WithIPAMConfig(value *IPAMConfigApplyConfiguration) *SimpleMacvlanConfigApplyConfiguration {
+ b.IPAMConfig = value
+ return b
+}
+
+// WithMode sets the Mode field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Mode field is set to the value of the last call.
+func (b *SimpleMacvlanConfigApplyConfiguration) WithMode(value operatorv1.MacvlanMode) *SimpleMacvlanConfigApplyConfiguration {
+ b.Mode = &value
+ return b
+}
+
+// WithMTU sets the MTU field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MTU field is set to the value of the last call.
+func (b *SimpleMacvlanConfigApplyConfiguration) WithMTU(value uint32) *SimpleMacvlanConfigApplyConfiguration {
+ b.MTU = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamaddresses.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamaddresses.go
new file mode 100644
index 0000000000..7b38e7a087
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamaddresses.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// StaticIPAMAddressesApplyConfiguration represents a declarative configuration of the StaticIPAMAddresses type for use
+// with apply.
+type StaticIPAMAddressesApplyConfiguration struct {
+ Address *string `json:"address,omitempty"`
+ Gateway *string `json:"gateway,omitempty"`
+}
+
+// StaticIPAMAddressesApplyConfiguration constructs a declarative configuration of the StaticIPAMAddresses type for use with
+// apply.
+func StaticIPAMAddresses() *StaticIPAMAddressesApplyConfiguration {
+ return &StaticIPAMAddressesApplyConfiguration{}
+}
+
+// WithAddress sets the Address field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Address field is set to the value of the last call.
+func (b *StaticIPAMAddressesApplyConfiguration) WithAddress(value string) *StaticIPAMAddressesApplyConfiguration {
+ b.Address = &value
+ return b
+}
+
+// WithGateway sets the Gateway field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Gateway field is set to the value of the last call.
+func (b *StaticIPAMAddressesApplyConfiguration) WithGateway(value string) *StaticIPAMAddressesApplyConfiguration {
+ b.Gateway = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamconfig.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamconfig.go
new file mode 100644
index 0000000000..acaf64799e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamconfig.go
@@ -0,0 +1,51 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// StaticIPAMConfigApplyConfiguration represents a declarative configuration of the StaticIPAMConfig type for use
+// with apply.
+type StaticIPAMConfigApplyConfiguration struct {
+ Addresses []StaticIPAMAddressesApplyConfiguration `json:"addresses,omitempty"`
+ Routes []StaticIPAMRoutesApplyConfiguration `json:"routes,omitempty"`
+ DNS *StaticIPAMDNSApplyConfiguration `json:"dns,omitempty"`
+}
+
+// StaticIPAMConfigApplyConfiguration constructs a declarative configuration of the StaticIPAMConfig type for use with
+// apply.
+func StaticIPAMConfig() *StaticIPAMConfigApplyConfiguration {
+ return &StaticIPAMConfigApplyConfiguration{}
+}
+
+// WithAddresses adds the given value to the Addresses field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Addresses field.
+func (b *StaticIPAMConfigApplyConfiguration) WithAddresses(values ...*StaticIPAMAddressesApplyConfiguration) *StaticIPAMConfigApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithAddresses")
+ }
+ b.Addresses = append(b.Addresses, *values[i])
+ }
+ return b
+}
+
+// WithRoutes adds the given value to the Routes field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Routes field.
+func (b *StaticIPAMConfigApplyConfiguration) WithRoutes(values ...*StaticIPAMRoutesApplyConfiguration) *StaticIPAMConfigApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithRoutes")
+ }
+ b.Routes = append(b.Routes, *values[i])
+ }
+ return b
+}
+
+// WithDNS sets the DNS field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DNS field is set to the value of the last call.
+func (b *StaticIPAMConfigApplyConfiguration) WithDNS(value *StaticIPAMDNSApplyConfiguration) *StaticIPAMConfigApplyConfiguration {
+ b.DNS = value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamdns.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamdns.go
new file mode 100644
index 0000000000..cf22aaabf9
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamdns.go
@@ -0,0 +1,45 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// StaticIPAMDNSApplyConfiguration represents a declarative configuration of the StaticIPAMDNS type for use
+// with apply.
+type StaticIPAMDNSApplyConfiguration struct {
+ Nameservers []string `json:"nameservers,omitempty"`
+ Domain *string `json:"domain,omitempty"`
+ Search []string `json:"search,omitempty"`
+}
+
+// StaticIPAMDNSApplyConfiguration constructs a declarative configuration of the StaticIPAMDNS type for use with
+// apply.
+func StaticIPAMDNS() *StaticIPAMDNSApplyConfiguration {
+ return &StaticIPAMDNSApplyConfiguration{}
+}
+
+// WithNameservers adds the given value to the Nameservers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Nameservers field.
+func (b *StaticIPAMDNSApplyConfiguration) WithNameservers(values ...string) *StaticIPAMDNSApplyConfiguration {
+ for i := range values {
+ b.Nameservers = append(b.Nameservers, values[i])
+ }
+ return b
+}
+
+// WithDomain sets the Domain field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Domain field is set to the value of the last call.
+func (b *StaticIPAMDNSApplyConfiguration) WithDomain(value string) *StaticIPAMDNSApplyConfiguration {
+ b.Domain = &value
+ return b
+}
+
+// WithSearch adds the given value to the Search field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Search field.
+func (b *StaticIPAMDNSApplyConfiguration) WithSearch(values ...string) *StaticIPAMDNSApplyConfiguration {
+ for i := range values {
+ b.Search = append(b.Search, values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamroutes.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamroutes.go
new file mode 100644
index 0000000000..d92b69b1be
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamroutes.go
@@ -0,0 +1,32 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// StaticIPAMRoutesApplyConfiguration represents a declarative configuration of the StaticIPAMRoutes type for use
+// with apply.
+type StaticIPAMRoutesApplyConfiguration struct {
+ Destination *string `json:"destination,omitempty"`
+ Gateway *string `json:"gateway,omitempty"`
+}
+
+// StaticIPAMRoutesApplyConfiguration constructs a declarative configuration of the StaticIPAMRoutes type for use with
+// apply.
+func StaticIPAMRoutes() *StaticIPAMRoutesApplyConfiguration {
+ return &StaticIPAMRoutesApplyConfiguration{}
+}
+
+// WithDestination sets the Destination field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Destination field is set to the value of the last call.
+func (b *StaticIPAMRoutesApplyConfiguration) WithDestination(value string) *StaticIPAMRoutesApplyConfiguration {
+ b.Destination = &value
+ return b
+}
+
+// WithGateway sets the Gateway field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Gateway field is set to the value of the last call.
+func (b *StaticIPAMRoutesApplyConfiguration) WithGateway(value string) *StaticIPAMRoutesApplyConfiguration {
+ b.Gateway = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticpodoperatorspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticpodoperatorspec.go
new file mode 100644
index 0000000000..b033f0d9a3
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticpodoperatorspec.go
@@ -0,0 +1,87 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// StaticPodOperatorSpecApplyConfiguration represents a declarative configuration of the StaticPodOperatorSpec type for use
+// with apply.
+type StaticPodOperatorSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+ ForceRedeploymentReason *string `json:"forceRedeploymentReason,omitempty"`
+ FailedRevisionLimit *int32 `json:"failedRevisionLimit,omitempty"`
+ SucceededRevisionLimit *int32 `json:"succeededRevisionLimit,omitempty"`
+}
+
+// StaticPodOperatorSpecApplyConfiguration constructs a declarative configuration of the StaticPodOperatorSpec type for use with
+// apply.
+func StaticPodOperatorSpec() *StaticPodOperatorSpecApplyConfiguration {
+ return &StaticPodOperatorSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *StaticPodOperatorSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *StaticPodOperatorSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *StaticPodOperatorSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *StaticPodOperatorSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *StaticPodOperatorSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *StaticPodOperatorSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *StaticPodOperatorSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *StaticPodOperatorSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *StaticPodOperatorSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *StaticPodOperatorSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithForceRedeploymentReason sets the ForceRedeploymentReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ForceRedeploymentReason field is set to the value of the last call.
+func (b *StaticPodOperatorSpecApplyConfiguration) WithForceRedeploymentReason(value string) *StaticPodOperatorSpecApplyConfiguration {
+ b.ForceRedeploymentReason = &value
+ return b
+}
+
+// WithFailedRevisionLimit sets the FailedRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the FailedRevisionLimit field is set to the value of the last call.
+func (b *StaticPodOperatorSpecApplyConfiguration) WithFailedRevisionLimit(value int32) *StaticPodOperatorSpecApplyConfiguration {
+ b.FailedRevisionLimit = &value
+ return b
+}
+
+// WithSucceededRevisionLimit sets the SucceededRevisionLimit field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the SucceededRevisionLimit field is set to the value of the last call.
+func (b *StaticPodOperatorSpecApplyConfiguration) WithSucceededRevisionLimit(value int32) *StaticPodOperatorSpecApplyConfiguration {
+ b.SucceededRevisionLimit = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticpodoperatorstatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticpodoperatorstatus.go
new file mode 100644
index 0000000000..d805f0a63e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticpodoperatorstatus.go
@@ -0,0 +1,96 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// StaticPodOperatorStatusApplyConfiguration represents a declarative configuration of the StaticPodOperatorStatus type for use
+// with apply.
+type StaticPodOperatorStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+ LatestAvailableRevisionReason *string `json:"latestAvailableRevisionReason,omitempty"`
+ NodeStatuses []NodeStatusApplyConfiguration `json:"nodeStatuses,omitempty"`
+}
+
+// StaticPodOperatorStatusApplyConfiguration constructs a declarative configuration of the StaticPodOperatorStatus type for use with
+// apply.
+func StaticPodOperatorStatus() *StaticPodOperatorStatusApplyConfiguration {
+ return &StaticPodOperatorStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *StaticPodOperatorStatusApplyConfiguration) WithObservedGeneration(value int64) *StaticPodOperatorStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *StaticPodOperatorStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *StaticPodOperatorStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *StaticPodOperatorStatusApplyConfiguration) WithVersion(value string) *StaticPodOperatorStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *StaticPodOperatorStatusApplyConfiguration) WithReadyReplicas(value int32) *StaticPodOperatorStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *StaticPodOperatorStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *StaticPodOperatorStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *StaticPodOperatorStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *StaticPodOperatorStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
+
+// WithLatestAvailableRevisionReason sets the LatestAvailableRevisionReason field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevisionReason field is set to the value of the last call.
+func (b *StaticPodOperatorStatusApplyConfiguration) WithLatestAvailableRevisionReason(value string) *StaticPodOperatorStatusApplyConfiguration {
+ b.LatestAvailableRevisionReason = &value
+ return b
+}
+
+// WithNodeStatuses adds the given value to the NodeStatuses field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the NodeStatuses field.
+func (b *StaticPodOperatorStatusApplyConfiguration) WithNodeStatuses(values ...*NodeStatusApplyConfiguration) *StaticPodOperatorStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithNodeStatuses")
+ }
+ b.NodeStatuses = append(b.NodeStatuses, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/statuspageprovider.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/statuspageprovider.go
new file mode 100644
index 0000000000..080a7ef36a
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/statuspageprovider.go
@@ -0,0 +1,23 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// StatuspageProviderApplyConfiguration represents a declarative configuration of the StatuspageProvider type for use
+// with apply.
+type StatuspageProviderApplyConfiguration struct {
+ PageID *string `json:"pageID,omitempty"`
+}
+
+// StatuspageProviderApplyConfiguration constructs a declarative configuration of the StatuspageProvider type for use with
+// apply.
+func StatuspageProvider() *StatuspageProviderApplyConfiguration {
+ return &StatuspageProviderApplyConfiguration{}
+}
+
+// WithPageID sets the PageID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the PageID field is set to the value of the last call.
+func (b *StatuspageProviderApplyConfiguration) WithPageID(value string) *StatuspageProviderApplyConfiguration {
+ b.PageID = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storage.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storage.go
new file mode 100644
index 0000000000..418d1dcc28
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storage.go
@@ -0,0 +1,246 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ apioperatorv1 "github.com/openshift/api/operator/v1"
+ internal "github.com/openshift/client-go/operator/applyconfigurations/internal"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ managedfields "k8s.io/apimachinery/pkg/util/managedfields"
+ v1 "k8s.io/client-go/applyconfigurations/meta/v1"
+)
+
+// StorageApplyConfiguration represents a declarative configuration of the Storage type for use
+// with apply.
+type StorageApplyConfiguration struct {
+ v1.TypeMetaApplyConfiguration `json:",inline"`
+ *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
+ Spec *StorageSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *StorageStatusApplyConfiguration `json:"status,omitempty"`
+}
+
+// Storage constructs a declarative configuration of the Storage type for use with
+// apply.
+func Storage(name string) *StorageApplyConfiguration {
+ b := &StorageApplyConfiguration{}
+ b.WithName(name)
+ b.WithKind("Storage")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b
+}
+
+// ExtractStorage extracts the applied configuration owned by fieldManager from
+// storage. If no managedFields are found in storage for fieldManager, a
+// StorageApplyConfiguration is returned with only the Name, Namespace (if applicable),
+// APIVersion and Kind populated. It is possible that no managed fields were found for because other
+// field managers have taken ownership of all the fields previously owned by fieldManager, or because
+// the fieldManager never owned fields any fields.
+// storage must be a unmodified Storage API object that was retrieved from the Kubernetes API.
+// ExtractStorage provides a way to perform a extract/modify-in-place/apply workflow.
+// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
+// applied if another fieldManager has updated or force applied any of the previously applied fields.
+// Experimental!
+func ExtractStorage(storage *apioperatorv1.Storage, fieldManager string) (*StorageApplyConfiguration, error) {
+ return extractStorage(storage, fieldManager, "")
+}
+
+// ExtractStorageStatus is the same as ExtractStorage except
+// that it extracts the status subresource applied configuration.
+// Experimental!
+func ExtractStorageStatus(storage *apioperatorv1.Storage, fieldManager string) (*StorageApplyConfiguration, error) {
+ return extractStorage(storage, fieldManager, "status")
+}
+
+func extractStorage(storage *apioperatorv1.Storage, fieldManager string, subresource string) (*StorageApplyConfiguration, error) {
+ b := &StorageApplyConfiguration{}
+ err := managedfields.ExtractInto(storage, internal.Parser().Type("com.github.openshift.api.operator.v1.Storage"), fieldManager, b, subresource)
+ if err != nil {
+ return nil, err
+ }
+ b.WithName(storage.Name)
+
+ b.WithKind("Storage")
+ b.WithAPIVersion("operator.openshift.io/v1")
+ return b, nil
+}
+
+// WithKind sets the Kind field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Kind field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithKind(value string) *StorageApplyConfiguration {
+ b.Kind = &value
+ return b
+}
+
+// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the APIVersion field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithAPIVersion(value string) *StorageApplyConfiguration {
+ b.APIVersion = &value
+ return b
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithName(value string) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Name = &value
+ return b
+}
+
+// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GenerateName field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithGenerateName(value string) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.GenerateName = &value
+ return b
+}
+
+// WithNamespace sets the Namespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Namespace field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithNamespace(value string) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Namespace = &value
+ return b
+}
+
+// WithUID sets the UID field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UID field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithUID(value types.UID) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.UID = &value
+ return b
+}
+
+// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ResourceVersion field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithResourceVersion(value string) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.ResourceVersion = &value
+ return b
+}
+
+// WithGeneration sets the Generation field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Generation field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithGeneration(value int64) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.Generation = &value
+ return b
+}
+
+// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the CreationTimestamp field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.CreationTimestamp = &value
+ return b
+}
+
+// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionTimestamp = &value
+ return b
+}
+
+// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ b.DeletionGracePeriodSeconds = &value
+ return b
+}
+
+// WithLabels puts the entries into the Labels field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Labels field,
+// overwriting an existing map entries in Labels field with the same key.
+func (b *StorageApplyConfiguration) WithLabels(entries map[string]string) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Labels == nil && len(entries) > 0 {
+ b.Labels = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Labels[k] = v
+ }
+ return b
+}
+
+// WithAnnotations puts the entries into the Annotations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the Annotations field,
+// overwriting an existing map entries in Annotations field with the same key.
+func (b *StorageApplyConfiguration) WithAnnotations(entries map[string]string) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ if b.Annotations == nil && len(entries) > 0 {
+ b.Annotations = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.Annotations[k] = v
+ }
+ return b
+}
+
+// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
+func (b *StorageApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithOwnerReferences")
+ }
+ b.OwnerReferences = append(b.OwnerReferences, *values[i])
+ }
+ return b
+}
+
+// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Finalizers field.
+func (b *StorageApplyConfiguration) WithFinalizers(values ...string) *StorageApplyConfiguration {
+ b.ensureObjectMetaApplyConfigurationExists()
+ for i := range values {
+ b.Finalizers = append(b.Finalizers, values[i])
+ }
+ return b
+}
+
+func (b *StorageApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
+ if b.ObjectMetaApplyConfiguration == nil {
+ b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
+ }
+}
+
+// WithSpec sets the Spec field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Spec field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithSpec(value *StorageSpecApplyConfiguration) *StorageApplyConfiguration {
+ b.Spec = value
+ return b
+}
+
+// WithStatus sets the Status field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Status field is set to the value of the last call.
+func (b *StorageApplyConfiguration) WithStatus(value *StorageStatusApplyConfiguration) *StorageApplyConfiguration {
+ b.Status = value
+ return b
+}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *StorageApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storagespec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storagespec.go
new file mode 100644
index 0000000000..735723c11e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storagespec.go
@@ -0,0 +1,69 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// StorageSpecApplyConfiguration represents a declarative configuration of the StorageSpec type for use
+// with apply.
+type StorageSpecApplyConfiguration struct {
+ OperatorSpecApplyConfiguration `json:",inline"`
+ VSphereStorageDriver *operatorv1.StorageDriverType `json:"vsphereStorageDriver,omitempty"`
+}
+
+// StorageSpecApplyConfiguration constructs a declarative configuration of the StorageSpec type for use with
+// apply.
+func StorageSpec() *StorageSpecApplyConfiguration {
+ return &StorageSpecApplyConfiguration{}
+}
+
+// WithManagementState sets the ManagementState field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ManagementState field is set to the value of the last call.
+func (b *StorageSpecApplyConfiguration) WithManagementState(value operatorv1.ManagementState) *StorageSpecApplyConfiguration {
+ b.ManagementState = &value
+ return b
+}
+
+// WithLogLevel sets the LogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LogLevel field is set to the value of the last call.
+func (b *StorageSpecApplyConfiguration) WithLogLevel(value operatorv1.LogLevel) *StorageSpecApplyConfiguration {
+ b.LogLevel = &value
+ return b
+}
+
+// WithOperatorLogLevel sets the OperatorLogLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the OperatorLogLevel field is set to the value of the last call.
+func (b *StorageSpecApplyConfiguration) WithOperatorLogLevel(value operatorv1.LogLevel) *StorageSpecApplyConfiguration {
+ b.OperatorLogLevel = &value
+ return b
+}
+
+// WithUnsupportedConfigOverrides sets the UnsupportedConfigOverrides field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UnsupportedConfigOverrides field is set to the value of the last call.
+func (b *StorageSpecApplyConfiguration) WithUnsupportedConfigOverrides(value runtime.RawExtension) *StorageSpecApplyConfiguration {
+ b.UnsupportedConfigOverrides = &value
+ return b
+}
+
+// WithObservedConfig sets the ObservedConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedConfig field is set to the value of the last call.
+func (b *StorageSpecApplyConfiguration) WithObservedConfig(value runtime.RawExtension) *StorageSpecApplyConfiguration {
+ b.ObservedConfig = &value
+ return b
+}
+
+// WithVSphereStorageDriver sets the VSphereStorageDriver field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the VSphereStorageDriver field is set to the value of the last call.
+func (b *StorageSpecApplyConfiguration) WithVSphereStorageDriver(value operatorv1.StorageDriverType) *StorageSpecApplyConfiguration {
+ b.VSphereStorageDriver = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storagestatus.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storagestatus.go
new file mode 100644
index 0000000000..13f796797e
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storagestatus.go
@@ -0,0 +1,73 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// StorageStatusApplyConfiguration represents a declarative configuration of the StorageStatus type for use
+// with apply.
+type StorageStatusApplyConfiguration struct {
+ OperatorStatusApplyConfiguration `json:",inline"`
+}
+
+// StorageStatusApplyConfiguration constructs a declarative configuration of the StorageStatus type for use with
+// apply.
+func StorageStatus() *StorageStatusApplyConfiguration {
+ return &StorageStatusApplyConfiguration{}
+}
+
+// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ObservedGeneration field is set to the value of the last call.
+func (b *StorageStatusApplyConfiguration) WithObservedGeneration(value int64) *StorageStatusApplyConfiguration {
+ b.ObservedGeneration = &value
+ return b
+}
+
+// WithConditions adds the given value to the Conditions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Conditions field.
+func (b *StorageStatusApplyConfiguration) WithConditions(values ...*OperatorConditionApplyConfiguration) *StorageStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithConditions")
+ }
+ b.Conditions = append(b.Conditions, *values[i])
+ }
+ return b
+}
+
+// WithVersion sets the Version field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Version field is set to the value of the last call.
+func (b *StorageStatusApplyConfiguration) WithVersion(value string) *StorageStatusApplyConfiguration {
+ b.Version = &value
+ return b
+}
+
+// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ReadyReplicas field is set to the value of the last call.
+func (b *StorageStatusApplyConfiguration) WithReadyReplicas(value int32) *StorageStatusApplyConfiguration {
+ b.ReadyReplicas = &value
+ return b
+}
+
+// WithLatestAvailableRevision sets the LatestAvailableRevision field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the LatestAvailableRevision field is set to the value of the last call.
+func (b *StorageStatusApplyConfiguration) WithLatestAvailableRevision(value int32) *StorageStatusApplyConfiguration {
+ b.LatestAvailableRevision = &value
+ return b
+}
+
+// WithGenerations adds the given value to the Generations field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Generations field.
+func (b *StorageStatusApplyConfiguration) WithGenerations(values ...*GenerationStatusApplyConfiguration) *StorageStatusApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithGenerations")
+ }
+ b.Generations = append(b.Generations, *values[i])
+ }
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/syslogloggingdestinationparameters.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/syslogloggingdestinationparameters.go
new file mode 100644
index 0000000000..9bd8ff1f84
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/syslogloggingdestinationparameters.go
@@ -0,0 +1,50 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// SyslogLoggingDestinationParametersApplyConfiguration represents a declarative configuration of the SyslogLoggingDestinationParameters type for use
+// with apply.
+type SyslogLoggingDestinationParametersApplyConfiguration struct {
+ Address *string `json:"address,omitempty"`
+ Port *uint32 `json:"port,omitempty"`
+ Facility *string `json:"facility,omitempty"`
+ MaxLength *uint32 `json:"maxLength,omitempty"`
+}
+
+// SyslogLoggingDestinationParametersApplyConfiguration constructs a declarative configuration of the SyslogLoggingDestinationParameters type for use with
+// apply.
+func SyslogLoggingDestinationParameters() *SyslogLoggingDestinationParametersApplyConfiguration {
+ return &SyslogLoggingDestinationParametersApplyConfiguration{}
+}
+
+// WithAddress sets the Address field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Address field is set to the value of the last call.
+func (b *SyslogLoggingDestinationParametersApplyConfiguration) WithAddress(value string) *SyslogLoggingDestinationParametersApplyConfiguration {
+ b.Address = &value
+ return b
+}
+
+// WithPort sets the Port field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Port field is set to the value of the last call.
+func (b *SyslogLoggingDestinationParametersApplyConfiguration) WithPort(value uint32) *SyslogLoggingDestinationParametersApplyConfiguration {
+ b.Port = &value
+ return b
+}
+
+// WithFacility sets the Facility field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Facility field is set to the value of the last call.
+func (b *SyslogLoggingDestinationParametersApplyConfiguration) WithFacility(value string) *SyslogLoggingDestinationParametersApplyConfiguration {
+ b.Facility = &value
+ return b
+}
+
+// WithMaxLength sets the MaxLength field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MaxLength field is set to the value of the last call.
+func (b *SyslogLoggingDestinationParametersApplyConfiguration) WithMaxLength(value uint32) *SyslogLoggingDestinationParametersApplyConfiguration {
+ b.MaxLength = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/upstream.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/upstream.go
new file mode 100644
index 0000000000..07eca5ee39
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/upstream.go
@@ -0,0 +1,45 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/openshift/api/operator/v1"
+)
+
+// UpstreamApplyConfiguration represents a declarative configuration of the Upstream type for use
+// with apply.
+type UpstreamApplyConfiguration struct {
+ Type *v1.UpstreamType `json:"type,omitempty"`
+ Address *string `json:"address,omitempty"`
+ Port *uint32 `json:"port,omitempty"`
+}
+
+// UpstreamApplyConfiguration constructs a declarative configuration of the Upstream type for use with
+// apply.
+func Upstream() *UpstreamApplyConfiguration {
+ return &UpstreamApplyConfiguration{}
+}
+
+// WithType sets the Type field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Type field is set to the value of the last call.
+func (b *UpstreamApplyConfiguration) WithType(value v1.UpstreamType) *UpstreamApplyConfiguration {
+ b.Type = &value
+ return b
+}
+
+// WithAddress sets the Address field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Address field is set to the value of the last call.
+func (b *UpstreamApplyConfiguration) WithAddress(value string) *UpstreamApplyConfiguration {
+ b.Address = &value
+ return b
+}
+
+// WithPort sets the Port field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Port field is set to the value of the last call.
+func (b *UpstreamApplyConfiguration) WithPort(value uint32) *UpstreamApplyConfiguration {
+ b.Port = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/upstreamresolvers.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/upstreamresolvers.go
new file mode 100644
index 0000000000..ff90a2347f
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/upstreamresolvers.go
@@ -0,0 +1,59 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ operatorv1 "github.com/openshift/api/operator/v1"
+)
+
+// UpstreamResolversApplyConfiguration represents a declarative configuration of the UpstreamResolvers type for use
+// with apply.
+type UpstreamResolversApplyConfiguration struct {
+ Upstreams []UpstreamApplyConfiguration `json:"upstreams,omitempty"`
+ Policy *operatorv1.ForwardingPolicy `json:"policy,omitempty"`
+ TransportConfig *DNSTransportConfigApplyConfiguration `json:"transportConfig,omitempty"`
+ ProtocolStrategy *operatorv1.ProtocolStrategy `json:"protocolStrategy,omitempty"`
+}
+
+// UpstreamResolversApplyConfiguration constructs a declarative configuration of the UpstreamResolvers type for use with
+// apply.
+func UpstreamResolvers() *UpstreamResolversApplyConfiguration {
+ return &UpstreamResolversApplyConfiguration{}
+}
+
+// WithUpstreams adds the given value to the Upstreams field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Upstreams field.
+func (b *UpstreamResolversApplyConfiguration) WithUpstreams(values ...*UpstreamApplyConfiguration) *UpstreamResolversApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithUpstreams")
+ }
+ b.Upstreams = append(b.Upstreams, *values[i])
+ }
+ return b
+}
+
+// WithPolicy sets the Policy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Policy field is set to the value of the last call.
+func (b *UpstreamResolversApplyConfiguration) WithPolicy(value operatorv1.ForwardingPolicy) *UpstreamResolversApplyConfiguration {
+ b.Policy = &value
+ return b
+}
+
+// WithTransportConfig sets the TransportConfig field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the TransportConfig field is set to the value of the last call.
+func (b *UpstreamResolversApplyConfiguration) WithTransportConfig(value *DNSTransportConfigApplyConfiguration) *UpstreamResolversApplyConfiguration {
+ b.TransportConfig = value
+ return b
+}
+
+// WithProtocolStrategy sets the ProtocolStrategy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ProtocolStrategy field is set to the value of the last call.
+func (b *UpstreamResolversApplyConfiguration) WithProtocolStrategy(value operatorv1.ProtocolStrategy) *UpstreamResolversApplyConfiguration {
+ b.ProtocolStrategy = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/vspherecsidriverconfigspec.go b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/vspherecsidriverconfigspec.go
new file mode 100644
index 0000000000..91ebc89d42
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/vspherecsidriverconfigspec.go
@@ -0,0 +1,52 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// VSphereCSIDriverConfigSpecApplyConfiguration represents a declarative configuration of the VSphereCSIDriverConfigSpec type for use
+// with apply.
+type VSphereCSIDriverConfigSpecApplyConfiguration struct {
+ TopologyCategories []string `json:"topologyCategories,omitempty"`
+ GlobalMaxSnapshotsPerBlockVolume *uint32 `json:"globalMaxSnapshotsPerBlockVolume,omitempty"`
+ GranularMaxSnapshotsPerBlockVolumeInVSAN *uint32 `json:"granularMaxSnapshotsPerBlockVolumeInVSAN,omitempty"`
+ GranularMaxSnapshotsPerBlockVolumeInVVOL *uint32 `json:"granularMaxSnapshotsPerBlockVolumeInVVOL,omitempty"`
+}
+
+// VSphereCSIDriverConfigSpecApplyConfiguration constructs a declarative configuration of the VSphereCSIDriverConfigSpec type for use with
+// apply.
+func VSphereCSIDriverConfigSpec() *VSphereCSIDriverConfigSpecApplyConfiguration {
+ return &VSphereCSIDriverConfigSpecApplyConfiguration{}
+}
+
+// WithTopologyCategories adds the given value to the TopologyCategories field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the TopologyCategories field.
+func (b *VSphereCSIDriverConfigSpecApplyConfiguration) WithTopologyCategories(values ...string) *VSphereCSIDriverConfigSpecApplyConfiguration {
+ for i := range values {
+ b.TopologyCategories = append(b.TopologyCategories, values[i])
+ }
+ return b
+}
+
+// WithGlobalMaxSnapshotsPerBlockVolume sets the GlobalMaxSnapshotsPerBlockVolume field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GlobalMaxSnapshotsPerBlockVolume field is set to the value of the last call.
+func (b *VSphereCSIDriverConfigSpecApplyConfiguration) WithGlobalMaxSnapshotsPerBlockVolume(value uint32) *VSphereCSIDriverConfigSpecApplyConfiguration {
+ b.GlobalMaxSnapshotsPerBlockVolume = &value
+ return b
+}
+
+// WithGranularMaxSnapshotsPerBlockVolumeInVSAN sets the GranularMaxSnapshotsPerBlockVolumeInVSAN field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GranularMaxSnapshotsPerBlockVolumeInVSAN field is set to the value of the last call.
+func (b *VSphereCSIDriverConfigSpecApplyConfiguration) WithGranularMaxSnapshotsPerBlockVolumeInVSAN(value uint32) *VSphereCSIDriverConfigSpecApplyConfiguration {
+ b.GranularMaxSnapshotsPerBlockVolumeInVSAN = &value
+ return b
+}
+
+// WithGranularMaxSnapshotsPerBlockVolumeInVVOL sets the GranularMaxSnapshotsPerBlockVolumeInVVOL field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the GranularMaxSnapshotsPerBlockVolumeInVVOL field is set to the value of the last call.
+func (b *VSphereCSIDriverConfigSpecApplyConfiguration) WithGranularMaxSnapshotsPerBlockVolumeInVVOL(value uint32) *VSphereCSIDriverConfigSpecApplyConfiguration {
+ b.GranularMaxSnapshotsPerBlockVolumeInVVOL = &value
+ return b
+}
diff --git a/vendor/github.com/openshift/client-go/security/applyconfigurations/internal/internal.go b/vendor/github.com/openshift/client-go/security/applyconfigurations/internal/internal.go
index 55e489fca0..b6dcc15482 100644
--- a/vendor/github.com/openshift/client-go/security/applyconfigurations/internal/internal.go
+++ b/vendor/github.com/openshift/client-go/security/applyconfigurations/internal/internal.go
@@ -209,6 +209,10 @@ var schemaYAML = typed.YAMLObject(`types:
type:
namedType: com.github.openshift.api.security.v1.SupplementalGroupsStrategyOptions
default: {}
+ - name: userNamespaceLevel
+ type:
+ scalar: string
+ default: AllowHostLevel
- name: users
type:
list:
@@ -295,7 +299,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: creationTimestamp
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
- default: {}
- name: deletionGracePeriodSeconds
type:
scalar: numeric
diff --git a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/allowedflexvolume.go b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/allowedflexvolume.go
index 73f0eb6cd7..0d9e9b40aa 100644
--- a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/allowedflexvolume.go
+++ b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/allowedflexvolume.go
@@ -2,13 +2,13 @@
package v1
-// AllowedFlexVolumeApplyConfiguration represents an declarative configuration of the AllowedFlexVolume type for use
+// AllowedFlexVolumeApplyConfiguration represents a declarative configuration of the AllowedFlexVolume type for use
// with apply.
type AllowedFlexVolumeApplyConfiguration struct {
Driver *string `json:"driver,omitempty"`
}
-// AllowedFlexVolumeApplyConfiguration constructs an declarative configuration of the AllowedFlexVolume type for use with
+// AllowedFlexVolumeApplyConfiguration constructs a declarative configuration of the AllowedFlexVolume type for use with
// apply.
func AllowedFlexVolume() *AllowedFlexVolumeApplyConfiguration {
return &AllowedFlexVolumeApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/fsgroupstrategyoptions.go b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/fsgroupstrategyoptions.go
index dd277fb6ad..d85d2a62ff 100644
--- a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/fsgroupstrategyoptions.go
+++ b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/fsgroupstrategyoptions.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/security/v1"
)
-// FSGroupStrategyOptionsApplyConfiguration represents an declarative configuration of the FSGroupStrategyOptions type for use
+// FSGroupStrategyOptionsApplyConfiguration represents a declarative configuration of the FSGroupStrategyOptions type for use
// with apply.
type FSGroupStrategyOptionsApplyConfiguration struct {
Type *v1.FSGroupStrategyType `json:"type,omitempty"`
Ranges []IDRangeApplyConfiguration `json:"ranges,omitempty"`
}
-// FSGroupStrategyOptionsApplyConfiguration constructs an declarative configuration of the FSGroupStrategyOptions type for use with
+// FSGroupStrategyOptionsApplyConfiguration constructs a declarative configuration of the FSGroupStrategyOptions type for use with
// apply.
func FSGroupStrategyOptions() *FSGroupStrategyOptionsApplyConfiguration {
return &FSGroupStrategyOptionsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/idrange.go b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/idrange.go
index aa2eb2ce00..70c20336a0 100644
--- a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/idrange.go
+++ b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/idrange.go
@@ -2,14 +2,14 @@
package v1
-// IDRangeApplyConfiguration represents an declarative configuration of the IDRange type for use
+// IDRangeApplyConfiguration represents a declarative configuration of the IDRange type for use
// with apply.
type IDRangeApplyConfiguration struct {
Min *int64 `json:"min,omitempty"`
Max *int64 `json:"max,omitempty"`
}
-// IDRangeApplyConfiguration constructs an declarative configuration of the IDRange type for use with
+// IDRangeApplyConfiguration constructs a declarative configuration of the IDRange type for use with
// apply.
func IDRange() *IDRangeApplyConfiguration {
return &IDRangeApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/rangeallocation.go b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/rangeallocation.go
index c5dde07ba7..ecba8c6ac0 100644
--- a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/rangeallocation.go
+++ b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/rangeallocation.go
@@ -11,7 +11,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// RangeAllocationApplyConfiguration represents an declarative configuration of the RangeAllocation type for use
+// RangeAllocationApplyConfiguration represents a declarative configuration of the RangeAllocation type for use
// with apply.
type RangeAllocationApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -20,7 +20,7 @@ type RangeAllocationApplyConfiguration struct {
Data []byte `json:"data,omitempty"`
}
-// RangeAllocation constructs an declarative configuration of the RangeAllocation type for use with
+// RangeAllocation constructs a declarative configuration of the RangeAllocation type for use with
// apply.
func RangeAllocation(name string) *RangeAllocationApplyConfiguration {
b := &RangeAllocationApplyConfiguration{}
@@ -240,3 +240,9 @@ func (b *RangeAllocationApplyConfiguration) WithData(values ...byte) *RangeAlloc
}
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *RangeAllocationApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/runasuserstrategyoptions.go b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/runasuserstrategyoptions.go
index df99d6ff77..ed671136e1 100644
--- a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/runasuserstrategyoptions.go
+++ b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/runasuserstrategyoptions.go
@@ -6,7 +6,7 @@ import (
v1 "github.com/openshift/api/security/v1"
)
-// RunAsUserStrategyOptionsApplyConfiguration represents an declarative configuration of the RunAsUserStrategyOptions type for use
+// RunAsUserStrategyOptionsApplyConfiguration represents a declarative configuration of the RunAsUserStrategyOptions type for use
// with apply.
type RunAsUserStrategyOptionsApplyConfiguration struct {
Type *v1.RunAsUserStrategyType `json:"type,omitempty"`
@@ -15,7 +15,7 @@ type RunAsUserStrategyOptionsApplyConfiguration struct {
UIDRangeMax *int64 `json:"uidRangeMax,omitempty"`
}
-// RunAsUserStrategyOptionsApplyConfiguration constructs an declarative configuration of the RunAsUserStrategyOptions type for use with
+// RunAsUserStrategyOptionsApplyConfiguration constructs a declarative configuration of the RunAsUserStrategyOptions type for use with
// apply.
func RunAsUserStrategyOptions() *RunAsUserStrategyOptionsApplyConfiguration {
return &RunAsUserStrategyOptionsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/securitycontextconstraints.go b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/securitycontextconstraints.go
index 9d029bb712..d7026978e6 100644
--- a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/securitycontextconstraints.go
+++ b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/securitycontextconstraints.go
@@ -12,7 +12,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
-// SecurityContextConstraintsApplyConfiguration represents an declarative configuration of the SecurityContextConstraints type for use
+// SecurityContextConstraintsApplyConfiguration represents a declarative configuration of the SecurityContextConstraints type for use
// with apply.
type SecurityContextConstraintsApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -29,6 +29,7 @@ type SecurityContextConstraintsApplyConfiguration struct {
AllowHostPorts *bool `json:"allowHostPorts,omitempty"`
AllowHostPID *bool `json:"allowHostPID,omitempty"`
AllowHostIPC *bool `json:"allowHostIPC,omitempty"`
+ UserNamespaceLevel *securityv1.NamespaceLevelType `json:"userNamespaceLevel,omitempty"`
DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty"`
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"`
SELinuxContext *SELinuxContextStrategyOptionsApplyConfiguration `json:"seLinuxContext,omitempty"`
@@ -43,7 +44,7 @@ type SecurityContextConstraintsApplyConfiguration struct {
ForbiddenSysctls []string `json:"forbiddenSysctls,omitempty"`
}
-// SecurityContextConstraints constructs an declarative configuration of the SecurityContextConstraints type for use with
+// SecurityContextConstraints constructs a declarative configuration of the SecurityContextConstraints type for use with
// apply.
func SecurityContextConstraints(name string) *SecurityContextConstraintsApplyConfiguration {
b := &SecurityContextConstraintsApplyConfiguration{}
@@ -355,6 +356,14 @@ func (b *SecurityContextConstraintsApplyConfiguration) WithAllowHostIPC(value bo
return b
}
+// WithUserNamespaceLevel sets the UserNamespaceLevel field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the UserNamespaceLevel field is set to the value of the last call.
+func (b *SecurityContextConstraintsApplyConfiguration) WithUserNamespaceLevel(value securityv1.NamespaceLevelType) *SecurityContextConstraintsApplyConfiguration {
+ b.UserNamespaceLevel = &value
+ return b
+}
+
// WithDefaultAllowPrivilegeEscalation sets the DefaultAllowPrivilegeEscalation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DefaultAllowPrivilegeEscalation field is set to the value of the last call.
@@ -460,3 +469,9 @@ func (b *SecurityContextConstraintsApplyConfiguration) WithForbiddenSysctls(valu
}
return b
}
+
+// GetName retrieves the value of the Name field in the declarative configuration.
+func (b *SecurityContextConstraintsApplyConfiguration) GetName() *string {
+ b.ensureObjectMetaApplyConfigurationExists()
+ return b.Name
+}
diff --git a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/selinuxcontextstrategyoptions.go b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/selinuxcontextstrategyoptions.go
index 8d3ac9551d..580c596b0c 100644
--- a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/selinuxcontextstrategyoptions.go
+++ b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/selinuxcontextstrategyoptions.go
@@ -7,14 +7,14 @@ import (
corev1 "k8s.io/api/core/v1"
)
-// SELinuxContextStrategyOptionsApplyConfiguration represents an declarative configuration of the SELinuxContextStrategyOptions type for use
+// SELinuxContextStrategyOptionsApplyConfiguration represents a declarative configuration of the SELinuxContextStrategyOptions type for use
// with apply.
type SELinuxContextStrategyOptionsApplyConfiguration struct {
Type *v1.SELinuxContextStrategyType `json:"type,omitempty"`
SELinuxOptions *corev1.SELinuxOptions `json:"seLinuxOptions,omitempty"`
}
-// SELinuxContextStrategyOptionsApplyConfiguration constructs an declarative configuration of the SELinuxContextStrategyOptions type for use with
+// SELinuxContextStrategyOptionsApplyConfiguration constructs a declarative configuration of the SELinuxContextStrategyOptions type for use with
// apply.
func SELinuxContextStrategyOptions() *SELinuxContextStrategyOptionsApplyConfiguration {
return &SELinuxContextStrategyOptionsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/supplementalgroupsstrategyoptions.go b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/supplementalgroupsstrategyoptions.go
index 0064f21ead..563e9d2856 100644
--- a/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/supplementalgroupsstrategyoptions.go
+++ b/vendor/github.com/openshift/client-go/security/applyconfigurations/security/v1/supplementalgroupsstrategyoptions.go
@@ -6,14 +6,14 @@ import (
v1 "github.com/openshift/api/security/v1"
)
-// SupplementalGroupsStrategyOptionsApplyConfiguration represents an declarative configuration of the SupplementalGroupsStrategyOptions type for use
+// SupplementalGroupsStrategyOptionsApplyConfiguration represents a declarative configuration of the SupplementalGroupsStrategyOptions type for use
// with apply.
type SupplementalGroupsStrategyOptionsApplyConfiguration struct {
Type *v1.SupplementalGroupsStrategyType `json:"type,omitempty"`
Ranges []IDRangeApplyConfiguration `json:"ranges,omitempty"`
}
-// SupplementalGroupsStrategyOptionsApplyConfiguration constructs an declarative configuration of the SupplementalGroupsStrategyOptions type for use with
+// SupplementalGroupsStrategyOptionsApplyConfiguration constructs a declarative configuration of the SupplementalGroupsStrategyOptions type for use with
// apply.
func SupplementalGroupsStrategyOptions() *SupplementalGroupsStrategyOptionsApplyConfiguration {
return &SupplementalGroupsStrategyOptionsApplyConfiguration{}
diff --git a/vendor/github.com/openshift/client-go/security/applyconfigurations/utils.go b/vendor/github.com/openshift/client-go/security/applyconfigurations/utils.go
new file mode 100644
index 0000000000..70ca6d623b
--- /dev/null
+++ b/vendor/github.com/openshift/client-go/security/applyconfigurations/utils.go
@@ -0,0 +1,42 @@
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package applyconfigurations
+
+import (
+ v1 "github.com/openshift/api/security/v1"
+ internal "github.com/openshift/client-go/security/applyconfigurations/internal"
+ securityv1 "github.com/openshift/client-go/security/applyconfigurations/security/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ testing "k8s.io/client-go/testing"
+)
+
+// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no
+// apply configuration type exists for the given GroupVersionKind.
+func ForKind(kind schema.GroupVersionKind) interface{} {
+ switch kind {
+ // Group=security.openshift.io, Version=v1
+ case v1.SchemeGroupVersion.WithKind("AllowedFlexVolume"):
+ return &securityv1.AllowedFlexVolumeApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("FSGroupStrategyOptions"):
+ return &securityv1.FSGroupStrategyOptionsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("IDRange"):
+ return &securityv1.IDRangeApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("RangeAllocation"):
+ return &securityv1.RangeAllocationApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("RunAsUserStrategyOptions"):
+ return &securityv1.RunAsUserStrategyOptionsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("SecurityContextConstraints"):
+ return &securityv1.SecurityContextConstraintsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("SELinuxContextStrategyOptions"):
+ return &securityv1.SELinuxContextStrategyOptionsApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("SupplementalGroupsStrategyOptions"):
+ return &securityv1.SupplementalGroupsStrategyOptionsApplyConfiguration{}
+
+ }
+ return nil
+}
+
+func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter {
+ return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()}
+}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/fake/clientset_generated.go
index 9bcd5d024a..33a91dd932 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/fake/clientset_generated.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/fake/clientset_generated.go
@@ -3,6 +3,7 @@
package fake
import (
+ applyconfigurations "github.com/openshift/client-go/security/applyconfigurations"
clientset "github.com/openshift/client-go/security/clientset/versioned"
securityv1 "github.com/openshift/client-go/security/clientset/versioned/typed/security/v1"
fakesecurityv1 "github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake"
@@ -15,8 +16,12 @@ import (
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
-// without applying any validations and/or defaults. It shouldn't be considered a replacement
+// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
+//
+// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves
+// server side apply testing. NewClientset is only available when apply configurations are generated (e.g.
+// via --with-applyconfig).
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
for _, obj := range objects {
@@ -58,6 +63,38 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
+// NewClientset returns a clientset that will respond with the provided objects.
+// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
+// without applying any validations and/or defaults. It shouldn't be considered a replacement
+// for a real clientset and is mostly useful in simple unit tests.
+func NewClientset(objects ...runtime.Object) *Clientset {
+ o := testing.NewFieldManagedObjectTracker(
+ scheme,
+ codecs.UniversalDecoder(),
+ applyconfigurations.NewTypeConverter(scheme),
+ )
+ for _, obj := range objects {
+ if err := o.Add(obj); err != nil {
+ panic(err)
+ }
+ }
+
+ cs := &Clientset{tracker: o}
+ cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
+ cs.AddReactor("*", "*", testing.ObjectReaction(o))
+ cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
+ gvr := action.GetResource()
+ ns := action.GetNamespace()
+ watch, err := o.Watch(gvr, ns)
+ if err != nil {
+ return false, nil, err
+ }
+ return true, watch, nil
+ })
+
+ return cs
+}
+
var (
_ clientset.Interface = &Clientset{}
_ testing.FakeClient = &Clientset{}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicyreview.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicyreview.go
index 61c5f9902a..e48b7cb686 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicyreview.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicyreview.go
@@ -22,11 +22,12 @@ var podsecuritypolicyreviewsKind = v1.SchemeGroupVersion.WithKind("PodSecurityPo
// Create takes the representation of a podSecurityPolicyReview and creates it. Returns the server's representation of the podSecurityPolicyReview, and an error, if there is any.
func (c *FakePodSecurityPolicyReviews) Create(ctx context.Context, podSecurityPolicyReview *v1.PodSecurityPolicyReview, opts metav1.CreateOptions) (result *v1.PodSecurityPolicyReview, err error) {
+ emptyResult := &v1.PodSecurityPolicyReview{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(podsecuritypolicyreviewsResource, c.ns, podSecurityPolicyReview), &v1.PodSecurityPolicyReview{})
+ Invokes(testing.NewCreateActionWithOptions(podsecuritypolicyreviewsResource, c.ns, podSecurityPolicyReview, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.PodSecurityPolicyReview), err
}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicyselfsubjectreview.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicyselfsubjectreview.go
index 80aa29043c..df51469695 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicyselfsubjectreview.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicyselfsubjectreview.go
@@ -22,11 +22,12 @@ var podsecuritypolicyselfsubjectreviewsKind = v1.SchemeGroupVersion.WithKind("Po
// Create takes the representation of a podSecurityPolicySelfSubjectReview and creates it. Returns the server's representation of the podSecurityPolicySelfSubjectReview, and an error, if there is any.
func (c *FakePodSecurityPolicySelfSubjectReviews) Create(ctx context.Context, podSecurityPolicySelfSubjectReview *v1.PodSecurityPolicySelfSubjectReview, opts metav1.CreateOptions) (result *v1.PodSecurityPolicySelfSubjectReview, err error) {
+ emptyResult := &v1.PodSecurityPolicySelfSubjectReview{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(podsecuritypolicyselfsubjectreviewsResource, c.ns, podSecurityPolicySelfSubjectReview), &v1.PodSecurityPolicySelfSubjectReview{})
+ Invokes(testing.NewCreateActionWithOptions(podsecuritypolicyselfsubjectreviewsResource, c.ns, podSecurityPolicySelfSubjectReview, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.PodSecurityPolicySelfSubjectReview), err
}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicysubjectreview.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicysubjectreview.go
index 9910db95de..1927c74441 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicysubjectreview.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_podsecuritypolicysubjectreview.go
@@ -22,11 +22,12 @@ var podsecuritypolicysubjectreviewsKind = v1.SchemeGroupVersion.WithKind("PodSec
// Create takes the representation of a podSecurityPolicySubjectReview and creates it. Returns the server's representation of the podSecurityPolicySubjectReview, and an error, if there is any.
func (c *FakePodSecurityPolicySubjectReviews) Create(ctx context.Context, podSecurityPolicySubjectReview *v1.PodSecurityPolicySubjectReview, opts metav1.CreateOptions) (result *v1.PodSecurityPolicySubjectReview, err error) {
+ emptyResult := &v1.PodSecurityPolicySubjectReview{}
obj, err := c.Fake.
- Invokes(testing.NewCreateAction(podsecuritypolicysubjectreviewsResource, c.ns, podSecurityPolicySubjectReview), &v1.PodSecurityPolicySubjectReview{})
+ Invokes(testing.NewCreateActionWithOptions(podsecuritypolicysubjectreviewsResource, c.ns, podSecurityPolicySubjectReview, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.PodSecurityPolicySubjectReview), err
}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_rangeallocation.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_rangeallocation.go
index 2692d3b982..cda0cc7b12 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_rangeallocation.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_rangeallocation.go
@@ -27,20 +27,22 @@ var rangeallocationsKind = v1.SchemeGroupVersion.WithKind("RangeAllocation")
// Get takes name of the rangeAllocation, and returns the corresponding rangeAllocation object, and an error if there is any.
func (c *FakeRangeAllocations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RangeAllocation, err error) {
+ emptyResult := &v1.RangeAllocation{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(rangeallocationsResource, name), &v1.RangeAllocation{})
+ Invokes(testing.NewRootGetActionWithOptions(rangeallocationsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.RangeAllocation), err
}
// List takes label and field selectors, and returns the list of RangeAllocations that match those selectors.
func (c *FakeRangeAllocations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RangeAllocationList, err error) {
+ emptyResult := &v1.RangeAllocationList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(rangeallocationsResource, rangeallocationsKind, opts), &v1.RangeAllocationList{})
+ Invokes(testing.NewRootListActionWithOptions(rangeallocationsResource, rangeallocationsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,25 +61,27 @@ func (c *FakeRangeAllocations) List(ctx context.Context, opts metav1.ListOptions
// Watch returns a watch.Interface that watches the requested rangeAllocations.
func (c *FakeRangeAllocations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(rangeallocationsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(rangeallocationsResource, opts))
}
// Create takes the representation of a rangeAllocation and creates it. Returns the server's representation of the rangeAllocation, and an error, if there is any.
func (c *FakeRangeAllocations) Create(ctx context.Context, rangeAllocation *v1.RangeAllocation, opts metav1.CreateOptions) (result *v1.RangeAllocation, err error) {
+ emptyResult := &v1.RangeAllocation{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(rangeallocationsResource, rangeAllocation), &v1.RangeAllocation{})
+ Invokes(testing.NewRootCreateActionWithOptions(rangeallocationsResource, rangeAllocation, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.RangeAllocation), err
}
// Update takes the representation of a rangeAllocation and updates it. Returns the server's representation of the rangeAllocation, and an error, if there is any.
func (c *FakeRangeAllocations) Update(ctx context.Context, rangeAllocation *v1.RangeAllocation, opts metav1.UpdateOptions) (result *v1.RangeAllocation, err error) {
+ emptyResult := &v1.RangeAllocation{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(rangeallocationsResource, rangeAllocation), &v1.RangeAllocation{})
+ Invokes(testing.NewRootUpdateActionWithOptions(rangeallocationsResource, rangeAllocation, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.RangeAllocation), err
}
@@ -91,7 +95,7 @@ func (c *FakeRangeAllocations) Delete(ctx context.Context, name string, opts met
// DeleteCollection deletes a collection of objects.
func (c *FakeRangeAllocations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(rangeallocationsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(rangeallocationsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.RangeAllocationList{})
return err
@@ -99,10 +103,11 @@ func (c *FakeRangeAllocations) DeleteCollection(ctx context.Context, opts metav1
// Patch applies the patch and returns the patched rangeAllocation.
func (c *FakeRangeAllocations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RangeAllocation, err error) {
+ emptyResult := &v1.RangeAllocation{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(rangeallocationsResource, name, pt, data, subresources...), &v1.RangeAllocation{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(rangeallocationsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.RangeAllocation), err
}
@@ -120,10 +125,11 @@ func (c *FakeRangeAllocations) Apply(ctx context.Context, rangeAllocation *secur
if name == nil {
return nil, fmt.Errorf("rangeAllocation.Name must be provided to Apply")
}
+ emptyResult := &v1.RangeAllocation{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(rangeallocationsResource, *name, types.ApplyPatchType, data), &v1.RangeAllocation{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(rangeallocationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.RangeAllocation), err
}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_securitycontextconstraints.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_securitycontextconstraints.go
index ee40b0dce0..d3674b611a 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_securitycontextconstraints.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake/fake_securitycontextconstraints.go
@@ -27,20 +27,22 @@ var securitycontextconstraintsKind = v1.SchemeGroupVersion.WithKind("SecurityCon
// Get takes name of the securityContextConstraints, and returns the corresponding securityContextConstraints object, and an error if there is any.
func (c *FakeSecurityContextConstraints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SecurityContextConstraints, err error) {
+ emptyResult := &v1.SecurityContextConstraints{}
obj, err := c.Fake.
- Invokes(testing.NewRootGetAction(securitycontextconstraintsResource, name), &v1.SecurityContextConstraints{})
+ Invokes(testing.NewRootGetActionWithOptions(securitycontextconstraintsResource, name, options), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.SecurityContextConstraints), err
}
// List takes label and field selectors, and returns the list of SecurityContextConstraints that match those selectors.
func (c *FakeSecurityContextConstraints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecurityContextConstraintsList, err error) {
+ emptyResult := &v1.SecurityContextConstraintsList{}
obj, err := c.Fake.
- Invokes(testing.NewRootListAction(securitycontextconstraintsResource, securitycontextconstraintsKind, opts), &v1.SecurityContextConstraintsList{})
+ Invokes(testing.NewRootListActionWithOptions(securitycontextconstraintsResource, securitycontextconstraintsKind, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -59,25 +61,27 @@ func (c *FakeSecurityContextConstraints) List(ctx context.Context, opts metav1.L
// Watch returns a watch.Interface that watches the requested securityContextConstraints.
func (c *FakeSecurityContextConstraints) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
return c.Fake.
- InvokesWatch(testing.NewRootWatchAction(securitycontextconstraintsResource, opts))
+ InvokesWatch(testing.NewRootWatchActionWithOptions(securitycontextconstraintsResource, opts))
}
// Create takes the representation of a securityContextConstraints and creates it. Returns the server's representation of the securityContextConstraints, and an error, if there is any.
func (c *FakeSecurityContextConstraints) Create(ctx context.Context, securityContextConstraints *v1.SecurityContextConstraints, opts metav1.CreateOptions) (result *v1.SecurityContextConstraints, err error) {
+ emptyResult := &v1.SecurityContextConstraints{}
obj, err := c.Fake.
- Invokes(testing.NewRootCreateAction(securitycontextconstraintsResource, securityContextConstraints), &v1.SecurityContextConstraints{})
+ Invokes(testing.NewRootCreateActionWithOptions(securitycontextconstraintsResource, securityContextConstraints, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.SecurityContextConstraints), err
}
// Update takes the representation of a securityContextConstraints and updates it. Returns the server's representation of the securityContextConstraints, and an error, if there is any.
func (c *FakeSecurityContextConstraints) Update(ctx context.Context, securityContextConstraints *v1.SecurityContextConstraints, opts metav1.UpdateOptions) (result *v1.SecurityContextConstraints, err error) {
+ emptyResult := &v1.SecurityContextConstraints{}
obj, err := c.Fake.
- Invokes(testing.NewRootUpdateAction(securitycontextconstraintsResource, securityContextConstraints), &v1.SecurityContextConstraints{})
+ Invokes(testing.NewRootUpdateActionWithOptions(securitycontextconstraintsResource, securityContextConstraints, opts), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.SecurityContextConstraints), err
}
@@ -91,7 +95,7 @@ func (c *FakeSecurityContextConstraints) Delete(ctx context.Context, name string
// DeleteCollection deletes a collection of objects.
func (c *FakeSecurityContextConstraints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- action := testing.NewRootDeleteCollectionAction(securitycontextconstraintsResource, listOpts)
+ action := testing.NewRootDeleteCollectionActionWithOptions(securitycontextconstraintsResource, opts, listOpts)
_, err := c.Fake.Invokes(action, &v1.SecurityContextConstraintsList{})
return err
@@ -99,10 +103,11 @@ func (c *FakeSecurityContextConstraints) DeleteCollection(ctx context.Context, o
// Patch applies the patch and returns the patched securityContextConstraints.
func (c *FakeSecurityContextConstraints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecurityContextConstraints, err error) {
+ emptyResult := &v1.SecurityContextConstraints{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(securitycontextconstraintsResource, name, pt, data, subresources...), &v1.SecurityContextConstraints{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(securitycontextconstraintsResource, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.SecurityContextConstraints), err
}
@@ -120,10 +125,11 @@ func (c *FakeSecurityContextConstraints) Apply(ctx context.Context, securityCont
if name == nil {
return nil, fmt.Errorf("securityContextConstraints.Name must be provided to Apply")
}
+ emptyResult := &v1.SecurityContextConstraints{}
obj, err := c.Fake.
- Invokes(testing.NewRootPatchSubresourceAction(securitycontextconstraintsResource, *name, types.ApplyPatchType, data), &v1.SecurityContextConstraints{})
+ Invokes(testing.NewRootPatchSubresourceActionWithOptions(securitycontextconstraintsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
- return nil, err
+ return emptyResult, err
}
return obj.(*v1.SecurityContextConstraints), err
}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicyreview.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicyreview.go
index 4d4937b4c3..9ccf473a78 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicyreview.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicyreview.go
@@ -8,7 +8,7 @@ import (
v1 "github.com/openshift/api/security/v1"
scheme "github.com/openshift/client-go/security/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// PodSecurityPolicyReviewsGetter has a method to return a PodSecurityPolicyReviewInterface.
@@ -25,27 +25,17 @@ type PodSecurityPolicyReviewInterface interface {
// podSecurityPolicyReviews implements PodSecurityPolicyReviewInterface
type podSecurityPolicyReviews struct {
- client rest.Interface
- ns string
+ *gentype.Client[*v1.PodSecurityPolicyReview]
}
// newPodSecurityPolicyReviews returns a PodSecurityPolicyReviews
func newPodSecurityPolicyReviews(c *SecurityV1Client, namespace string) *podSecurityPolicyReviews {
return &podSecurityPolicyReviews{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClient[*v1.PodSecurityPolicyReview](
+ "podsecuritypolicyreviews",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1.PodSecurityPolicyReview { return &v1.PodSecurityPolicyReview{} }),
}
}
-
-// Create takes the representation of a podSecurityPolicyReview and creates it. Returns the server's representation of the podSecurityPolicyReview, and an error, if there is any.
-func (c *podSecurityPolicyReviews) Create(ctx context.Context, podSecurityPolicyReview *v1.PodSecurityPolicyReview, opts metav1.CreateOptions) (result *v1.PodSecurityPolicyReview, err error) {
- result = &v1.PodSecurityPolicyReview{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("podsecuritypolicyreviews").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(podSecurityPolicyReview).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicyselfsubjectreview.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicyselfsubjectreview.go
index 1190e3796c..794322ea95 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicyselfsubjectreview.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicyselfsubjectreview.go
@@ -8,7 +8,7 @@ import (
v1 "github.com/openshift/api/security/v1"
scheme "github.com/openshift/client-go/security/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// PodSecurityPolicySelfSubjectReviewsGetter has a method to return a PodSecurityPolicySelfSubjectReviewInterface.
@@ -25,27 +25,17 @@ type PodSecurityPolicySelfSubjectReviewInterface interface {
// podSecurityPolicySelfSubjectReviews implements PodSecurityPolicySelfSubjectReviewInterface
type podSecurityPolicySelfSubjectReviews struct {
- client rest.Interface
- ns string
+ *gentype.Client[*v1.PodSecurityPolicySelfSubjectReview]
}
// newPodSecurityPolicySelfSubjectReviews returns a PodSecurityPolicySelfSubjectReviews
func newPodSecurityPolicySelfSubjectReviews(c *SecurityV1Client, namespace string) *podSecurityPolicySelfSubjectReviews {
return &podSecurityPolicySelfSubjectReviews{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClient[*v1.PodSecurityPolicySelfSubjectReview](
+ "podsecuritypolicyselfsubjectreviews",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1.PodSecurityPolicySelfSubjectReview { return &v1.PodSecurityPolicySelfSubjectReview{} }),
}
}
-
-// Create takes the representation of a podSecurityPolicySelfSubjectReview and creates it. Returns the server's representation of the podSecurityPolicySelfSubjectReview, and an error, if there is any.
-func (c *podSecurityPolicySelfSubjectReviews) Create(ctx context.Context, podSecurityPolicySelfSubjectReview *v1.PodSecurityPolicySelfSubjectReview, opts metav1.CreateOptions) (result *v1.PodSecurityPolicySelfSubjectReview, err error) {
- result = &v1.PodSecurityPolicySelfSubjectReview{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("podsecuritypolicyselfsubjectreviews").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(podSecurityPolicySelfSubjectReview).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicysubjectreview.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicysubjectreview.go
index 5678072a3c..88bf620959 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicysubjectreview.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/podsecuritypolicysubjectreview.go
@@ -8,7 +8,7 @@ import (
v1 "github.com/openshift/api/security/v1"
scheme "github.com/openshift/client-go/security/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// PodSecurityPolicySubjectReviewsGetter has a method to return a PodSecurityPolicySubjectReviewInterface.
@@ -25,27 +25,17 @@ type PodSecurityPolicySubjectReviewInterface interface {
// podSecurityPolicySubjectReviews implements PodSecurityPolicySubjectReviewInterface
type podSecurityPolicySubjectReviews struct {
- client rest.Interface
- ns string
+ *gentype.Client[*v1.PodSecurityPolicySubjectReview]
}
// newPodSecurityPolicySubjectReviews returns a PodSecurityPolicySubjectReviews
func newPodSecurityPolicySubjectReviews(c *SecurityV1Client, namespace string) *podSecurityPolicySubjectReviews {
return &podSecurityPolicySubjectReviews{
- client: c.RESTClient(),
- ns: namespace,
+ gentype.NewClient[*v1.PodSecurityPolicySubjectReview](
+ "podsecuritypolicysubjectreviews",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ namespace,
+ func() *v1.PodSecurityPolicySubjectReview { return &v1.PodSecurityPolicySubjectReview{} }),
}
}
-
-// Create takes the representation of a podSecurityPolicySubjectReview and creates it. Returns the server's representation of the podSecurityPolicySubjectReview, and an error, if there is any.
-func (c *podSecurityPolicySubjectReviews) Create(ctx context.Context, podSecurityPolicySubjectReview *v1.PodSecurityPolicySubjectReview, opts metav1.CreateOptions) (result *v1.PodSecurityPolicySubjectReview, err error) {
- result = &v1.PodSecurityPolicySubjectReview{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("podsecuritypolicysubjectreviews").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(podSecurityPolicySubjectReview).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/rangeallocation.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/rangeallocation.go
index 07c4942226..8980a4d607 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/rangeallocation.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/rangeallocation.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/security/v1"
securityv1 "github.com/openshift/client-go/security/applyconfigurations/security/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// RangeAllocationsGetter has a method to return a RangeAllocationInterface.
@@ -39,143 +36,18 @@ type RangeAllocationInterface interface {
// rangeAllocations implements RangeAllocationInterface
type rangeAllocations struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.RangeAllocation, *v1.RangeAllocationList, *securityv1.RangeAllocationApplyConfiguration]
}
// newRangeAllocations returns a RangeAllocations
func newRangeAllocations(c *SecurityV1Client) *rangeAllocations {
return &rangeAllocations{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.RangeAllocation, *v1.RangeAllocationList, *securityv1.RangeAllocationApplyConfiguration](
+ "rangeallocations",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.RangeAllocation { return &v1.RangeAllocation{} },
+ func() *v1.RangeAllocationList { return &v1.RangeAllocationList{} }),
}
}
-
-// Get takes name of the rangeAllocation, and returns the corresponding rangeAllocation object, and an error if there is any.
-func (c *rangeAllocations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RangeAllocation, err error) {
- result = &v1.RangeAllocation{}
- err = c.client.Get().
- Resource("rangeallocations").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of RangeAllocations that match those selectors.
-func (c *rangeAllocations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RangeAllocationList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.RangeAllocationList{}
- err = c.client.Get().
- Resource("rangeallocations").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested rangeAllocations.
-func (c *rangeAllocations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("rangeallocations").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a rangeAllocation and creates it. Returns the server's representation of the rangeAllocation, and an error, if there is any.
-func (c *rangeAllocations) Create(ctx context.Context, rangeAllocation *v1.RangeAllocation, opts metav1.CreateOptions) (result *v1.RangeAllocation, err error) {
- result = &v1.RangeAllocation{}
- err = c.client.Post().
- Resource("rangeallocations").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(rangeAllocation).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a rangeAllocation and updates it. Returns the server's representation of the rangeAllocation, and an error, if there is any.
-func (c *rangeAllocations) Update(ctx context.Context, rangeAllocation *v1.RangeAllocation, opts metav1.UpdateOptions) (result *v1.RangeAllocation, err error) {
- result = &v1.RangeAllocation{}
- err = c.client.Put().
- Resource("rangeallocations").
- Name(rangeAllocation.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(rangeAllocation).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the rangeAllocation and deletes it. Returns an error if one occurs.
-func (c *rangeAllocations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("rangeallocations").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *rangeAllocations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("rangeallocations").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched rangeAllocation.
-func (c *rangeAllocations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RangeAllocation, err error) {
- result = &v1.RangeAllocation{}
- err = c.client.Patch(pt).
- Resource("rangeallocations").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied rangeAllocation.
-func (c *rangeAllocations) Apply(ctx context.Context, rangeAllocation *securityv1.RangeAllocationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RangeAllocation, err error) {
- if rangeAllocation == nil {
- return nil, fmt.Errorf("rangeAllocation provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(rangeAllocation)
- if err != nil {
- return nil, err
- }
- name := rangeAllocation.Name
- if name == nil {
- return nil, fmt.Errorf("rangeAllocation.Name must be provided to Apply")
- }
- result = &v1.RangeAllocation{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("rangeallocations").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/securitycontextconstraints.go b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/securitycontextconstraints.go
index fc60789239..f4b52587f2 100644
--- a/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/securitycontextconstraints.go
+++ b/vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/securitycontextconstraints.go
@@ -4,9 +4,6 @@ package v1
import (
"context"
- json "encoding/json"
- "fmt"
- "time"
v1 "github.com/openshift/api/security/v1"
securityv1 "github.com/openshift/client-go/security/applyconfigurations/security/v1"
@@ -14,7 +11,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
- rest "k8s.io/client-go/rest"
+ gentype "k8s.io/client-go/gentype"
)
// SecurityContextConstraintsGetter has a method to return a SecurityContextConstraintsInterface.
@@ -39,143 +36,18 @@ type SecurityContextConstraintsInterface interface {
// securityContextConstraints implements SecurityContextConstraintsInterface
type securityContextConstraints struct {
- client rest.Interface
+ *gentype.ClientWithListAndApply[*v1.SecurityContextConstraints, *v1.SecurityContextConstraintsList, *securityv1.SecurityContextConstraintsApplyConfiguration]
}
// newSecurityContextConstraints returns a SecurityContextConstraints
func newSecurityContextConstraints(c *SecurityV1Client) *securityContextConstraints {
return &securityContextConstraints{
- client: c.RESTClient(),
+ gentype.NewClientWithListAndApply[*v1.SecurityContextConstraints, *v1.SecurityContextConstraintsList, *securityv1.SecurityContextConstraintsApplyConfiguration](
+ "securitycontextconstraints",
+ c.RESTClient(),
+ scheme.ParameterCodec,
+ "",
+ func() *v1.SecurityContextConstraints { return &v1.SecurityContextConstraints{} },
+ func() *v1.SecurityContextConstraintsList { return &v1.SecurityContextConstraintsList{} }),
}
}
-
-// Get takes name of the securityContextConstraints, and returns the corresponding securityContextConstraints object, and an error if there is any.
-func (c *securityContextConstraints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SecurityContextConstraints, err error) {
- result = &v1.SecurityContextConstraints{}
- err = c.client.Get().
- Resource("securitycontextconstraints").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do(ctx).
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of SecurityContextConstraints that match those selectors.
-func (c *securityContextConstraints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecurityContextConstraintsList, err error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- result = &v1.SecurityContextConstraintsList{}
- err = c.client.Get().
- Resource("securitycontextconstraints").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Do(ctx).
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested securityContextConstraints.
-func (c *securityContextConstraints) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
- var timeout time.Duration
- if opts.TimeoutSeconds != nil {
- timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
- }
- opts.Watch = true
- return c.client.Get().
- Resource("securitycontextconstraints").
- VersionedParams(&opts, scheme.ParameterCodec).
- Timeout(timeout).
- Watch(ctx)
-}
-
-// Create takes the representation of a securityContextConstraints and creates it. Returns the server's representation of the securityContextConstraints, and an error, if there is any.
-func (c *securityContextConstraints) Create(ctx context.Context, securityContextConstraints *v1.SecurityContextConstraints, opts metav1.CreateOptions) (result *v1.SecurityContextConstraints, err error) {
- result = &v1.SecurityContextConstraints{}
- err = c.client.Post().
- Resource("securitycontextconstraints").
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(securityContextConstraints).
- Do(ctx).
- Into(result)
- return
-}
-
-// Update takes the representation of a securityContextConstraints and updates it. Returns the server's representation of the securityContextConstraints, and an error, if there is any.
-func (c *securityContextConstraints) Update(ctx context.Context, securityContextConstraints *v1.SecurityContextConstraints, opts metav1.UpdateOptions) (result *v1.SecurityContextConstraints, err error) {
- result = &v1.SecurityContextConstraints{}
- err = c.client.Put().
- Resource("securitycontextconstraints").
- Name(securityContextConstraints.Name).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(securityContextConstraints).
- Do(ctx).
- Into(result)
- return
-}
-
-// Delete takes name of the securityContextConstraints and deletes it. Returns an error if one occurs.
-func (c *securityContextConstraints) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
- return c.client.Delete().
- Resource("securitycontextconstraints").
- Name(name).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *securityContextConstraints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
- var timeout time.Duration
- if listOpts.TimeoutSeconds != nil {
- timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
- }
- return c.client.Delete().
- Resource("securitycontextconstraints").
- VersionedParams(&listOpts, scheme.ParameterCodec).
- Timeout(timeout).
- Body(&opts).
- Do(ctx).
- Error()
-}
-
-// Patch applies the patch and returns the patched securityContextConstraints.
-func (c *securityContextConstraints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SecurityContextConstraints, err error) {
- result = &v1.SecurityContextConstraints{}
- err = c.client.Patch(pt).
- Resource("securitycontextconstraints").
- Name(name).
- SubResource(subresources...).
- VersionedParams(&opts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
-
-// Apply takes the given apply declarative configuration, applies it and returns the applied securityContextConstraints.
-func (c *securityContextConstraints) Apply(ctx context.Context, securityContextConstraints *securityv1.SecurityContextConstraintsApplyConfiguration, opts metav1.ApplyOptions) (result *v1.SecurityContextConstraints, err error) {
- if securityContextConstraints == nil {
- return nil, fmt.Errorf("securityContextConstraints provided to Apply must not be nil")
- }
- patchOpts := opts.ToPatchOptions()
- data, err := json.Marshal(securityContextConstraints)
- if err != nil {
- return nil, err
- }
- name := securityContextConstraints.Name
- if name == nil {
- return nil, fmt.Errorf("securityContextConstraints.Name must be provided to Apply")
- }
- result = &v1.SecurityContextConstraints{}
- err = c.client.Patch(types.ApplyPatchType).
- Resource("securitycontextconstraints").
- Name(*name).
- VersionedParams(&patchOpts, scheme.ParameterCodec).
- Body(data).
- Do(ctx).
- Into(result)
- return
-}
diff --git a/vendor/github.com/openshift/library-go/pkg/apiserver/jsonpatch/jsonpatch.go b/vendor/github.com/openshift/library-go/pkg/apiserver/jsonpatch/jsonpatch.go
new file mode 100644
index 0000000000..a718832b1e
--- /dev/null
+++ b/vendor/github.com/openshift/library-go/pkg/apiserver/jsonpatch/jsonpatch.go
@@ -0,0 +1,87 @@
+package jsonpatch
+
+import (
+ "encoding/json"
+ "fmt"
+
+ utilerrors "k8s.io/apimachinery/pkg/util/errors"
+)
+
+type PatchOperation struct {
+ Op string `json:"op,omitempty"`
+ Path string `json:"path,omitempty"`
+ Value interface{} `json:"value,omitempty"`
+}
+
+const (
+ patchTestOperation = "test"
+ patchRemoveOperation = "remove"
+)
+
+type PatchSet struct {
+ patches []PatchOperation
+}
+
+func New() *PatchSet {
+ return &PatchSet{}
+}
+
+func (p *PatchSet) WithRemove(path string, test TestCondition) *PatchSet {
+ p.WithTest(test.path, test.value)
+ p.addOperation(patchRemoveOperation, path, nil)
+ return p
+}
+
+func (p *PatchSet) WithTest(path string, value interface{}) *PatchSet {
+ p.addOperation(patchTestOperation, path, value)
+ return p
+}
+
+func (p *PatchSet) IsEmpty() bool {
+ return len(p.patches) == 0
+}
+
+func (p *PatchSet) Marshal() ([]byte, error) {
+ if err := p.validate(); err != nil {
+ return nil, err
+ }
+ jsonBytes, err := json.Marshal(p.patches)
+ if err != nil {
+ return nil, err
+ }
+ return jsonBytes, nil
+}
+
+func (p *PatchSet) addOperation(op, path string, value interface{}) {
+ patch := PatchOperation{
+ Op: op,
+ Path: path,
+ Value: value,
+ }
+ p.patches = append(p.patches, patch)
+}
+
+func (p *PatchSet) validate() error {
+ var errs []error
+ for i, patch := range p.patches {
+ if patch.Op == patchTestOperation {
+ // testing resourceVersion is fragile
+ // because it is likely to change frequently
+ // instead, test against a different field
+ // should be written.
+ if patch.Path == "/metadata/resourceVersion" {
+ errs = append(errs, fmt.Errorf("test operation at index: %d contains forbidden path: %q", i, patch.Path))
+ }
+ }
+ }
+ return utilerrors.NewAggregate(errs)
+}
+
+type TestCondition struct {
+ path string
+ value interface{}
+}
+
+func NewTestCondition(path string, value interface{}) TestCondition {
+ return TestCondition{path, value}
+}
diff --git a/vendor/github.com/openshift/library-go/pkg/config/serving/server.go b/vendor/github.com/openshift/library-go/pkg/config/serving/server.go
index 15ebf898e0..0b406b35b4 100644
--- a/vendor/github.com/openshift/library-go/pkg/config/serving/server.go
+++ b/vendor/github.com/openshift/library-go/pkg/config/serving/server.go
@@ -9,9 +9,12 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
+ utilversion "k8s.io/apimachinery/pkg/util/version"
"k8s.io/apimachinery/pkg/util/wait"
+ "k8s.io/apimachinery/pkg/version"
genericapiserver "k8s.io/apiserver/pkg/server"
genericapiserveroptions "k8s.io/apiserver/pkg/server/options"
+ kasversion "k8s.io/apiserver/pkg/util/version"
"k8s.io/client-go/kubernetes"
"k8s.io/klog/v2"
@@ -19,8 +22,7 @@ import (
operatorv1alpha1 "github.com/openshift/api/operator/v1alpha1"
)
-func ToServerConfig(ctx context.Context, servingInfo configv1.HTTPServingInfo, authenticationConfig operatorv1alpha1.DelegatedAuthentication, authorizationConfig operatorv1alpha1.DelegatedAuthorization,
- kubeConfigFile string, kubeClient *kubernetes.Clientset, le *configv1.LeaderElection, enableHTTP2 bool) (*genericapiserver.Config, error) {
+func ToServerConfig(ctx context.Context, servingInfo configv1.HTTPServingInfo, authenticationConfig operatorv1alpha1.DelegatedAuthentication, authorizationConfig operatorv1alpha1.DelegatedAuthorization, kubeConfigFile string, kubeClient *kubernetes.Clientset, le *configv1.LeaderElection, enableHTTP2 bool, versionInfo *version.Info) (*genericapiserver.Config, error) {
scheme := runtime.NewScheme()
metav1.AddToGroupVersion(scheme, metav1.SchemeGroupVersion)
config := genericapiserver.NewConfig(serializer.NewCodecFactory(scheme))
@@ -83,6 +85,7 @@ func ToServerConfig(ctx context.Context, servingInfo configv1.HTTPServingInfo, a
}
config.SecureServing.DisableHTTP2 = !enableHTTP2
+ config.EffectiveVersion = defaultBuildEffectiveVersion(versionInfo)
return config, nil
}
@@ -103,3 +106,17 @@ func assertAPIConnection(ctx context.Context, kubeClient *kubernetes.Clientset,
return nil
}
+
+// DefaultBuildEffectiveVersion returns the MutableEffectiveVersion based on the
+// current build information.
+// Similar to version.DefaultBuildEffectiveVersion
+func defaultBuildEffectiveVersion(versionInfo *version.Info) kasversion.MutableEffectiveVersion {
+ if versionInfo != nil {
+ // major.minor passed through gitVersion
+ parsedVersion, err := utilversion.Parse(versionInfo.String())
+ if err == nil && (parsedVersion.Major() != 0 || parsedVersion.Minor() != 0) {
+ return kasversion.NewEffectiveVersion(versionInfo.String())
+ }
+ }
+ return kasversion.DefaultKubeEffectiveVersion()
+}
diff --git a/vendor/github.com/openshift/library-go/pkg/controller/controllercmd/builder.go b/vendor/github.com/openshift/library-go/pkg/controller/controllercmd/builder.go
index eccadd26ba..c0b4b77fe0 100644
--- a/vendor/github.com/openshift/library-go/pkg/controller/controllercmd/builder.go
+++ b/vendor/github.com/openshift/library-go/pkg/controller/controllercmd/builder.go
@@ -268,7 +268,7 @@ func (b *ControllerBuilder) Run(ctx context.Context, config *unstructured.Unstru
}
eventRecorder := events.NewKubeRecorderWithOptions(kubeClient.CoreV1().Events(namespace), b.eventRecorderOptions, b.componentName, controllerRef)
- utilruntime.PanicHandlers = append(utilruntime.PanicHandlers, func(r interface{}) {
+ utilruntime.PanicHandlers = append(utilruntime.PanicHandlers, func(c context.Context, r interface{}) {
eventRecorder.Warningf(fmt.Sprintf("%sPanic", strings.Title(b.componentName)), "Panic observed: %v", r)
})
@@ -305,7 +305,7 @@ func (b *ControllerBuilder) Run(ctx context.Context, config *unstructured.Unstru
var server *genericapiserver.GenericAPIServer
if b.servingInfo != nil {
- serverConfig, err := serving.ToServerConfig(ctx, *b.servingInfo, *b.authenticationConfig, *b.authorizationConfig, kubeConfig, kubeClient, b.leaderElection, b.enableHTTP2)
+ serverConfig, err := serving.ToServerConfig(ctx, *b.servingInfo, *b.authenticationConfig, *b.authorizationConfig, kubeConfig, kubeClient, b.leaderElection, b.enableHTTP2, b.versionInfo)
if err != nil {
return err
}
diff --git a/vendor/github.com/openshift/library-go/pkg/controller/factory/base_controller.go b/vendor/github.com/openshift/library-go/pkg/controller/factory/base_controller.go
index 722d95d5e8..bf5b1f373e 100644
--- a/vendor/github.com/openshift/library-go/pkg/controller/factory/base_controller.go
+++ b/vendor/github.com/openshift/library-go/pkg/controller/factory/base_controller.go
@@ -7,6 +7,8 @@ import (
"sync"
"time"
+ applyoperatorv1 "github.com/openshift/client-go/operator/applyconfigurations/operator/v1"
+
"github.com/robfig/cron"
apierrors "k8s.io/apimachinery/pkg/api/errors"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
@@ -17,7 +19,6 @@ import (
operatorv1 "github.com/openshift/api/operator/v1"
"github.com/openshift/library-go/pkg/operator/management"
- "github.com/openshift/library-go/pkg/operator/v1helpers"
operatorv1helpers "github.com/openshift/library-go/pkg/operator/v1helpers"
)
@@ -29,23 +30,31 @@ var defaultCacheSyncTimeout = 10 * time.Minute
// baseController represents generic Kubernetes controller boiler-plate
type baseController struct {
- name string
- cachesToSync []cache.InformerSynced
- sync func(ctx context.Context, controllerContext SyncContext) error
- syncContext SyncContext
- syncDegradedClient operatorv1helpers.OperatorClient
- resyncEvery time.Duration
- resyncSchedules []cron.Schedule
- postStartHooks []PostStartHook
- cacheSyncTimeout time.Duration
+ name string
+ controllerInstanceName string
+ cachesToSync []cache.InformerSynced
+ sync func(ctx context.Context, controllerContext SyncContext) error
+ syncContext SyncContext
+ syncDegradedClient operatorv1helpers.OperatorClient
+ resyncEvery time.Duration
+ resyncSchedules []cron.Schedule
+ postStartHooks []PostStartHook
+ cacheSyncTimeout time.Duration
}
var _ Controller = &baseController{}
+// Name returns a controller name.
func (c baseController) Name() string {
return c.name
}
+// ControllerInstanceName specifies the controller instance.
+// Useful when the same controller is used multiple times.
+func (c baseController) ControllerInstanceName() string {
+ return c.controllerInstanceName
+}
+
type scheduledJob struct {
queue workqueue.RateLimitingInterface
name string
@@ -222,23 +231,25 @@ func (c *baseController) reportDegraded(ctx context.Context, reportedError error
return reportedError
}
if reportedError != nil {
- _, _, updateErr := v1helpers.UpdateStatus(ctx, c.syncDegradedClient, v1helpers.UpdateConditionFn(operatorv1.OperatorCondition{
- Type: c.name + "Degraded",
- Status: operatorv1.ConditionTrue,
- Reason: "SyncError",
- Message: reportedError.Error(),
- }))
+ condition := applyoperatorv1.OperatorStatus().
+ WithConditions(applyoperatorv1.OperatorCondition().
+ WithType(c.name + "Degraded").
+ WithStatus(operatorv1.ConditionTrue).
+ WithReason("SyncError").
+ WithMessage(reportedError.Error()))
+ updateErr := c.syncDegradedClient.ApplyOperatorStatus(ctx, ControllerFieldManager(c.name, "reportDegraded"), condition)
if updateErr != nil {
klog.Warningf("Updating status of %q failed: %v", c.Name(), updateErr)
}
return reportedError
}
- _, _, updateErr := v1helpers.UpdateStatus(ctx, c.syncDegradedClient,
- v1helpers.UpdateConditionFn(operatorv1.OperatorCondition{
- Type: c.name + "Degraded",
- Status: operatorv1.ConditionFalse,
- Reason: "AsExpected",
- }))
+
+ condition := applyoperatorv1.OperatorStatus().
+ WithConditions(applyoperatorv1.OperatorCondition().
+ WithType(c.name + "Degraded").
+ WithStatus(operatorv1.ConditionFalse).
+ WithReason("AsExpected"))
+ updateErr := c.syncDegradedClient.ApplyOperatorStatus(ctx, ControllerFieldManager(c.name, "reportDegraded"), condition)
return updateErr
}
diff --git a/vendor/github.com/openshift/library-go/pkg/controller/factory/factory.go b/vendor/github.com/openshift/library-go/pkg/controller/factory/factory.go
index a431f1f1a6..1f9b15a727 100644
--- a/vendor/github.com/openshift/library-go/pkg/controller/factory/factory.go
+++ b/vendor/github.com/openshift/library-go/pkg/controller/factory/factory.go
@@ -25,17 +25,18 @@ func DefaultQueueKeysFunc(_ runtime.Object) []string {
// Factory is generator that generate standard Kubernetes controllers.
// Factory is really generic and should be only used for simple controllers that does not require special stuff..
type Factory struct {
- sync SyncFunc
- syncContext SyncContext
- syncDegradedClient operatorv1helpers.OperatorClient
- resyncInterval time.Duration
- resyncSchedules []string
- informers []filteredInformers
- informerQueueKeys []informersWithQueueKey
- bareInformers []Informer
- postStartHooks []PostStartHook
- namespaceInformers []*namespaceInformer
- cachesToSync []cache.InformerSynced
+ sync SyncFunc
+ syncContext SyncContext
+ syncDegradedClient operatorv1helpers.OperatorClient
+ resyncInterval time.Duration
+ resyncSchedules []string
+ informers []filteredInformers
+ informerQueueKeys []informersWithQueueKey
+ bareInformers []Informer
+ postStartHooks []PostStartHook
+ namespaceInformers []*namespaceInformer
+ cachesToSync []cache.InformerSynced
+ controllerInstanceName string
}
// Informer represents any structure that allow to register event handlers and informs if caches are synced.
@@ -237,6 +238,13 @@ func (f *Factory) WithSyncDegradedOnError(operatorClient operatorv1helpers.Opera
return f
}
+// WithControllerInstanceName specifies the controller instance.
+// Useful when the same controller is used multiple times.
+func (f *Factory) WithControllerInstanceName(controllerInstanceName string) *Factory {
+ f.controllerInstanceName = controllerInstanceName
+ return f
+}
+
// Controller produce a runnable controller.
func (f *Factory) ToController(name string, eventRecorder events.Recorder) Controller {
if f.sync == nil {
@@ -266,15 +274,16 @@ func (f *Factory) ToController(name string, eventRecorder events.Recorder) Contr
}
c := &baseController{
- name: name,
- syncDegradedClient: f.syncDegradedClient,
- sync: f.sync,
- resyncEvery: f.resyncInterval,
- resyncSchedules: cronSchedules,
- cachesToSync: append([]cache.InformerSynced{}, f.cachesToSync...),
- syncContext: ctx,
- postStartHooks: f.postStartHooks,
- cacheSyncTimeout: defaultCacheSyncTimeout,
+ name: name,
+ controllerInstanceName: f.controllerInstanceName,
+ syncDegradedClient: f.syncDegradedClient,
+ sync: f.sync,
+ resyncEvery: f.resyncInterval,
+ resyncSchedules: cronSchedules,
+ cachesToSync: append([]cache.InformerSynced{}, f.cachesToSync...),
+ syncContext: ctx,
+ postStartHooks: f.postStartHooks,
+ cacheSyncTimeout: defaultCacheSyncTimeout,
}
for i := range f.informerQueueKeys {
diff --git a/vendor/github.com/openshift/library-go/pkg/controller/factory/interfaces.go b/vendor/github.com/openshift/library-go/pkg/controller/factory/interfaces.go
index 0ef98c6701..f0cbfd0c80 100644
--- a/vendor/github.com/openshift/library-go/pkg/controller/factory/interfaces.go
+++ b/vendor/github.com/openshift/library-go/pkg/controller/factory/interfaces.go
@@ -2,6 +2,7 @@ package factory
import (
"context"
+ "fmt"
"k8s.io/client-go/util/workqueue"
@@ -45,3 +46,11 @@ type SyncContext interface {
// The syncContext.syncContext passed is the main controller syncContext, when cancelled it means the controller is being shut down.
// The syncContext provides access to controller name, queue and event recorder.
type SyncFunc func(ctx context.Context, controllerContext SyncContext) error
+
+func ControllerFieldManager(controllerName, usageName string) string {
+ return fmt.Sprintf("%s-%s", controllerName, usageName)
+}
+
+func ControllerInstanceName(instanceName, controllerName string) string {
+ return fmt.Sprintf("%s-%s", instanceName, controllerName)
+}
diff --git a/vendor/github.com/openshift/library-go/pkg/crypto/crypto.go b/vendor/github.com/openshift/library-go/pkg/crypto/crypto.go
index 63184d2eb4..e6651fecc2 100644
--- a/vendor/github.com/openshift/library-go/pkg/crypto/crypto.go
+++ b/vendor/github.com/openshift/library-go/pkg/crypto/crypto.go
@@ -150,9 +150,9 @@ var ciphers = map[string]uint16{
// ref: https://www.iana.org/assignments/tls-parameters/tls-parameters.xml
var openSSLToIANACiphersMap = map[string]string{
// TLS 1.3 ciphers - not configurable in go 1.13, all of them are used in TLSv1.3 flows
- // "TLS_AES_128_GCM_SHA256": "TLS_AES_128_GCM_SHA256", // 0x13,0x01
- // "TLS_AES_256_GCM_SHA384": "TLS_AES_256_GCM_SHA384", // 0x13,0x02
- // "TLS_CHACHA20_POLY1305_SHA256": "TLS_CHACHA20_POLY1305_SHA256", // 0x13,0x03
+ "TLS_AES_128_GCM_SHA256": "TLS_AES_128_GCM_SHA256", // 0x13,0x01
+ "TLS_AES_256_GCM_SHA384": "TLS_AES_256_GCM_SHA384", // 0x13,0x02
+ "TLS_CHACHA20_POLY1305_SHA256": "TLS_CHACHA20_POLY1305_SHA256", // 0x13,0x03
// TLS 1.2
"ECDHE-ECDSA-AES128-GCM-SHA256": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", // 0xC0,0x2B
diff --git a/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/canonicalize.go b/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/canonicalize.go
new file mode 100644
index 0000000000..b6a59e243e
--- /dev/null
+++ b/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/canonicalize.go
@@ -0,0 +1,109 @@
+package v1helpers
+
+import (
+ "fmt"
+ "slices"
+ "strings"
+
+ operatorv1 "github.com/openshift/api/operator/v1"
+ applyoperatorv1 "github.com/openshift/client-go/operator/applyconfigurations/operator/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/util/json"
+ "k8s.io/utils/clock"
+ "k8s.io/utils/ptr"
+)
+
+// ToStaticPodOperator returns the equivalent typed kind for the applyconfiguration. Due to differences in serialization like
+// omitempty on strings versus pointers, the returned values can be slightly different. This is an expensive way to diff the
+// result, but it is an effective one.
+func ToStaticPodOperator(in *applyoperatorv1.StaticPodOperatorStatusApplyConfiguration) (*operatorv1.StaticPodOperatorStatus, error) {
+ if in == nil {
+ return nil, nil
+ }
+ jsonBytes, err := json.Marshal(in)
+ if err != nil {
+ return nil, fmt.Errorf("unable to serialize: %w", err)
+ }
+
+ ret := &operatorv1.StaticPodOperatorStatus{}
+ if err := json.Unmarshal(jsonBytes, ret); err != nil {
+ return nil, fmt.Errorf("unable to deserialize: %w", err)
+ }
+
+ return ret, nil
+}
+
+func SetApplyConditionsLastTransitionTime(clock clock.PassiveClock, newConditions *[]applyoperatorv1.OperatorConditionApplyConfiguration, oldConditions []applyoperatorv1.OperatorConditionApplyConfiguration) {
+ if newConditions == nil {
+ return
+ }
+
+ now := metav1.NewTime(clock.Now())
+ for i := range *newConditions {
+ newCondition := (*newConditions)[i]
+
+ // if the condition status is the same, then the lastTransitionTime doesn't change
+ if existingCondition := FindApplyCondition(oldConditions, newCondition.Type); existingCondition != nil && ptr.Equal(existingCondition.Status, newCondition.Status) {
+ newCondition.LastTransitionTime = existingCondition.LastTransitionTime
+ }
+
+ // backstop to handle upgrade case too. If the newCondition doesn't have a lastTransitionTime it needs something
+ if newCondition.LastTransitionTime == nil {
+ newCondition.LastTransitionTime = &now
+ }
+
+ (*newConditions)[i] = newCondition
+ }
+}
+
+func FindApplyCondition(haystack []applyoperatorv1.OperatorConditionApplyConfiguration, conditionType *string) *applyoperatorv1.OperatorConditionApplyConfiguration {
+ for i := range haystack {
+ curr := haystack[i]
+ if ptr.Equal(curr.Type, conditionType) {
+ return &curr
+ }
+ }
+
+ return nil
+}
+
+func CanonicalizeStaticPodOperatorStatus(obj *applyoperatorv1.StaticPodOperatorStatusApplyConfiguration) {
+ if obj == nil {
+ return
+ }
+ CanonicalizeOperatorStatus(&obj.OperatorStatusApplyConfiguration)
+ slices.SortStableFunc(obj.NodeStatuses, CompareNodeStatusByNode)
+}
+
+func CanonicalizeOperatorStatus(obj *applyoperatorv1.OperatorStatusApplyConfiguration) {
+ if obj == nil {
+ return
+ }
+ slices.SortStableFunc(obj.Conditions, CompareOperatorConditionByType)
+ slices.SortStableFunc(obj.Generations, CompareGenerationStatusByKeys)
+}
+
+func CompareOperatorConditionByType(a, b applyoperatorv1.OperatorConditionApplyConfiguration) int {
+ return strings.Compare(ptr.Deref(a.Type, ""), ptr.Deref(b.Type, ""))
+}
+
+func CompareGenerationStatusByKeys(a, b applyoperatorv1.GenerationStatusApplyConfiguration) int {
+ if c := strings.Compare(ptr.Deref(a.Group, ""), ptr.Deref(b.Group, "")); c != 0 {
+ return c
+ }
+ if c := strings.Compare(ptr.Deref(a.Resource, ""), ptr.Deref(b.Resource, "")); c != 0 {
+ return c
+ }
+ if c := strings.Compare(ptr.Deref(a.Namespace, ""), ptr.Deref(b.Namespace, "")); c != 0 {
+ return c
+ }
+ if c := strings.Compare(ptr.Deref(a.Name, ""), ptr.Deref(b.Name, "")); c != 0 {
+ return c
+ }
+
+ return 0
+}
+
+func CompareNodeStatusByNode(a, b applyoperatorv1.NodeStatusApplyConfiguration) int {
+ return strings.Compare(ptr.Deref(a.NodeName, ""), ptr.Deref(b.NodeName, ""))
+}
diff --git a/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/informers.go b/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/informers.go
index 1dd17e7590..cd31031242 100644
--- a/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/informers.go
+++ b/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/informers.go
@@ -2,6 +2,7 @@ package v1helpers
import (
"fmt"
+ "reflect"
"time"
corev1 "k8s.io/api/core/v1"
@@ -18,6 +19,10 @@ type KubeInformersForNamespaces interface {
InformersFor(namespace string) informers.SharedInformerFactory
Namespaces() sets.Set[string]
+ // WaitForCacheSync blocks until all started informers' caches were synced
+ // or the stop channel gets closed.
+ WaitForCacheSync(stopCh <-chan struct{}) map[string]map[reflect.Type]bool
+
ConfigMapLister() corev1listers.ConfigMapLister
SecretLister() corev1listers.SecretLister
@@ -42,6 +47,16 @@ func NewKubeInformersForNamespaces(kubeClient kubernetes.Interface, namespaces .
type kubeInformersForNamespaces map[string]informers.SharedInformerFactory
+// WaitForCacheSync waits for all started informers' cache were synced.
+func (i kubeInformersForNamespaces) WaitForCacheSync(stopCh <-chan struct{}) map[string]map[reflect.Type]bool {
+ ret := map[string]map[reflect.Type]bool{}
+ for namespace, informerFactory := range i {
+ ret[namespace] = informerFactory.WaitForCacheSync(stopCh)
+ }
+
+ return ret
+}
+
func (i kubeInformersForNamespaces) Start(stopCh <-chan struct{}) {
for _, informer := range i {
informer.Start(stopCh)
diff --git a/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/interfaces.go b/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/interfaces.go
index 1dd9c641a5..50bfae945e 100644
--- a/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/interfaces.go
+++ b/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/interfaces.go
@@ -4,7 +4,11 @@ import (
"context"
operatorv1 "github.com/openshift/api/operator/v1"
+ applyoperatorv1 "github.com/openshift/client-go/operator/applyconfigurations/operator/v1"
+ "github.com/openshift/library-go/pkg/apiserver/jsonpatch"
+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/client-go/tools/cache"
)
@@ -20,6 +24,11 @@ type OperatorClient interface {
UpdateOperatorSpec(ctx context.Context, oldResourceVersion string, in *operatorv1.OperatorSpec) (out *operatorv1.OperatorSpec, newResourceVersion string, err error)
// UpdateOperatorStatus updates the status of the operator, assuming the given resource version.
UpdateOperatorStatus(ctx context.Context, oldResourceVersion string, in *operatorv1.OperatorStatus) (out *operatorv1.OperatorStatus, err error)
+
+ ApplyOperatorSpec(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.OperatorSpecApplyConfiguration) (err error)
+ ApplyOperatorStatus(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.OperatorStatusApplyConfiguration) (err error)
+
+ PatchOperatorStatus(ctx context.Context, jsonPatch *jsonpatch.PatchSet) (err error)
}
type StaticPodOperatorClient interface {
@@ -34,6 +43,11 @@ type StaticPodOperatorClient interface {
UpdateStaticPodOperatorStatus(ctx context.Context, resourceVersion string, in *operatorv1.StaticPodOperatorStatus) (out *operatorv1.StaticPodOperatorStatus, err error)
// UpdateStaticPodOperatorSpec updates the spec, assuming the given resource version.
UpdateStaticPodOperatorSpec(ctx context.Context, resourceVersion string, in *operatorv1.StaticPodOperatorSpec) (out *operatorv1.StaticPodOperatorSpec, newResourceVersion string, err error)
+
+ ApplyStaticPodOperatorSpec(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.StaticPodOperatorSpecApplyConfiguration) (err error)
+ ApplyStaticPodOperatorStatus(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.StaticPodOperatorStatusApplyConfiguration) (err error)
+
+ PatchStaticOperatorStatus(ctx context.Context, jsonPatch *jsonpatch.PatchSet) (err error)
}
type OperatorClientWithFinalizers interface {
@@ -43,3 +57,11 @@ type OperatorClientWithFinalizers interface {
// RemoveFinalizer removes a finalizer from the operator CR, if it is there. No-op otherwise.
RemoveFinalizer(ctx context.Context, finalizer string) error
}
+
+type Foo interface {
+ ExtractOperatorSpec(fieldManager string) (*applyoperatorv1.OperatorSpecApplyConfiguration, error)
+ ExtractOperatorStatus(fieldManager string) (*applyoperatorv1.OperatorStatusApplyConfiguration, error)
+}
+
+type OperatorSpecExtractor func(obj *unstructured.Unstructured, fieldManager string) (*applyoperatorv1.OperatorSpecApplyConfiguration, error)
+type OperatorStatusExtractor func(obj *unstructured.Unstructured, fieldManager string) (*applyoperatorv1.OperatorStatusApplyConfiguration, error)
diff --git a/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/test_helpers.go b/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/test_helpers.go
index 7fa64719fe..68694179af 100644
--- a/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/test_helpers.go
+++ b/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/test_helpers.go
@@ -14,8 +14,12 @@ import (
"k8s.io/client-go/kubernetes"
corev1listers "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/tools/cache"
+ "k8s.io/utils/ptr"
operatorv1 "github.com/openshift/api/operator/v1"
+ v1 "github.com/openshift/api/operator/v1"
+ applyoperatorv1 "github.com/openshift/client-go/operator/applyconfigurations/operator/v1"
+ "github.com/openshift/library-go/pkg/apiserver/jsonpatch"
)
// NewFakeSharedIndexInformer returns a fake shared index informer, suitable to use in static pod controller unit tests.
@@ -81,7 +85,7 @@ func (fakeSharedIndexInformer) SetTransform(f cache.TransformFunc) error {
func NewFakeStaticPodOperatorClient(
staticPodSpec *operatorv1.StaticPodOperatorSpec, staticPodStatus *operatorv1.StaticPodOperatorStatus,
triggerStatusErr func(rv string, status *operatorv1.StaticPodOperatorStatus) error,
- triggerSpecErr func(rv string, spec *operatorv1.StaticPodOperatorSpec) error) StaticPodOperatorClient {
+ triggerSpecErr func(rv string, spec *operatorv1.StaticPodOperatorSpec) error) *fakeStaticPodOperatorClient {
return &fakeStaticPodOperatorClient{
fakeStaticPodOperatorSpec: staticPodSpec,
fakeStaticPodOperatorStatus: staticPodStatus,
@@ -97,6 +101,8 @@ type fakeStaticPodOperatorClient struct {
resourceVersion string
triggerStatusUpdateError func(rv string, status *operatorv1.StaticPodOperatorStatus) error
triggerSpecUpdateError func(rv string, status *operatorv1.StaticPodOperatorSpec) error
+
+ patchedOperatorStatus *jsonpatch.PatchSet
}
func (c *fakeStaticPodOperatorClient) Informer() cache.SharedIndexInformer {
@@ -155,6 +161,54 @@ func (c *fakeStaticPodOperatorClient) UpdateStaticPodOperatorSpec(ctx context.Co
return c.fakeStaticPodOperatorSpec, c.resourceVersion, nil
}
+func (c *fakeStaticPodOperatorClient) ApplyOperatorSpec(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.OperatorSpecApplyConfiguration) (err error) {
+ return nil
+}
+
+func (c *fakeStaticPodOperatorClient) ApplyOperatorStatus(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.OperatorStatusApplyConfiguration) (err error) {
+ if c.triggerStatusUpdateError != nil {
+ operatorStatus := &operatorv1.StaticPodOperatorStatus{OperatorStatus: *mergeOperatorStatusApplyConfiguration(&c.fakeStaticPodOperatorStatus.OperatorStatus, applyConfiguration)}
+ if err := c.triggerStatusUpdateError("", operatorStatus); err != nil {
+ return err
+ }
+ }
+ c.fakeStaticPodOperatorStatus = &operatorv1.StaticPodOperatorStatus{
+ OperatorStatus: *mergeOperatorStatusApplyConfiguration(&c.fakeStaticPodOperatorStatus.OperatorStatus, applyConfiguration),
+ }
+ return nil
+}
+
+func (c *fakeStaticPodOperatorClient) ApplyStaticPodOperatorSpec(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.StaticPodOperatorSpecApplyConfiguration) (err error) {
+ return nil
+}
+
+func (c *fakeStaticPodOperatorClient) ApplyStaticPodOperatorStatus(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.StaticPodOperatorStatusApplyConfiguration) (err error) {
+ if c.triggerStatusUpdateError != nil {
+ operatorStatus := mergeStaticPodOperatorStatusApplyConfiguration(&c.fakeStaticPodOperatorStatus.OperatorStatus, applyConfiguration)
+ if err := c.triggerStatusUpdateError("", operatorStatus); err != nil {
+ return err
+ }
+ }
+ c.fakeStaticPodOperatorStatus = mergeStaticPodOperatorStatusApplyConfiguration(&c.fakeStaticPodOperatorStatus.OperatorStatus, applyConfiguration)
+ return nil
+}
+
+func (c *fakeStaticPodOperatorClient) PatchOperatorStatus(ctx context.Context, jsonPatch *jsonpatch.PatchSet) (err error) {
+ return nil
+}
+
+func (c *fakeStaticPodOperatorClient) PatchStaticOperatorStatus(ctx context.Context, jsonPatch *jsonpatch.PatchSet) (err error) {
+ if c.triggerStatusUpdateError != nil {
+ return c.triggerStatusUpdateError("", nil)
+ }
+ c.patchedOperatorStatus = jsonPatch
+ return nil
+}
+
+func (c *fakeStaticPodOperatorClient) GetPatchedOperatorStatus() *jsonpatch.PatchSet {
+ return c.patchedOperatorStatus
+}
+
func (c *fakeStaticPodOperatorClient) GetOperatorState() (*operatorv1.OperatorSpec, *operatorv1.OperatorStatus, string, error) {
return &c.fakeStaticPodOperatorSpec.OperatorSpec, &c.fakeStaticPodOperatorStatus.OperatorStatus, c.resourceVersion, nil
}
@@ -210,11 +264,11 @@ func (n *fakeNodeLister) Get(name string) (*corev1.Node, error) {
}
// NewFakeOperatorClient returns a fake operator client suitable to use in static pod controller unit tests.
-func NewFakeOperatorClient(spec *operatorv1.OperatorSpec, status *operatorv1.OperatorStatus, triggerErr func(rv string, status *operatorv1.OperatorStatus) error) OperatorClientWithFinalizers {
+func NewFakeOperatorClient(spec *operatorv1.OperatorSpec, status *operatorv1.OperatorStatus, triggerErr func(rv string, status *operatorv1.OperatorStatus) error) *fakeOperatorClient {
return NewFakeOperatorClientWithObjectMeta(nil, spec, status, triggerErr)
}
-func NewFakeOperatorClientWithObjectMeta(meta *metav1.ObjectMeta, spec *operatorv1.OperatorSpec, status *operatorv1.OperatorStatus, triggerErr func(rv string, status *operatorv1.OperatorStatus) error) OperatorClientWithFinalizers {
+func NewFakeOperatorClientWithObjectMeta(meta *metav1.ObjectMeta, spec *operatorv1.OperatorSpec, status *operatorv1.OperatorStatus, triggerErr func(rv string, status *operatorv1.OperatorStatus) error) *fakeOperatorClient {
return &fakeOperatorClient{
fakeOperatorSpec: spec,
fakeOperatorStatus: status,
@@ -230,6 +284,8 @@ type fakeOperatorClient struct {
fakeObjectMeta *metav1.ObjectMeta
resourceVersion string
triggerStatusUpdateError func(rv string, status *operatorv1.OperatorStatus) error
+
+ patchedOperatorStatus *jsonpatch.PatchSet
}
func (c *fakeOperatorClient) Informer() cache.SharedIndexInformer {
@@ -283,6 +339,27 @@ func (c *fakeOperatorClient) UpdateOperatorSpec(ctx context.Context, resourceVer
return c.fakeOperatorSpec, c.resourceVersion, nil
}
+func (c *fakeOperatorClient) ApplyOperatorSpec(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.OperatorSpecApplyConfiguration) (err error) {
+ return nil
+}
+
+func (c *fakeOperatorClient) ApplyOperatorStatus(ctx context.Context, fieldManager string, applyConfiguration *applyoperatorv1.OperatorStatusApplyConfiguration) (err error) {
+ c.fakeOperatorStatus = mergeOperatorStatusApplyConfiguration(c.fakeOperatorStatus, applyConfiguration)
+ return nil
+}
+
+func (c *fakeOperatorClient) PatchOperatorStatus(ctx context.Context, jsonPatch *jsonpatch.PatchSet) (err error) {
+ if c.triggerStatusUpdateError != nil {
+ return c.triggerStatusUpdateError("", nil)
+ }
+ c.patchedOperatorStatus = jsonPatch
+ return nil
+}
+
+func (c *fakeOperatorClient) GetPatchedOperatorStatus() *jsonpatch.PatchSet {
+ return c.patchedOperatorStatus
+}
+
func (c *fakeOperatorClient) EnsureFinalizer(ctx context.Context, finalizer string) error {
if c.fakeObjectMeta == nil {
c.fakeObjectMeta = &metav1.ObjectMeta{}
@@ -311,3 +388,93 @@ func (c *fakeOperatorClient) RemoveFinalizer(ctx context.Context, finalizer stri
func (c *fakeOperatorClient) SetObjectMeta(meta *metav1.ObjectMeta) {
c.fakeObjectMeta = meta
}
+
+func mergeOperatorStatusApplyConfiguration(currentOperatorStatus *v1.OperatorStatus, applyConfiguration *applyoperatorv1.OperatorStatusApplyConfiguration) *v1.OperatorStatus {
+ status := &v1.OperatorStatus{
+ ObservedGeneration: ptr.Deref(applyConfiguration.ObservedGeneration, currentOperatorStatus.ObservedGeneration),
+ Version: ptr.Deref(applyConfiguration.Version, currentOperatorStatus.Version),
+ ReadyReplicas: ptr.Deref(applyConfiguration.ReadyReplicas, currentOperatorStatus.ReadyReplicas),
+ LatestAvailableRevision: ptr.Deref(applyConfiguration.LatestAvailableRevision, currentOperatorStatus.LatestAvailableRevision),
+ }
+
+ for _, condition := range applyConfiguration.Conditions {
+ newCondition := operatorv1.OperatorCondition{
+ Type: ptr.Deref(condition.Type, ""),
+ Status: ptr.Deref(condition.Status, ""),
+ Reason: ptr.Deref(condition.Reason, ""),
+ Message: ptr.Deref(condition.Message, ""),
+ }
+ status.Conditions = append(status.Conditions, newCondition)
+ }
+ var existingConditions []v1.OperatorCondition
+ for _, condition := range currentOperatorStatus.Conditions {
+ var foundCondition bool
+ for _, statusCondition := range status.Conditions {
+ if condition.Type == statusCondition.Type {
+ foundCondition = true
+ break
+ }
+ }
+ if !foundCondition {
+ existingConditions = append(existingConditions, condition)
+ }
+ }
+ status.Conditions = append(status.Conditions, existingConditions...)
+
+ for _, generation := range applyConfiguration.Generations {
+ newGeneration := operatorv1.GenerationStatus{
+ Group: ptr.Deref(generation.Group, ""),
+ Resource: ptr.Deref(generation.Resource, ""),
+ Namespace: ptr.Deref(generation.Namespace, ""),
+ Name: ptr.Deref(generation.Name, ""),
+ LastGeneration: ptr.Deref(generation.LastGeneration, 0),
+ Hash: ptr.Deref(generation.Hash, ""),
+ }
+ status.Generations = append(status.Generations, newGeneration)
+ }
+ var existingGenerations []v1.GenerationStatus
+ for _, generation := range currentOperatorStatus.Generations {
+ var foundGeneration bool
+ for _, statusGeneration := range status.Generations {
+ if generation.Namespace == statusGeneration.Namespace && generation.Name == statusGeneration.Name {
+ foundGeneration = true
+ break
+ }
+ }
+ if !foundGeneration {
+ existingGenerations = append(existingGenerations, generation)
+ }
+ }
+ status.Generations = append(status.Generations, existingGenerations...)
+
+ return status
+}
+
+func mergeStaticPodOperatorStatusApplyConfiguration(currentOperatorStatus *v1.OperatorStatus, applyConfiguration *applyoperatorv1.StaticPodOperatorStatusApplyConfiguration) *v1.StaticPodOperatorStatus {
+ status := &v1.StaticPodOperatorStatus{
+ OperatorStatus: *mergeOperatorStatusApplyConfiguration(currentOperatorStatus, &applyConfiguration.OperatorStatusApplyConfiguration),
+ }
+
+ for _, nodeStatus := range applyConfiguration.NodeStatuses {
+ newNodeStatus := operatorv1.NodeStatus{
+ NodeName: ptr.Deref(nodeStatus.NodeName, ""),
+ CurrentRevision: ptr.Deref(nodeStatus.CurrentRevision, 0),
+ TargetRevision: ptr.Deref(nodeStatus.TargetRevision, 0),
+ LastFailedRevision: ptr.Deref(nodeStatus.LastFailedRevision, 0),
+ LastFailedTime: nil,
+ LastFailedReason: ptr.Deref(nodeStatus.LastFailedReason, ""),
+ LastFailedCount: ptr.Deref(nodeStatus.LastFailedCount, 0),
+ LastFallbackCount: ptr.Deref(nodeStatus.LastFallbackCount, 0),
+ LastFailedRevisionErrors: nil,
+ }
+ if nodeStatus.LastFailedTime != nil {
+ newNodeStatus.LastFailedTime = nodeStatus.LastFailedTime
+ }
+ for _, curr := range nodeStatus.LastFailedRevisionErrors {
+ newNodeStatus.LastFailedRevisionErrors = append(newNodeStatus.LastFailedRevisionErrors, curr)
+ }
+ status.NodeStatuses = append(status.NodeStatuses, newNodeStatus)
+ }
+
+ return status
+}
diff --git a/vendor/github.com/openshift/library-go/pkg/serviceability/panic.go b/vendor/github.com/openshift/library-go/pkg/serviceability/panic.go
index 93309febac..11cfd2fc81 100644
--- a/vendor/github.com/openshift/library-go/pkg/serviceability/panic.go
+++ b/vendor/github.com/openshift/library-go/pkg/serviceability/panic.go
@@ -1,6 +1,7 @@
package serviceability
import (
+ "context"
"encoding/json"
"strings"
"time"
@@ -65,8 +66,8 @@ func behaviorOnPanic(mode string, productVersion version.Info) func() {
}
}
-func crashOnDelay(delay time.Duration, delayString string) func(interface{}) {
- return func(in interface{}) {
+func crashOnDelay(delay time.Duration, delayString string) func(context.Context, interface{}) {
+ return func(ctx context.Context, in interface{}) {
go func() {
klog.Errorf("Panic happened. Process will crash in %v.", delayString)
time.Sleep(delay)
diff --git a/vendor/github.com/pkg/profile/.travis.yml b/vendor/github.com/pkg/profile/.travis.yml
index 1c9e6bb6bc..0b895c9849 100644
--- a/vendor/github.com/pkg/profile/.travis.yml
+++ b/vendor/github.com/pkg/profile/.travis.yml
@@ -1,10 +1,9 @@
language: go
go_import_path: github.com/pkg/profile
go:
- - 1.10.x
- - 1.12.x
+ - 1.13.x
+ - 1.14.x
- tip
script:
- - go test github.com/pkg/profile
- go test -race github.com/pkg/profile
diff --git a/vendor/github.com/pkg/profile/README.md b/vendor/github.com/pkg/profile/README.md
index 37bfa58c5f..8bae598267 100644
--- a/vendor/github.com/pkg/profile/README.md
+++ b/vendor/github.com/pkg/profile/README.md
@@ -28,7 +28,7 @@ func main() {
options
-------
-What to profile is controlled by config value passed to profile.Start.
+What to profile is controlled by config value passed to profile.Start.
By default CPU profiling is enabled.
```go
@@ -39,6 +39,9 @@ func main() {
// ensure profiling information is written to disk.
p := profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.NoShutdownHook)
...
+ // You can enable different kinds of memory profiling, either Heap or Allocs where Heap
+ // profiling is the default with profile.MemProfile.
+ p := profile.Start(profile.MemProfileAllocs, profile.ProfilePath("."), profile.NoShutdownHook)
}
```
diff --git a/vendor/github.com/pkg/profile/mutex.go b/vendor/github.com/pkg/profile/mutex.go
deleted file mode 100644
index e69c5b44d8..0000000000
--- a/vendor/github.com/pkg/profile/mutex.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// +build go1.8
-
-package profile
-
-import "runtime"
-
-func enableMutexProfile() {
- runtime.SetMutexProfileFraction(1)
-}
-
-func disableMutexProfile() {
- runtime.SetMutexProfileFraction(0)
-}
diff --git a/vendor/github.com/pkg/profile/mutex17.go b/vendor/github.com/pkg/profile/mutex17.go
deleted file mode 100644
index b004c21d56..0000000000
--- a/vendor/github.com/pkg/profile/mutex17.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// +build !go1.8
-
-package profile
-
-// mock mutex support for Go 1.7 and earlier.
-
-func enableMutexProfile() {}
-
-func disableMutexProfile() {}
diff --git a/vendor/github.com/pkg/profile/profile.go b/vendor/github.com/pkg/profile/profile.go
index 20e285427e..ea4e8533e3 100644
--- a/vendor/github.com/pkg/profile/profile.go
+++ b/vendor/github.com/pkg/profile/profile.go
@@ -10,7 +10,10 @@ import (
"path/filepath"
"runtime"
"runtime/pprof"
+ "runtime/trace"
"sync/atomic"
+
+ "github.com/felixge/fgprof"
)
const (
@@ -20,6 +23,8 @@ const (
blockMode
traceMode
threadCreateMode
+ goroutineMode
+ clockMode
)
// Profile represents an active profiling session.
@@ -41,6 +46,10 @@ type Profile struct {
// memProfileRate holds the rate for the memory profile.
memProfileRate int
+ // memProfileType holds the profile type for memory
+ // profiles. Allowed values are `heap` and `allocs`.
+ memProfileType string
+
// closer holds a cleanup function that run after each profile
closer func()
@@ -82,6 +91,20 @@ func MemProfileRate(rate int) func(*Profile) {
}
}
+// MemProfileHeap changes which type of memory profiling to profile
+// the heap.
+func MemProfileHeap(p *Profile) {
+ p.memProfileType = "heap"
+ p.mode = memMode
+}
+
+// MemProfileAllocs changes which type of memory to profile
+// allocations.
+func MemProfileAllocs(p *Profile) {
+ p.memProfileType = "allocs"
+ p.mode = memMode
+}
+
// MutexProfile enables mutex profiling.
// It disables any previous profiling settings.
func MutexProfile(p *Profile) { p.mode = mutexMode }
@@ -98,6 +121,14 @@ func TraceProfile(p *Profile) { p.mode = traceMode }
// It disables any previous profiling settings.
func ThreadcreationProfile(p *Profile) { p.mode = threadCreateMode }
+// GoroutineProfile enables goroutine profiling.
+// It disables any previous profiling settings.
+func GoroutineProfile(p *Profile) { p.mode = goroutineMode }
+
+// ClockProfile enables wall clock (fgprof) profiling.
+// It disables any previous profiling settings.
+func ClockProfile(p *Profile) { p.mode = clockMode }
+
// ProfilePath controls the base path where various profiling
// files are written. If blank, the base path will be generated
// by ioutil.TempDir.
@@ -152,6 +183,10 @@ func Start(options ...func(*Profile)) interface {
}
}
+ if prof.memProfileType == "" {
+ prof.memProfileType = "heap"
+ }
+
switch prof.mode {
case cpuMode:
fn := filepath.Join(path, "cpu.pprof")
@@ -177,7 +212,7 @@ func Start(options ...func(*Profile)) interface {
runtime.MemProfileRate = prof.memProfileRate
logf("profile: memory profiling enabled (rate %d), %s", runtime.MemProfileRate, fn)
prof.closer = func() {
- pprof.Lookup("heap").WriteTo(f, 0)
+ pprof.Lookup(prof.memProfileType).WriteTo(f, 0)
f.Close()
runtime.MemProfileRate = old
logf("profile: memory profiling disabled, %s", fn)
@@ -189,14 +224,14 @@ func Start(options ...func(*Profile)) interface {
if err != nil {
log.Fatalf("profile: could not create mutex profile %q: %v", fn, err)
}
- enableMutexProfile()
+ runtime.SetMutexProfileFraction(1)
logf("profile: mutex profiling enabled, %s", fn)
prof.closer = func() {
if mp := pprof.Lookup("mutex"); mp != nil {
mp.WriteTo(f, 0)
}
f.Close()
- disableMutexProfile()
+ runtime.SetMutexProfileFraction(0)
logf("profile: mutex profiling disabled, %s", fn)
}
@@ -236,14 +271,43 @@ func Start(options ...func(*Profile)) interface {
if err != nil {
log.Fatalf("profile: could not create trace output file %q: %v", fn, err)
}
- if err := startTrace(f); err != nil {
+ if err := trace.Start(f); err != nil {
log.Fatalf("profile: could not start trace: %v", err)
}
logf("profile: trace enabled, %s", fn)
prof.closer = func() {
- stopTrace()
+ trace.Stop()
logf("profile: trace disabled, %s", fn)
}
+
+ case goroutineMode:
+ fn := filepath.Join(path, "goroutine.pprof")
+ f, err := os.Create(fn)
+ if err != nil {
+ log.Fatalf("profile: could not create goroutine profile %q: %v", fn, err)
+ }
+ logf("profile: goroutine profiling enabled, %s", fn)
+ prof.closer = func() {
+ if mp := pprof.Lookup("goroutine"); mp != nil {
+ mp.WriteTo(f, 0)
+ }
+ f.Close()
+ logf("profile: goroutine profiling disabled, %s", fn)
+ }
+
+ case clockMode:
+ fn := filepath.Join(path, "clock.pprof")
+ f, err := os.Create(fn)
+ if err != nil {
+ log.Fatalf("profile: could not create clock profile %q: %v", fn, err)
+ }
+ logf("profile: clock profiling enabled, %s", fn)
+ stop := fgprof.Start(f, fgprof.FormatPprof)
+ prof.closer = func() {
+ stop()
+ f.Close()
+ logf("profile: clock profiling disabled, %s", fn)
+ }
}
if !prof.noShutdownHook {
diff --git a/vendor/github.com/pkg/profile/trace.go b/vendor/github.com/pkg/profile/trace.go
deleted file mode 100644
index b349ed8b25..0000000000
--- a/vendor/github.com/pkg/profile/trace.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// +build go1.7
-
-package profile
-
-import "runtime/trace"
-
-var startTrace = trace.Start
-var stopTrace = trace.Stop
diff --git a/vendor/github.com/pkg/profile/trace16.go b/vendor/github.com/pkg/profile/trace16.go
deleted file mode 100644
index 6aa6566ef6..0000000000
--- a/vendor/github.com/pkg/profile/trace16.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// +build !go1.7
-
-package profile
-
-import "io"
-
-// mock trace support for Go 1.6 and earlier.
-
-func startTrace(w io.Writer) error { return nil }
-func stopTrace() {}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/collectors/expvar_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/collectors/expvar_collector.go
index 3aa8d0590b..b22d862fbc 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/collectors/expvar_collector.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/collectors/expvar_collector.go
@@ -22,7 +22,7 @@ import "github.com/prometheus/client_golang/prometheus"
// Prometheus metrics. Note that the data models of expvar and Prometheus are
// fundamentally different, and that the expvar Collector is inherently slower
// than native Prometheus metrics. Thus, the expvar Collector is probably great
-// for experiments and prototying, but you should seriously consider a more
+// for experiments and prototyping, but you should seriously consider a more
// direct implementation of Prometheus metrics for monitoring production
// systems.
//
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/collectors/go_collector_latest.go b/vendor/github.com/prometheus/client_golang/prometheus/collectors/go_collector_latest.go
index 2f5616894e..bcfa4fa10e 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/collectors/go_collector_latest.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/collectors/go_collector_latest.go
@@ -132,16 +132,19 @@ type GoCollectionOption uint32
const (
// GoRuntimeMemStatsCollection represents the metrics represented by runtime.MemStats structure.
- // Deprecated. Use WithGoCollectorMemStatsMetricsDisabled() function to disable those metrics in the collector.
+ //
+ // Deprecated: Use WithGoCollectorMemStatsMetricsDisabled() function to disable those metrics in the collector.
GoRuntimeMemStatsCollection GoCollectionOption = 1 << iota
// GoRuntimeMetricsCollection is the new set of metrics represented by runtime/metrics package.
- // Deprecated. Use WithGoCollectorRuntimeMetrics(GoRuntimeMetricsRule{Matcher: regexp.MustCompile("/.*")})
+ //
+ // Deprecated: Use WithGoCollectorRuntimeMetrics(GoRuntimeMetricsRule{Matcher: regexp.MustCompile("/.*")})
// function to enable those metrics in the collector.
GoRuntimeMetricsCollection
)
// WithGoCollections allows enabling different collections for Go collector on top of base metrics.
-// Deprecated. Use WithGoCollectorRuntimeMetrics() and WithGoCollectorMemStatsMetricsDisabled() instead to control metrics.
+//
+// Deprecated: Use WithGoCollectorRuntimeMetrics() and WithGoCollectorMemStatsMetricsDisabled() instead to control metrics.
func WithGoCollections(flags GoCollectionOption) func(options *internal.GoCollectorOptions) {
return func(options *internal.GoCollectorOptions) {
if flags&GoRuntimeMemStatsCollection == 0 {
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/counter.go b/vendor/github.com/prometheus/client_golang/prometheus/counter.go
index 62de4dc59a..4ce84e7a80 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/counter.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/counter.go
@@ -20,6 +20,7 @@ import (
"time"
dto "github.com/prometheus/client_model/go"
+ "google.golang.org/protobuf/types/known/timestamppb"
)
// Counter is a Metric that represents a single numerical value that only ever
@@ -66,7 +67,7 @@ type CounterVecOpts struct {
CounterOpts
// VariableLabels are used to partition the metric vector by the given set
- // of labels. Each label value will be constrained with the optional Contraint
+ // of labels. Each label value will be constrained with the optional Constraint
// function, if provided.
VariableLabels ConstrainableLabels
}
@@ -90,8 +91,12 @@ func NewCounter(opts CounterOpts) Counter {
nil,
opts.ConstLabels,
)
- result := &counter{desc: desc, labelPairs: desc.constLabelPairs, now: time.Now}
+ if opts.now == nil {
+ opts.now = time.Now
+ }
+ result := &counter{desc: desc, labelPairs: desc.constLabelPairs, now: opts.now}
result.init(result) // Init self-collection.
+ result.createdTs = timestamppb.New(opts.now())
return result
}
@@ -106,10 +111,12 @@ type counter struct {
selfCollector
desc *Desc
+ createdTs *timestamppb.Timestamp
labelPairs []*dto.LabelPair
exemplar atomic.Value // Containing nil or a *dto.Exemplar.
- now func() time.Time // To mock out time.Now() for testing.
+ // now is for testing purposes, by default it's time.Now.
+ now func() time.Time
}
func (c *counter) Desc() *Desc {
@@ -159,8 +166,7 @@ func (c *counter) Write(out *dto.Metric) error {
exemplar = e.(*dto.Exemplar)
}
val := c.get()
-
- return populateMetric(CounterValue, val, c.labelPairs, exemplar, out)
+ return populateMetric(CounterValue, val, c.labelPairs, exemplar, out, c.createdTs)
}
func (c *counter) updateExemplar(v float64, l Labels) {
@@ -200,13 +206,17 @@ func (v2) NewCounterVec(opts CounterVecOpts) *CounterVec {
opts.VariableLabels,
opts.ConstLabels,
)
+ if opts.now == nil {
+ opts.now = time.Now
+ }
return &CounterVec{
MetricVec: NewMetricVec(desc, func(lvs ...string) Metric {
- if len(lvs) != len(desc.variableLabels) {
- panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.labelNames(), lvs))
+ if len(lvs) != len(desc.variableLabels.names) {
+ panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.names, lvs))
}
- result := &counter{desc: desc, labelPairs: MakeLabelPairs(desc, lvs), now: time.Now}
+ result := &counter{desc: desc, labelPairs: MakeLabelPairs(desc, lvs), now: opts.now}
result.init(result) // Init self-collection.
+ result.createdTs = timestamppb.New(opts.now())
return result
}),
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/desc.go b/vendor/github.com/prometheus/client_golang/prometheus/desc.go
index deedc2dfbe..68ffe3c248 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/desc.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/desc.go
@@ -52,7 +52,7 @@ type Desc struct {
constLabelPairs []*dto.LabelPair
// variableLabels contains names of labels and normalization function for
// which the metric maintains variable values.
- variableLabels ConstrainedLabels
+ variableLabels *compiledLabels
// id is a hash of the values of the ConstLabels and fqName. This
// must be unique among all registered descriptors and can therefore be
// used as an identifier of the descriptor.
@@ -93,7 +93,7 @@ func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, const
d := &Desc{
fqName: fqName,
help: help,
- variableLabels: variableLabels.constrainedLabels(),
+ variableLabels: variableLabels.compile(),
}
if !model.IsValidMetricName(model.LabelValue(fqName)) {
d.err = fmt.Errorf("%q is not a valid metric name", fqName)
@@ -103,7 +103,7 @@ func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, const
// their sorted label names) plus the fqName (at position 0).
labelValues := make([]string, 1, len(constLabels)+1)
labelValues[0] = fqName
- labelNames := make([]string, 0, len(constLabels)+len(d.variableLabels))
+ labelNames := make([]string, 0, len(constLabels)+len(d.variableLabels.names))
labelNameSet := map[string]struct{}{}
// First add only the const label names and sort them...
for labelName := range constLabels {
@@ -128,13 +128,13 @@ func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, const
// Now add the variable label names, but prefix them with something that
// cannot be in a regular label name. That prevents matching the label
// dimension with a different mix between preset and variable labels.
- for _, label := range d.variableLabels {
- if !checkLabelName(label.Name) {
- d.err = fmt.Errorf("%q is not a valid label name for metric %q", label.Name, fqName)
+ for _, label := range d.variableLabels.names {
+ if !checkLabelName(label) {
+ d.err = fmt.Errorf("%q is not a valid label name for metric %q", label, fqName)
return d
}
- labelNames = append(labelNames, "$"+label.Name)
- labelNameSet[label.Name] = struct{}{}
+ labelNames = append(labelNames, "$"+label)
+ labelNameSet[label] = struct{}{}
}
if len(labelNames) != len(labelNameSet) {
d.err = fmt.Errorf("duplicate label names in constant and variable labels for metric %q", fqName)
@@ -189,11 +189,19 @@ func (d *Desc) String() string {
fmt.Sprintf("%s=%q", lp.GetName(), lp.GetValue()),
)
}
+ vlStrings := make([]string, 0, len(d.variableLabels.names))
+ for _, vl := range d.variableLabels.names {
+ if fn, ok := d.variableLabels.labelConstraints[vl]; ok && fn != nil {
+ vlStrings = append(vlStrings, fmt.Sprintf("c(%s)", vl))
+ } else {
+ vlStrings = append(vlStrings, vl)
+ }
+ }
return fmt.Sprintf(
- "Desc{fqName: %q, help: %q, constLabels: {%s}, variableLabels: %v}",
+ "Desc{fqName: %q, help: %q, constLabels: {%s}, variableLabels: {%s}}",
d.fqName,
d.help,
strings.Join(lpStrings, ","),
- d.variableLabels,
+ strings.Join(vlStrings, ","),
)
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go
index c41ab37f3b..de5a856293 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/expvar_collector.go
@@ -48,7 +48,7 @@ func (e *expvarCollector) Collect(ch chan<- Metric) {
continue
}
var v interface{}
- labels := make([]string, len(desc.variableLabels))
+ labels := make([]string, len(desc.variableLabels.names))
if err := json.Unmarshal([]byte(expVar.String()), &v); err != nil {
ch <- NewInvalidMetric(desc, err)
continue
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/gauge.go b/vendor/github.com/prometheus/client_golang/prometheus/gauge.go
index f1ea6c76f7..dd2eac9406 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/gauge.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/gauge.go
@@ -62,7 +62,7 @@ type GaugeVecOpts struct {
GaugeOpts
// VariableLabels are used to partition the metric vector by the given set
- // of labels. Each label value will be constrained with the optional Contraint
+ // of labels. Each label value will be constrained with the optional Constraint
// function, if provided.
VariableLabels ConstrainableLabels
}
@@ -135,7 +135,7 @@ func (g *gauge) Sub(val float64) {
func (g *gauge) Write(out *dto.Metric) error {
val := math.Float64frombits(atomic.LoadUint64(&g.valBits))
- return populateMetric(GaugeValue, val, g.labelPairs, nil, out)
+ return populateMetric(GaugeValue, val, g.labelPairs, nil, out, nil)
}
// GaugeVec is a Collector that bundles a set of Gauges that all share the same
@@ -166,8 +166,8 @@ func (v2) NewGaugeVec(opts GaugeVecOpts) *GaugeVec {
)
return &GaugeVec{
MetricVec: NewMetricVec(desc, func(lvs ...string) Metric {
- if len(lvs) != len(desc.variableLabels) {
- panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.labelNames(), lvs))
+ if len(lvs) != len(desc.variableLabels.names) {
+ panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.names, lvs))
}
result := &gauge{desc: desc, labelPairs: MakeLabelPairs(desc, lvs)}
result.init(result) // Init self-collection.
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
index 8d818afe90..b5c8bcb395 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
@@ -25,6 +25,7 @@ import (
dto "github.com/prometheus/client_model/go"
"google.golang.org/protobuf/proto"
+ "google.golang.org/protobuf/types/known/timestamppb"
)
// nativeHistogramBounds for the frac of observed values. Only relevant for
@@ -391,7 +392,7 @@ type HistogramOpts struct {
// zero, it is replaced by default buckets. The default buckets are
// DefBuckets if no buckets for a native histogram (see below) are used,
// otherwise the default is no buckets. (In other words, if you want to
- // use both reguler buckets and buckets for a native histogram, you have
+ // use both regular buckets and buckets for a native histogram, you have
// to define the regular buckets here explicitly.)
Buckets []float64
@@ -413,8 +414,8 @@ type HistogramOpts struct {
// and 2, same as between 2 and 4, and 4 and 8, etc.).
//
// Details about the actually used factor: The factor is calculated as
- // 2^(2^n), where n is an integer number between (and including) -8 and
- // 4. n is chosen so that the resulting factor is the largest that is
+ // 2^(2^-n), where n is an integer number between (and including) -4 and
+ // 8. n is chosen so that the resulting factor is the largest that is
// still smaller or equal to NativeHistogramBucketFactor. Note that the
// smallest possible factor is therefore approx. 1.00271 (i.e. 2^(2^-8)
// ). If NativeHistogramBucketFactor is greater than 1 but smaller than
@@ -428,12 +429,12 @@ type HistogramOpts struct {
// a major version bump.
NativeHistogramBucketFactor float64
// All observations with an absolute value of less or equal
- // NativeHistogramZeroThreshold are accumulated into a “zero”
- // bucket. For best results, this should be close to a bucket
- // boundary. This is usually the case if picking a power of two. If
+ // NativeHistogramZeroThreshold are accumulated into a “zero” bucket.
+ // For best results, this should be close to a bucket boundary. This is
+ // usually the case if picking a power of two. If
// NativeHistogramZeroThreshold is left at zero,
- // DefNativeHistogramZeroThreshold is used as the threshold. To configure
- // a zero bucket with an actual threshold of zero (i.e. only
+ // DefNativeHistogramZeroThreshold is used as the threshold. To
+ // configure a zero bucket with an actual threshold of zero (i.e. only
// observations of precisely zero will go into the zero bucket), set
// NativeHistogramZeroThreshold to the NativeHistogramZeroThresholdZero
// constant (or any negative float value).
@@ -446,26 +447,37 @@ type HistogramOpts struct {
// Histogram are sufficiently wide-spread. In particular, this could be
// used as a DoS attack vector. Where the observed values depend on
// external inputs, it is highly recommended to set a
- // NativeHistogramMaxBucketNumber.) Once the set
+ // NativeHistogramMaxBucketNumber.) Once the set
// NativeHistogramMaxBucketNumber is exceeded, the following strategy is
- // enacted: First, if the last reset (or the creation) of the histogram
- // is at least NativeHistogramMinResetDuration ago, then the whole
- // histogram is reset to its initial state (including regular
- // buckets). If less time has passed, or if
- // NativeHistogramMinResetDuration is zero, no reset is
- // performed. Instead, the zero threshold is increased sufficiently to
- // reduce the number of buckets to or below
- // NativeHistogramMaxBucketNumber, but not to more than
- // NativeHistogramMaxZeroThreshold. Thus, if
- // NativeHistogramMaxZeroThreshold is already at or below the current
- // zero threshold, nothing happens at this step. After that, if the
- // number of buckets still exceeds NativeHistogramMaxBucketNumber, the
- // resolution of the histogram is reduced by doubling the width of the
- // sparse buckets (up to a growth factor between one bucket to the next
- // of 2^(2^4) = 65536, see above).
+ // enacted:
+ // - First, if the last reset (or the creation) of the histogram is at
+ // least NativeHistogramMinResetDuration ago, then the whole
+ // histogram is reset to its initial state (including regular
+ // buckets).
+ // - If less time has passed, or if NativeHistogramMinResetDuration is
+ // zero, no reset is performed. Instead, the zero threshold is
+ // increased sufficiently to reduce the number of buckets to or below
+ // NativeHistogramMaxBucketNumber, but not to more than
+ // NativeHistogramMaxZeroThreshold. Thus, if
+ // NativeHistogramMaxZeroThreshold is already at or below the current
+ // zero threshold, nothing happens at this step.
+ // - After that, if the number of buckets still exceeds
+ // NativeHistogramMaxBucketNumber, the resolution of the histogram is
+ // reduced by doubling the width of the sparse buckets (up to a
+ // growth factor between one bucket to the next of 2^(2^4) = 65536,
+ // see above).
+ // - Any increased zero threshold or reduced resolution is reset back
+ // to their original values once NativeHistogramMinResetDuration has
+ // passed (since the last reset or the creation of the histogram).
NativeHistogramMaxBucketNumber uint32
NativeHistogramMinResetDuration time.Duration
NativeHistogramMaxZeroThreshold float64
+
+ // now is for testing purposes, by default it's time.Now.
+ now func() time.Time
+
+ // afterFunc is for testing purposes, by default it's time.AfterFunc.
+ afterFunc func(time.Duration, func()) *time.Timer
}
// HistogramVecOpts bundles the options to create a HistogramVec metric.
@@ -475,7 +487,7 @@ type HistogramVecOpts struct {
HistogramOpts
// VariableLabels are used to partition the metric vector by the given set
- // of labels. Each label value will be constrained with the optional Contraint
+ // of labels. Each label value will be constrained with the optional Constraint
// function, if provided.
VariableLabels ConstrainableLabels
}
@@ -499,12 +511,12 @@ func NewHistogram(opts HistogramOpts) Histogram {
}
func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogram {
- if len(desc.variableLabels) != len(labelValues) {
- panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.labelNames(), labelValues))
+ if len(desc.variableLabels.names) != len(labelValues) {
+ panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.names, labelValues))
}
- for _, n := range desc.variableLabels {
- if n.Name == bucketLabel {
+ for _, n := range desc.variableLabels.names {
+ if n == bucketLabel {
panic(errBucketLabelNotAllowed)
}
}
@@ -514,6 +526,12 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr
}
}
+ if opts.now == nil {
+ opts.now = time.Now
+ }
+ if opts.afterFunc == nil {
+ opts.afterFunc = time.AfterFunc
+ }
h := &histogram{
desc: desc,
upperBounds: opts.Buckets,
@@ -521,8 +539,9 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr
nativeHistogramMaxBuckets: opts.NativeHistogramMaxBucketNumber,
nativeHistogramMaxZeroThreshold: opts.NativeHistogramMaxZeroThreshold,
nativeHistogramMinResetDuration: opts.NativeHistogramMinResetDuration,
- lastResetTime: time.Now(),
- now: time.Now,
+ lastResetTime: opts.now(),
+ now: opts.now,
+ afterFunc: opts.afterFunc,
}
if len(h.upperBounds) == 0 && opts.NativeHistogramBucketFactor <= 1 {
h.upperBounds = DefBuckets
@@ -701,9 +720,18 @@ type histogram struct {
nativeHistogramMaxZeroThreshold float64
nativeHistogramMaxBuckets uint32
nativeHistogramMinResetDuration time.Duration
- lastResetTime time.Time // Protected by mtx.
-
- now func() time.Time // To mock out time.Now() for testing.
+ // lastResetTime is protected by mtx. It is also used as created timestamp.
+ lastResetTime time.Time
+ // resetScheduled is protected by mtx. It is true if a reset is
+ // scheduled for a later time (when nativeHistogramMinResetDuration has
+ // passed).
+ resetScheduled bool
+
+ // now is for testing purposes, by default it's time.Now.
+ now func() time.Time
+
+ // afterFunc is for testing purposes, by default it's time.AfterFunc.
+ afterFunc func(time.Duration, func()) *time.Timer
}
func (h *histogram) Desc() *Desc {
@@ -742,9 +770,10 @@ func (h *histogram) Write(out *dto.Metric) error {
waitForCooldown(count, coldCounts)
his := &dto.Histogram{
- Bucket: make([]*dto.Bucket, len(h.upperBounds)),
- SampleCount: proto.Uint64(count),
- SampleSum: proto.Float64(math.Float64frombits(atomic.LoadUint64(&coldCounts.sumBits))),
+ Bucket: make([]*dto.Bucket, len(h.upperBounds)),
+ SampleCount: proto.Uint64(count),
+ SampleSum: proto.Float64(math.Float64frombits(atomic.LoadUint64(&coldCounts.sumBits))),
+ CreatedTimestamp: timestamppb.New(h.lastResetTime),
}
out.Histogram = his
out.Label = h.labelPairs
@@ -782,6 +811,16 @@ func (h *histogram) Write(out *dto.Metric) error {
his.ZeroCount = proto.Uint64(zeroBucket)
his.NegativeSpan, his.NegativeDelta = makeBuckets(&coldCounts.nativeHistogramBucketsNegative)
his.PositiveSpan, his.PositiveDelta = makeBuckets(&coldCounts.nativeHistogramBucketsPositive)
+
+ // Add a no-op span to a histogram without observations and with
+ // a zero threshold of zero. Otherwise, a native histogram would
+ // look like a classic histogram to scrapers.
+ if *his.ZeroThreshold == 0 && *his.ZeroCount == 0 && len(his.PositiveSpan) == 0 && len(his.NegativeSpan) == 0 {
+ his.PositiveSpan = []*dto.BucketSpan{{
+ Offset: proto.Int32(0),
+ Length: proto.Uint32(0),
+ }}
+ }
}
addAndResetCounts(hotCounts, coldCounts)
return nil
@@ -848,26 +887,39 @@ func (h *histogram) limitBuckets(counts *histogramCounts, value float64, bucket
if h.maybeReset(hotCounts, coldCounts, coldIdx, value, bucket) {
return
}
+ // One of the other strategies will happen. To undo what they will do as
+ // soon as enough time has passed to satisfy
+ // h.nativeHistogramMinResetDuration, schedule a reset at the right time
+ // if we haven't done so already.
+ if h.nativeHistogramMinResetDuration > 0 && !h.resetScheduled {
+ h.resetScheduled = true
+ h.afterFunc(h.nativeHistogramMinResetDuration-h.now().Sub(h.lastResetTime), h.reset)
+ }
+
if h.maybeWidenZeroBucket(hotCounts, coldCounts) {
return
}
h.doubleBucketWidth(hotCounts, coldCounts)
}
-// maybeReset resests the whole histogram if at least h.nativeHistogramMinResetDuration
-// has been passed. It returns true if the histogram has been reset. The caller
-// must have locked h.mtx.
-func (h *histogram) maybeReset(hot, cold *histogramCounts, coldIdx uint64, value float64, bucket int) bool {
+// maybeReset resets the whole histogram if at least
+// h.nativeHistogramMinResetDuration has been passed. It returns true if the
+// histogram has been reset. The caller must have locked h.mtx.
+func (h *histogram) maybeReset(
+ hot, cold *histogramCounts, coldIdx uint64, value float64, bucket int,
+) bool {
// We are using the possibly mocked h.now() rather than
// time.Since(h.lastResetTime) to enable testing.
- if h.nativeHistogramMinResetDuration == 0 || h.now().Sub(h.lastResetTime) < h.nativeHistogramMinResetDuration {
+ if h.nativeHistogramMinResetDuration == 0 || // No reset configured.
+ h.resetScheduled || // Do not interefere if a reset is already scheduled.
+ h.now().Sub(h.lastResetTime) < h.nativeHistogramMinResetDuration {
return false
}
// Completely reset coldCounts.
h.resetCounts(cold)
// Repeat the latest observation to not lose it completely.
cold.observe(value, bucket, true)
- // Make coldCounts the new hot counts while ressetting countAndHotIdx.
+ // Make coldCounts the new hot counts while resetting countAndHotIdx.
n := atomic.SwapUint64(&h.countAndHotIdx, (coldIdx<<63)+1)
count := n & ((1 << 63) - 1)
waitForCooldown(count, hot)
@@ -877,6 +929,29 @@ func (h *histogram) maybeReset(hot, cold *histogramCounts, coldIdx uint64, value
return true
}
+// reset resets the whole histogram. It locks h.mtx itself, i.e. it has to be
+// called without having locked h.mtx.
+func (h *histogram) reset() {
+ h.mtx.Lock()
+ defer h.mtx.Unlock()
+
+ n := atomic.LoadUint64(&h.countAndHotIdx)
+ hotIdx := n >> 63
+ coldIdx := (^n) >> 63
+ hot := h.counts[hotIdx]
+ cold := h.counts[coldIdx]
+ // Completely reset coldCounts.
+ h.resetCounts(cold)
+ // Make coldCounts the new hot counts while resetting countAndHotIdx.
+ n = atomic.SwapUint64(&h.countAndHotIdx, coldIdx<<63)
+ count := n & ((1 << 63) - 1)
+ waitForCooldown(count, hot)
+ // Finally, reset the formerly hot counts, too.
+ h.resetCounts(hot)
+ h.lastResetTime = h.now()
+ h.resetScheduled = false
+}
+
// maybeWidenZeroBucket widens the zero bucket until it includes the existing
// buckets closest to the zero bucket (which could be two, if an equidistant
// negative and a positive bucket exists, but usually it's only one bucket to be
@@ -1176,6 +1251,7 @@ type constHistogram struct {
sum float64
buckets map[float64]uint64
labelPairs []*dto.LabelPair
+ createdTs *timestamppb.Timestamp
}
func (h *constHistogram) Desc() *Desc {
@@ -1183,7 +1259,9 @@ func (h *constHistogram) Desc() *Desc {
}
func (h *constHistogram) Write(out *dto.Metric) error {
- his := &dto.Histogram{}
+ his := &dto.Histogram{
+ CreatedTimestamp: h.createdTs,
+ }
buckets := make([]*dto.Bucket, 0, len(h.buckets))
@@ -1230,7 +1308,7 @@ func NewConstHistogram(
if desc.err != nil {
return nil, desc.err
}
- if err := validateLabelValues(labelValues, len(desc.variableLabels)); err != nil {
+ if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil {
return nil, err
}
return &constHistogram{
@@ -1324,7 +1402,7 @@ func makeBuckets(buckets *sync.Map) ([]*dto.BucketSpan, []int64) {
// Multiple spans with only small gaps in between are probably
// encoded more efficiently as one larger span with a few empty
// buckets. Needs some research to find the sweet spot. For now,
- // we assume that gaps of one ore two buckets should not create
+ // we assume that gaps of one or two buckets should not create
// a new span.
iDelta := int32(i - nextI)
if n == 0 || iDelta > 2 {
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go b/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go
index fd0750f2cf..a595a20362 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go
@@ -14,7 +14,7 @@
// It provides tools to compare sequences of strings and generate textual diffs.
//
// Maintaining `GetUnifiedDiffString` here because original repository
-// (https://github.com/pmezard/go-difflib) is no loger maintained.
+// (https://github.com/pmezard/go-difflib) is no longer maintained.
package internal
import (
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/labels.go b/vendor/github.com/prometheus/client_golang/prometheus/labels.go
index 63ff8683ce..c21911f292 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/labels.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/labels.go
@@ -32,19 +32,15 @@ import (
// create a Desc.
type Labels map[string]string
+// LabelConstraint normalizes label values.
+type LabelConstraint func(string) string
+
// ConstrainedLabels represents a label name and its constrain function
// to normalize label values. This type is commonly used when constructing
// metric vector Collectors.
type ConstrainedLabel struct {
Name string
- Constraint func(string) string
-}
-
-func (cl ConstrainedLabel) Constrain(v string) string {
- if cl.Constraint == nil {
- return v
- }
- return cl.Constraint(v)
+ Constraint LabelConstraint
}
// ConstrainableLabels is an interface that allows creating of labels that can
@@ -58,7 +54,7 @@ func (cl ConstrainedLabel) Constrain(v string) string {
// },
// })
type ConstrainableLabels interface {
- constrainedLabels() ConstrainedLabels
+ compile() *compiledLabels
labelNames() []string
}
@@ -67,8 +63,20 @@ type ConstrainableLabels interface {
// metric vector Collectors.
type ConstrainedLabels []ConstrainedLabel
-func (cls ConstrainedLabels) constrainedLabels() ConstrainedLabels {
- return cls
+func (cls ConstrainedLabels) compile() *compiledLabels {
+ compiled := &compiledLabels{
+ names: make([]string, len(cls)),
+ labelConstraints: map[string]LabelConstraint{},
+ }
+
+ for i, label := range cls {
+ compiled.names[i] = label.Name
+ if label.Constraint != nil {
+ compiled.labelConstraints[label.Name] = label.Constraint
+ }
+ }
+
+ return compiled
}
func (cls ConstrainedLabels) labelNames() []string {
@@ -92,18 +100,36 @@ func (cls ConstrainedLabels) labelNames() []string {
// }
type UnconstrainedLabels []string
-func (uls UnconstrainedLabels) constrainedLabels() ConstrainedLabels {
- constrainedLabels := make([]ConstrainedLabel, len(uls))
- for i, l := range uls {
- constrainedLabels[i] = ConstrainedLabel{Name: l}
+func (uls UnconstrainedLabels) compile() *compiledLabels {
+ return &compiledLabels{
+ names: uls,
}
- return constrainedLabels
}
func (uls UnconstrainedLabels) labelNames() []string {
return uls
}
+type compiledLabels struct {
+ names []string
+ labelConstraints map[string]LabelConstraint
+}
+
+func (cls *compiledLabels) compile() *compiledLabels {
+ return cls
+}
+
+func (cls *compiledLabels) labelNames() []string {
+ return cls.names
+}
+
+func (cls *compiledLabels) constrain(labelName, value string) string {
+ if fn, ok := cls.labelConstraints[labelName]; ok && fn != nil {
+ return fn(value)
+ }
+ return value
+}
+
// reservedLabelPrefix is a prefix which is not legal in user-supplied
// label names.
const reservedLabelPrefix = "__"
@@ -139,6 +165,8 @@ func validateValuesInLabels(labels Labels, expectedNumberOfValues int) error {
func validateLabelValues(vals []string, expectedNumberOfValues int) error {
if len(vals) != expectedNumberOfValues {
+ // The call below makes vals escape, copy them to avoid that.
+ vals := append([]string(nil), vals...)
return fmt.Errorf(
"%w: expected %d label values but got %d in %#v",
errInconsistentCardinality, expectedNumberOfValues,
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/metric.go b/vendor/github.com/prometheus/client_golang/prometheus/metric.go
index 07bbc9d768..f018e57237 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/metric.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/metric.go
@@ -92,6 +92,9 @@ type Opts struct {
// machine_role metric). See also
// https://prometheus.io/docs/instrumenting/writing_exporters/#target-labels-not-static-scraped-labels
ConstLabels Labels
+
+ // now is for testing purposes, by default it's time.Now.
+ now func() time.Time
}
// BuildFQName joins the given three name components by "_". Empty name
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go
index c0152cdb61..8c1136ceea 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go
@@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-//go:build !windows && !js
-// +build !windows,!js
+//go:build !windows && !js && !wasip1
+// +build !windows,!js,!wasip1
package prometheus
diff --git a/vendor/google.golang.org/genproto/internal/doc.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_wasip1.go
similarity index 63%
rename from vendor/google.golang.org/genproto/internal/doc.go
rename to vendor/github.com/prometheus/client_golang/prometheus/process_collector_wasip1.go
index 90e89b4aa3..d8d9a6d7a2 100644
--- a/vendor/google.golang.org/genproto/internal/doc.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_wasip1.go
@@ -1,10 +1,9 @@
-// Copyright 2023 Google LLC
-//
+// Copyright 2023 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@@ -12,6 +11,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// This file makes internal an importable go package
-// for use with backreferences from submodules.
-package internal
+//go:build wasip1
+// +build wasip1
+
+package prometheus
+
+func canCollectProcess() bool {
+ return false
+}
+
+func (*processCollector) processCollect(chan<- Metric) {
+ // noop on this platform
+ return
+}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go
index 3793036ad0..356edb7868 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go
@@ -389,15 +389,12 @@ func isLabelCurried(c prometheus.Collector, label string) bool {
return true
}
-// emptyLabels is a one-time allocation for non-partitioned metrics to avoid
-// unnecessary allocations on each request.
-var emptyLabels = prometheus.Labels{}
-
func labels(code, method bool, reqMethod string, status int, extraMethods ...string) prometheus.Labels {
+ labels := prometheus.Labels{}
+
if !(code || method) {
- return emptyLabels
+ return labels
}
- labels := prometheus.Labels{}
if code {
labels["code"] = sanitizeCode(status)
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/registry.go b/vendor/github.com/prometheus/client_golang/prometheus/registry.go
index 44da9433be..5e2ced25a0 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/registry.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/registry.go
@@ -548,7 +548,7 @@ func (r *Registry) Gather() ([]*dto.MetricFamily, error) {
goroutineBudget--
runtime.Gosched()
}
- // Once both checkedMetricChan and uncheckdMetricChan are closed
+ // Once both checkedMetricChan and uncheckedMetricChan are closed
// and drained, the contraption above will nil out cmc and umc,
// and then we can leave the collect loop here.
if cmc == nil && umc == nil {
@@ -963,9 +963,9 @@ func checkDescConsistency(
// Is the desc consistent with the content of the metric?
lpsFromDesc := make([]*dto.LabelPair, len(desc.constLabelPairs), len(dtoMetric.Label))
copy(lpsFromDesc, desc.constLabelPairs)
- for _, l := range desc.variableLabels {
+ for _, l := range desc.variableLabels.names {
lpsFromDesc = append(lpsFromDesc, &dto.LabelPair{
- Name: proto.String(l.Name),
+ Name: proto.String(l),
})
}
if len(lpsFromDesc) != len(dtoMetric.Label) {
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/summary.go b/vendor/github.com/prometheus/client_golang/prometheus/summary.go
index dd359264e5..1462704446 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/summary.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/summary.go
@@ -26,6 +26,7 @@ import (
"github.com/beorn7/perks/quantile"
"google.golang.org/protobuf/proto"
+ "google.golang.org/protobuf/types/known/timestamppb"
)
// quantileLabel is used for the label that defines the quantile in a
@@ -145,6 +146,9 @@ type SummaryOpts struct {
// is the internal buffer size of the underlying package
// "github.com/bmizerany/perks/quantile").
BufCap uint32
+
+ // now is for testing purposes, by default it's time.Now.
+ now func() time.Time
}
// SummaryVecOpts bundles the options to create a SummaryVec metric.
@@ -154,7 +158,7 @@ type SummaryVecOpts struct {
SummaryOpts
// VariableLabels are used to partition the metric vector by the given set
- // of labels. Each label value will be constrained with the optional Contraint
+ // of labels. Each label value will be constrained with the optional Constraint
// function, if provided.
VariableLabels ConstrainableLabels
}
@@ -188,12 +192,12 @@ func NewSummary(opts SummaryOpts) Summary {
}
func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary {
- if len(desc.variableLabels) != len(labelValues) {
- panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.labelNames(), labelValues))
+ if len(desc.variableLabels.names) != len(labelValues) {
+ panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels.names, labelValues))
}
- for _, n := range desc.variableLabels {
- if n.Name == quantileLabel {
+ for _, n := range desc.variableLabels.names {
+ if n == quantileLabel {
panic(errQuantileLabelNotAllowed)
}
}
@@ -222,6 +226,9 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary {
opts.BufCap = DefBufCap
}
+ if opts.now == nil {
+ opts.now = time.Now
+ }
if len(opts.Objectives) == 0 {
// Use the lock-free implementation of a Summary without objectives.
s := &noObjectivesSummary{
@@ -230,6 +237,7 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary {
counts: [2]*summaryCounts{{}, {}},
}
s.init(s) // Init self-collection.
+ s.createdTs = timestamppb.New(opts.now())
return s
}
@@ -245,7 +253,7 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary {
coldBuf: make([]float64, 0, opts.BufCap),
streamDuration: opts.MaxAge / time.Duration(opts.AgeBuckets),
}
- s.headStreamExpTime = time.Now().Add(s.streamDuration)
+ s.headStreamExpTime = opts.now().Add(s.streamDuration)
s.hotBufExpTime = s.headStreamExpTime
for i := uint32(0); i < opts.AgeBuckets; i++ {
@@ -259,6 +267,7 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary {
sort.Float64s(s.sortedObjectives)
s.init(s) // Init self-collection.
+ s.createdTs = timestamppb.New(opts.now())
return s
}
@@ -286,6 +295,8 @@ type summary struct {
headStream *quantile.Stream
headStreamIdx int
headStreamExpTime, hotBufExpTime time.Time
+
+ createdTs *timestamppb.Timestamp
}
func (s *summary) Desc() *Desc {
@@ -307,7 +318,9 @@ func (s *summary) Observe(v float64) {
}
func (s *summary) Write(out *dto.Metric) error {
- sum := &dto.Summary{}
+ sum := &dto.Summary{
+ CreatedTimestamp: s.createdTs,
+ }
qs := make([]*dto.Quantile, 0, len(s.objectives))
s.bufMtx.Lock()
@@ -440,6 +453,8 @@ type noObjectivesSummary struct {
counts [2]*summaryCounts
labelPairs []*dto.LabelPair
+
+ createdTs *timestamppb.Timestamp
}
func (s *noObjectivesSummary) Desc() *Desc {
@@ -490,8 +505,9 @@ func (s *noObjectivesSummary) Write(out *dto.Metric) error {
}
sum := &dto.Summary{
- SampleCount: proto.Uint64(count),
- SampleSum: proto.Float64(math.Float64frombits(atomic.LoadUint64(&coldCounts.sumBits))),
+ SampleCount: proto.Uint64(count),
+ SampleSum: proto.Float64(math.Float64frombits(atomic.LoadUint64(&coldCounts.sumBits))),
+ CreatedTimestamp: s.createdTs,
}
out.Summary = sum
@@ -681,6 +697,7 @@ type constSummary struct {
sum float64
quantiles map[float64]float64
labelPairs []*dto.LabelPair
+ createdTs *timestamppb.Timestamp
}
func (s *constSummary) Desc() *Desc {
@@ -688,7 +705,9 @@ func (s *constSummary) Desc() *Desc {
}
func (s *constSummary) Write(out *dto.Metric) error {
- sum := &dto.Summary{}
+ sum := &dto.Summary{
+ CreatedTimestamp: s.createdTs,
+ }
qs := make([]*dto.Quantile, 0, len(s.quantiles))
sum.SampleCount = proto.Uint64(s.count)
@@ -737,7 +756,7 @@ func NewConstSummary(
if desc.err != nil {
return nil, desc.err
}
- if err := validateLabelValues(labelValues, len(desc.variableLabels)); err != nil {
+ if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil {
return nil, err
}
return &constSummary{
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/problem.go
similarity index 53%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go
rename to vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/problem.go
index 66ffd5989f..9ba42826ad 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/problem.go
@@ -1,5 +1,4 @@
-// Copyright The OpenTelemetry Authors
-//
+// Copyright 2020 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -12,9 +11,23 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
+package promlint
+
+import dto "github.com/prometheus/client_model/go"
+
+// A Problem is an issue detected by a linter.
+type Problem struct {
+ // The name of the metric indicated by this Problem.
+ Metric string
+
+ // A description of the issue for this Problem.
+ Text string
+}
-// SchemaURL is the schema URL that matches the version of the semantic conventions
-// that this package defines. Semconv packages starting from v1.4.0 must declare
-// non-empty schema URL in the form https://opentelemetry.io/schemas/
-const SchemaURL = "https://opentelemetry.io/schemas/1.21.0"
+// newProblem is helper function to create a Problem.
+func newProblem(mf *dto.MetricFamily, text string) Problem {
+ return Problem{
+ Metric: mf.GetName(),
+ Text: text,
+ }
+}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/promlint.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/promlint.go
index c8864b6c3f..ea46f38ecf 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/promlint.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/promlint.go
@@ -16,15 +16,11 @@ package promlint
import (
"errors"
- "fmt"
"io"
- "regexp"
"sort"
- "strings"
-
- "github.com/prometheus/common/expfmt"
dto "github.com/prometheus/client_model/go"
+ "github.com/prometheus/common/expfmt"
)
// A Linter is a Prometheus metrics linter. It identifies issues with metric
@@ -37,23 +33,8 @@ type Linter struct {
// of them.
r io.Reader
mfs []*dto.MetricFamily
-}
-// A Problem is an issue detected by a Linter.
-type Problem struct {
- // The name of the metric indicated by this Problem.
- Metric string
-
- // A description of the issue for this Problem.
- Text string
-}
-
-// newProblem is helper function to create a Problem.
-func newProblem(mf *dto.MetricFamily, text string) Problem {
- return Problem{
- Metric: mf.GetName(),
- Text: text,
- }
+ customValidations []Validation
}
// New creates a new Linter that reads an input stream of Prometheus metrics in
@@ -72,6 +53,14 @@ func NewWithMetricFamilies(mfs []*dto.MetricFamily) *Linter {
}
}
+// AddCustomValidations adds custom validations to the linter.
+func (l *Linter) AddCustomValidations(vs ...Validation) {
+ if l.customValidations == nil {
+ l.customValidations = make([]Validation, 0, len(vs))
+ }
+ l.customValidations = append(l.customValidations, vs...)
+}
+
// Lint performs a linting pass, returning a slice of Problems indicating any
// issues found in the metrics stream. The slice is sorted by metric name
// and issue description.
@@ -79,7 +68,7 @@ func (l *Linter) Lint() ([]Problem, error) {
var problems []Problem
if l.r != nil {
- d := expfmt.NewDecoder(l.r, expfmt.FmtText)
+ d := expfmt.NewDecoder(l.r, expfmt.NewFormat(expfmt.TypeTextPlain))
mf := &dto.MetricFamily{}
for {
@@ -91,11 +80,11 @@ func (l *Linter) Lint() ([]Problem, error) {
return nil, err
}
- problems = append(problems, lint(mf)...)
+ problems = append(problems, l.lint(mf)...)
}
}
for _, mf := range l.mfs {
- problems = append(problems, lint(mf)...)
+ problems = append(problems, l.lint(mf)...)
}
// Ensure deterministic output.
@@ -110,276 +99,25 @@ func (l *Linter) Lint() ([]Problem, error) {
}
// lint is the entry point for linting a single metric.
-func lint(mf *dto.MetricFamily) []Problem {
- fns := []func(mf *dto.MetricFamily) []Problem{
- lintHelp,
- lintMetricUnits,
- lintCounter,
- lintHistogramSummaryReserved,
- lintMetricTypeInName,
- lintReservedChars,
- lintCamelCase,
- lintUnitAbbreviations,
- }
-
- var problems []Problem
- for _, fn := range fns {
- problems = append(problems, fn(mf)...)
- }
-
- // TODO(mdlayher): lint rules for specific metrics types.
- return problems
-}
-
-// lintHelp detects issues related to the help text for a metric.
-func lintHelp(mf *dto.MetricFamily) []Problem {
+func (l *Linter) lint(mf *dto.MetricFamily) []Problem {
var problems []Problem
- // Expect all metrics to have help text available.
- if mf.Help == nil {
- problems = append(problems, newProblem(mf, "no help text"))
- }
-
- return problems
-}
-
-// lintMetricUnits detects issues with metric unit names.
-func lintMetricUnits(mf *dto.MetricFamily) []Problem {
- var problems []Problem
-
- unit, base, ok := metricUnits(*mf.Name)
- if !ok {
- // No known units detected.
- return nil
- }
-
- // Unit is already a base unit.
- if unit == base {
- return nil
- }
-
- problems = append(problems, newProblem(mf, fmt.Sprintf("use base unit %q instead of %q", base, unit)))
-
- return problems
-}
-
-// lintCounter detects issues specific to counters, as well as patterns that should
-// only be used with counters.
-func lintCounter(mf *dto.MetricFamily) []Problem {
- var problems []Problem
-
- isCounter := mf.GetType() == dto.MetricType_COUNTER
- isUntyped := mf.GetType() == dto.MetricType_UNTYPED
- hasTotalSuffix := strings.HasSuffix(mf.GetName(), "_total")
-
- switch {
- case isCounter && !hasTotalSuffix:
- problems = append(problems, newProblem(mf, `counter metrics should have "_total" suffix`))
- case !isUntyped && !isCounter && hasTotalSuffix:
- problems = append(problems, newProblem(mf, `non-counter metrics should not have "_total" suffix`))
- }
-
- return problems
-}
-
-// lintHistogramSummaryReserved detects when other types of metrics use names or labels
-// reserved for use by histograms and/or summaries.
-func lintHistogramSummaryReserved(mf *dto.MetricFamily) []Problem {
- // These rules do not apply to untyped metrics.
- t := mf.GetType()
- if t == dto.MetricType_UNTYPED {
- return nil
- }
-
- var problems []Problem
-
- isHistogram := t == dto.MetricType_HISTOGRAM
- isSummary := t == dto.MetricType_SUMMARY
-
- n := mf.GetName()
-
- if !isHistogram && strings.HasSuffix(n, "_bucket") {
- problems = append(problems, newProblem(mf, `non-histogram metrics should not have "_bucket" suffix`))
- }
- if !isHistogram && !isSummary && strings.HasSuffix(n, "_count") {
- problems = append(problems, newProblem(mf, `non-histogram and non-summary metrics should not have "_count" suffix`))
- }
- if !isHistogram && !isSummary && strings.HasSuffix(n, "_sum") {
- problems = append(problems, newProblem(mf, `non-histogram and non-summary metrics should not have "_sum" suffix`))
- }
-
- for _, m := range mf.GetMetric() {
- for _, l := range m.GetLabel() {
- ln := l.GetName()
-
- if !isHistogram && ln == "le" {
- problems = append(problems, newProblem(mf, `non-histogram metrics should not have "le" label`))
- }
- if !isSummary && ln == "quantile" {
- problems = append(problems, newProblem(mf, `non-summary metrics should not have "quantile" label`))
- }
- }
- }
-
- return problems
-}
-
-// lintMetricTypeInName detects when metric types are included in the metric name.
-func lintMetricTypeInName(mf *dto.MetricFamily) []Problem {
- var problems []Problem
- n := strings.ToLower(mf.GetName())
-
- for i, t := range dto.MetricType_name {
- if i == int32(dto.MetricType_UNTYPED) {
- continue
+ for _, fn := range defaultValidations {
+ errs := fn(mf)
+ for _, err := range errs {
+ problems = append(problems, newProblem(mf, err.Error()))
}
-
- typename := strings.ToLower(t)
- if strings.Contains(n, "_"+typename+"_") || strings.HasSuffix(n, "_"+typename) {
- problems = append(problems, newProblem(mf, fmt.Sprintf(`metric name should not include type '%s'`, typename)))
- }
- }
- return problems
-}
-
-// lintReservedChars detects colons in metric names.
-func lintReservedChars(mf *dto.MetricFamily) []Problem {
- var problems []Problem
- if strings.Contains(mf.GetName(), ":") {
- problems = append(problems, newProblem(mf, "metric names should not contain ':'"))
- }
- return problems
-}
-
-var camelCase = regexp.MustCompile(`[a-z][A-Z]`)
-
-// lintCamelCase detects metric names and label names written in camelCase.
-func lintCamelCase(mf *dto.MetricFamily) []Problem {
- var problems []Problem
- if camelCase.FindString(mf.GetName()) != "" {
- problems = append(problems, newProblem(mf, "metric names should be written in 'snake_case' not 'camelCase'"))
}
- for _, m := range mf.GetMetric() {
- for _, l := range m.GetLabel() {
- if camelCase.FindString(l.GetName()) != "" {
- problems = append(problems, newProblem(mf, "label names should be written in 'snake_case' not 'camelCase'"))
+ if l.customValidations != nil {
+ for _, fn := range l.customValidations {
+ errs := fn(mf)
+ for _, err := range errs {
+ problems = append(problems, newProblem(mf, err.Error()))
}
}
}
- return problems
-}
-// lintUnitAbbreviations detects abbreviated units in the metric name.
-func lintUnitAbbreviations(mf *dto.MetricFamily) []Problem {
- var problems []Problem
- n := strings.ToLower(mf.GetName())
- for _, s := range unitAbbreviations {
- if strings.Contains(n, "_"+s+"_") || strings.HasSuffix(n, "_"+s) {
- problems = append(problems, newProblem(mf, "metric names should not contain abbreviated units"))
- }
- }
+ // TODO(mdlayher): lint rules for specific metrics types.
return problems
}
-
-// metricUnits attempts to detect known unit types used as part of a metric name,
-// e.g. "foo_bytes_total" or "bar_baz_milligrams".
-func metricUnits(m string) (unit, base string, ok bool) {
- ss := strings.Split(m, "_")
-
- for _, s := range ss {
- if base, found := units[s]; found {
- return s, base, true
- }
-
- for _, p := range unitPrefixes {
- if strings.HasPrefix(s, p) {
- if base, found := units[s[len(p):]]; found {
- return s, base, true
- }
- }
- }
- }
-
- return "", "", false
-}
-
-// Units and their possible prefixes recognized by this library. More can be
-// added over time as needed.
-var (
- // map a unit to the appropriate base unit.
- units = map[string]string{
- // Base units.
- "amperes": "amperes",
- "bytes": "bytes",
- "celsius": "celsius", // Also allow Celsius because it is common in typical Prometheus use cases.
- "grams": "grams",
- "joules": "joules",
- "kelvin": "kelvin", // SI base unit, used in special cases (e.g. color temperature, scientific measurements).
- "meters": "meters", // Both American and international spelling permitted.
- "metres": "metres",
- "seconds": "seconds",
- "volts": "volts",
-
- // Non base units.
- // Time.
- "minutes": "seconds",
- "hours": "seconds",
- "days": "seconds",
- "weeks": "seconds",
- // Temperature.
- "kelvins": "kelvin",
- "fahrenheit": "celsius",
- "rankine": "celsius",
- // Length.
- "inches": "meters",
- "yards": "meters",
- "miles": "meters",
- // Bytes.
- "bits": "bytes",
- // Energy.
- "calories": "joules",
- // Mass.
- "pounds": "grams",
- "ounces": "grams",
- }
-
- unitPrefixes = []string{
- "pico",
- "nano",
- "micro",
- "milli",
- "centi",
- "deci",
- "deca",
- "hecto",
- "kilo",
- "kibi",
- "mega",
- "mibi",
- "giga",
- "gibi",
- "tera",
- "tebi",
- "peta",
- "pebi",
- }
-
- // Common abbreviations that we'd like to discourage.
- unitAbbreviations = []string{
- "s",
- "ms",
- "us",
- "ns",
- "sec",
- "b",
- "kb",
- "mb",
- "gb",
- "tb",
- "pb",
- "m",
- "h",
- "d",
- }
-)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validation.go
similarity index 50%
rename from vendor/go.opentelemetry.io/otel/sdk/internal/internal.go
rename to vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validation.go
index dfeaaa8ca0..f52ad9eab6 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/internal/internal.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validation.go
@@ -1,5 +1,4 @@
-// Copyright The OpenTelemetry Authors
-//
+// Copyright 2020 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -12,17 +11,23 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package internal // import "go.opentelemetry.io/otel/sdk/internal"
+package promlint
-import "time"
+import (
+ dto "github.com/prometheus/client_model/go"
-// MonotonicEndTime returns the end time at present
-// but offset from start, monotonically.
-//
-// The monotonic clock is used in subtractions hence
-// the duration since start added back to start gives
-// end as a monotonic time.
-// See https://golang.org/pkg/time/#hdr-Monotonic_Clocks
-func MonotonicEndTime(start time.Time) time.Time {
- return start.Add(time.Since(start))
+ "github.com/prometheus/client_golang/prometheus/testutil/promlint/validations"
+)
+
+type Validation = func(mf *dto.MetricFamily) []error
+
+var defaultValidations = []Validation{
+ validations.LintHelp,
+ validations.LintMetricUnits,
+ validations.LintCounter,
+ validations.LintHistogramSummaryReserved,
+ validations.LintMetricTypeInName,
+ validations.LintReservedChars,
+ validations.LintCamelCase,
+ validations.LintUnitAbbreviations,
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/counter_validations.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/counter_validations.go
new file mode 100644
index 0000000000..f2c2c3905d
--- /dev/null
+++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/counter_validations.go
@@ -0,0 +1,40 @@
+// Copyright 2020 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 validations
+
+import (
+ "errors"
+ "strings"
+
+ dto "github.com/prometheus/client_model/go"
+)
+
+// LintCounter detects issues specific to counters, as well as patterns that should
+// only be used with counters.
+func LintCounter(mf *dto.MetricFamily) []error {
+ var problems []error
+
+ isCounter := mf.GetType() == dto.MetricType_COUNTER
+ isUntyped := mf.GetType() == dto.MetricType_UNTYPED
+ hasTotalSuffix := strings.HasSuffix(mf.GetName(), "_total")
+
+ switch {
+ case isCounter && !hasTotalSuffix:
+ problems = append(problems, errors.New(`counter metrics should have "_total" suffix`))
+ case !isUntyped && !isCounter && hasTotalSuffix:
+ problems = append(problems, errors.New(`non-counter metrics should not have "_total" suffix`))
+ }
+
+ return problems
+}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/generic_name_validations.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/generic_name_validations.go
new file mode 100644
index 0000000000..bc8dbd1e16
--- /dev/null
+++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/generic_name_validations.go
@@ -0,0 +1,101 @@
+// Copyright 2020 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 validations
+
+import (
+ "errors"
+ "fmt"
+ "regexp"
+ "strings"
+
+ dto "github.com/prometheus/client_model/go"
+)
+
+var camelCase = regexp.MustCompile(`[a-z][A-Z]`)
+
+// LintMetricUnits detects issues with metric unit names.
+func LintMetricUnits(mf *dto.MetricFamily) []error {
+ var problems []error
+
+ unit, base, ok := metricUnits(*mf.Name)
+ if !ok {
+ // No known units detected.
+ return nil
+ }
+
+ // Unit is already a base unit.
+ if unit == base {
+ return nil
+ }
+
+ problems = append(problems, fmt.Errorf("use base unit %q instead of %q", base, unit))
+
+ return problems
+}
+
+// LintMetricTypeInName detects when metric types are included in the metric name.
+func LintMetricTypeInName(mf *dto.MetricFamily) []error {
+ var problems []error
+ n := strings.ToLower(mf.GetName())
+
+ for i, t := range dto.MetricType_name {
+ if i == int32(dto.MetricType_UNTYPED) {
+ continue
+ }
+
+ typename := strings.ToLower(t)
+ if strings.Contains(n, "_"+typename+"_") || strings.HasSuffix(n, "_"+typename) {
+ problems = append(problems, fmt.Errorf(`metric name should not include type '%s'`, typename))
+ }
+ }
+ return problems
+}
+
+// LintReservedChars detects colons in metric names.
+func LintReservedChars(mf *dto.MetricFamily) []error {
+ var problems []error
+ if strings.Contains(mf.GetName(), ":") {
+ problems = append(problems, errors.New("metric names should not contain ':'"))
+ }
+ return problems
+}
+
+// LintCamelCase detects metric names and label names written in camelCase.
+func LintCamelCase(mf *dto.MetricFamily) []error {
+ var problems []error
+ if camelCase.FindString(mf.GetName()) != "" {
+ problems = append(problems, errors.New("metric names should be written in 'snake_case' not 'camelCase'"))
+ }
+
+ for _, m := range mf.GetMetric() {
+ for _, l := range m.GetLabel() {
+ if camelCase.FindString(l.GetName()) != "" {
+ problems = append(problems, errors.New("label names should be written in 'snake_case' not 'camelCase'"))
+ }
+ }
+ }
+ return problems
+}
+
+// LintUnitAbbreviations detects abbreviated units in the metric name.
+func LintUnitAbbreviations(mf *dto.MetricFamily) []error {
+ var problems []error
+ n := strings.ToLower(mf.GetName())
+ for _, s := range unitAbbreviations {
+ if strings.Contains(n, "_"+s+"_") || strings.HasSuffix(n, "_"+s) {
+ problems = append(problems, errors.New("metric names should not contain abbreviated units"))
+ }
+ }
+ return problems
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/help_validations.go
similarity index 57%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go
rename to vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/help_validations.go
index 7cf424855e..1df2944689 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/help_validations.go
@@ -1,5 +1,4 @@
-// Copyright The OpenTelemetry Authors
-//
+// Copyright 2020 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -12,9 +11,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Package semconv implements OpenTelemetry semantic conventions.
-//
-// OpenTelemetry semantic conventions are agreed standardized naming
-// patterns for OpenTelemetry things. This package represents the conventions
-// as of the v1.21.0 version of the OpenTelemetry specification.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
+package validations
+
+import (
+ "errors"
+
+ dto "github.com/prometheus/client_model/go"
+)
+
+// LintHelp detects issues related to the help text for a metric.
+func LintHelp(mf *dto.MetricFamily) []error {
+ var problems []error
+
+ // Expect all metrics to have help text available.
+ if mf.Help == nil {
+ problems = append(problems, errors.New("no help text"))
+ }
+
+ return problems
+}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/histogram_validations.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/histogram_validations.go
new file mode 100644
index 0000000000..6564bdf366
--- /dev/null
+++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/histogram_validations.go
@@ -0,0 +1,63 @@
+// Copyright 2020 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 validations
+
+import (
+ "errors"
+ "strings"
+
+ dto "github.com/prometheus/client_model/go"
+)
+
+// LintHistogramSummaryReserved detects when other types of metrics use names or labels
+// reserved for use by histograms and/or summaries.
+func LintHistogramSummaryReserved(mf *dto.MetricFamily) []error {
+ // These rules do not apply to untyped metrics.
+ t := mf.GetType()
+ if t == dto.MetricType_UNTYPED {
+ return nil
+ }
+
+ var problems []error
+
+ isHistogram := t == dto.MetricType_HISTOGRAM
+ isSummary := t == dto.MetricType_SUMMARY
+
+ n := mf.GetName()
+
+ if !isHistogram && strings.HasSuffix(n, "_bucket") {
+ problems = append(problems, errors.New(`non-histogram metrics should not have "_bucket" suffix`))
+ }
+ if !isHistogram && !isSummary && strings.HasSuffix(n, "_count") {
+ problems = append(problems, errors.New(`non-histogram and non-summary metrics should not have "_count" suffix`))
+ }
+ if !isHistogram && !isSummary && strings.HasSuffix(n, "_sum") {
+ problems = append(problems, errors.New(`non-histogram and non-summary metrics should not have "_sum" suffix`))
+ }
+
+ for _, m := range mf.GetMetric() {
+ for _, l := range m.GetLabel() {
+ ln := l.GetName()
+
+ if !isHistogram && ln == "le" {
+ problems = append(problems, errors.New(`non-histogram metrics should not have "le" label`))
+ }
+ if !isSummary && ln == "quantile" {
+ problems = append(problems, errors.New(`non-summary metrics should not have "quantile" label`))
+ }
+ }
+ }
+
+ return problems
+}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/units.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/units.go
new file mode 100644
index 0000000000..967977d2b0
--- /dev/null
+++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/units.go
@@ -0,0 +1,118 @@
+// Copyright 2020 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 validations
+
+import "strings"
+
+// Units and their possible prefixes recognized by this library. More can be
+// added over time as needed.
+var (
+ // map a unit to the appropriate base unit.
+ units = map[string]string{
+ // Base units.
+ "amperes": "amperes",
+ "bytes": "bytes",
+ "celsius": "celsius", // Also allow Celsius because it is common in typical Prometheus use cases.
+ "grams": "grams",
+ "joules": "joules",
+ "kelvin": "kelvin", // SI base unit, used in special cases (e.g. color temperature, scientific measurements).
+ "meters": "meters", // Both American and international spelling permitted.
+ "metres": "metres",
+ "seconds": "seconds",
+ "volts": "volts",
+
+ // Non base units.
+ // Time.
+ "minutes": "seconds",
+ "hours": "seconds",
+ "days": "seconds",
+ "weeks": "seconds",
+ // Temperature.
+ "kelvins": "kelvin",
+ "fahrenheit": "celsius",
+ "rankine": "celsius",
+ // Length.
+ "inches": "meters",
+ "yards": "meters",
+ "miles": "meters",
+ // Bytes.
+ "bits": "bytes",
+ // Energy.
+ "calories": "joules",
+ // Mass.
+ "pounds": "grams",
+ "ounces": "grams",
+ }
+
+ unitPrefixes = []string{
+ "pico",
+ "nano",
+ "micro",
+ "milli",
+ "centi",
+ "deci",
+ "deca",
+ "hecto",
+ "kilo",
+ "kibi",
+ "mega",
+ "mibi",
+ "giga",
+ "gibi",
+ "tera",
+ "tebi",
+ "peta",
+ "pebi",
+ }
+
+ // Common abbreviations that we'd like to discourage.
+ unitAbbreviations = []string{
+ "s",
+ "ms",
+ "us",
+ "ns",
+ "sec",
+ "b",
+ "kb",
+ "mb",
+ "gb",
+ "tb",
+ "pb",
+ "m",
+ "h",
+ "d",
+ }
+)
+
+// metricUnits attempts to detect known unit types used as part of a metric name,
+// e.g. "foo_bytes_total" or "bar_baz_milligrams".
+func metricUnits(m string) (unit, base string, ok bool) {
+ ss := strings.Split(m, "_")
+
+ for _, s := range ss {
+ if base, found := units[s]; found {
+ return s, base, true
+ }
+
+ for _, p := range unitPrefixes {
+ if strings.HasPrefix(s, p) {
+ if base, found := units[s[len(p):]]; found {
+ return s, base, true
+ }
+ }
+ }
+ }
+
+ return "", "", false
+}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go
index 82d4a5436b..9dce15eafa 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go
@@ -47,6 +47,7 @@ import (
"github.com/davecgh/go-spew/spew"
dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/expfmt"
+ "google.golang.org/protobuf/proto"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/internal"
@@ -230,6 +231,20 @@ func convertReaderToMetricFamily(reader io.Reader) ([]*dto.MetricFamily, error)
return nil, fmt.Errorf("converting reader to metric families failed: %w", err)
}
+ // The text protocol handles empty help fields inconsistently. When
+ // encoding, any non-nil value, include the empty string, produces a
+ // "# HELP" line. But when decoding, the help field is only set to a
+ // non-nil value if the "# HELP" line contains a non-empty value.
+ //
+ // Because metrics in a registry always have non-nil help fields, populate
+ // any nil help fields in the parsed metrics with the empty string so that
+ // when we compare text encodings, the results are consistent.
+ for _, metric := range notNormalized {
+ if metric.Help == nil {
+ metric.Help = proto.String("")
+ }
+ }
+
return internal.NormalizeMetricFamilies(notNormalized), nil
}
@@ -250,13 +265,13 @@ func compareMetricFamilies(got, expected []*dto.MetricFamily, metricNames ...str
// result.
func compare(got, want []*dto.MetricFamily) error {
var gotBuf, wantBuf bytes.Buffer
- enc := expfmt.NewEncoder(&gotBuf, expfmt.FmtText)
+ enc := expfmt.NewEncoder(&gotBuf, expfmt.NewFormat(expfmt.TypeTextPlain))
for _, mf := range got {
if err := enc.Encode(mf); err != nil {
return fmt.Errorf("encoding gathered metrics failed: %w", err)
}
}
- enc = expfmt.NewEncoder(&wantBuf, expfmt.FmtText)
+ enc = expfmt.NewEncoder(&wantBuf, expfmt.NewFormat(expfmt.TypeTextPlain))
for _, mf := range want {
if err := enc.Encode(mf); err != nil {
return fmt.Errorf("encoding expected metrics failed: %w", err)
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/value.go b/vendor/github.com/prometheus/client_golang/prometheus/value.go
index 5f6bb80014..cc23011fad 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/value.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/value.go
@@ -14,6 +14,7 @@
package prometheus
import (
+ "errors"
"fmt"
"sort"
"time"
@@ -91,7 +92,7 @@ func (v *valueFunc) Desc() *Desc {
}
func (v *valueFunc) Write(out *dto.Metric) error {
- return populateMetric(v.valType, v.function(), v.labelPairs, nil, out)
+ return populateMetric(v.valType, v.function(), v.labelPairs, nil, out, nil)
}
// NewConstMetric returns a metric with one fixed value that cannot be
@@ -105,12 +106,12 @@ func NewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues
if desc.err != nil {
return nil, desc.err
}
- if err := validateLabelValues(labelValues, len(desc.variableLabels)); err != nil {
+ if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil {
return nil, err
}
metric := &dto.Metric{}
- if err := populateMetric(valueType, value, MakeLabelPairs(desc, labelValues), nil, metric); err != nil {
+ if err := populateMetric(valueType, value, MakeLabelPairs(desc, labelValues), nil, metric, nil); err != nil {
return nil, err
}
@@ -130,6 +131,43 @@ func MustNewConstMetric(desc *Desc, valueType ValueType, value float64, labelVal
return m
}
+// NewConstMetricWithCreatedTimestamp does the same thing as NewConstMetric, but generates Counters
+// with created timestamp set and returns an error for other metric types.
+func NewConstMetricWithCreatedTimestamp(desc *Desc, valueType ValueType, value float64, ct time.Time, labelValues ...string) (Metric, error) {
+ if desc.err != nil {
+ return nil, desc.err
+ }
+ if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil {
+ return nil, err
+ }
+ switch valueType {
+ case CounterValue:
+ break
+ default:
+ return nil, errors.New("created timestamps are only supported for counters")
+ }
+
+ metric := &dto.Metric{}
+ if err := populateMetric(valueType, value, MakeLabelPairs(desc, labelValues), nil, metric, timestamppb.New(ct)); err != nil {
+ return nil, err
+ }
+
+ return &constMetric{
+ desc: desc,
+ metric: metric,
+ }, nil
+}
+
+// MustNewConstMetricWithCreatedTimestamp is a version of NewConstMetricWithCreatedTimestamp that panics where
+// NewConstMetricWithCreatedTimestamp would have returned an error.
+func MustNewConstMetricWithCreatedTimestamp(desc *Desc, valueType ValueType, value float64, ct time.Time, labelValues ...string) Metric {
+ m, err := NewConstMetricWithCreatedTimestamp(desc, valueType, value, ct, labelValues...)
+ if err != nil {
+ panic(err)
+ }
+ return m
+}
+
type constMetric struct {
desc *Desc
metric *dto.Metric
@@ -153,11 +191,12 @@ func populateMetric(
labelPairs []*dto.LabelPair,
e *dto.Exemplar,
m *dto.Metric,
+ ct *timestamppb.Timestamp,
) error {
m.Label = labelPairs
switch t {
case CounterValue:
- m.Counter = &dto.Counter{Value: proto.Float64(v), Exemplar: e}
+ m.Counter = &dto.Counter{Value: proto.Float64(v), Exemplar: e, CreatedTimestamp: ct}
case GaugeValue:
m.Gauge = &dto.Gauge{Value: proto.Float64(v)}
case UntypedValue:
@@ -176,19 +215,19 @@ func populateMetric(
// This function is only needed for custom Metric implementations. See MetricVec
// example.
func MakeLabelPairs(desc *Desc, labelValues []string) []*dto.LabelPair {
- totalLen := len(desc.variableLabels) + len(desc.constLabelPairs)
+ totalLen := len(desc.variableLabels.names) + len(desc.constLabelPairs)
if totalLen == 0 {
// Super fast path.
return nil
}
- if len(desc.variableLabels) == 0 {
+ if len(desc.variableLabels.names) == 0 {
// Moderately fast path.
return desc.constLabelPairs
}
labelPairs := make([]*dto.LabelPair, 0, totalLen)
- for i, l := range desc.variableLabels {
+ for i, l := range desc.variableLabels.names {
labelPairs = append(labelPairs, &dto.LabelPair{
- Name: proto.String(l.Name),
+ Name: proto.String(l),
Value: proto.String(labelValues[i]),
})
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/vec.go b/vendor/github.com/prometheus/client_golang/prometheus/vec.go
index f0d0015a0f..955cfd59f8 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/vec.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/vec.go
@@ -20,24 +20,6 @@ import (
"github.com/prometheus/common/model"
)
-var labelsPool = &sync.Pool{
- New: func() interface{} {
- return make(Labels)
- },
-}
-
-func getLabelsFromPool() Labels {
- return labelsPool.Get().(Labels)
-}
-
-func putLabelsToPool(labels Labels) {
- for k := range labels {
- delete(labels, k)
- }
-
- labelsPool.Put(labels)
-}
-
// MetricVec is a Collector to bundle metrics of the same name that differ in
// their label values. MetricVec is not used directly but as a building block
// for implementations of vectors of a given metric type, like GaugeVec,
@@ -91,6 +73,7 @@ func NewMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *MetricVec {
// See also the CounterVec example.
func (m *MetricVec) DeleteLabelValues(lvs ...string) bool {
lvs = constrainLabelValues(m.desc, lvs, m.curry)
+
h, err := m.hashLabelValues(lvs)
if err != nil {
return false
@@ -110,8 +93,8 @@ func (m *MetricVec) DeleteLabelValues(lvs ...string) bool {
// This method is used for the same purpose as DeleteLabelValues(...string). See
// there for pros and cons of the two methods.
func (m *MetricVec) Delete(labels Labels) bool {
- labels = constrainLabels(m.desc, labels)
- defer putLabelsToPool(labels)
+ labels, closer := constrainLabels(m.desc, labels)
+ defer closer()
h, err := m.hashLabels(labels)
if err != nil {
@@ -128,8 +111,8 @@ func (m *MetricVec) Delete(labels Labels) bool {
// Note that curried labels will never be matched if deleting from the curried vector.
// To match curried labels with DeletePartialMatch, it must be called on the base vector.
func (m *MetricVec) DeletePartialMatch(labels Labels) int {
- labels = constrainLabels(m.desc, labels)
- defer putLabelsToPool(labels)
+ labels, closer := constrainLabels(m.desc, labels)
+ defer closer()
return m.metricMap.deleteByLabels(labels, m.curry)
}
@@ -169,11 +152,11 @@ func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) {
oldCurry = m.curry
iCurry int
)
- for i, label := range m.desc.variableLabels {
- val, ok := labels[label.Name]
+ for i, labelName := range m.desc.variableLabels.names {
+ val, ok := labels[labelName]
if iCurry < len(oldCurry) && oldCurry[iCurry].index == i {
if ok {
- return nil, fmt.Errorf("label name %q is already curried", label.Name)
+ return nil, fmt.Errorf("label name %q is already curried", labelName)
}
newCurry = append(newCurry, oldCurry[iCurry])
iCurry++
@@ -181,7 +164,10 @@ func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) {
if !ok {
continue // Label stays uncurried.
}
- newCurry = append(newCurry, curriedLabelValue{i, label.Constrain(val)})
+ newCurry = append(newCurry, curriedLabelValue{
+ i,
+ m.desc.variableLabels.constrain(labelName, val),
+ })
}
}
if l := len(oldCurry) + len(labels) - len(newCurry); l > 0 {
@@ -250,8 +236,8 @@ func (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) {
// around MetricVec, implementing a vector for a specific Metric implementation,
// for example GaugeVec.
func (m *MetricVec) GetMetricWith(labels Labels) (Metric, error) {
- labels = constrainLabels(m.desc, labels)
- defer putLabelsToPool(labels)
+ labels, closer := constrainLabels(m.desc, labels)
+ defer closer()
h, err := m.hashLabels(labels)
if err != nil {
@@ -262,7 +248,7 @@ func (m *MetricVec) GetMetricWith(labels Labels) (Metric, error) {
}
func (m *MetricVec) hashLabelValues(vals []string) (uint64, error) {
- if err := validateLabelValues(vals, len(m.desc.variableLabels)-len(m.curry)); err != nil {
+ if err := validateLabelValues(vals, len(m.desc.variableLabels.names)-len(m.curry)); err != nil {
return 0, err
}
@@ -271,7 +257,7 @@ func (m *MetricVec) hashLabelValues(vals []string) (uint64, error) {
curry = m.curry
iVals, iCurry int
)
- for i := 0; i < len(m.desc.variableLabels); i++ {
+ for i := 0; i < len(m.desc.variableLabels.names); i++ {
if iCurry < len(curry) && curry[iCurry].index == i {
h = m.hashAdd(h, curry[iCurry].value)
iCurry++
@@ -285,7 +271,7 @@ func (m *MetricVec) hashLabelValues(vals []string) (uint64, error) {
}
func (m *MetricVec) hashLabels(labels Labels) (uint64, error) {
- if err := validateValuesInLabels(labels, len(m.desc.variableLabels)-len(m.curry)); err != nil {
+ if err := validateValuesInLabels(labels, len(m.desc.variableLabels.names)-len(m.curry)); err != nil {
return 0, err
}
@@ -294,17 +280,17 @@ func (m *MetricVec) hashLabels(labels Labels) (uint64, error) {
curry = m.curry
iCurry int
)
- for i, label := range m.desc.variableLabels {
- val, ok := labels[label.Name]
+ for i, labelName := range m.desc.variableLabels.names {
+ val, ok := labels[labelName]
if iCurry < len(curry) && curry[iCurry].index == i {
if ok {
- return 0, fmt.Errorf("label name %q is already curried", label.Name)
+ return 0, fmt.Errorf("label name %q is already curried", labelName)
}
h = m.hashAdd(h, curry[iCurry].value)
iCurry++
} else {
if !ok {
- return 0, fmt.Errorf("label name %q missing in label map", label.Name)
+ return 0, fmt.Errorf("label name %q missing in label map", labelName)
}
h = m.hashAdd(h, val)
}
@@ -482,7 +468,7 @@ func valueMatchesVariableOrCurriedValue(targetValue string, index int, values []
func matchPartialLabels(desc *Desc, values []string, labels Labels, curry []curriedLabelValue) bool {
for l, v := range labels {
// Check if the target label exists in our metrics and get the index.
- varLabelIndex, validLabel := indexOf(l, desc.variableLabels.labelNames())
+ varLabelIndex, validLabel := indexOf(l, desc.variableLabels.names)
if validLabel {
// Check the value of that label against the target value.
// We don't consider curried values in partial matches.
@@ -626,7 +612,7 @@ func matchLabels(desc *Desc, values []string, labels Labels, curry []curriedLabe
return false
}
iCurry := 0
- for i, k := range desc.variableLabels {
+ for i, k := range desc.variableLabels.names {
if iCurry < len(curry) && curry[iCurry].index == i {
if values[i] != curry[iCurry].value {
return false
@@ -634,7 +620,7 @@ func matchLabels(desc *Desc, values []string, labels Labels, curry []curriedLabe
iCurry++
continue
}
- if values[i] != labels[k.Name] {
+ if values[i] != labels[k] {
return false
}
}
@@ -644,13 +630,13 @@ func matchLabels(desc *Desc, values []string, labels Labels, curry []curriedLabe
func extractLabelValues(desc *Desc, labels Labels, curry []curriedLabelValue) []string {
labelValues := make([]string, len(labels)+len(curry))
iCurry := 0
- for i, k := range desc.variableLabels {
+ for i, k := range desc.variableLabels.names {
if iCurry < len(curry) && curry[iCurry].index == i {
labelValues[i] = curry[iCurry].value
iCurry++
continue
}
- labelValues[i] = labels[k.Name]
+ labelValues[i] = labels[k]
}
return labelValues
}
@@ -670,20 +656,37 @@ func inlineLabelValues(lvs []string, curry []curriedLabelValue) []string {
return labelValues
}
-func constrainLabels(desc *Desc, labels Labels) Labels {
- constrainedLabels := getLabelsFromPool()
- for l, v := range labels {
- if i, ok := indexOf(l, desc.variableLabels.labelNames()); ok {
- v = desc.variableLabels[i].Constrain(v)
- }
+var labelsPool = &sync.Pool{
+ New: func() interface{} {
+ return make(Labels)
+ },
+}
- constrainedLabels[l] = v
+func constrainLabels(desc *Desc, labels Labels) (Labels, func()) {
+ if len(desc.variableLabels.labelConstraints) == 0 {
+ // Fast path when there's no constraints
+ return labels, func() {}
}
- return constrainedLabels
+ constrainedLabels := labelsPool.Get().(Labels)
+ for l, v := range labels {
+ constrainedLabels[l] = desc.variableLabels.constrain(l, v)
+ }
+
+ return constrainedLabels, func() {
+ for k := range constrainedLabels {
+ delete(constrainedLabels, k)
+ }
+ labelsPool.Put(constrainedLabels)
+ }
}
func constrainLabelValues(desc *Desc, lvs []string, curry []curriedLabelValue) []string {
+ if len(desc.variableLabels.labelConstraints) == 0 {
+ // Fast path when there's no constraints
+ return lvs
+ }
+
constrainedValues := make([]string, len(lvs))
var iCurry, iLVs int
for i := 0; i < len(lvs)+len(curry); i++ {
@@ -692,8 +695,11 @@ func constrainLabelValues(desc *Desc, lvs []string, curry []curriedLabelValue) [
continue
}
- if i < len(desc.variableLabels) {
- constrainedValues[iLVs] = desc.variableLabels[i].Constrain(lvs[iLVs])
+ if i < len(desc.variableLabels.names) {
+ constrainedValues[iLVs] = desc.variableLabels.constrain(
+ desc.variableLabels.names[i],
+ lvs[iLVs],
+ )
} else {
constrainedValues[iLVs] = lvs[iLVs]
}
diff --git a/vendor/github.com/prometheus/client_model/go/metrics.pb.go b/vendor/github.com/prometheus/client_model/go/metrics.pb.go
index 2b5bca4b99..2f15490758 100644
--- a/vendor/github.com/prometheus/client_model/go/metrics.pb.go
+++ b/vendor/github.com/prometheus/client_model/go/metrics.pb.go
@@ -215,8 +215,9 @@ type Counter struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Value *float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"`
- Exemplar *Exemplar `protobuf:"bytes,2,opt,name=exemplar" json:"exemplar,omitempty"`
+ Value *float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"`
+ Exemplar *Exemplar `protobuf:"bytes,2,opt,name=exemplar" json:"exemplar,omitempty"`
+ CreatedTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_timestamp,json=createdTimestamp" json:"created_timestamp,omitempty"`
}
func (x *Counter) Reset() {
@@ -265,6 +266,13 @@ func (x *Counter) GetExemplar() *Exemplar {
return nil
}
+func (x *Counter) GetCreatedTimestamp() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreatedTimestamp
+ }
+ return nil
+}
+
type Quantile struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -325,9 +333,10 @@ type Summary struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"`
- SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"`
- Quantile []*Quantile `protobuf:"bytes,3,rep,name=quantile" json:"quantile,omitempty"`
+ SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"`
+ SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"`
+ Quantile []*Quantile `protobuf:"bytes,3,rep,name=quantile" json:"quantile,omitempty"`
+ CreatedTimestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_timestamp,json=createdTimestamp" json:"created_timestamp,omitempty"`
}
func (x *Summary) Reset() {
@@ -383,6 +392,13 @@ func (x *Summary) GetQuantile() []*Quantile {
return nil
}
+func (x *Summary) GetCreatedTimestamp() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreatedTimestamp
+ }
+ return nil
+}
+
type Untyped struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -439,7 +455,8 @@ type Histogram struct {
SampleCountFloat *float64 `protobuf:"fixed64,4,opt,name=sample_count_float,json=sampleCountFloat" json:"sample_count_float,omitempty"` // Overrides sample_count if > 0.
SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"`
// Buckets for the conventional histogram.
- Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"` // Ordered in increasing order of upper_bound, +Inf bucket is optional.
+ Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"` // Ordered in increasing order of upper_bound, +Inf bucket is optional.
+ CreatedTimestamp *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=created_timestamp,json=createdTimestamp" json:"created_timestamp,omitempty"`
// schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
// They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
// then each power of two is divided into 2^n logarithmic buckets.
@@ -457,12 +474,17 @@ type Histogram struct {
NegativeDelta []int64 `protobuf:"zigzag64,10,rep,name=negative_delta,json=negativeDelta" json:"negative_delta,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket).
NegativeCount []float64 `protobuf:"fixed64,11,rep,name=negative_count,json=negativeCount" json:"negative_count,omitempty"` // Absolute count of each bucket.
// Positive buckets for the native histogram.
+ // Use a no-op span (offset 0, length 0) for a native histogram without any
+ // observations yet and with a zero_threshold of 0. Otherwise, it would be
+ // indistinguishable from a classic histogram.
PositiveSpan []*BucketSpan `protobuf:"bytes,12,rep,name=positive_span,json=positiveSpan" json:"positive_span,omitempty"`
// Use either "positive_delta" or "positive_count", the former for
// regular histograms with integer counts, the latter for float
// histograms.
PositiveDelta []int64 `protobuf:"zigzag64,13,rep,name=positive_delta,json=positiveDelta" json:"positive_delta,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket).
PositiveCount []float64 `protobuf:"fixed64,14,rep,name=positive_count,json=positiveCount" json:"positive_count,omitempty"` // Absolute count of each bucket.
+ // Only used for native histograms. These exemplars MUST have a timestamp.
+ Exemplars []*Exemplar `protobuf:"bytes,16,rep,name=exemplars" json:"exemplars,omitempty"`
}
func (x *Histogram) Reset() {
@@ -525,6 +547,13 @@ func (x *Histogram) GetBucket() []*Bucket {
return nil
}
+func (x *Histogram) GetCreatedTimestamp() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreatedTimestamp
+ }
+ return nil
+}
+
func (x *Histogram) GetSchema() int32 {
if x != nil && x.Schema != nil {
return *x.Schema
@@ -595,6 +624,13 @@ func (x *Histogram) GetPositiveCount() []float64 {
return nil
}
+func (x *Histogram) GetExemplars() []*Exemplar {
+ if x != nil {
+ return x.Exemplars
+ }
+ return nil
+}
+
// A Bucket of a conventional histogram, each of which is treated as
// an individual counter-like time series by Prometheus.
type Bucket struct {
@@ -896,6 +932,7 @@ type MetricFamily struct {
Help *string `protobuf:"bytes,2,opt,name=help" json:"help,omitempty"`
Type *MetricType `protobuf:"varint,3,opt,name=type,enum=io.prometheus.client.MetricType" json:"type,omitempty"`
Metric []*Metric `protobuf:"bytes,4,rep,name=metric" json:"metric,omitempty"`
+ Unit *string `protobuf:"bytes,5,opt,name=unit" json:"unit,omitempty"`
}
func (x *MetricFamily) Reset() {
@@ -958,6 +995,13 @@ func (x *MetricFamily) GetMetric() []*Metric {
return nil
}
+func (x *MetricFamily) GetUnit() string {
+ if x != nil && x.Unit != nil {
+ return *x.Unit
+ }
+ return ""
+}
+
var File_io_prometheus_client_metrics_proto protoreflect.FileDescriptor
var file_io_prometheus_client_metrics_proto_rawDesc = []byte{
@@ -972,137 +1016,156 @@ var file_io_prometheus_client_metrics_proto_rawDesc = []byte{
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x22, 0x1d, 0x0a, 0x05, 0x47, 0x61, 0x75, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
- 0x65, 0x22, 0x5b, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05,
- 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c,
- 0x75, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74,
- 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, 0x65, 0x6d,
- 0x70, 0x6c, 0x61, 0x72, 0x52, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x22, 0x3c,
- 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75,
- 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x71, 0x75,
- 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x87, 0x01, 0x0a,
- 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x61, 0x6d, 0x70,
+ 0x65, 0x22, 0xa4, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a,
+ 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65,
+ 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, 0x65,
+ 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x12,
+ 0x47, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73,
+ 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
+ 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54,
+ 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x3c, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e,
+ 0x74, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65,
+ 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52,
+ 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61,
+ 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75,
+ 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65,
+ 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f,
+ 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x73, 0x61, 0x6d, 0x70, 0x6c,
+ 0x65, 0x53, 0x75, 0x6d, 0x12, 0x3a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65,
+ 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d,
+ 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x51, 0x75,
+ 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65,
+ 0x12, 0x47, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65,
+ 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
+ 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
+ 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x1f, 0x0a, 0x07, 0x55, 0x6e, 0x74,
+ 0x79, 0x70, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xea, 0x05, 0x0a, 0x09, 0x48,
+ 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b,
- 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73,
- 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52,
- 0x09, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x3a, 0x0a, 0x08, 0x71, 0x75,
- 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69,
+ 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x73,
+ 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61,
+ 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x43,
+ 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6d,
+ 0x70, 0x6c, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x73,
+ 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x34, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b,
+ 0x65, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72,
+ 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e,
+ 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x47,
+ 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
+ 0x61, 0x6d, 0x70, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
+ 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69,
+ 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d,
+ 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12,
+ 0x25, 0x0a, 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c,
+ 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0d, 0x7a, 0x65, 0x72, 0x6f, 0x54, 0x68, 0x72,
+ 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x7a, 0x65, 0x72, 0x6f,
+ 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x63, 0x6f,
+ 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52,
+ 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12,
+ 0x45, 0x0a, 0x0d, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x6e,
+ 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d,
+ 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x42, 0x75,
+ 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x0c, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x12, 0x52, 0x0d,
+ 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x25, 0x0a,
+ 0x0e, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
+ 0x0b, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0d, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43,
+ 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65,
+ 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6f,
+ 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x0c, 0x70,
+ 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x70,
+ 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x0d, 0x20,
+ 0x03, 0x28, 0x12, 0x52, 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x44, 0x65, 0x6c,
+ 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0d, 0x70, 0x6f, 0x73, 0x69,
+ 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x78, 0x65,
+ 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69,
0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69,
- 0x65, 0x6e, 0x74, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x52, 0x08, 0x71, 0x75,
- 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x22, 0x1f, 0x0a, 0x07, 0x55, 0x6e, 0x74, 0x79, 0x70, 0x65,
- 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01,
- 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xe3, 0x04, 0x0a, 0x09, 0x48, 0x69, 0x73, 0x74,
- 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f,
- 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x61, 0x6d,
- 0x70, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x61, 0x6d, 0x70,
- 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x04,
- 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e,
- 0x74, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65,
- 0x5f, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x73, 0x61, 0x6d, 0x70,
- 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x12, 0x34, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18,
- 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65,
- 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x42, 0x75, 0x63,
- 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73,
- 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, 0x73, 0x63, 0x68,
- 0x65, 0x6d, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65,
- 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0d, 0x7a, 0x65, 0x72,
- 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x7a, 0x65,
- 0x72, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09,
- 0x7a, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x7a, 0x65, 0x72,
- 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x08, 0x20,
- 0x01, 0x28, 0x01, 0x52, 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c,
- 0x6f, 0x61, 0x74, 0x12, 0x45, 0x0a, 0x0d, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f,
- 0x73, 0x70, 0x61, 0x6e, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6f, 0x2e,
+ 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x09, 0x65, 0x78,
+ 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x06, 0x42, 0x75, 0x63, 0x6b,
+ 0x65, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x63, 0x75,
+ 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a,
+ 0x16, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
+ 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x14, 0x63,
+ 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c,
+ 0x6f, 0x61, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x6f, 0x75,
+ 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x75, 0x70, 0x70, 0x65, 0x72, 0x42,
+ 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d,
+ 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78,
+ 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72,
+ 0x22, 0x3c, 0x0a, 0x0a, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x16,
+ 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06,
+ 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x91,
+ 0x01, 0x0a, 0x08, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x12, 0x35, 0x0a, 0x05, 0x6c,
+ 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6f, 0x2e,
0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e,
- 0x74, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x0c, 0x6e, 0x65,
- 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x65,
- 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x03,
- 0x28, 0x12, 0x52, 0x0d, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x44, 0x65, 0x6c, 0x74,
- 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f,
- 0x75, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0d, 0x6e, 0x65, 0x67, 0x61, 0x74,
- 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x0d, 0x70, 0x6f, 0x73, 0x69,
- 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32,
- 0x20, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e,
- 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61,
- 0x6e, 0x52, 0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x12,
- 0x25, 0x0a, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74,
- 0x61, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x12, 0x52, 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76,
- 0x65, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69,
- 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0d,
- 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc6, 0x01,
- 0x0a, 0x06, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x75, 0x6d, 0x75,
- 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x04, 0x52, 0x0f, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f,
- 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76,
- 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x01, 0x52, 0x14, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43,
- 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x70,
- 0x65, 0x72, 0x5f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a,
- 0x75, 0x70, 0x70, 0x65, 0x72, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x78,
- 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69,
+ 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x61, 0x69, 0x72, 0x52, 0x05, 0x6c, 0x61, 0x62,
+ 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65,
+ 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
+ 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
+ 0x6d, 0x70, 0x22, 0xff, 0x02, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x35, 0x0a,
+ 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69,
0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69,
- 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x08, 0x65, 0x78,
- 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x22, 0x3c, 0x0a, 0x0a, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74,
- 0x53, 0x70, 0x61, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06,
- 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65,
- 0x6e, 0x67, 0x74, 0x68, 0x22, 0x91, 0x01, 0x0a, 0x08, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61,
- 0x72, 0x12, 0x35, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
- 0x32, 0x1f, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73,
- 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x61, 0x69,
- 0x72, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
- 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38,
- 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74,
- 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xff, 0x02, 0x0a, 0x06, 0x4d, 0x65, 0x74,
- 0x72, 0x69, 0x63, 0x12, 0x35, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03,
- 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65,
- 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50,
- 0x61, 0x69, 0x72, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x05, 0x67, 0x61,
- 0x75, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6f, 0x2e, 0x70,
- 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
- 0x2e, 0x47, 0x61, 0x75, 0x67, 0x65, 0x52, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x12, 0x37, 0x0a,
- 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d,
- 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63,
- 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72,
- 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f,
- 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x53,
- 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12,
- 0x37, 0x0a, 0x07, 0x75, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73,
- 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x55, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x64, 0x52,
- 0x07, 0x75, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x68, 0x69, 0x73, 0x74,
- 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6f,
+ 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x61, 0x69, 0x72, 0x52, 0x05, 0x6c,
+ 0x61, 0x62, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68,
+ 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x61, 0x75, 0x67, 0x65,
+ 0x52, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+ 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72,
+ 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e,
+ 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72,
+ 0x12, 0x37, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75,
+ 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79,
+ 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x75, 0x6e, 0x74,
+ 0x79, 0x70, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e,
+ 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e,
+ 0x74, 0x2e, 0x55, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x64, 0x52, 0x07, 0x75, 0x6e, 0x74, 0x79, 0x70,
+ 0x65, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18,
+ 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65,
+ 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x48, 0x69, 0x73,
+ 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61,
+ 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d,
+ 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
+ 0x6d, 0x70, 0x4d, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x46,
+ 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c,
+ 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x34, 0x0a,
+ 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x69, 0x6f,
0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65,
- 0x6e, 0x74, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x09, 0x68, 0x69,
- 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x73,
- 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74,
- 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x0c, 0x4d,
- 0x65, 0x74, 0x72, 0x69, 0x63, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
- 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68,
- 0x65, 0x6c, 0x70, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x20, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75,
- 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54,
- 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x6d, 0x65, 0x74,
- 0x72, 0x69, 0x63, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6f, 0x2e, 0x70,
- 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
- 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2a,
- 0x62, 0x0a, 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a,
- 0x07, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41,
- 0x55, 0x47, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x4d, 0x4d, 0x41, 0x52, 0x59,
- 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x54, 0x59, 0x50, 0x45, 0x44, 0x10, 0x03, 0x12,
- 0x0d, 0x0a, 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x04, 0x12, 0x13,
- 0x0a, 0x0f, 0x47, 0x41, 0x55, 0x47, 0x45, 0x5f, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41,
- 0x4d, 0x10, 0x05, 0x42, 0x52, 0x0a, 0x14, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74,
- 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5a, 0x3a, 0x67, 0x69, 0x74,
- 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65,
- 0x75, 0x73, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f,
- 0x67, 0x6f, 0x3b, 0x69, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73,
- 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
+ 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
+ 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x18, 0x04, 0x20,
+ 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68,
+ 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69,
+ 0x63, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69,
+ 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x2a, 0x62, 0x0a,
+ 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x43,
+ 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47,
+ 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x4d, 0x4d, 0x41, 0x52, 0x59, 0x10, 0x02,
+ 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x54, 0x59, 0x50, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0d, 0x0a,
+ 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f,
+ 0x47, 0x41, 0x55, 0x47, 0x45, 0x5f, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10,
+ 0x05, 0x42, 0x52, 0x0a, 0x14, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65,
+ 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75,
+ 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73,
+ 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x67, 0x6f,
+ 0x3b, 0x69, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63,
+ 0x6c, 0x69, 0x65, 0x6e, 0x74,
}
var (
@@ -1137,26 +1200,30 @@ var file_io_prometheus_client_metrics_proto_goTypes = []interface{}{
}
var file_io_prometheus_client_metrics_proto_depIdxs = []int32{
10, // 0: io.prometheus.client.Counter.exemplar:type_name -> io.prometheus.client.Exemplar
- 4, // 1: io.prometheus.client.Summary.quantile:type_name -> io.prometheus.client.Quantile
- 8, // 2: io.prometheus.client.Histogram.bucket:type_name -> io.prometheus.client.Bucket
- 9, // 3: io.prometheus.client.Histogram.negative_span:type_name -> io.prometheus.client.BucketSpan
- 9, // 4: io.prometheus.client.Histogram.positive_span:type_name -> io.prometheus.client.BucketSpan
- 10, // 5: io.prometheus.client.Bucket.exemplar:type_name -> io.prometheus.client.Exemplar
- 1, // 6: io.prometheus.client.Exemplar.label:type_name -> io.prometheus.client.LabelPair
- 13, // 7: io.prometheus.client.Exemplar.timestamp:type_name -> google.protobuf.Timestamp
- 1, // 8: io.prometheus.client.Metric.label:type_name -> io.prometheus.client.LabelPair
- 2, // 9: io.prometheus.client.Metric.gauge:type_name -> io.prometheus.client.Gauge
- 3, // 10: io.prometheus.client.Metric.counter:type_name -> io.prometheus.client.Counter
- 5, // 11: io.prometheus.client.Metric.summary:type_name -> io.prometheus.client.Summary
- 6, // 12: io.prometheus.client.Metric.untyped:type_name -> io.prometheus.client.Untyped
- 7, // 13: io.prometheus.client.Metric.histogram:type_name -> io.prometheus.client.Histogram
- 0, // 14: io.prometheus.client.MetricFamily.type:type_name -> io.prometheus.client.MetricType
- 11, // 15: io.prometheus.client.MetricFamily.metric:type_name -> io.prometheus.client.Metric
- 16, // [16:16] is the sub-list for method output_type
- 16, // [16:16] is the sub-list for method input_type
- 16, // [16:16] is the sub-list for extension type_name
- 16, // [16:16] is the sub-list for extension extendee
- 0, // [0:16] is the sub-list for field type_name
+ 13, // 1: io.prometheus.client.Counter.created_timestamp:type_name -> google.protobuf.Timestamp
+ 4, // 2: io.prometheus.client.Summary.quantile:type_name -> io.prometheus.client.Quantile
+ 13, // 3: io.prometheus.client.Summary.created_timestamp:type_name -> google.protobuf.Timestamp
+ 8, // 4: io.prometheus.client.Histogram.bucket:type_name -> io.prometheus.client.Bucket
+ 13, // 5: io.prometheus.client.Histogram.created_timestamp:type_name -> google.protobuf.Timestamp
+ 9, // 6: io.prometheus.client.Histogram.negative_span:type_name -> io.prometheus.client.BucketSpan
+ 9, // 7: io.prometheus.client.Histogram.positive_span:type_name -> io.prometheus.client.BucketSpan
+ 10, // 8: io.prometheus.client.Histogram.exemplars:type_name -> io.prometheus.client.Exemplar
+ 10, // 9: io.prometheus.client.Bucket.exemplar:type_name -> io.prometheus.client.Exemplar
+ 1, // 10: io.prometheus.client.Exemplar.label:type_name -> io.prometheus.client.LabelPair
+ 13, // 11: io.prometheus.client.Exemplar.timestamp:type_name -> google.protobuf.Timestamp
+ 1, // 12: io.prometheus.client.Metric.label:type_name -> io.prometheus.client.LabelPair
+ 2, // 13: io.prometheus.client.Metric.gauge:type_name -> io.prometheus.client.Gauge
+ 3, // 14: io.prometheus.client.Metric.counter:type_name -> io.prometheus.client.Counter
+ 5, // 15: io.prometheus.client.Metric.summary:type_name -> io.prometheus.client.Summary
+ 6, // 16: io.prometheus.client.Metric.untyped:type_name -> io.prometheus.client.Untyped
+ 7, // 17: io.prometheus.client.Metric.histogram:type_name -> io.prometheus.client.Histogram
+ 0, // 18: io.prometheus.client.MetricFamily.type:type_name -> io.prometheus.client.MetricType
+ 11, // 19: io.prometheus.client.MetricFamily.metric:type_name -> io.prometheus.client.Metric
+ 20, // [20:20] is the sub-list for method output_type
+ 20, // [20:20] is the sub-list for method input_type
+ 20, // [20:20] is the sub-list for extension type_name
+ 20, // [20:20] is the sub-list for extension extendee
+ 0, // [0:20] is the sub-list for field type_name
}
func init() { file_io_prometheus_client_metrics_proto_init() }
diff --git a/vendor/github.com/prometheus/common/config/config.go b/vendor/github.com/prometheus/common/config/config.go
index 0b91f20d55..7588da5556 100644
--- a/vendor/github.com/prometheus/common/config/config.go
+++ b/vendor/github.com/prometheus/common/config/config.go
@@ -27,8 +27,16 @@ const secretToken = ""
// Secret special type for storing secrets.
type Secret string
+// MarshalSecretValue if set to true will expose Secret type
+// through the marshal interfaces. Useful for outside projects
+// that load and marshal the Prometheus config.
+var MarshalSecretValue bool = false
+
// MarshalYAML implements the yaml.Marshaler interface for Secrets.
func (s Secret) MarshalYAML() (interface{}, error) {
+ if MarshalSecretValue {
+ return string(s), nil
+ }
if s != "" {
return secretToken, nil
}
@@ -43,15 +51,18 @@ func (s *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error {
// MarshalJSON implements the json.Marshaler interface for Secret.
func (s Secret) MarshalJSON() ([]byte, error) {
+ if MarshalSecretValue {
+ return json.Marshal(string(s))
+ }
if len(s) == 0 {
return json.Marshal("")
}
return json.Marshal(secretToken)
}
-type Header map[string][]Secret
+type ProxyHeader map[string][]Secret
-func (h *Header) HTTPHeader() http.Header {
+func (h *ProxyHeader) HTTPHeader() http.Header {
if h == nil || *h == nil {
return nil
}
diff --git a/vendor/github.com/prometheus/common/config/headers.go b/vendor/github.com/prometheus/common/config/headers.go
new file mode 100644
index 0000000000..4a0be4a10e
--- /dev/null
+++ b/vendor/github.com/prometheus/common/config/headers.go
@@ -0,0 +1,140 @@
+// Copyright 2024 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This package no longer handles safe yaml parsing. In order to
+// ensure correct yaml unmarshalling, use "yaml.UnmarshalStrict()".
+
+package config
+
+import (
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "os"
+ "strings"
+)
+
+// reservedHeaders that change the connection, are set by Prometheus, or can
+// be changed otherwise.
+var reservedHeaders = map[string]struct{}{
+ "Authorization": {},
+ "Host": {},
+ "Content-Encoding": {},
+ "Content-Length": {},
+ "Content-Type": {},
+ "User-Agent": {},
+ "Connection": {},
+ "Keep-Alive": {},
+ "Proxy-Authenticate": {},
+ "Proxy-Authorization": {},
+ "Www-Authenticate": {},
+ "Accept-Encoding": {},
+ "X-Prometheus-Remote-Write-Version": {},
+ "X-Prometheus-Remote-Read-Version": {},
+ "X-Prometheus-Scrape-Timeout-Seconds": {},
+
+ // Added by SigV4.
+ "X-Amz-Date": {},
+ "X-Amz-Security-Token": {},
+ "X-Amz-Content-Sha256": {},
+}
+
+// Headers represents the configuration for HTTP headers.
+type Headers struct {
+ Headers map[string]Header `yaml:",inline"`
+ dir string
+}
+
+// Header represents the configuration for a single HTTP header.
+type Header struct {
+ Values []string `yaml:"values,omitempty" json:"values,omitempty"`
+ Secrets []Secret `yaml:"secrets,omitempty" json:"secrets,omitempty"`
+ Files []string `yaml:"files,omitempty" json:"files,omitempty"`
+}
+
+func (h Headers) MarshalJSON() ([]byte, error) {
+ // Inline the Headers map when serializing JSON because json encoder doesn't support "inline" directive.
+ return json.Marshal(h.Headers)
+}
+
+// SetDirectory records the directory to make headers file relative to the
+// configuration file.
+func (h *Headers) SetDirectory(dir string) {
+ if h == nil {
+ return
+ }
+ h.dir = dir
+}
+
+// Validate validates the Headers config.
+func (h *Headers) Validate() error {
+ for n, header := range h.Headers {
+ if _, ok := reservedHeaders[http.CanonicalHeaderKey(n)]; ok {
+ return fmt.Errorf("setting header %q is not allowed", http.CanonicalHeaderKey(n))
+ }
+ for _, v := range header.Files {
+ f := JoinDir(h.dir, v)
+ _, err := os.ReadFile(f)
+ if err != nil {
+ return fmt.Errorf("unable to read header %q from file %s: %w", http.CanonicalHeaderKey(n), f, err)
+ }
+ }
+ }
+ return nil
+}
+
+// NewHeadersRoundTripper returns a RoundTripper that sets HTTP headers on
+// requests as configured.
+func NewHeadersRoundTripper(config *Headers, next http.RoundTripper) http.RoundTripper {
+ if len(config.Headers) == 0 {
+ return next
+ }
+ return &headersRoundTripper{
+ config: config,
+ next: next,
+ }
+}
+
+type headersRoundTripper struct {
+ next http.RoundTripper
+ config *Headers
+}
+
+// RoundTrip implements http.RoundTripper.
+func (rt *headersRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
+ req = cloneRequest(req)
+ for n, h := range rt.config.Headers {
+ for _, v := range h.Values {
+ req.Header.Add(n, v)
+ }
+ for _, v := range h.Secrets {
+ req.Header.Add(n, string(v))
+ }
+ for _, v := range h.Files {
+ f := JoinDir(rt.config.dir, v)
+ b, err := os.ReadFile(f)
+ if err != nil {
+ return nil, fmt.Errorf("unable to read headers file %s: %w", f, err)
+ }
+ req.Header.Add(n, strings.TrimSpace(string(b)))
+ }
+ }
+ return rt.next.RoundTrip(req)
+}
+
+// CloseIdleConnections implements closeIdler.
+func (rt *headersRoundTripper) CloseIdleConnections() {
+ if ci, ok := rt.next.(closeIdler); ok {
+ ci.CloseIdleConnections()
+ }
+}
diff --git a/vendor/github.com/prometheus/common/config/http_config.go b/vendor/github.com/prometheus/common/config/http_config.go
index 37aa966748..3e32013477 100644
--- a/vendor/github.com/prometheus/common/config/http_config.go
+++ b/vendor/github.com/prometheus/common/config/http_config.go
@@ -20,6 +20,7 @@ import (
"crypto/tls"
"crypto/x509"
"encoding/json"
+ "errors"
"fmt"
"net"
"net/http"
@@ -30,7 +31,7 @@ import (
"sync"
"time"
- "github.com/mwitkow/go-conntrack"
+ conntrack "github.com/mwitkow/go-conntrack"
"golang.org/x/net/http/httpproxy"
"golang.org/x/net/http2"
"golang.org/x/oauth2"
@@ -129,8 +130,13 @@ func (tv *TLSVersion) String() string {
// BasicAuth contains basic HTTP authentication credentials.
type BasicAuth struct {
Username string `yaml:"username" json:"username"`
+ UsernameFile string `yaml:"username_file,omitempty" json:"username_file,omitempty"`
+ // UsernameRef is the name of the secret within the secret manager to use as the username.
+ UsernameRef string `yaml:"username_ref,omitempty" json:"username_ref,omitempty"`
Password Secret `yaml:"password,omitempty" json:"password,omitempty"`
PasswordFile string `yaml:"password_file,omitempty" json:"password_file,omitempty"`
+ // PasswordRef is the name of the secret within the secret manager to use as the password.
+ PasswordRef string `yaml:"password_ref,omitempty" json:"password_ref,omitempty"`
}
// SetDirectory joins any relative file paths with dir.
@@ -139,6 +145,7 @@ func (a *BasicAuth) SetDirectory(dir string) {
return
}
a.PasswordFile = JoinDir(dir, a.PasswordFile)
+ a.UsernameFile = JoinDir(dir, a.UsernameFile)
}
// Authorization contains HTTP authorization credentials.
@@ -146,6 +153,8 @@ type Authorization struct {
Type string `yaml:"type,omitempty" json:"type,omitempty"`
Credentials Secret `yaml:"credentials,omitempty" json:"credentials,omitempty"`
CredentialsFile string `yaml:"credentials_file,omitempty" json:"credentials_file,omitempty"`
+ // CredentialsRef is the name of the secret within the secret manager to use as credentials.
+ CredentialsRef string `yaml:"credentials_ref,omitempty" json:"credentials_ref,omitempty"`
}
// SetDirectory joins any relative file paths with dir.
@@ -222,14 +231,17 @@ func (u URL) MarshalJSON() ([]byte, error) {
// OAuth2 is the oauth2 client configuration.
type OAuth2 struct {
- ClientID string `yaml:"client_id" json:"client_id"`
- ClientSecret Secret `yaml:"client_secret" json:"client_secret"`
- ClientSecretFile string `yaml:"client_secret_file" json:"client_secret_file"`
- Scopes []string `yaml:"scopes,omitempty" json:"scopes,omitempty"`
- TokenURL string `yaml:"token_url" json:"token_url"`
- EndpointParams map[string]string `yaml:"endpoint_params,omitempty" json:"endpoint_params,omitempty"`
- TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
- ProxyConfig `yaml:",inline"`
+ ClientID string `yaml:"client_id" json:"client_id"`
+ ClientSecret Secret `yaml:"client_secret" json:"client_secret"`
+ ClientSecretFile string `yaml:"client_secret_file" json:"client_secret_file"`
+ // ClientSecretRef is the name of the secret within the secret manager to use as the client
+ // secret.
+ ClientSecretRef string `yaml:"client_secret_ref" json:"client_secret_ref"`
+ Scopes []string `yaml:"scopes,omitempty" json:"scopes,omitempty"`
+ TokenURL string `yaml:"token_url" json:"token_url"`
+ EndpointParams map[string]string `yaml:"endpoint_params,omitempty" json:"endpoint_params,omitempty"`
+ TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
+ ProxyConfig `yaml:",inline"`
}
// UnmarshalYAML implements the yaml.Unmarshaler interface
@@ -251,12 +263,12 @@ func (o *OAuth2) UnmarshalJSON(data []byte) error {
}
// SetDirectory joins any relative file paths with dir.
-func (a *OAuth2) SetDirectory(dir string) {
- if a == nil {
+func (o *OAuth2) SetDirectory(dir string) {
+ if o == nil {
return
}
- a.ClientSecretFile = JoinDir(dir, a.ClientSecretFile)
- a.TLSConfig.SetDirectory(dir)
+ o.ClientSecretFile = JoinDir(dir, o.ClientSecretFile)
+ o.TLSConfig.SetDirectory(dir)
}
// LoadHTTPConfig parses the YAML input s into a HTTPClientConfig.
@@ -309,6 +321,9 @@ type HTTPClientConfig struct {
EnableHTTP2 bool `yaml:"enable_http2" json:"enable_http2"`
// Proxy configuration.
ProxyConfig `yaml:",inline"`
+ // HTTPHeaders specify headers to inject in the requests. Those headers
+ // could be marshalled back to the users.
+ HTTPHeaders *Headers `yaml:"http_headers,omitempty" json:"http_headers,omitempty"`
}
// SetDirectory joins any relative file paths with dir.
@@ -320,9 +335,22 @@ func (c *HTTPClientConfig) SetDirectory(dir string) {
c.BasicAuth.SetDirectory(dir)
c.Authorization.SetDirectory(dir)
c.OAuth2.SetDirectory(dir)
+ c.HTTPHeaders.SetDirectory(dir)
c.BearerTokenFile = JoinDir(dir, c.BearerTokenFile)
}
+// nonZeroCount returns the amount of values that are non-zero.
+func nonZeroCount[T comparable](values ...T) int {
+ count := 0
+ var zero T
+ for _, value := range values {
+ if value != zero {
+ count += 1
+ }
+ }
+ return count
+}
+
// Validate validates the HTTPClientConfig to check only one of BearerToken,
// BasicAuth and BearerTokenFile is configured. It also validates that ProxyURL
// is set if ProxyConnectHeader is set.
@@ -334,14 +362,17 @@ func (c *HTTPClientConfig) Validate() error {
if (c.BasicAuth != nil || c.OAuth2 != nil) && (len(c.BearerToken) > 0 || len(c.BearerTokenFile) > 0) {
return fmt.Errorf("at most one of basic_auth, oauth2, bearer_token & bearer_token_file must be configured")
}
- if c.BasicAuth != nil && (string(c.BasicAuth.Password) != "" && c.BasicAuth.PasswordFile != "") {
- return fmt.Errorf("at most one of basic_auth password & password_file must be configured")
+ if c.BasicAuth != nil && nonZeroCount(string(c.BasicAuth.Username) != "", c.BasicAuth.UsernameFile != "", c.BasicAuth.UsernameRef != "") > 1 {
+ return fmt.Errorf("at most one of basic_auth username, username_file & username_ref must be configured")
+ }
+ if c.BasicAuth != nil && nonZeroCount(string(c.BasicAuth.Password) != "", c.BasicAuth.PasswordFile != "", c.BasicAuth.PasswordRef != "") > 1 {
+ return fmt.Errorf("at most one of basic_auth password, password_file & password_ref must be configured")
}
if c.Authorization != nil {
if len(c.BearerToken) > 0 || len(c.BearerTokenFile) > 0 {
return fmt.Errorf("authorization is not compatible with bearer_token & bearer_token_file")
}
- if string(c.Authorization.Credentials) != "" && c.Authorization.CredentialsFile != "" {
+ if nonZeroCount(string(c.Authorization.Credentials) != "", c.Authorization.CredentialsFile != "", c.Authorization.CredentialsRef != "") > 1 {
return fmt.Errorf("at most one of authorization credentials & credentials_file must be configured")
}
c.Authorization.Type = strings.TrimSpace(c.Authorization.Type)
@@ -373,19 +404,21 @@ func (c *HTTPClientConfig) Validate() error {
if len(c.OAuth2.ClientID) == 0 {
return fmt.Errorf("oauth2 client_id must be configured")
}
- if len(c.OAuth2.ClientSecret) == 0 && len(c.OAuth2.ClientSecretFile) == 0 {
- return fmt.Errorf("either oauth2 client_secret or client_secret_file must be configured")
- }
if len(c.OAuth2.TokenURL) == 0 {
return fmt.Errorf("oauth2 token_url must be configured")
}
- if len(c.OAuth2.ClientSecret) > 0 && len(c.OAuth2.ClientSecretFile) > 0 {
- return fmt.Errorf("at most one of oauth2 client_secret & client_secret_file must be configured")
+ if nonZeroCount(len(c.OAuth2.ClientSecret) > 0, len(c.OAuth2.ClientSecretFile) > 0, len(c.OAuth2.ClientSecretRef) > 0) > 1 {
+ return fmt.Errorf("at most one of oauth2 client_secret, client_secret_file & client_secret_ref must be configured")
}
}
if err := c.ProxyConfig.Validate(); err != nil {
return err
}
+ if c.HTTPHeaders != nil {
+ if err := c.HTTPHeaders.Validate(); err != nil {
+ return err
+ }
+ }
return nil
}
@@ -425,43 +458,79 @@ type httpClientOptions struct {
http2Enabled bool
idleConnTimeout time.Duration
userAgent string
+ host string
+ secretManager SecretManager
}
// HTTPClientOption defines an option that can be applied to the HTTP client.
-type HTTPClientOption func(options *httpClientOptions)
+type HTTPClientOption interface {
+ applyToHTTPClientOptions(options *httpClientOptions)
+}
+
+type httpClientOptionFunc func(options *httpClientOptions)
+
+func (f httpClientOptionFunc) applyToHTTPClientOptions(options *httpClientOptions) {
+ f(options)
+}
// WithDialContextFunc allows you to override func gets used for the actual dialing. The default is `net.Dialer.DialContext`.
func WithDialContextFunc(fn DialContextFunc) HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.dialContextFunc = fn
- }
+ })
}
// WithKeepAlivesDisabled allows to disable HTTP keepalive.
func WithKeepAlivesDisabled() HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.keepAlivesEnabled = false
- }
+ })
}
// WithHTTP2Disabled allows to disable HTTP2.
func WithHTTP2Disabled() HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.http2Enabled = false
- }
+ })
}
// WithIdleConnTimeout allows setting the idle connection timeout.
func WithIdleConnTimeout(timeout time.Duration) HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.idleConnTimeout = timeout
- }
+ })
}
// WithUserAgent allows setting the user agent.
func WithUserAgent(ua string) HTTPClientOption {
- return func(opts *httpClientOptions) {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
opts.userAgent = ua
+ })
+}
+
+// WithHost allows setting the host header.
+func WithHost(host string) HTTPClientOption {
+ return httpClientOptionFunc(func(opts *httpClientOptions) {
+ opts.host = host
+ })
+}
+
+type secretManagerOption struct {
+ secretManager SecretManager
+}
+
+func (s *secretManagerOption) applyToHTTPClientOptions(opts *httpClientOptions) {
+ opts.secretManager = s.secretManager
+}
+
+func (s *secretManagerOption) applyToTLSConfigOptions(opts *tlsConfigOptions) {
+ opts.secretManager = s.secretManager
+}
+
+// WithSecretManager allows setting the secret manager.
+func WithSecretManager(manager SecretManager) *secretManagerOption {
+ return &secretManagerOption{
+ secretManager: manager,
}
}
@@ -491,9 +560,16 @@ func NewClientFromConfig(cfg HTTPClientConfig, name string, optFuncs ...HTTPClie
// given config.HTTPClientConfig and config.HTTPClientOption.
// The name is used as go-conntrack metric label.
func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, optFuncs ...HTTPClientOption) (http.RoundTripper, error) {
+ return NewRoundTripperFromConfigWithContext(context.Background(), cfg, name, optFuncs...)
+}
+
+// NewRoundTripperFromConfigWithContext returns a new HTTP RoundTripper configured for the
+// given config.HTTPClientConfig and config.HTTPClientOption.
+// The name is used as go-conntrack metric label.
+func NewRoundTripperFromConfigWithContext(ctx context.Context, cfg HTTPClientConfig, name string, optFuncs ...HTTPClientOption) (http.RoundTripper, error) {
opts := defaultHTTPClientOptions
- for _, f := range optFuncs {
- f(&opts)
+ for _, opt := range optFuncs {
+ opt.applyToHTTPClientOptions(&opts)
}
var dialContext func(ctx context.Context, network, addr string) (net.Conn, error)
@@ -541,134 +617,243 @@ func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, optFuncs ...HT
// If a authorization_credentials is provided, create a round tripper that will set the
// Authorization header correctly on each request.
- if cfg.Authorization != nil && len(cfg.Authorization.Credentials) > 0 {
- rt = NewAuthorizationCredentialsRoundTripper(cfg.Authorization.Type, cfg.Authorization.Credentials, rt)
- } else if cfg.Authorization != nil && len(cfg.Authorization.CredentialsFile) > 0 {
- rt = NewAuthorizationCredentialsFileRoundTripper(cfg.Authorization.Type, cfg.Authorization.CredentialsFile, rt)
+ if cfg.Authorization != nil {
+ credentialsSecret, err := toSecret(opts.secretManager, cfg.Authorization.Credentials, cfg.Authorization.CredentialsFile, cfg.Authorization.CredentialsRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use credentials: %w", err)
+ }
+ rt = NewAuthorizationCredentialsRoundTripper(cfg.Authorization.Type, credentialsSecret, rt)
}
// Backwards compatibility, be nice with importers who would not have
// called Validate().
- if len(cfg.BearerToken) > 0 {
- rt = NewAuthorizationCredentialsRoundTripper("Bearer", cfg.BearerToken, rt)
- } else if len(cfg.BearerTokenFile) > 0 {
- rt = NewAuthorizationCredentialsFileRoundTripper("Bearer", cfg.BearerTokenFile, rt)
+ if len(cfg.BearerToken) > 0 || len(cfg.BearerTokenFile) > 0 {
+ bearerSecret, err := toSecret(opts.secretManager, cfg.BearerToken, cfg.BearerTokenFile, "")
+ if err != nil {
+ return nil, fmt.Errorf("unable to use bearer token: %w", err)
+ }
+ rt = NewAuthorizationCredentialsRoundTripper("Bearer", bearerSecret, rt)
}
if cfg.BasicAuth != nil {
- rt = NewBasicAuthRoundTripper(cfg.BasicAuth.Username, cfg.BasicAuth.Password, cfg.BasicAuth.PasswordFile, rt)
+ usernameSecret, err := toSecret(opts.secretManager, Secret(cfg.BasicAuth.Username), cfg.BasicAuth.UsernameFile, cfg.BasicAuth.UsernameRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use username: %w", err)
+ }
+ passwordSecret, err := toSecret(opts.secretManager, cfg.BasicAuth.Password, cfg.BasicAuth.PasswordFile, cfg.BasicAuth.PasswordRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use password: %w", err)
+ }
+ rt = NewBasicAuthRoundTripper(usernameSecret, passwordSecret, rt)
}
if cfg.OAuth2 != nil {
- rt = NewOAuth2RoundTripper(cfg.OAuth2, rt, &opts)
+ clientSecret, err := toSecret(opts.secretManager, cfg.OAuth2.ClientSecret, cfg.OAuth2.ClientSecretFile, cfg.OAuth2.ClientSecretRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use client secret: %w", err)
+ }
+ rt = NewOAuth2RoundTripper(clientSecret, cfg.OAuth2, rt, &opts)
+ }
+
+ if cfg.HTTPHeaders != nil {
+ rt = NewHeadersRoundTripper(cfg.HTTPHeaders, rt)
}
if opts.userAgent != "" {
rt = NewUserAgentRoundTripper(opts.userAgent, rt)
}
+ if opts.host != "" {
+ rt = NewHostRoundTripper(opts.host, rt)
+ }
+
// Return a new configured RoundTripper.
return rt, nil
}
- tlsConfig, err := NewTLSConfig(&cfg.TLSConfig)
+ tlsConfig, err := NewTLSConfig(&cfg.TLSConfig, WithSecretManager(opts.secretManager))
if err != nil {
return nil, err
}
- if len(cfg.TLSConfig.CAFile) == 0 {
+ tlsSettings, err := cfg.TLSConfig.roundTripperSettings(opts.secretManager)
+ if err != nil {
+ return nil, err
+ }
+ if tlsSettings.CA == nil || tlsSettings.CA.Immutable() {
// No need for a RoundTripper that reloads the CA file automatically.
return newRT(tlsConfig)
}
- return NewTLSRoundTripper(tlsConfig, cfg.TLSConfig.roundTripperSettings(), newRT)
+ return NewTLSRoundTripperWithContext(ctx, tlsConfig, tlsSettings, newRT)
}
-type authorizationCredentialsRoundTripper struct {
- authType string
- authCredentials Secret
- rt http.RoundTripper
+// SecretManager manages secret data mapped to names known as "references" or "refs".
+type SecretManager interface {
+ // Fetch returns the secret data given a secret name indicated by `secretRef`.
+ Fetch(ctx context.Context, secretRef string) (string, error)
}
-// NewAuthorizationCredentialsRoundTripper adds the provided credentials to a
-// request unless the authorization header has already been set.
-func NewAuthorizationCredentialsRoundTripper(authType string, authCredentials Secret, rt http.RoundTripper) http.RoundTripper {
- return &authorizationCredentialsRoundTripper{authType, authCredentials, rt}
+type SecretReader interface {
+ Fetch(ctx context.Context) (string, error)
+ Description() string
+ Immutable() bool
}
-func (rt *authorizationCredentialsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
- if len(req.Header.Get("Authorization")) == 0 {
- req = cloneRequest(req)
- req.Header.Set("Authorization", fmt.Sprintf("%s %s", rt.authType, string(rt.authCredentials)))
+type InlineSecret struct {
+ text string
+}
+
+func NewInlineSecret(text string) *InlineSecret {
+ return &InlineSecret{text: text}
+}
+
+func (s *InlineSecret) Fetch(context.Context) (string, error) {
+ return s.text, nil
+}
+
+func (s *InlineSecret) Description() string {
+ return "inline"
+}
+
+func (s *InlineSecret) Immutable() bool {
+ return true
+}
+
+type FileSecret struct {
+ file string
+}
+
+func NewFileSecret(file string) *FileSecret {
+ return &FileSecret{file: file}
+}
+
+func (s *FileSecret) Fetch(ctx context.Context) (string, error) {
+ fileBytes, err := os.ReadFile(s.file)
+ if err != nil {
+ return "", fmt.Errorf("unable to read file %s: %w", s.file, err)
}
- return rt.rt.RoundTrip(req)
+ return strings.TrimSpace(string(fileBytes)), nil
}
-func (rt *authorizationCredentialsRoundTripper) CloseIdleConnections() {
- if ci, ok := rt.rt.(closeIdler); ok {
- ci.CloseIdleConnections()
+func (s *FileSecret) Description() string {
+ return fmt.Sprintf("file %s", s.file)
+}
+
+func (s *FileSecret) Immutable() bool {
+ return false
+}
+
+// refSecret fetches a single secret from a SecretManager.
+type refSecret struct {
+ ref string
+ manager SecretManager // manager is expected to be not nil.
+}
+
+func (s *refSecret) Fetch(ctx context.Context) (string, error) {
+ return s.manager.Fetch(ctx, s.ref)
+}
+
+func (s *refSecret) Description() string {
+ return fmt.Sprintf("ref %s", s.ref)
+}
+
+func (s *refSecret) Immutable() bool {
+ return false
+}
+
+// toSecret returns a SecretReader from one of the given sources, assuming exactly
+// one or none of the sources are provided.
+func toSecret(secretManager SecretManager, text Secret, file, ref string) (SecretReader, error) {
+ if text != "" {
+ return NewInlineSecret(string(text)), nil
+ }
+ if file != "" {
+ return NewFileSecret(file), nil
}
+ if ref != "" {
+ if secretManager == nil {
+ return nil, errors.New("cannot use secret ref without manager")
+ }
+ return &refSecret{
+ ref: ref,
+ manager: secretManager,
+ }, nil
+ }
+ return nil, nil
}
-type authorizationCredentialsFileRoundTripper struct {
- authType string
- authCredentialsFile string
- rt http.RoundTripper
+type authorizationCredentialsRoundTripper struct {
+ authType string
+ authCredentials SecretReader
+ rt http.RoundTripper
}
-// NewAuthorizationCredentialsFileRoundTripper adds the authorization
-// credentials read from the provided file to a request unless the authorization
-// header has already been set. This file is read for every request.
-func NewAuthorizationCredentialsFileRoundTripper(authType, authCredentialsFile string, rt http.RoundTripper) http.RoundTripper {
- return &authorizationCredentialsFileRoundTripper{authType, authCredentialsFile, rt}
+// NewAuthorizationCredentialsRoundTripper adds the authorization credentials
+// read from the provided SecretReader to a request unless the authorization header
+// has already been set.
+func NewAuthorizationCredentialsRoundTripper(authType string, authCredentials SecretReader, rt http.RoundTripper) http.RoundTripper {
+ return &authorizationCredentialsRoundTripper{authType, authCredentials, rt}
}
-func (rt *authorizationCredentialsFileRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
- if len(req.Header.Get("Authorization")) == 0 {
- b, err := os.ReadFile(rt.authCredentialsFile)
+func (rt *authorizationCredentialsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
+ if len(req.Header.Get("Authorization")) != 0 {
+ return rt.rt.RoundTrip(req)
+ }
+
+ var authCredentials string
+ if rt.authCredentials != nil {
+ var err error
+ authCredentials, err = rt.authCredentials.Fetch(req.Context())
if err != nil {
- return nil, fmt.Errorf("unable to read authorization credentials file %s: %s", rt.authCredentialsFile, err)
+ return nil, fmt.Errorf("unable to read authorization credentials: %w", err)
}
- authCredentials := strings.TrimSpace(string(b))
-
- req = cloneRequest(req)
- req.Header.Set("Authorization", fmt.Sprintf("%s %s", rt.authType, authCredentials))
}
+ req = cloneRequest(req)
+ req.Header.Set("Authorization", fmt.Sprintf("%s %s", rt.authType, authCredentials))
+
return rt.rt.RoundTrip(req)
}
-func (rt *authorizationCredentialsFileRoundTripper) CloseIdleConnections() {
+func (rt *authorizationCredentialsRoundTripper) CloseIdleConnections() {
if ci, ok := rt.rt.(closeIdler); ok {
ci.CloseIdleConnections()
}
}
type basicAuthRoundTripper struct {
- username string
- password Secret
- passwordFile string
- rt http.RoundTripper
+ username SecretReader
+ password SecretReader
+ rt http.RoundTripper
}
// NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a request unless it has
// already been set.
-func NewBasicAuthRoundTripper(username string, password Secret, passwordFile string, rt http.RoundTripper) http.RoundTripper {
- return &basicAuthRoundTripper{username, password, passwordFile, rt}
+func NewBasicAuthRoundTripper(username SecretReader, password SecretReader, rt http.RoundTripper) http.RoundTripper {
+ return &basicAuthRoundTripper{username, password, rt}
}
func (rt *basicAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
if len(req.Header.Get("Authorization")) != 0 {
return rt.rt.RoundTrip(req)
}
- req = cloneRequest(req)
- if rt.passwordFile != "" {
- bs, err := os.ReadFile(rt.passwordFile)
+ var username string
+ var password string
+ if rt.username != nil {
+ var err error
+ username, err = rt.username.Fetch(req.Context())
if err != nil {
- return nil, fmt.Errorf("unable to read basic auth password file %s: %s", rt.passwordFile, err)
+ return nil, fmt.Errorf("unable to read basic auth username: %w", err)
+ }
+ }
+ if rt.password != nil {
+ var err error
+ password, err = rt.password.Fetch(req.Context())
+ if err != nil {
+ return nil, fmt.Errorf("unable to read basic auth password: %w", err)
}
- req.SetBasicAuth(rt.username, strings.TrimSpace(string(bs)))
- } else {
- req.SetBasicAuth(rt.username, strings.TrimSpace(string(rt.password)))
}
+ req = cloneRequest(req)
+ req.SetBasicAuth(username, password)
return rt.rt.RoundTrip(req)
}
@@ -679,105 +864,118 @@ func (rt *basicAuthRoundTripper) CloseIdleConnections() {
}
type oauth2RoundTripper struct {
- config *OAuth2
- rt http.RoundTripper
- next http.RoundTripper
- secret string
- mtx sync.RWMutex
- opts *httpClientOptions
- client *http.Client
+ mtx sync.RWMutex
+ lastRT *oauth2.Transport
+ lastSecret string
+
+ // Required for interaction with Oauth2 server.
+ config *OAuth2
+ clientSecret SecretReader
+ opts *httpClientOptions
+ client *http.Client
}
-func NewOAuth2RoundTripper(config *OAuth2, next http.RoundTripper, opts *httpClientOptions) http.RoundTripper {
+func NewOAuth2RoundTripper(clientSecret SecretReader, config *OAuth2, next http.RoundTripper, opts *httpClientOptions) http.RoundTripper {
+ if clientSecret == nil {
+ clientSecret = NewInlineSecret("")
+ }
+
return &oauth2RoundTripper{
config: config,
- next: next,
- opts: opts,
+ // A correct tokenSource will be added later on.
+ lastRT: &oauth2.Transport{Base: next},
+ opts: opts,
+ clientSecret: clientSecret,
}
}
-func (rt *oauth2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
- var (
- secret string
- changed bool
- )
+func (rt *oauth2RoundTripper) newOauth2TokenSource(req *http.Request, secret string) (client *http.Client, source oauth2.TokenSource, err error) {
+ tlsConfig, err := NewTLSConfig(&rt.config.TLSConfig, WithSecretManager(rt.opts.secretManager))
+ if err != nil {
+ return nil, nil, err
+ }
- if rt.config.ClientSecretFile != "" {
- data, err := os.ReadFile(rt.config.ClientSecretFile)
+ tlsTransport := func(tlsConfig *tls.Config) (http.RoundTripper, error) {
+ return &http.Transport{
+ TLSClientConfig: tlsConfig,
+ Proxy: rt.config.ProxyConfig.Proxy(),
+ ProxyConnectHeader: rt.config.ProxyConfig.GetProxyConnectHeader(),
+ DisableKeepAlives: !rt.opts.keepAlivesEnabled,
+ MaxIdleConns: 20,
+ MaxIdleConnsPerHost: 1, // see https://github.com/golang/go/issues/13801
+ IdleConnTimeout: 10 * time.Second,
+ TLSHandshakeTimeout: 10 * time.Second,
+ ExpectContinueTimeout: 1 * time.Second,
+ }, nil
+ }
+
+ var t http.RoundTripper
+ tlsSettings, err := rt.config.TLSConfig.roundTripperSettings(rt.opts.secretManager)
+ if err != nil {
+ return nil, nil, err
+ }
+ if tlsSettings.CA == nil || tlsSettings.CA.Immutable() {
+ t, _ = tlsTransport(tlsConfig)
+ } else {
+ t, err = NewTLSRoundTripperWithContext(req.Context(), tlsConfig, tlsSettings, tlsTransport)
if err != nil {
- return nil, fmt.Errorf("unable to read oauth2 client secret file %s: %s", rt.config.ClientSecretFile, err)
+ return nil, nil, err
}
- secret = strings.TrimSpace(string(data))
- rt.mtx.RLock()
- changed = secret != rt.secret
- rt.mtx.RUnlock()
}
- if changed || rt.rt == nil {
- if rt.config.ClientSecret != "" {
- secret = string(rt.config.ClientSecret)
- }
+ if ua := req.UserAgent(); ua != "" {
+ t = NewUserAgentRoundTripper(ua, t)
+ }
- config := &clientcredentials.Config{
- ClientID: rt.config.ClientID,
- ClientSecret: secret,
- Scopes: rt.config.Scopes,
- TokenURL: rt.config.TokenURL,
- EndpointParams: mapToValues(rt.config.EndpointParams),
- }
+ config := &clientcredentials.Config{
+ ClientID: rt.config.ClientID,
+ ClientSecret: secret,
+ Scopes: rt.config.Scopes,
+ TokenURL: rt.config.TokenURL,
+ EndpointParams: mapToValues(rt.config.EndpointParams),
+ }
+ client = &http.Client{Transport: t}
+ ctx := context.WithValue(context.Background(), oauth2.HTTPClient, client)
+ return client, config.TokenSource(ctx), nil
+}
- tlsConfig, err := NewTLSConfig(&rt.config.TLSConfig)
- if err != nil {
- return nil, err
- }
+func (rt *oauth2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
+ var (
+ secret string
+ needsInit bool
+ )
- tlsTransport := func(tlsConfig *tls.Config) (http.RoundTripper, error) {
- return &http.Transport{
- TLSClientConfig: tlsConfig,
- Proxy: rt.config.ProxyConfig.Proxy(),
- ProxyConnectHeader: rt.config.ProxyConfig.GetProxyConnectHeader(),
- DisableKeepAlives: !rt.opts.keepAlivesEnabled,
- MaxIdleConns: 20,
- MaxIdleConnsPerHost: 1, // see https://github.com/golang/go/issues/13801
- IdleConnTimeout: 10 * time.Second,
- TLSHandshakeTimeout: 10 * time.Second,
- ExpectContinueTimeout: 1 * time.Second,
- }, nil
- }
+ rt.mtx.RLock()
+ secret = rt.lastSecret
+ needsInit = rt.lastRT.Source == nil
+ rt.mtx.RUnlock()
- var t http.RoundTripper
- if len(rt.config.TLSConfig.CAFile) == 0 {
- t, _ = tlsTransport(tlsConfig)
- } else {
- t, err = NewTLSRoundTripper(tlsConfig, rt.config.TLSConfig.roundTripperSettings(), tlsTransport)
+ // Fetch the secret if it's our first run or always if the secret can change.
+ if !rt.clientSecret.Immutable() || needsInit {
+ newSecret, err := rt.clientSecret.Fetch(req.Context())
+ if err != nil {
+ return nil, fmt.Errorf("unable to read oauth2 client secret: %w", err)
+ }
+ if newSecret != secret || needsInit {
+ // Secret changed or it's a first run. Rebuilt oauth2 setup.
+ client, source, err := rt.newOauth2TokenSource(req, newSecret)
if err != nil {
return nil, err
}
- }
-
- if ua := req.UserAgent(); ua != "" {
- t = NewUserAgentRoundTripper(ua, t)
- }
- client := &http.Client{Transport: t}
- ctx := context.WithValue(context.Background(), oauth2.HTTPClient, client)
- tokenSource := config.TokenSource(ctx)
-
- rt.mtx.Lock()
- rt.secret = secret
- rt.rt = &oauth2.Transport{
- Base: rt.next,
- Source: tokenSource,
- }
- if rt.client != nil {
- rt.client.CloseIdleConnections()
+ rt.mtx.Lock()
+ rt.lastSecret = secret
+ rt.lastRT.Source = source
+ if rt.client != nil {
+ rt.client.CloseIdleConnections()
+ }
+ rt.client = client
+ rt.mtx.Unlock()
}
- rt.client = client
- rt.mtx.Unlock()
}
rt.mtx.RLock()
- currentRT := rt.rt
+ currentRT := rt.lastRT
rt.mtx.RUnlock()
return currentRT.RoundTrip(req)
}
@@ -786,7 +984,7 @@ func (rt *oauth2RoundTripper) CloseIdleConnections() {
if rt.client != nil {
rt.client.CloseIdleConnections()
}
- if ci, ok := rt.next.(closeIdler); ok {
+ if ci, ok := rt.lastRT.Base.(closeIdler); ok {
ci.CloseIdleConnections()
}
}
@@ -814,8 +1012,27 @@ func cloneRequest(r *http.Request) *http.Request {
return r2
}
+type tlsConfigOptions struct {
+ secretManager SecretManager
+}
+
+// TLSConfigOption defines an option that can be applied to the HTTP client.
+type TLSConfigOption interface {
+ applyToTLSConfigOptions(options *tlsConfigOptions)
+}
+
// NewTLSConfig creates a new tls.Config from the given TLSConfig.
-func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) {
+func NewTLSConfig(cfg *TLSConfig, optFuncs ...TLSConfigOption) (*tls.Config, error) {
+ return NewTLSConfigWithContext(context.Background(), cfg, optFuncs...)
+}
+
+// NewTLSConfigWithContext creates a new tls.Config from the given TLSConfig.
+func NewTLSConfigWithContext(ctx context.Context, cfg *TLSConfig, optFuncs ...TLSConfigOption) (*tls.Config, error) {
+ opts := tlsConfigOptions{}
+ for _, opt := range optFuncs {
+ opt.applyToTLSConfigOptions(&opts)
+ }
+
if err := cfg.Validate(); err != nil {
return nil, err
}
@@ -834,17 +1051,17 @@ func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) {
// If a CA cert is provided then let's read it in so we can validate the
// scrape target's certificate properly.
- if len(cfg.CA) > 0 {
- if !updateRootCA(tlsConfig, []byte(cfg.CA)) {
- return nil, fmt.Errorf("unable to use inline CA cert")
- }
- } else if len(cfg.CAFile) > 0 {
- b, err := readCAFile(cfg.CAFile)
+ caSecret, err := toSecret(opts.secretManager, Secret(cfg.CA), cfg.CAFile, cfg.CARef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use CA cert: %w", err)
+ }
+ if caSecret != nil {
+ ca, err := caSecret.Fetch(ctx)
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("unable to read CA cert: %w", err)
}
- if !updateRootCA(tlsConfig, b) {
- return nil, fmt.Errorf("unable to use specified CA cert %s", cfg.CAFile)
+ if !updateRootCA(tlsConfig, []byte(ca)) {
+ return nil, fmt.Errorf("unable to use specified CA cert %s", caSecret.Description())
}
}
@@ -855,10 +1072,16 @@ func NewTLSConfig(cfg *TLSConfig) (*tls.Config, error) {
// If a client cert & key is provided then configure TLS config accordingly.
if cfg.usingClientCert() && cfg.usingClientKey() {
// Verify that client cert and key are valid.
- if _, err := cfg.getClientCertificate(nil); err != nil {
+ if _, err := cfg.getClientCertificate(ctx, opts.secretManager); err != nil {
return nil, err
}
- tlsConfig.GetClientCertificate = cfg.getClientCertificate
+ tlsConfig.GetClientCertificate = func(cri *tls.CertificateRequestInfo) (*tls.Certificate, error) {
+ var ctx context.Context
+ if cri != nil {
+ ctx = cri.Context()
+ }
+ return cfg.getClientCertificate(ctx, opts.secretManager)
+ }
}
return tlsConfig, nil
@@ -878,6 +1101,15 @@ type TLSConfig struct {
CertFile string `yaml:"cert_file,omitempty" json:"cert_file,omitempty"`
// The client key file for the targets.
KeyFile string `yaml:"key_file,omitempty" json:"key_file,omitempty"`
+ // CARef is the name of the secret within the secret manager to use as the CA cert for the
+ // targets.
+ CARef string `yaml:"ca_ref,omitempty" json:"ca_ref,omitempty"`
+ // CertRef is the name of the secret within the secret manager to use as the client cert for
+ // the targets.
+ CertRef string `yaml:"cert_ref,omitempty" json:"cert_ref,omitempty"`
+ // KeyRef is the name of the secret within the secret manager to use as the client key for
+ // the targets.
+ KeyRef string `yaml:"key_ref,omitempty" json:"key_ref,omitempty"`
// Used to verify the hostname for the targets.
ServerName string `yaml:"server_name,omitempty" json:"server_name,omitempty"`
// Disable target certificate validation.
@@ -911,13 +1143,13 @@ func (c *TLSConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
// file-based fields for the TLS CA, client certificate, and client key are
// used.
func (c *TLSConfig) Validate() error {
- if len(c.CA) > 0 && len(c.CAFile) > 0 {
- return fmt.Errorf("at most one of ca and ca_file must be configured")
+ if nonZeroCount(len(c.CA) > 0, len(c.CAFile) > 0, len(c.CARef) > 0) > 1 {
+ return fmt.Errorf("at most one of ca, ca_file & ca_ref must be configured")
}
- if len(c.Cert) > 0 && len(c.CertFile) > 0 {
- return fmt.Errorf("at most one of cert and cert_file must be configured")
+ if nonZeroCount(len(c.Cert) > 0, len(c.CertFile) > 0, len(c.CertRef) > 0) > 1 {
+ return fmt.Errorf("at most one of cert, cert_file & cert_ref must be configured")
}
- if len(c.Key) > 0 && len(c.KeyFile) > 0 {
+ if nonZeroCount(len(c.Key) > 0, len(c.KeyFile) > 0, len(c.KeyRef) > 0) > 1 {
return fmt.Errorf("at most one of key and key_file must be configured")
}
@@ -931,66 +1163,70 @@ func (c *TLSConfig) Validate() error {
}
func (c *TLSConfig) usingClientCert() bool {
- return len(c.Cert) > 0 || len(c.CertFile) > 0
+ return len(c.Cert) > 0 || len(c.CertFile) > 0 || len(c.CertRef) > 0
}
func (c *TLSConfig) usingClientKey() bool {
- return len(c.Key) > 0 || len(c.KeyFile) > 0
+ return len(c.Key) > 0 || len(c.KeyFile) > 0 || len(c.KeyRef) > 0
}
-func (c *TLSConfig) roundTripperSettings() TLSRoundTripperSettings {
- return TLSRoundTripperSettings{
- CA: c.CA,
- CAFile: c.CAFile,
- Cert: c.Cert,
- CertFile: c.CertFile,
- Key: string(c.Key),
- KeyFile: c.KeyFile,
+func (c *TLSConfig) roundTripperSettings(secretManager SecretManager) (TLSRoundTripperSettings, error) {
+ ca, err := toSecret(secretManager, Secret(c.CA), c.CAFile, c.CARef)
+ if err != nil {
+ return TLSRoundTripperSettings{}, err
}
+ cert, err := toSecret(secretManager, Secret(c.Cert), c.CertFile, c.CertRef)
+ if err != nil {
+ return TLSRoundTripperSettings{}, err
+ }
+ key, err := toSecret(secretManager, c.Key, c.KeyFile, c.KeyRef)
+ if err != nil {
+ return TLSRoundTripperSettings{}, err
+ }
+ return TLSRoundTripperSettings{
+ CA: ca,
+ Cert: cert,
+ Key: key,
+ }, nil
}
-// getClientCertificate reads the pair of client cert and key from disk and returns a tls.Certificate.
-func (c *TLSConfig) getClientCertificate(_ *tls.CertificateRequestInfo) (*tls.Certificate, error) {
+// getClientCertificate reads the pair of client cert and key and returns a tls.Certificate.
+func (c *TLSConfig) getClientCertificate(ctx context.Context, secretManager SecretManager) (*tls.Certificate, error) {
var (
- certData, keyData []byte
+ certData, keyData string
err error
)
- if c.CertFile != "" {
- certData, err = os.ReadFile(c.CertFile)
+ certSecret, err := toSecret(secretManager, Secret(c.Cert), c.CertFile, c.CertRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use client cert: %w", err)
+ }
+ if certSecret != nil {
+ certData, err = certSecret.Fetch(ctx)
if err != nil {
- return nil, fmt.Errorf("unable to read specified client cert (%s): %s", c.CertFile, err)
+ return nil, fmt.Errorf("unable to read specified client cert: %w", err)
}
- } else {
- certData = []byte(c.Cert)
}
- if c.KeyFile != "" {
- keyData, err = os.ReadFile(c.KeyFile)
+ keySecret, err := toSecret(secretManager, Secret(c.Key), c.KeyFile, c.KeyRef)
+ if err != nil {
+ return nil, fmt.Errorf("unable to use client key: %w", err)
+ }
+ if keySecret != nil {
+ keyData, err = keySecret.Fetch(ctx)
if err != nil {
- return nil, fmt.Errorf("unable to read specified client key (%s): %s", c.KeyFile, err)
+ return nil, fmt.Errorf("unable to read specified client key: %w", err)
}
- } else {
- keyData = []byte(c.Key)
}
- cert, err := tls.X509KeyPair(certData, keyData)
+ cert, err := tls.X509KeyPair([]byte(certData), []byte(keyData))
if err != nil {
- return nil, fmt.Errorf("unable to use specified client cert (%s) & key (%s): %s", c.CertFile, c.KeyFile, err)
+ return nil, fmt.Errorf("unable to use specified client cert (%s) & key (%s): %w", certSecret.Description(), keySecret.Description(), err)
}
return &cert, nil
}
-// readCAFile reads the CA cert file from disk.
-func readCAFile(f string) ([]byte, error) {
- data, err := os.ReadFile(f)
- if err != nil {
- return nil, fmt.Errorf("unable to load specified CA cert %s: %s", f, err)
- }
- return data, nil
-}
-
// updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs.
func updateRootCA(cfg *tls.Config, b []byte) bool {
caCertPool := x509.NewCertPool()
@@ -1018,15 +1254,24 @@ type tlsRoundTripper struct {
}
type TLSRoundTripperSettings struct {
- CA, CAFile string
- Cert, CertFile string
- Key, KeyFile string
+ CA SecretReader
+ Cert SecretReader
+ Key SecretReader
}
func NewTLSRoundTripper(
cfg *tls.Config,
settings TLSRoundTripperSettings,
newRT func(*tls.Config) (http.RoundTripper, error),
+) (http.RoundTripper, error) {
+ return NewTLSRoundTripperWithContext(context.Background(), cfg, settings, newRT)
+}
+
+func NewTLSRoundTripperWithContext(
+ ctx context.Context,
+ cfg *tls.Config,
+ settings TLSRoundTripperSettings,
+ newRT func(*tls.Config) (http.RoundTripper, error),
) (http.RoundTripper, error) {
t := &tlsRoundTripper{
settings: settings,
@@ -1039,7 +1284,7 @@ func NewTLSRoundTripper(
return nil, err
}
t.rt = rt
- _, t.hashCAData, t.hashCertData, t.hashKeyData, err = t.getTLSDataWithHash()
+ _, t.hashCAData, t.hashCertData, t.hashKeyData, err = t.getTLSDataWithHash(ctx)
if err != nil {
return nil, err
}
@@ -1047,38 +1292,31 @@ func NewTLSRoundTripper(
return t, nil
}
-func (t *tlsRoundTripper) getTLSDataWithHash() ([]byte, []byte, []byte, []byte, error) {
- var (
- caBytes, certBytes, keyBytes []byte
-
- err error
- )
+func (t *tlsRoundTripper) getTLSDataWithHash(ctx context.Context) ([]byte, []byte, []byte, []byte, error) {
+ var caBytes, certBytes, keyBytes []byte
- if t.settings.CAFile != "" {
- caBytes, err = os.ReadFile(t.settings.CAFile)
+ if t.settings.CA != nil {
+ ca, err := t.settings.CA.Fetch(ctx)
if err != nil {
- return nil, nil, nil, nil, err
+ return nil, nil, nil, nil, fmt.Errorf("unable to read CA cert: %w", err)
}
- } else if t.settings.CA != "" {
- caBytes = []byte(t.settings.CA)
+ caBytes = []byte(ca)
}
- if t.settings.CertFile != "" {
- certBytes, err = os.ReadFile(t.settings.CertFile)
+ if t.settings.Cert != nil {
+ cert, err := t.settings.Cert.Fetch(ctx)
if err != nil {
- return nil, nil, nil, nil, err
+ return nil, nil, nil, nil, fmt.Errorf("unable to read client cert: %w", err)
}
- } else if t.settings.Cert != "" {
- certBytes = []byte(t.settings.Cert)
+ certBytes = []byte(cert)
}
- if t.settings.KeyFile != "" {
- keyBytes, err = os.ReadFile(t.settings.KeyFile)
+ if t.settings.Key != nil {
+ key, err := t.settings.Key.Fetch(ctx)
if err != nil {
- return nil, nil, nil, nil, err
+ return nil, nil, nil, nil, fmt.Errorf("unable to read client key: %w", err)
}
- } else if t.settings.Key != "" {
- keyBytes = []byte(t.settings.Key)
+ keyBytes = []byte(key)
}
var caHash, certHash, keyHash [32]byte
@@ -1098,7 +1336,7 @@ func (t *tlsRoundTripper) getTLSDataWithHash() ([]byte, []byte, []byte, []byte,
// RoundTrip implements the http.RoundTrip interface.
func (t *tlsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
- caData, caHash, certHash, keyHash, err := t.getTLSDataWithHash()
+ caData, caHash, certHash, keyHash, err := t.getTLSDataWithHash(req.Context())
if err != nil {
return nil, err
}
@@ -1119,7 +1357,7 @@ func (t *tlsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
// using GetClientCertificate.
tlsConfig := t.tlsConfig.Clone()
if !updateRootCA(tlsConfig, caData) {
- return nil, fmt.Errorf("unable to use specified CA cert %s", t.settings.CAFile)
+ return nil, fmt.Errorf("unable to use specified CA cert %s", t.settings.CA.Description())
}
rt, err = t.newRT(tlsConfig)
if err != nil {
@@ -1150,11 +1388,21 @@ type userAgentRoundTripper struct {
rt http.RoundTripper
}
+type hostRoundTripper struct {
+ host string
+ rt http.RoundTripper
+}
+
// NewUserAgentRoundTripper adds the user agent every request header.
func NewUserAgentRoundTripper(userAgent string, rt http.RoundTripper) http.RoundTripper {
return &userAgentRoundTripper{userAgent, rt}
}
+// NewHostRoundTripper sets the [http.Request.Host] of every request.
+func NewHostRoundTripper(host string, rt http.RoundTripper) http.RoundTripper {
+ return &hostRoundTripper{host, rt}
+}
+
func (rt *userAgentRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
req = cloneRequest(req)
req.Header.Set("User-Agent", rt.userAgent)
@@ -1167,6 +1415,19 @@ func (rt *userAgentRoundTripper) CloseIdleConnections() {
}
}
+func (rt *hostRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
+ req = cloneRequest(req)
+ req.Host = rt.host
+ req.Header.Set("Host", rt.host)
+ return rt.rt.RoundTrip(req)
+}
+
+func (rt *hostRoundTripper) CloseIdleConnections() {
+ if ci, ok := rt.rt.(closeIdler); ok {
+ ci.CloseIdleConnections()
+ }
+}
+
func (c HTTPClientConfig) String() string {
b, err := yaml.Marshal(c)
if err != nil {
@@ -1187,7 +1448,7 @@ type ProxyConfig struct {
// proxies during CONNECT requests. Assume that at least _some_ of
// these headers are going to contain secrets and use Secret as the
// value type instead of string.
- ProxyConnectHeader Header `yaml:"proxy_connect_header,omitempty" json:"proxy_connect_header,omitempty"`
+ ProxyConnectHeader ProxyHeader `yaml:"proxy_connect_header,omitempty" json:"proxy_connect_header,omitempty"`
proxyFunc func(*http.Request) (*url.URL, error)
}
diff --git a/vendor/github.com/prometheus/common/expfmt/decode.go b/vendor/github.com/prometheus/common/expfmt/decode.go
index 9063978151..25cfaa2164 100644
--- a/vendor/github.com/prometheus/common/expfmt/decode.go
+++ b/vendor/github.com/prometheus/common/expfmt/decode.go
@@ -14,6 +14,7 @@
package expfmt
import (
+ "bufio"
"fmt"
"io"
"math"
@@ -21,8 +22,8 @@ import (
"net/http"
dto "github.com/prometheus/client_model/go"
+ "google.golang.org/protobuf/encoding/protodelim"
- "github.com/matttproud/golang_protobuf_extensions/pbutil"
"github.com/prometheus/common/model"
)
@@ -44,7 +45,7 @@ func ResponseFormat(h http.Header) Format {
mediatype, params, err := mime.ParseMediaType(ct)
if err != nil {
- return FmtUnknown
+ return fmtUnknown
}
const textType = "text/plain"
@@ -52,42 +53,44 @@ func ResponseFormat(h http.Header) Format {
switch mediatype {
case ProtoType:
if p, ok := params["proto"]; ok && p != ProtoProtocol {
- return FmtUnknown
+ return fmtUnknown
}
if e, ok := params["encoding"]; ok && e != "delimited" {
- return FmtUnknown
+ return fmtUnknown
}
- return FmtProtoDelim
+ return fmtProtoDelim
case textType:
if v, ok := params["version"]; ok && v != TextVersion {
- return FmtUnknown
+ return fmtUnknown
}
- return FmtText
+ return fmtText
}
- return FmtUnknown
+ return fmtUnknown
}
// NewDecoder returns a new decoder based on the given input format.
// If the input format does not imply otherwise, a text format decoder is returned.
func NewDecoder(r io.Reader, format Format) Decoder {
- switch format {
- case FmtProtoDelim:
- return &protoDecoder{r: r}
+ switch format.FormatType() {
+ case TypeProtoDelim:
+ return &protoDecoder{r: bufio.NewReader(r)}
}
return &textDecoder{r: r}
}
// protoDecoder implements the Decoder interface for protocol buffers.
type protoDecoder struct {
- r io.Reader
+ r protodelim.Reader
}
// Decode implements the Decoder interface.
func (d *protoDecoder) Decode(v *dto.MetricFamily) error {
- _, err := pbutil.ReadDelimited(d.r, v)
- if err != nil {
+ opts := protodelim.UnmarshalOptions{
+ MaxSize: -1,
+ }
+ if err := opts.UnmarshalFrom(d.r, v); err != nil {
return err
}
if !model.IsValidMetricName(model.LabelValue(v.GetName())) {
diff --git a/vendor/github.com/prometheus/common/expfmt/encode.go b/vendor/github.com/prometheus/common/expfmt/encode.go
index 7f611ffaad..ff5ef7a9d9 100644
--- a/vendor/github.com/prometheus/common/expfmt/encode.go
+++ b/vendor/github.com/prometheus/common/expfmt/encode.go
@@ -18,10 +18,13 @@ import (
"io"
"net/http"
- "github.com/matttproud/golang_protobuf_extensions/pbutil"
- "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg"
+ "google.golang.org/protobuf/encoding/protodelim"
"google.golang.org/protobuf/encoding/prototext"
+ "github.com/prometheus/common/model"
+
+ "github.com/munnerz/goautoneg"
+
dto "github.com/prometheus/client_model/go"
)
@@ -60,23 +63,32 @@ func (ec encoderCloser) Close() error {
// as the support is still experimental. To include the option to negotiate
// FmtOpenMetrics, use NegotiateOpenMetrics.
func Negotiate(h http.Header) Format {
+ escapingScheme := Format(fmt.Sprintf("; escaping=%s", Format(model.NameEscapingScheme.String())))
for _, ac := range goautoneg.ParseAccept(h.Get(hdrAccept)) {
+ if escapeParam := ac.Params[model.EscapingKey]; escapeParam != "" {
+ switch Format(escapeParam) {
+ case model.AllowUTF8, model.EscapeUnderscores, model.EscapeDots, model.EscapeValues:
+ escapingScheme = Format(fmt.Sprintf("; escaping=%s", escapeParam))
+ default:
+ // If the escaping parameter is unknown, ignore it.
+ }
+ }
ver := ac.Params["version"]
if ac.Type+"/"+ac.SubType == ProtoType && ac.Params["proto"] == ProtoProtocol {
switch ac.Params["encoding"] {
case "delimited":
- return FmtProtoDelim
+ return fmtProtoDelim + escapingScheme
case "text":
- return FmtProtoText
+ return fmtProtoText + escapingScheme
case "compact-text":
- return FmtProtoCompact
+ return fmtProtoCompact + escapingScheme
}
}
if ac.Type == "text" && ac.SubType == "plain" && (ver == TextVersion || ver == "") {
- return FmtText
+ return fmtText + escapingScheme
}
}
- return FmtText
+ return fmtText + escapingScheme
}
// NegotiateIncludingOpenMetrics works like Negotiate but includes
@@ -84,29 +96,40 @@ func Negotiate(h http.Header) Format {
// temporary and will disappear once FmtOpenMetrics is fully supported and as
// such may be negotiated by the normal Negotiate function.
func NegotiateIncludingOpenMetrics(h http.Header) Format {
+ escapingScheme := Format(fmt.Sprintf("; escaping=%s", Format(model.NameEscapingScheme.String())))
for _, ac := range goautoneg.ParseAccept(h.Get(hdrAccept)) {
+ if escapeParam := ac.Params[model.EscapingKey]; escapeParam != "" {
+ switch Format(escapeParam) {
+ case model.AllowUTF8, model.EscapeUnderscores, model.EscapeDots, model.EscapeValues:
+ escapingScheme = Format(fmt.Sprintf("; escaping=%s", escapeParam))
+ default:
+ // If the escaping parameter is unknown, ignore it.
+ }
+ }
ver := ac.Params["version"]
if ac.Type+"/"+ac.SubType == ProtoType && ac.Params["proto"] == ProtoProtocol {
switch ac.Params["encoding"] {
case "delimited":
- return FmtProtoDelim
+ return fmtProtoDelim + escapingScheme
case "text":
- return FmtProtoText
+ return fmtProtoText + escapingScheme
case "compact-text":
- return FmtProtoCompact
+ return fmtProtoCompact + escapingScheme
}
}
if ac.Type == "text" && ac.SubType == "plain" && (ver == TextVersion || ver == "") {
- return FmtText
+ return fmtText + escapingScheme
}
if ac.Type+"/"+ac.SubType == OpenMetricsType && (ver == OpenMetricsVersion_0_0_1 || ver == OpenMetricsVersion_1_0_0 || ver == "") {
- if ver == OpenMetricsVersion_1_0_0 {
- return FmtOpenMetrics_1_0_0
+ switch ver {
+ case OpenMetricsVersion_1_0_0:
+ return fmtOpenMetrics_1_0_0 + escapingScheme
+ default:
+ return fmtOpenMetrics_0_0_1 + escapingScheme
}
- return FmtOpenMetrics_0_0_1
}
}
- return FmtText
+ return fmtText + escapingScheme
}
// NewEncoder returns a new encoder based on content type negotiation. All
@@ -115,44 +138,54 @@ func NegotiateIncludingOpenMetrics(h http.Header) Format {
// for FmtOpenMetrics, but a future (breaking) release will add the Close method
// to the Encoder interface directly. The current version of the Encoder
// interface is kept for backwards compatibility.
-func NewEncoder(w io.Writer, format Format) Encoder {
- switch format {
- case FmtProtoDelim:
+// In cases where the Format does not allow for UTF-8 names, the global
+// NameEscapingScheme will be applied.
+//
+// NewEncoder can be called with additional options to customize the OpenMetrics text output.
+// For example:
+// NewEncoder(w, FmtOpenMetrics_1_0_0, WithCreatedLines())
+//
+// Extra options are ignored for all other formats.
+func NewEncoder(w io.Writer, format Format, options ...EncoderOption) Encoder {
+ escapingScheme := format.ToEscapingScheme()
+
+ switch format.FormatType() {
+ case TypeProtoDelim:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
- _, err := pbutil.WriteDelimited(w, v)
+ _, err := protodelim.MarshalTo(w, v)
return err
},
close: func() error { return nil },
}
- case FmtProtoCompact:
+ case TypeProtoCompact:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
- _, err := fmt.Fprintln(w, v.String())
+ _, err := fmt.Fprintln(w, model.EscapeMetricFamily(v, escapingScheme).String())
return err
},
close: func() error { return nil },
}
- case FmtProtoText:
+ case TypeProtoText:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
- _, err := fmt.Fprintln(w, prototext.Format(v))
+ _, err := fmt.Fprintln(w, prototext.Format(model.EscapeMetricFamily(v, escapingScheme)))
return err
},
close: func() error { return nil },
}
- case FmtText:
+ case TypeTextPlain:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
- _, err := MetricFamilyToText(w, v)
+ _, err := MetricFamilyToText(w, model.EscapeMetricFamily(v, escapingScheme))
return err
},
close: func() error { return nil },
}
- case FmtOpenMetrics_0_0_1, FmtOpenMetrics_1_0_0:
+ case TypeOpenMetrics:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
- _, err := MetricFamilyToOpenMetrics(w, v)
+ _, err := MetricFamilyToOpenMetrics(w, model.EscapeMetricFamily(v, escapingScheme), options...)
return err
},
close: func() error {
diff --git a/vendor/github.com/prometheus/common/expfmt/expfmt.go b/vendor/github.com/prometheus/common/expfmt/expfmt.go
index c4cb20f0d3..051b38cd17 100644
--- a/vendor/github.com/prometheus/common/expfmt/expfmt.go
+++ b/vendor/github.com/prometheus/common/expfmt/expfmt.go
@@ -14,30 +14,164 @@
// Package expfmt contains tools for reading and writing Prometheus metrics.
package expfmt
+import (
+ "fmt"
+ "strings"
+
+ "github.com/prometheus/common/model"
+)
+
// Format specifies the HTTP content type of the different wire protocols.
type Format string
-// Constants to assemble the Content-Type values for the different wire protocols.
+// Constants to assemble the Content-Type values for the different wire
+// protocols. The Content-Type strings here are all for the legacy exposition
+// formats, where valid characters for metric names and label names are limited.
+// Support for arbitrary UTF-8 characters in those names is already partially
+// implemented in this module (see model.ValidationScheme), but to actually use
+// it on the wire, new content-type strings will have to be agreed upon and
+// added here.
const (
TextVersion = "0.0.4"
ProtoType = `application/vnd.google.protobuf`
ProtoProtocol = `io.prometheus.client.MetricFamily`
- ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";"
+ protoFmt = ProtoType + "; proto=" + ProtoProtocol + ";"
OpenMetricsType = `application/openmetrics-text`
OpenMetricsVersion_0_0_1 = "0.0.1"
OpenMetricsVersion_1_0_0 = "1.0.0"
- // The Content-Type values for the different wire protocols.
- FmtUnknown Format = ``
- FmtText Format = `text/plain; version=` + TextVersion + `; charset=utf-8`
- FmtProtoDelim Format = ProtoFmt + ` encoding=delimited`
- FmtProtoText Format = ProtoFmt + ` encoding=text`
- FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text`
- FmtOpenMetrics_1_0_0 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_1_0_0 + `; charset=utf-8`
- FmtOpenMetrics_0_0_1 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_0_0_1 + `; charset=utf-8`
+ // The Content-Type values for the different wire protocols. Note that these
+ // values are now unexported. If code was relying on comparisons to these
+ // constants, instead use FormatType().
+ fmtUnknown Format = ``
+ fmtText Format = `text/plain; version=` + TextVersion + `; charset=utf-8`
+ fmtProtoDelim Format = protoFmt + ` encoding=delimited`
+ fmtProtoText Format = protoFmt + ` encoding=text`
+ fmtProtoCompact Format = protoFmt + ` encoding=compact-text`
+ fmtOpenMetrics_1_0_0 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_1_0_0 + `; charset=utf-8`
+ fmtOpenMetrics_0_0_1 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_0_0_1 + `; charset=utf-8`
)
const (
hdrContentType = "Content-Type"
hdrAccept = "Accept"
)
+
+// FormatType is a Go enum representing the overall category for the given
+// Format. As the number of Format permutations increases, doing basic string
+// comparisons are not feasible, so this enum captures the most useful
+// high-level attribute of the Format string.
+type FormatType int
+
+const (
+ TypeUnknown FormatType = iota
+ TypeProtoCompact
+ TypeProtoDelim
+ TypeProtoText
+ TypeTextPlain
+ TypeOpenMetrics
+)
+
+// NewFormat generates a new Format from the type provided. Mostly used for
+// tests, most Formats should be generated as part of content negotiation in
+// encode.go. If a type has more than one version, the latest version will be
+// returned.
+func NewFormat(t FormatType) Format {
+ switch t {
+ case TypeProtoCompact:
+ return fmtProtoCompact
+ case TypeProtoDelim:
+ return fmtProtoDelim
+ case TypeProtoText:
+ return fmtProtoText
+ case TypeTextPlain:
+ return fmtText
+ case TypeOpenMetrics:
+ return fmtOpenMetrics_1_0_0
+ default:
+ return fmtUnknown
+ }
+}
+
+// NewOpenMetricsFormat generates a new OpenMetrics format matching the
+// specified version number.
+func NewOpenMetricsFormat(version string) (Format, error) {
+ if version == OpenMetricsVersion_0_0_1 {
+ return fmtOpenMetrics_0_0_1, nil
+ }
+ if version == OpenMetricsVersion_1_0_0 {
+ return fmtOpenMetrics_1_0_0, nil
+ }
+ return fmtUnknown, fmt.Errorf("unknown open metrics version string")
+}
+
+// FormatType deduces an overall FormatType for the given format.
+func (f Format) FormatType() FormatType {
+ toks := strings.Split(string(f), ";")
+ params := make(map[string]string)
+ for i, t := range toks {
+ if i == 0 {
+ continue
+ }
+ args := strings.Split(t, "=")
+ if len(args) != 2 {
+ continue
+ }
+ params[strings.TrimSpace(args[0])] = strings.TrimSpace(args[1])
+ }
+
+ switch strings.TrimSpace(toks[0]) {
+ case ProtoType:
+ if params["proto"] != ProtoProtocol {
+ return TypeUnknown
+ }
+ switch params["encoding"] {
+ case "delimited":
+ return TypeProtoDelim
+ case "text":
+ return TypeProtoText
+ case "compact-text":
+ return TypeProtoCompact
+ default:
+ return TypeUnknown
+ }
+ case OpenMetricsType:
+ if params["charset"] != "utf-8" {
+ return TypeUnknown
+ }
+ return TypeOpenMetrics
+ case "text/plain":
+ v, ok := params["version"]
+ if !ok {
+ return TypeTextPlain
+ }
+ if v == TextVersion {
+ return TypeTextPlain
+ }
+ return TypeUnknown
+ default:
+ return TypeUnknown
+ }
+}
+
+// ToEscapingScheme returns an EscapingScheme depending on the Format. Iff the
+// Format contains a escaping=allow-utf-8 term, it will select NoEscaping. If a valid
+// "escaping" term exists, that will be used. Otherwise, the global default will
+// be returned.
+func (format Format) ToEscapingScheme() model.EscapingScheme {
+ for _, p := range strings.Split(string(format), ";") {
+ toks := strings.Split(p, "=")
+ if len(toks) != 2 {
+ continue
+ }
+ key, value := strings.TrimSpace(toks[0]), strings.TrimSpace(toks[1])
+ if key == model.EscapingKey {
+ scheme, err := model.ToEscapingScheme(value)
+ if err != nil {
+ return model.NameEscapingScheme
+ }
+ return scheme
+ }
+ }
+ return model.NameEscapingScheme
+}
diff --git a/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go b/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
index 21cdddcf05..353c5e93f9 100644
--- a/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
+++ b/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
@@ -22,11 +22,47 @@ import (
"strconv"
"strings"
+ "google.golang.org/protobuf/types/known/timestamppb"
+
"github.com/prometheus/common/model"
dto "github.com/prometheus/client_model/go"
)
+type encoderOption struct {
+ withCreatedLines bool
+ withUnit bool
+}
+
+type EncoderOption func(*encoderOption)
+
+// WithCreatedLines is an EncoderOption that configures the OpenMetrics encoder
+// to include _created lines (See
+// https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#counter-1).
+// Created timestamps can improve the accuracy of series reset detection, but
+// come with a bandwidth cost.
+//
+// At the time of writing, created timestamp ingestion is still experimental in
+// Prometheus and need to be enabled with the feature-flag
+// `--feature-flag=created-timestamp-zero-ingestion`, and breaking changes are
+// still possible. Therefore, it is recommended to use this feature with caution.
+func WithCreatedLines() EncoderOption {
+ return func(t *encoderOption) {
+ t.withCreatedLines = true
+ }
+}
+
+// WithUnit is an EncoderOption enabling a set unit to be written to the output
+// and to be added to the metric name, if it's not there already, as a suffix.
+// Without opting in this way, the unit will not be added to the metric name and,
+// on top of that, the unit will not be passed onto the output, even if it
+// were declared in the *dto.MetricFamily struct, i.e. even if in.Unit !=nil.
+func WithUnit() EncoderOption {
+ return func(t *encoderOption) {
+ t.withUnit = true
+ }
+}
+
// MetricFamilyToOpenMetrics converts a MetricFamily proto message into the
// OpenMetrics text format and writes the resulting lines to 'out'. It returns
// the number of bytes written and any error encountered. The output will have
@@ -35,6 +71,18 @@ import (
// sanity checks. If the input contains duplicate metrics or invalid metric or
// label names, the conversion will result in invalid text format output.
//
+// If metric names conform to the legacy validation pattern, they will be placed
+// outside the brackets in the traditional way, like `foo{}`. If the metric name
+// fails the legacy validation check, it will be placed quoted inside the
+// brackets: `{"foo"}`. As stated above, the input is assumed to be santized and
+// no error will be thrown in this case.
+//
+// Similar to metric names, if label names conform to the legacy validation
+// pattern, they will be unquoted as normal, like `foo{bar="baz"}`. If the label
+// name fails the legacy validation check, it will be quoted:
+// `foo{"bar"="baz"}`. As stated above, the input is assumed to be santized and
+// no error will be thrown in this case.
+//
// This function fulfills the type 'expfmt.encoder'.
//
// Note that OpenMetrics requires a final `# EOF` line. Since this function acts
@@ -47,20 +95,34 @@ import (
// Prometheus to OpenMetrics or vice versa:
//
// - Counters are expected to have the `_total` suffix in their metric name. In
-// the output, the suffix will be truncated from the `# TYPE` and `# HELP`
-// line. A counter with a missing `_total` suffix is not an error. However,
+// the output, the suffix will be truncated from the `# TYPE`, `# HELP` and `# UNIT`
+// lines. A counter with a missing `_total` suffix is not an error. However,
// its type will be set to `unknown` in that case to avoid invalid OpenMetrics
// output.
//
-// - No support for the following (optional) features: `# UNIT` line, `_created`
-// line, info type, stateset type, gaugehistogram type.
+// - According to the OM specs, the `# UNIT` line is optional, but if populated,
+// the unit has to be present in the metric name as its suffix:
+// (see https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#unit).
+// However, in order to accommodate any potential scenario where such a change in the
+// metric name is not desirable, the users are here given the choice of either explicitly
+// opt in, in case they wish for the unit to be included in the output AND in the metric name
+// as a suffix (see the description of the WithUnit function above),
+// or not to opt in, in case they don't want for any of that to happen.
+//
+// - No support for the following (optional) features: info type,
+// stateset type, gaugehistogram type.
//
// - The size of exemplar labels is not checked (i.e. it's possible to create
// exemplars that are larger than allowed by the OpenMetrics specification).
//
// - The value of Counters is not checked. (OpenMetrics doesn't allow counters
// with a `NaN` value.)
-func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int, err error) {
+func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...EncoderOption) (written int, err error) {
+ toOM := encoderOption{}
+ for _, option := range options {
+ option(&toOM)
+ }
+
name := in.GetName()
if name == "" {
return 0, fmt.Errorf("MetricFamily has no name: %s", in)
@@ -83,12 +145,15 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
}
var (
- n int
- metricType = in.GetType()
- shortName = name
+ n int
+ metricType = in.GetType()
+ compliantName = name
)
- if metricType == dto.MetricType_COUNTER && strings.HasSuffix(shortName, "_total") {
- shortName = name[:len(name)-6]
+ if metricType == dto.MetricType_COUNTER && strings.HasSuffix(compliantName, "_total") {
+ compliantName = name[:len(name)-6]
+ }
+ if toOM.withUnit && in.Unit != nil && !strings.HasSuffix(compliantName, fmt.Sprintf("_%s", *in.Unit)) {
+ compliantName = compliantName + fmt.Sprintf("_%s", *in.Unit)
}
// Comments, first HELP, then TYPE.
@@ -98,7 +163,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
if err != nil {
return
}
- n, err = w.WriteString(shortName)
+ n, err = writeName(w, compliantName)
written += n
if err != nil {
return
@@ -124,7 +189,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
if err != nil {
return
}
- n, err = w.WriteString(shortName)
+ n, err = writeName(w, compliantName)
written += n
if err != nil {
return
@@ -151,55 +216,89 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
if err != nil {
return
}
+ if toOM.withUnit && in.Unit != nil {
+ n, err = w.WriteString("# UNIT ")
+ written += n
+ if err != nil {
+ return
+ }
+ n, err = writeName(w, compliantName)
+ written += n
+ if err != nil {
+ return
+ }
+
+ err = w.WriteByte(' ')
+ written++
+ if err != nil {
+ return
+ }
+ n, err = writeEscapedString(w, *in.Unit, true)
+ written += n
+ if err != nil {
+ return
+ }
+ err = w.WriteByte('\n')
+ written++
+ if err != nil {
+ return
+ }
+ }
+
+ var createdTsBytesWritten int
// Finally the samples, one line for each.
+ if metricType == dto.MetricType_COUNTER && strings.HasSuffix(name, "_total") {
+ compliantName = compliantName + "_total"
+ }
for _, metric := range in.Metric {
switch metricType {
case dto.MetricType_COUNTER:
if metric.Counter == nil {
return written, fmt.Errorf(
- "expected counter in metric %s %s", name, metric,
+ "expected counter in metric %s %s", compliantName, metric,
)
}
- // Note that we have ensured above that either the name
- // ends on `_total` or that the rendered type is
- // `unknown`. Therefore, no `_total` must be added here.
n, err = writeOpenMetricsSample(
- w, name, "", metric, "", 0,
+ w, compliantName, "", metric, "", 0,
metric.Counter.GetValue(), 0, false,
metric.Counter.Exemplar,
)
+ if toOM.withCreatedLines && metric.Counter.CreatedTimestamp != nil {
+ createdTsBytesWritten, err = writeOpenMetricsCreated(w, compliantName, "_total", metric, "", 0, metric.Counter.GetCreatedTimestamp())
+ n += createdTsBytesWritten
+ }
case dto.MetricType_GAUGE:
if metric.Gauge == nil {
return written, fmt.Errorf(
- "expected gauge in metric %s %s", name, metric,
+ "expected gauge in metric %s %s", compliantName, metric,
)
}
n, err = writeOpenMetricsSample(
- w, name, "", metric, "", 0,
+ w, compliantName, "", metric, "", 0,
metric.Gauge.GetValue(), 0, false,
nil,
)
case dto.MetricType_UNTYPED:
if metric.Untyped == nil {
return written, fmt.Errorf(
- "expected untyped in metric %s %s", name, metric,
+ "expected untyped in metric %s %s", compliantName, metric,
)
}
n, err = writeOpenMetricsSample(
- w, name, "", metric, "", 0,
+ w, compliantName, "", metric, "", 0,
metric.Untyped.GetValue(), 0, false,
nil,
)
case dto.MetricType_SUMMARY:
if metric.Summary == nil {
return written, fmt.Errorf(
- "expected summary in metric %s %s", name, metric,
+ "expected summary in metric %s %s", compliantName, metric,
)
}
for _, q := range metric.Summary.Quantile {
n, err = writeOpenMetricsSample(
- w, name, "", metric,
+ w, compliantName, "", metric,
model.QuantileLabel, q.GetQuantile(),
q.GetValue(), 0, false,
nil,
@@ -210,7 +309,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
}
}
n, err = writeOpenMetricsSample(
- w, name, "_sum", metric, "", 0,
+ w, compliantName, "_sum", metric, "", 0,
metric.Summary.GetSampleSum(), 0, false,
nil,
)
@@ -219,20 +318,24 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
return
}
n, err = writeOpenMetricsSample(
- w, name, "_count", metric, "", 0,
+ w, compliantName, "_count", metric, "", 0,
0, metric.Summary.GetSampleCount(), true,
nil,
)
+ if toOM.withCreatedLines && metric.Summary.CreatedTimestamp != nil {
+ createdTsBytesWritten, err = writeOpenMetricsCreated(w, compliantName, "", metric, "", 0, metric.Summary.GetCreatedTimestamp())
+ n += createdTsBytesWritten
+ }
case dto.MetricType_HISTOGRAM:
if metric.Histogram == nil {
return written, fmt.Errorf(
- "expected histogram in metric %s %s", name, metric,
+ "expected histogram in metric %s %s", compliantName, metric,
)
}
infSeen := false
for _, b := range metric.Histogram.Bucket {
n, err = writeOpenMetricsSample(
- w, name, "_bucket", metric,
+ w, compliantName, "_bucket", metric,
model.BucketLabel, b.GetUpperBound(),
0, b.GetCumulativeCount(), true,
b.Exemplar,
@@ -247,7 +350,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
}
if !infSeen {
n, err = writeOpenMetricsSample(
- w, name, "_bucket", metric,
+ w, compliantName, "_bucket", metric,
model.BucketLabel, math.Inf(+1),
0, metric.Histogram.GetSampleCount(), true,
nil,
@@ -258,7 +361,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
}
}
n, err = writeOpenMetricsSample(
- w, name, "_sum", metric, "", 0,
+ w, compliantName, "_sum", metric, "", 0,
metric.Histogram.GetSampleSum(), 0, false,
nil,
)
@@ -267,13 +370,17 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
return
}
n, err = writeOpenMetricsSample(
- w, name, "_count", metric, "", 0,
+ w, compliantName, "_count", metric, "", 0,
0, metric.Histogram.GetSampleCount(), true,
nil,
)
+ if toOM.withCreatedLines && metric.Histogram.CreatedTimestamp != nil {
+ createdTsBytesWritten, err = writeOpenMetricsCreated(w, compliantName, "", metric, "", 0, metric.Histogram.GetCreatedTimestamp())
+ n += createdTsBytesWritten
+ }
default:
return written, fmt.Errorf(
- "unexpected type in metric %s %s", name, metric,
+ "unexpected type in metric %s %s", compliantName, metric,
)
}
written += n
@@ -303,21 +410,9 @@ func writeOpenMetricsSample(
floatValue float64, intValue uint64, useIntValue bool,
exemplar *dto.Exemplar,
) (int, error) {
- var written int
- n, err := w.WriteString(name)
- written += n
- if err != nil {
- return written, err
- }
- if suffix != "" {
- n, err = w.WriteString(suffix)
- written += n
- if err != nil {
- return written, err
- }
- }
- n, err = writeOpenMetricsLabelPairs(
- w, metric.Label, additionalLabelName, additionalLabelValue,
+ written := 0
+ n, err := writeOpenMetricsNameAndLabelPairs(
+ w, name+suffix, metric.Label, additionalLabelName, additionalLabelValue,
)
written += n
if err != nil {
@@ -350,7 +445,7 @@ func writeOpenMetricsSample(
return written, err
}
}
- if exemplar != nil {
+ if exemplar != nil && len(exemplar.Label) > 0 {
n, err = writeExemplar(w, exemplar)
written += n
if err != nil {
@@ -365,27 +460,58 @@ func writeOpenMetricsSample(
return written, nil
}
-// writeOpenMetricsLabelPairs works like writeOpenMetrics but formats the float
-// in OpenMetrics style.
-func writeOpenMetricsLabelPairs(
+// writeOpenMetricsNameAndLabelPairs works like writeOpenMetricsSample but
+// formats the float in OpenMetrics style.
+func writeOpenMetricsNameAndLabelPairs(
w enhancedWriter,
+ name string,
in []*dto.LabelPair,
additionalLabelName string, additionalLabelValue float64,
) (int, error) {
- if len(in) == 0 && additionalLabelName == "" {
- return 0, nil
- }
var (
- written int
- separator byte = '{'
+ written int
+ separator byte = '{'
+ metricInsideBraces = false
)
+
+ if name != "" {
+ // If the name does not pass the legacy validity check, we must put the
+ // metric name inside the braces, quoted.
+ if !model.IsValidLegacyMetricName(model.LabelValue(name)) {
+ metricInsideBraces = true
+ err := w.WriteByte(separator)
+ written++
+ if err != nil {
+ return written, err
+ }
+ separator = ','
+ }
+
+ n, err := writeName(w, name)
+ written += n
+ if err != nil {
+ return written, err
+ }
+ }
+
+ if len(in) == 0 && additionalLabelName == "" {
+ if metricInsideBraces {
+ err := w.WriteByte('}')
+ written++
+ if err != nil {
+ return written, err
+ }
+ }
+ return written, nil
+ }
+
for _, lp := range in {
err := w.WriteByte(separator)
written++
if err != nil {
return written, err
}
- n, err := w.WriteString(lp.GetName())
+ n, err := writeName(w, lp.GetName())
written += n
if err != nil {
return written, err
@@ -442,6 +568,49 @@ func writeOpenMetricsLabelPairs(
return written, nil
}
+// writeOpenMetricsCreated writes the created timestamp for a single time series
+// following OpenMetrics text format to w, given the metric name, the metric proto
+// message itself, optionally a suffix to be removed, e.g. '_total' for counters,
+// an additional label name with a float64 value (use empty string as label name if
+// not required) and the timestamp that represents the created timestamp.
+// The function returns the number of bytes written and any error encountered.
+func writeOpenMetricsCreated(w enhancedWriter,
+ name, suffixToTrim string, metric *dto.Metric,
+ additionalLabelName string, additionalLabelValue float64,
+ createdTimestamp *timestamppb.Timestamp,
+) (int, error) {
+ written := 0
+ n, err := writeOpenMetricsNameAndLabelPairs(
+ w, strings.TrimSuffix(name, suffixToTrim)+"_created", metric.Label, additionalLabelName, additionalLabelValue,
+ )
+ written += n
+ if err != nil {
+ return written, err
+ }
+
+ err = w.WriteByte(' ')
+ written++
+ if err != nil {
+ return written, err
+ }
+
+ // TODO(beorn7): Format this directly from components of ts to
+ // avoid overflow/underflow and precision issues of the float
+ // conversion.
+ n, err = writeOpenMetricsFloat(w, float64(createdTimestamp.AsTime().UnixNano())/1e9)
+ written += n
+ if err != nil {
+ return written, err
+ }
+
+ err = w.WriteByte('\n')
+ written++
+ if err != nil {
+ return written, err
+ }
+ return written, nil
+}
+
// writeExemplar writes the provided exemplar in OpenMetrics format to w. The
// function returns the number of bytes written and any error encountered.
func writeExemplar(w enhancedWriter, e *dto.Exemplar) (int, error) {
@@ -451,7 +620,7 @@ func writeExemplar(w enhancedWriter, e *dto.Exemplar) (int, error) {
if err != nil {
return written, err
}
- n, err = writeOpenMetricsLabelPairs(w, e.Label, "", 0)
+ n, err = writeOpenMetricsNameAndLabelPairs(w, "", e.Label, "", 0)
written += n
if err != nil {
return written, err
diff --git a/vendor/github.com/prometheus/common/expfmt/text_create.go b/vendor/github.com/prometheus/common/expfmt/text_create.go
index 2946b8f1a6..f9b8265a9e 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_create.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_create.go
@@ -62,6 +62,18 @@ var (
// contains duplicate metrics or invalid metric or label names, the conversion
// will result in invalid text format output.
//
+// If metric names conform to the legacy validation pattern, they will be placed
+// outside the brackets in the traditional way, like `foo{}`. If the metric name
+// fails the legacy validation check, it will be placed quoted inside the
+// brackets: `{"foo"}`. As stated above, the input is assumed to be santized and
+// no error will be thrown in this case.
+//
+// Similar to metric names, if label names conform to the legacy validation
+// pattern, they will be unquoted as normal, like `foo{bar="baz"}`. If the label
+// name fails the legacy validation check, it will be quoted:
+// `foo{"bar"="baz"}`. As stated above, the input is assumed to be santized and
+// no error will be thrown in this case.
+//
// This method fulfills the type 'prometheus.encoder'.
func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err error) {
// Fail-fast checks.
@@ -98,7 +110,7 @@ func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err e
if err != nil {
return
}
- n, err = w.WriteString(name)
+ n, err = writeName(w, name)
written += n
if err != nil {
return
@@ -124,7 +136,7 @@ func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err e
if err != nil {
return
}
- n, err = w.WriteString(name)
+ n, err = writeName(w, name)
written += n
if err != nil {
return
@@ -280,21 +292,9 @@ func writeSample(
additionalLabelName string, additionalLabelValue float64,
value float64,
) (int, error) {
- var written int
- n, err := w.WriteString(name)
- written += n
- if err != nil {
- return written, err
- }
- if suffix != "" {
- n, err = w.WriteString(suffix)
- written += n
- if err != nil {
- return written, err
- }
- }
- n, err = writeLabelPairs(
- w, metric.Label, additionalLabelName, additionalLabelValue,
+ written := 0
+ n, err := writeNameAndLabelPairs(
+ w, name+suffix, metric.Label, additionalLabelName, additionalLabelValue,
)
written += n
if err != nil {
@@ -330,32 +330,64 @@ func writeSample(
return written, nil
}
-// writeLabelPairs converts a slice of LabelPair proto messages plus the
-// explicitly given additional label pair into text formatted as required by the
-// text format and writes it to 'w'. An empty slice in combination with an empty
-// string 'additionalLabelName' results in nothing being written. Otherwise, the
-// label pairs are written, escaped as required by the text format, and enclosed
-// in '{...}'. The function returns the number of bytes written and any error
-// encountered.
-func writeLabelPairs(
+// writeNameAndLabelPairs converts a slice of LabelPair proto messages plus the
+// explicitly given metric name and additional label pair into text formatted as
+// required by the text format and writes it to 'w'. An empty slice in
+// combination with an empty string 'additionalLabelName' results in nothing
+// being written. Otherwise, the label pairs are written, escaped as required by
+// the text format, and enclosed in '{...}'. The function returns the number of
+// bytes written and any error encountered. If the metric name is not
+// legacy-valid, it will be put inside the brackets as well. Legacy-invalid
+// label names will also be quoted.
+func writeNameAndLabelPairs(
w enhancedWriter,
+ name string,
in []*dto.LabelPair,
additionalLabelName string, additionalLabelValue float64,
) (int, error) {
- if len(in) == 0 && additionalLabelName == "" {
- return 0, nil
- }
var (
- written int
- separator byte = '{'
+ written int
+ separator byte = '{'
+ metricInsideBraces = false
)
+
+ if name != "" {
+ // If the name does not pass the legacy validity check, we must put the
+ // metric name inside the braces.
+ if !model.IsValidLegacyMetricName(model.LabelValue(name)) {
+ metricInsideBraces = true
+ err := w.WriteByte(separator)
+ written++
+ if err != nil {
+ return written, err
+ }
+ separator = ','
+ }
+ n, err := writeName(w, name)
+ written += n
+ if err != nil {
+ return written, err
+ }
+ }
+
+ if len(in) == 0 && additionalLabelName == "" {
+ if metricInsideBraces {
+ err := w.WriteByte('}')
+ written++
+ if err != nil {
+ return written, err
+ }
+ }
+ return written, nil
+ }
+
for _, lp := range in {
err := w.WriteByte(separator)
written++
if err != nil {
return written, err
}
- n, err := w.WriteString(lp.GetName())
+ n, err := writeName(w, lp.GetName())
written += n
if err != nil {
return written, err
@@ -462,3 +494,27 @@ func writeInt(w enhancedWriter, i int64) (int, error) {
numBufPool.Put(bp)
return written, err
}
+
+// writeName writes a string as-is if it complies with the legacy naming
+// scheme, or escapes it in double quotes if not.
+func writeName(w enhancedWriter, name string) (int, error) {
+ if model.IsValidLegacyMetricName(model.LabelValue(name)) {
+ return w.WriteString(name)
+ }
+ var written int
+ var err error
+ err = w.WriteByte('"')
+ written++
+ if err != nil {
+ return written, err
+ }
+ var n int
+ n, err = writeEscapedString(w, name, true)
+ written += n
+ if err != nil {
+ return written, err
+ }
+ err = w.WriteByte('"')
+ written++
+ return written, err
+}
diff --git a/vendor/github.com/prometheus/common/expfmt/text_parse.go b/vendor/github.com/prometheus/common/expfmt/text_parse.go
index 35db1cc9d7..26490211af 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_parse.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_parse.go
@@ -16,6 +16,7 @@ package expfmt
import (
"bufio"
"bytes"
+ "errors"
"fmt"
"io"
"math"
@@ -24,8 +25,9 @@ import (
dto "github.com/prometheus/client_model/go"
- "github.com/prometheus/common/model"
"google.golang.org/protobuf/proto"
+
+ "github.com/prometheus/common/model"
)
// A stateFn is a function that represents a state in a state machine. By
@@ -112,7 +114,7 @@ func (p *TextParser) TextToMetricFamilies(in io.Reader) (map[string]*dto.MetricF
// stream. Turn this error into something nicer and more
// meaningful. (io.EOF is often used as a signal for the legitimate end
// of an input stream.)
- if p.err == io.EOF {
+ if p.err != nil && errors.Is(p.err, io.EOF) {
p.parseError("unexpected end of input stream")
}
return p.metricFamiliesByName, p.err
@@ -146,7 +148,7 @@ func (p *TextParser) startOfLine() stateFn {
// which is not an error but the signal that we are done.
// Any other error that happens to align with the start of
// a line is still an error.
- if p.err == io.EOF {
+ if errors.Is(p.err, io.EOF) {
p.err = nil
}
return nil
diff --git a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt b/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt
deleted file mode 100644
index 7723656d58..0000000000
--- a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-PACKAGE
-
-package goautoneg
-import "bitbucket.org/ww/goautoneg"
-
-HTTP Content-Type Autonegotiation.
-
-The functions in this package implement the behaviour specified in
-http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-
-Copyright (c) 2011, Open Knowledge Foundation Ltd.
-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 the Open Knowledge Foundation Ltd. 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.
-
-
-FUNCTIONS
-
-func Negotiate(header string, alternatives []string) (content_type string)
-Negotiate the most appropriate content_type given the accept header
-and a list of alternatives.
-
-func ParseAccept(header string) (accept []Accept)
-Parse an Accept Header string returning a sorted list
-of clauses
-
-
-TYPES
-
-type Accept struct {
- Type, SubType string
- Q float32
- Params map[string]string
-}
-Structure to represent a clause in an HTTP Accept Header
-
-
-SUBDIRECTORIES
-
- .hg
diff --git a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go b/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go
deleted file mode 100644
index a21b9d15dd..0000000000
--- a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
-Copyright (c) 2011, Open Knowledge Foundation Ltd.
-All rights reserved.
-
-HTTP Content-Type Autonegotiation.
-
-The functions in this package implement the behaviour specified in
-http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-
-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 the Open Knowledge Foundation Ltd. 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.
-*/
-package goautoneg
-
-import (
- "sort"
- "strconv"
- "strings"
-)
-
-// Structure to represent a clause in an HTTP Accept Header
-type Accept struct {
- Type, SubType string
- Q float64
- Params map[string]string
-}
-
-// For internal use, so that we can use the sort interface
-type accept_slice []Accept
-
-func (accept accept_slice) Len() int {
- slice := []Accept(accept)
- return len(slice)
-}
-
-func (accept accept_slice) Less(i, j int) bool {
- slice := []Accept(accept)
- ai, aj := slice[i], slice[j]
- if ai.Q > aj.Q {
- return true
- }
- if ai.Type != "*" && aj.Type == "*" {
- return true
- }
- if ai.SubType != "*" && aj.SubType == "*" {
- return true
- }
- return false
-}
-
-func (accept accept_slice) Swap(i, j int) {
- slice := []Accept(accept)
- slice[i], slice[j] = slice[j], slice[i]
-}
-
-// Parse an Accept Header string returning a sorted list
-// of clauses
-func ParseAccept(header string) (accept []Accept) {
- parts := strings.Split(header, ",")
- accept = make([]Accept, 0, len(parts))
- for _, part := range parts {
- part := strings.Trim(part, " ")
-
- a := Accept{}
- a.Params = make(map[string]string)
- a.Q = 1.0
-
- mrp := strings.Split(part, ";")
-
- media_range := mrp[0]
- sp := strings.Split(media_range, "/")
- a.Type = strings.Trim(sp[0], " ")
-
- switch {
- case len(sp) == 1 && a.Type == "*":
- a.SubType = "*"
- case len(sp) == 2:
- a.SubType = strings.Trim(sp[1], " ")
- default:
- continue
- }
-
- if len(mrp) == 1 {
- accept = append(accept, a)
- continue
- }
-
- for _, param := range mrp[1:] {
- sp := strings.SplitN(param, "=", 2)
- if len(sp) != 2 {
- continue
- }
- token := strings.Trim(sp[0], " ")
- if token == "q" {
- a.Q, _ = strconv.ParseFloat(sp[1], 32)
- } else {
- a.Params[token] = strings.Trim(sp[1], " ")
- }
- }
-
- accept = append(accept, a)
- }
-
- slice := accept_slice(accept)
- sort.Sort(slice)
-
- return
-}
-
-// Negotiate the most appropriate content_type given the accept header
-// and a list of alternatives.
-func Negotiate(header string, alternatives []string) (content_type string) {
- asp := make([][]string, 0, len(alternatives))
- for _, ctype := range alternatives {
- asp = append(asp, strings.SplitN(ctype, "/", 2))
- }
- for _, clause := range ParseAccept(header) {
- for i, ctsp := range asp {
- if clause.Type == ctsp[0] && clause.SubType == ctsp[1] {
- content_type = alternatives[i]
- return
- }
- if clause.Type == ctsp[0] && clause.SubType == "*" {
- content_type = alternatives[i]
- return
- }
- if clause.Type == "*" && clause.SubType == "*" {
- content_type = alternatives[i]
- return
- }
- }
- }
- return
-}
diff --git a/vendor/github.com/prometheus/common/model/alert.go b/vendor/github.com/prometheus/common/model/alert.go
index 35e739c7ad..80d1fe944e 100644
--- a/vendor/github.com/prometheus/common/model/alert.go
+++ b/vendor/github.com/prometheus/common/model/alert.go
@@ -75,7 +75,12 @@ func (a *Alert) ResolvedAt(ts time.Time) bool {
// Status returns the status of the alert.
func (a *Alert) Status() AlertStatus {
- if a.Resolved() {
+ return a.StatusAt(time.Now())
+}
+
+// StatusAt returns the status of the alert at the given timestamp.
+func (a *Alert) StatusAt(ts time.Time) AlertStatus {
+ if a.ResolvedAt(ts) {
return AlertResolved
}
return AlertFiring
@@ -90,13 +95,13 @@ func (a *Alert) Validate() error {
return fmt.Errorf("start time must be before end time")
}
if err := a.Labels.Validate(); err != nil {
- return fmt.Errorf("invalid label set: %s", err)
+ return fmt.Errorf("invalid label set: %w", err)
}
if len(a.Labels) == 0 {
return fmt.Errorf("at least one label pair required")
}
if err := a.Annotations.Validate(); err != nil {
- return fmt.Errorf("invalid annotations: %s", err)
+ return fmt.Errorf("invalid annotations: %w", err)
}
return nil
}
@@ -127,6 +132,17 @@ func (as Alerts) HasFiring() bool {
return false
}
+// HasFiringAt returns true iff one of the alerts is not resolved
+// at the time ts.
+func (as Alerts) HasFiringAt(ts time.Time) bool {
+ for _, a := range as {
+ if !a.ResolvedAt(ts) {
+ return true
+ }
+ }
+ return false
+}
+
// Status returns StatusFiring iff at least one of the alerts is firing.
func (as Alerts) Status() AlertStatus {
if as.HasFiring() {
@@ -134,3 +150,12 @@ func (as Alerts) Status() AlertStatus {
}
return AlertResolved
}
+
+// StatusAt returns StatusFiring iff at least one of the alerts is firing
+// at the time ts.
+func (as Alerts) StatusAt(ts time.Time) AlertStatus {
+ if as.HasFiringAt(ts) {
+ return AlertFiring
+ }
+ return AlertResolved
+}
diff --git a/vendor/github.com/prometheus/common/model/labels.go b/vendor/github.com/prometheus/common/model/labels.go
index ef89563354..3317ce22ff 100644
--- a/vendor/github.com/prometheus/common/model/labels.go
+++ b/vendor/github.com/prometheus/common/model/labels.go
@@ -97,17 +97,25 @@ var LabelNameRE = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$")
// therewith.
type LabelName string
-// IsValid is true iff the label name matches the pattern of LabelNameRE. This
-// method, however, does not use LabelNameRE for the check but a much faster
-// hardcoded implementation.
+// IsValid returns true iff name matches the pattern of LabelNameRE for legacy
+// names, and iff it's valid UTF-8 if NameValidationScheme is set to
+// UTF8Validation. For the legacy matching, it does not use LabelNameRE for the
+// check but a much faster hardcoded implementation.
func (ln LabelName) IsValid() bool {
if len(ln) == 0 {
return false
}
- for i, b := range ln {
- if !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || (b >= '0' && b <= '9' && i > 0)) {
- return false
+ switch NameValidationScheme {
+ case LegacyValidation:
+ for i, b := range ln {
+ if !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || (b >= '0' && b <= '9' && i > 0)) {
+ return false
+ }
}
+ case UTF8Validation:
+ return utf8.ValidString(string(ln))
+ default:
+ panic(fmt.Sprintf("Invalid name validation scheme requested: %d", NameValidationScheme))
}
return true
}
@@ -164,7 +172,7 @@ func (l LabelNames) String() string {
// A LabelValue is an associated value for a LabelName.
type LabelValue string
-// IsValid returns true iff the string is a valid UTF8.
+// IsValid returns true iff the string is a valid UTF-8.
func (lv LabelValue) IsValid() bool {
return utf8.ValidString(string(lv))
}
diff --git a/vendor/github.com/prometheus/common/model/labelset.go b/vendor/github.com/prometheus/common/model/labelset.go
index 6eda08a739..d0ad88da33 100644
--- a/vendor/github.com/prometheus/common/model/labelset.go
+++ b/vendor/github.com/prometheus/common/model/labelset.go
@@ -17,7 +17,6 @@ import (
"encoding/json"
"fmt"
"sort"
- "strings"
)
// A LabelSet is a collection of LabelName and LabelValue pairs. The LabelSet
@@ -129,16 +128,6 @@ func (l LabelSet) Merge(other LabelSet) LabelSet {
return result
}
-func (l LabelSet) String() string {
- lstrs := make([]string, 0, len(l))
- for l, v := range l {
- lstrs = append(lstrs, fmt.Sprintf("%s=%q", l, v))
- }
-
- sort.Strings(lstrs)
- return fmt.Sprintf("{%s}", strings.Join(lstrs, ", "))
-}
-
// Fingerprint returns the LabelSet's fingerprint.
func (ls LabelSet) Fingerprint() Fingerprint {
return labelSetToFingerprint(ls)
diff --git a/vendor/github.com/prometheus/common/model/labelset_string.go b/vendor/github.com/prometheus/common/model/labelset_string.go
new file mode 100644
index 0000000000..481c47b46e
--- /dev/null
+++ b/vendor/github.com/prometheus/common/model/labelset_string.go
@@ -0,0 +1,45 @@
+// Copyright 2024 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//go:build go1.21
+
+package model
+
+import (
+ "bytes"
+ "slices"
+ "strconv"
+)
+
+// String will look like `{foo="bar", more="less"}`. Names are sorted alphabetically.
+func (l LabelSet) String() string {
+ var lna [32]string // On stack to avoid memory allocation for sorting names.
+ labelNames := lna[:0]
+ for name := range l {
+ labelNames = append(labelNames, string(name))
+ }
+ slices.Sort(labelNames)
+ var bytea [1024]byte // On stack to avoid memory allocation while building the output.
+ b := bytes.NewBuffer(bytea[:0])
+ b.WriteByte('{')
+ for i, name := range labelNames {
+ if i > 0 {
+ b.WriteString(", ")
+ }
+ b.WriteString(name)
+ b.WriteByte('=')
+ b.Write(strconv.AppendQuote(b.AvailableBuffer(), string(l[LabelName(name)])))
+ }
+ b.WriteByte('}')
+ return b.String()
+}
diff --git a/vendor/github.com/prometheus/common/model/labelset_string_go120.go b/vendor/github.com/prometheus/common/model/labelset_string_go120.go
new file mode 100644
index 0000000000..c4212685e7
--- /dev/null
+++ b/vendor/github.com/prometheus/common/model/labelset_string_go120.go
@@ -0,0 +1,39 @@
+// Copyright 2024 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//go:build !go1.21
+
+package model
+
+import (
+ "fmt"
+ "sort"
+ "strings"
+)
+
+// String was optimized using functions not available for go 1.20
+// or lower. We keep the old implementation for compatibility with client_golang.
+// Once client golang drops support for go 1.20 (scheduled for August 2024), this
+// file can be removed.
+func (l LabelSet) String() string {
+ labelNames := make([]string, 0, len(l))
+ for name := range l {
+ labelNames = append(labelNames, string(name))
+ }
+ sort.Strings(labelNames)
+ lstrs := make([]string, 0, len(l))
+ for _, name := range labelNames {
+ lstrs = append(lstrs, fmt.Sprintf("%s=%q", name, l[LabelName(name)]))
+ }
+ return fmt.Sprintf("{%s}", strings.Join(lstrs, ", "))
+}
diff --git a/vendor/github.com/prometheus/common/model/metadata.go b/vendor/github.com/prometheus/common/model/metadata.go
new file mode 100644
index 0000000000..447ab8ad63
--- /dev/null
+++ b/vendor/github.com/prometheus/common/model/metadata.go
@@ -0,0 +1,28 @@
+// Copyright 2023 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 model
+
+// MetricType represents metric type values.
+type MetricType string
+
+const (
+ MetricTypeCounter = MetricType("counter")
+ MetricTypeGauge = MetricType("gauge")
+ MetricTypeHistogram = MetricType("histogram")
+ MetricTypeGaugeHistogram = MetricType("gaugehistogram")
+ MetricTypeSummary = MetricType("summary")
+ MetricTypeInfo = MetricType("info")
+ MetricTypeStateset = MetricType("stateset")
+ MetricTypeUnknown = MetricType("unknown")
+)
diff --git a/vendor/github.com/prometheus/common/model/metric.go b/vendor/github.com/prometheus/common/model/metric.go
index 00804b7fed..eb865e5a59 100644
--- a/vendor/github.com/prometheus/common/model/metric.go
+++ b/vendor/github.com/prometheus/common/model/metric.go
@@ -18,15 +18,84 @@ import (
"regexp"
"sort"
"strings"
+ "unicode/utf8"
+
+ dto "github.com/prometheus/client_model/go"
+ "google.golang.org/protobuf/proto"
)
var (
- // MetricNameRE is a regular expression matching valid metric
- // names. Note that the IsValidMetricName function performs the same
- // check but faster than a match with this regular expression.
- MetricNameRE = regexp.MustCompile(`^[a-zA-Z_:][a-zA-Z0-9_:]*$`)
+ // NameValidationScheme determines the method of name validation to be used by
+ // all calls to IsValidMetricName() and LabelName IsValid(). Setting UTF-8 mode
+ // in isolation from other components that don't support UTF-8 may result in
+ // bugs or other undefined behavior. This value is intended to be set by
+ // UTF-8-aware binaries as part of their startup. To avoid need for locking,
+ // this value should be set once, ideally in an init(), before multiple
+ // goroutines are started.
+ NameValidationScheme = LegacyValidation
+
+ // NameEscapingScheme defines the default way that names will be
+ // escaped when presented to systems that do not support UTF-8 names. If the
+ // Content-Type "escaping" term is specified, that will override this value.
+ NameEscapingScheme = ValueEncodingEscaping
+)
+
+// ValidationScheme is a Go enum for determining how metric and label names will
+// be validated by this library.
+type ValidationScheme int
+
+const (
+ // LegacyValidation is a setting that requirets that metric and label names
+ // conform to the original Prometheus character requirements described by
+ // MetricNameRE and LabelNameRE.
+ LegacyValidation ValidationScheme = iota
+
+ // UTF8Validation only requires that metric and label names be valid UTF-8
+ // strings.
+ UTF8Validation
+)
+
+type EscapingScheme int
+
+const (
+ // NoEscaping indicates that a name will not be escaped. Unescaped names that
+ // do not conform to the legacy validity check will use a new exposition
+ // format syntax that will be officially standardized in future versions.
+ NoEscaping EscapingScheme = iota
+
+ // UnderscoreEscaping replaces all legacy-invalid characters with underscores.
+ UnderscoreEscaping
+
+ // DotsEscaping is similar to UnderscoreEscaping, except that dots are
+ // converted to `_dot_` and pre-existing underscores are converted to `__`.
+ DotsEscaping
+
+ // ValueEncodingEscaping prepends the name with `U__` and replaces all invalid
+ // characters with the unicode value, surrounded by underscores. Single
+ // underscores are replaced with double underscores.
+ ValueEncodingEscaping
+)
+
+const (
+ // EscapingKey is the key in an Accept or Content-Type header that defines how
+ // metric and label names that do not conform to the legacy character
+ // requirements should be escaped when being scraped by a legacy prometheus
+ // system. If a system does not explicitly pass an escaping parameter in the
+ // Accept header, the default NameEscapingScheme will be used.
+ EscapingKey = "escaping"
+
+ // Possible values for Escaping Key:
+ AllowUTF8 = "allow-utf-8" // No escaping required.
+ EscapeUnderscores = "underscores"
+ EscapeDots = "dots"
+ EscapeValues = "values"
)
+// MetricNameRE is a regular expression matching valid metric
+// names. Note that the IsValidMetricName function performs the same
+// check but faster than a match with this regular expression.
+var MetricNameRE = regexp.MustCompile(`^[a-zA-Z_:][a-zA-Z0-9_:]*$`)
+
// A Metric is similar to a LabelSet, but the key difference is that a Metric is
// a singleton and refers to one and only one stream of samples.
type Metric LabelSet
@@ -86,17 +155,303 @@ func (m Metric) FastFingerprint() Fingerprint {
return LabelSet(m).FastFingerprint()
}
-// IsValidMetricName returns true iff name matches the pattern of MetricNameRE.
+// IsValidMetricName returns true iff name matches the pattern of MetricNameRE
+// for legacy names, and iff it's valid UTF-8 if the UTF8Validation scheme is
+// selected.
+func IsValidMetricName(n LabelValue) bool {
+ switch NameValidationScheme {
+ case LegacyValidation:
+ return IsValidLegacyMetricName(n)
+ case UTF8Validation:
+ if len(n) == 0 {
+ return false
+ }
+ return utf8.ValidString(string(n))
+ default:
+ panic(fmt.Sprintf("Invalid name validation scheme requested: %d", NameValidationScheme))
+ }
+}
+
+// IsValidLegacyMetricName is similar to IsValidMetricName but always uses the
+// legacy validation scheme regardless of the value of NameValidationScheme.
// This function, however, does not use MetricNameRE for the check but a much
// faster hardcoded implementation.
-func IsValidMetricName(n LabelValue) bool {
+func IsValidLegacyMetricName(n LabelValue) bool {
if len(n) == 0 {
return false
}
for i, b := range n {
- if !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || b == ':' || (b >= '0' && b <= '9' && i > 0)) {
+ if !isValidLegacyRune(b, i) {
return false
}
}
return true
}
+
+// EscapeMetricFamily escapes the given metric names and labels with the given
+// escaping scheme. Returns a new object that uses the same pointers to fields
+// when possible and creates new escaped versions so as not to mutate the
+// input.
+func EscapeMetricFamily(v *dto.MetricFamily, scheme EscapingScheme) *dto.MetricFamily {
+ if v == nil {
+ return nil
+ }
+
+ if scheme == NoEscaping {
+ return v
+ }
+
+ out := &dto.MetricFamily{
+ Help: v.Help,
+ Type: v.Type,
+ Unit: v.Unit,
+ }
+
+ // If the name is nil, copy as-is, don't try to escape.
+ if v.Name == nil || IsValidLegacyMetricName(LabelValue(v.GetName())) {
+ out.Name = v.Name
+ } else {
+ out.Name = proto.String(EscapeName(v.GetName(), scheme))
+ }
+ for _, m := range v.Metric {
+ if !metricNeedsEscaping(m) {
+ out.Metric = append(out.Metric, m)
+ continue
+ }
+
+ escaped := &dto.Metric{
+ Gauge: m.Gauge,
+ Counter: m.Counter,
+ Summary: m.Summary,
+ Untyped: m.Untyped,
+ Histogram: m.Histogram,
+ TimestampMs: m.TimestampMs,
+ }
+
+ for _, l := range m.Label {
+ if l.GetName() == MetricNameLabel {
+ if l.Value == nil || IsValidLegacyMetricName(LabelValue(l.GetValue())) {
+ escaped.Label = append(escaped.Label, l)
+ continue
+ }
+ escaped.Label = append(escaped.Label, &dto.LabelPair{
+ Name: proto.String(MetricNameLabel),
+ Value: proto.String(EscapeName(l.GetValue(), scheme)),
+ })
+ continue
+ }
+ if l.Name == nil || IsValidLegacyMetricName(LabelValue(l.GetName())) {
+ escaped.Label = append(escaped.Label, l)
+ continue
+ }
+ escaped.Label = append(escaped.Label, &dto.LabelPair{
+ Name: proto.String(EscapeName(l.GetName(), scheme)),
+ Value: l.Value,
+ })
+ }
+ out.Metric = append(out.Metric, escaped)
+ }
+ return out
+}
+
+func metricNeedsEscaping(m *dto.Metric) bool {
+ for _, l := range m.Label {
+ if l.GetName() == MetricNameLabel && !IsValidLegacyMetricName(LabelValue(l.GetValue())) {
+ return true
+ }
+ if !IsValidLegacyMetricName(LabelValue(l.GetName())) {
+ return true
+ }
+ }
+ return false
+}
+
+const (
+ lowerhex = "0123456789abcdef"
+)
+
+// EscapeName escapes the incoming name according to the provided escaping
+// scheme. Depending on the rules of escaping, this may cause no change in the
+// string that is returned. (Especially NoEscaping, which by definition is a
+// noop). This function does not do any validation of the name.
+func EscapeName(name string, scheme EscapingScheme) string {
+ if len(name) == 0 {
+ return name
+ }
+ var escaped strings.Builder
+ switch scheme {
+ case NoEscaping:
+ return name
+ case UnderscoreEscaping:
+ if IsValidLegacyMetricName(LabelValue(name)) {
+ return name
+ }
+ for i, b := range name {
+ if isValidLegacyRune(b, i) {
+ escaped.WriteRune(b)
+ } else {
+ escaped.WriteRune('_')
+ }
+ }
+ return escaped.String()
+ case DotsEscaping:
+ // Do not early return for legacy valid names, we still escape underscores.
+ for i, b := range name {
+ if b == '_' {
+ escaped.WriteString("__")
+ } else if b == '.' {
+ escaped.WriteString("_dot_")
+ } else if isValidLegacyRune(b, i) {
+ escaped.WriteRune(b)
+ } else {
+ escaped.WriteRune('_')
+ }
+ }
+ return escaped.String()
+ case ValueEncodingEscaping:
+ if IsValidLegacyMetricName(LabelValue(name)) {
+ return name
+ }
+ escaped.WriteString("U__")
+ for i, b := range name {
+ if isValidLegacyRune(b, i) {
+ escaped.WriteRune(b)
+ } else if !utf8.ValidRune(b) {
+ escaped.WriteString("_FFFD_")
+ } else if b < 0x100 {
+ escaped.WriteRune('_')
+ for s := 4; s >= 0; s -= 4 {
+ escaped.WriteByte(lowerhex[b>>uint(s)&0xF])
+ }
+ escaped.WriteRune('_')
+ } else if b < 0x10000 {
+ escaped.WriteRune('_')
+ for s := 12; s >= 0; s -= 4 {
+ escaped.WriteByte(lowerhex[b>>uint(s)&0xF])
+ }
+ escaped.WriteRune('_')
+ }
+ }
+ return escaped.String()
+ default:
+ panic(fmt.Sprintf("invalid escaping scheme %d", scheme))
+ }
+}
+
+// lower function taken from strconv.atoi
+func lower(c byte) byte {
+ return c | ('x' - 'X')
+}
+
+// UnescapeName unescapes the incoming name according to the provided escaping
+// scheme if possible. Some schemes are partially or totally non-roundtripable.
+// If any error is enountered, returns the original input.
+func UnescapeName(name string, scheme EscapingScheme) string {
+ if len(name) == 0 {
+ return name
+ }
+ switch scheme {
+ case NoEscaping:
+ return name
+ case UnderscoreEscaping:
+ // It is not possible to unescape from underscore replacement.
+ return name
+ case DotsEscaping:
+ name = strings.ReplaceAll(name, "_dot_", ".")
+ name = strings.ReplaceAll(name, "__", "_")
+ return name
+ case ValueEncodingEscaping:
+ escapedName, found := strings.CutPrefix(name, "U__")
+ if !found {
+ return name
+ }
+
+ var unescaped strings.Builder
+ TOP:
+ for i := 0; i < len(escapedName); i++ {
+ // All non-underscores are treated normally.
+ if escapedName[i] != '_' {
+ unescaped.WriteByte(escapedName[i])
+ continue
+ }
+ i++
+ if i >= len(escapedName) {
+ return name
+ }
+ // A double underscore is a single underscore.
+ if escapedName[i] == '_' {
+ unescaped.WriteByte('_')
+ continue
+ }
+ // We think we are in a UTF-8 code, process it.
+ var utf8Val uint
+ for j := 0; i < len(escapedName); j++ {
+ // This is too many characters for a utf8 value.
+ if j > 4 {
+ return name
+ }
+ // Found a closing underscore, convert to a rune, check validity, and append.
+ if escapedName[i] == '_' {
+ utf8Rune := rune(utf8Val)
+ if !utf8.ValidRune(utf8Rune) {
+ return name
+ }
+ unescaped.WriteRune(utf8Rune)
+ continue TOP
+ }
+ r := lower(escapedName[i])
+ utf8Val *= 16
+ if r >= '0' && r <= '9' {
+ utf8Val += uint(r) - '0'
+ } else if r >= 'a' && r <= 'f' {
+ utf8Val += uint(r) - 'a' + 10
+ } else {
+ return name
+ }
+ i++
+ }
+ // Didn't find closing underscore, invalid.
+ return name
+ }
+ return unescaped.String()
+ default:
+ panic(fmt.Sprintf("invalid escaping scheme %d", scheme))
+ }
+}
+
+func isValidLegacyRune(b rune, i int) bool {
+ return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || b == ':' || (b >= '0' && b <= '9' && i > 0)
+}
+
+func (e EscapingScheme) String() string {
+ switch e {
+ case NoEscaping:
+ return AllowUTF8
+ case UnderscoreEscaping:
+ return EscapeUnderscores
+ case DotsEscaping:
+ return EscapeDots
+ case ValueEncodingEscaping:
+ return EscapeValues
+ default:
+ panic(fmt.Sprintf("unknown format scheme %d", e))
+ }
+}
+
+func ToEscapingScheme(s string) (EscapingScheme, error) {
+ if s == "" {
+ return NoEscaping, fmt.Errorf("got empty string instead of escaping scheme")
+ }
+ switch s {
+ case AllowUTF8:
+ return NoEscaping, nil
+ case EscapeUnderscores:
+ return UnderscoreEscaping, nil
+ case EscapeDots:
+ return DotsEscaping, nil
+ case EscapeValues:
+ return ValueEncodingEscaping, nil
+ default:
+ return NoEscaping, fmt.Errorf("unknown format scheme " + s)
+ }
+}
diff --git a/vendor/github.com/prometheus/common/model/signature.go b/vendor/github.com/prometheus/common/model/signature.go
index 8762b13c63..dc8a0026c4 100644
--- a/vendor/github.com/prometheus/common/model/signature.go
+++ b/vendor/github.com/prometheus/common/model/signature.go
@@ -22,10 +22,8 @@ import (
// when calculating their combined hash value (aka signature aka fingerprint).
const SeparatorByte byte = 255
-var (
- // cache the signature of an empty label set.
- emptyLabelSignature = hashNew()
-)
+// cache the signature of an empty label set.
+var emptyLabelSignature = hashNew()
// LabelsToSignature returns a quasi-unique signature (i.e., fingerprint) for a
// given label set. (Collisions are possible but unlikely if the number of label
diff --git a/vendor/github.com/prometheus/common/model/silence.go b/vendor/github.com/prometheus/common/model/silence.go
index bb99889d2c..910b0b71fc 100644
--- a/vendor/github.com/prometheus/common/model/silence.go
+++ b/vendor/github.com/prometheus/common/model/silence.go
@@ -81,7 +81,7 @@ func (s *Silence) Validate() error {
}
for _, m := range s.Matchers {
if err := m.Validate(); err != nil {
- return fmt.Errorf("invalid matcher: %s", err)
+ return fmt.Errorf("invalid matcher: %w", err)
}
}
if s.StartsAt.IsZero() {
diff --git a/vendor/github.com/prometheus/common/model/value.go b/vendor/github.com/prometheus/common/model/value.go
index 9eb440413f..8050637d82 100644
--- a/vendor/github.com/prometheus/common/model/value.go
+++ b/vendor/github.com/prometheus/common/model/value.go
@@ -21,14 +21,12 @@ import (
"strings"
)
-var (
- // ZeroSample is the pseudo zero-value of Sample used to signal a
- // non-existing sample. It is a Sample with timestamp Earliest, value 0.0,
- // and metric nil. Note that the natural zero value of Sample has a timestamp
- // of 0, which is possible to appear in a real Sample and thus not suitable
- // to signal a non-existing Sample.
- ZeroSample = Sample{Timestamp: Earliest}
-)
+// ZeroSample is the pseudo zero-value of Sample used to signal a
+// non-existing sample. It is a Sample with timestamp Earliest, value 0.0,
+// and metric nil. Note that the natural zero value of Sample has a timestamp
+// of 0, which is possible to appear in a real Sample and thus not suitable
+// to signal a non-existing Sample.
+var ZeroSample = Sample{Timestamp: Earliest}
// Sample is a sample pair associated with a metric. A single sample must either
// define Value or Histogram but not both. Histogram == nil implies the Value
@@ -274,7 +272,7 @@ func (s *Scalar) UnmarshalJSON(b []byte) error {
value, err := strconv.ParseFloat(f, 64)
if err != nil {
- return fmt.Errorf("error parsing sample value: %s", err)
+ return fmt.Errorf("error parsing sample value: %w", err)
}
s.Value = SampleValue(value)
return nil
diff --git a/vendor/github.com/prometheus/common/model/value_float.go b/vendor/github.com/prometheus/common/model/value_float.go
index 0f615a7053..ae35cc2ab4 100644
--- a/vendor/github.com/prometheus/common/model/value_float.go
+++ b/vendor/github.com/prometheus/common/model/value_float.go
@@ -20,14 +20,12 @@ import (
"strconv"
)
-var (
- // ZeroSamplePair is the pseudo zero-value of SamplePair used to signal a
- // non-existing sample pair. It is a SamplePair with timestamp Earliest and
- // value 0.0. Note that the natural zero value of SamplePair has a timestamp
- // of 0, which is possible to appear in a real SamplePair and thus not
- // suitable to signal a non-existing SamplePair.
- ZeroSamplePair = SamplePair{Timestamp: Earliest}
-)
+// ZeroSamplePair is the pseudo zero-value of SamplePair used to signal a
+// non-existing sample pair. It is a SamplePair with timestamp Earliest and
+// value 0.0. Note that the natural zero value of SamplePair has a timestamp
+// of 0, which is possible to appear in a real SamplePair and thus not
+// suitable to signal a non-existing SamplePair.
+var ZeroSamplePair = SamplePair{Timestamp: Earliest}
// A SampleValue is a representation of a value for a given sample at a given
// time.
diff --git a/vendor/github.com/prometheus/procfs/.golangci.yml b/vendor/github.com/prometheus/procfs/.golangci.yml
index a197699a1e..126df9e67a 100644
--- a/vendor/github.com/prometheus/procfs/.golangci.yml
+++ b/vendor/github.com/prometheus/procfs/.golangci.yml
@@ -1,8 +1,16 @@
---
linters:
enable:
+ - errcheck
- godot
+ - gosimple
+ - govet
+ - ineffassign
+ - misspell
- revive
+ - staticcheck
+ - testifylint
+ - unused
linter-settings:
godot:
@@ -10,3 +18,5 @@ linter-settings:
exclude:
# Ignore "See: URL"
- 'See:'
+ misspell:
+ locale: US
diff --git a/vendor/github.com/prometheus/procfs/MAINTAINERS.md b/vendor/github.com/prometheus/procfs/MAINTAINERS.md
index 56ba67d3e3..e00f3b365b 100644
--- a/vendor/github.com/prometheus/procfs/MAINTAINERS.md
+++ b/vendor/github.com/prometheus/procfs/MAINTAINERS.md
@@ -1,2 +1,3 @@
* Johannes 'fish' Ziemke @discordianfish
-* Paul Gier @pgier
+* Paul Gier @pgier
+* Ben Kochie @SuperQ
diff --git a/vendor/github.com/prometheus/procfs/Makefile.common b/vendor/github.com/prometheus/procfs/Makefile.common
index b111d25620..1617292350 100644
--- a/vendor/github.com/prometheus/procfs/Makefile.common
+++ b/vendor/github.com/prometheus/procfs/Makefile.common
@@ -49,23 +49,23 @@ endif
GOTEST := $(GO) test
GOTEST_DIR :=
ifneq ($(CIRCLE_JOB),)
-ifneq ($(shell which gotestsum),)
+ifneq ($(shell command -v gotestsum 2> /dev/null),)
GOTEST_DIR := test-results
GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml --
endif
endif
-PROMU_VERSION ?= 0.14.0
+PROMU_VERSION ?= 0.17.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
-GOLANGCI_LINT_VERSION ?= v1.51.2
-# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
+GOLANGCI_LINT_VERSION ?= v1.59.0
+# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
- ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
+ ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386 arm64))
# If we're in CI and there is an Actions file, that means the linter
# is being run in Actions, so we don't need to run it here.
ifneq (,$(SKIP_GOLANGCI_LINT))
@@ -169,16 +169,20 @@ common-vet:
common-lint: $(GOLANGCI_LINT)
ifdef GOLANGCI_LINT
@echo ">> running golangci-lint"
-# 'go list' needs to be executed before staticcheck to prepopulate the modules cache.
-# Otherwise staticcheck might fail randomly for some reason not yet explained.
- $(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null
$(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs)
endif
+.PHONY: common-lint-fix
+common-lint-fix: $(GOLANGCI_LINT)
+ifdef GOLANGCI_LINT
+ @echo ">> running golangci-lint fix"
+ $(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_OPTS) $(pkgs)
+endif
+
.PHONY: common-yamllint
common-yamllint:
@echo ">> running yamllint on all YAML files in the repository"
-ifeq (, $(shell which yamllint))
+ifeq (, $(shell command -v yamllint 2> /dev/null))
@echo "yamllint not installed so skipping"
else
yamllint .
@@ -204,6 +208,10 @@ common-tarball: promu
@echo ">> building release tarball"
$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)
+.PHONY: common-docker-repo-name
+common-docker-repo-name:
+ @echo "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)"
+
.PHONY: common-docker $(BUILD_DOCKER_ARCHS)
common-docker: $(BUILD_DOCKER_ARCHS)
$(BUILD_DOCKER_ARCHS): common-docker-%:
diff --git a/vendor/github.com/prometheus/procfs/README.md b/vendor/github.com/prometheus/procfs/README.md
index 43c37735a7..1224816c2a 100644
--- a/vendor/github.com/prometheus/procfs/README.md
+++ b/vendor/github.com/prometheus/procfs/README.md
@@ -51,11 +51,11 @@ ensure the `fixtures` directory is up to date by removing the existing directory
extracting the ttar file using `make fixtures/.unpacked` or just `make test`.
```bash
-rm -rf fixtures
+rm -rf testdata/fixtures
make test
```
Next, make the required changes to the extracted files in the `fixtures` directory. When
the changes are complete, run `make update_fixtures` to create a new `fixtures.ttar` file
based on the updated `fixtures` directory. And finally, verify the changes using
-`git diff fixtures.ttar`.
+`git diff testdata/fixtures.ttar`.
diff --git a/vendor/github.com/prometheus/procfs/arp.go b/vendor/github.com/prometheus/procfs/arp.go
index 68f36e888f..cdcc8a7ccc 100644
--- a/vendor/github.com/prometheus/procfs/arp.go
+++ b/vendor/github.com/prometheus/procfs/arp.go
@@ -55,7 +55,7 @@ type ARPEntry struct {
func (fs FS) GatherARPEntries() ([]ARPEntry, error) {
data, err := os.ReadFile(fs.proc.Path("net/arp"))
if err != nil {
- return nil, fmt.Errorf("error reading arp %q: %w", fs.proc.Path("net/arp"), err)
+ return nil, fmt.Errorf("%w: error reading arp %s: %w", ErrFileRead, fs.proc.Path("net/arp"), err)
}
return parseARPEntries(data)
@@ -78,11 +78,11 @@ func parseARPEntries(data []byte) ([]ARPEntry, error) {
} else if width == expectedDataWidth {
entry, err := parseARPEntry(columns)
if err != nil {
- return []ARPEntry{}, fmt.Errorf("failed to parse ARP entry: %w", err)
+ return []ARPEntry{}, fmt.Errorf("%w: Failed to parse ARP entry: %v: %w", ErrFileParse, entry, err)
}
entries = append(entries, entry)
} else {
- return []ARPEntry{}, fmt.Errorf("%d columns were detected, but %d were expected", width, expectedDataWidth)
+ return []ARPEntry{}, fmt.Errorf("%w: %d columns found, but expected %d: %w", ErrFileParse, width, expectedDataWidth, err)
}
}
diff --git a/vendor/github.com/prometheus/procfs/buddyinfo.go b/vendor/github.com/prometheus/procfs/buddyinfo.go
index f5b7939b26..8380750090 100644
--- a/vendor/github.com/prometheus/procfs/buddyinfo.go
+++ b/vendor/github.com/prometheus/procfs/buddyinfo.go
@@ -55,18 +55,18 @@ func parseBuddyInfo(r io.Reader) ([]BuddyInfo, error) {
parts := strings.Fields(line)
if len(parts) < 4 {
- return nil, fmt.Errorf("invalid number of fields when parsing buddyinfo")
+ return nil, fmt.Errorf("%w: Invalid number of fields, found: %v", ErrFileParse, parts)
}
- node := strings.TrimRight(parts[1], ",")
- zone := strings.TrimRight(parts[3], ",")
+ node := strings.TrimSuffix(parts[1], ",")
+ zone := strings.TrimSuffix(parts[3], ",")
arraySize := len(parts[4:])
if bucketCount == -1 {
bucketCount = arraySize
} else {
if bucketCount != arraySize {
- return nil, fmt.Errorf("mismatch in number of buddyinfo buckets, previous count %d, new count %d", bucketCount, arraySize)
+ return nil, fmt.Errorf("%w: mismatch in number of buddyinfo buckets, previous count %d, new count %d", ErrFileParse, bucketCount, arraySize)
}
}
@@ -74,7 +74,7 @@ func parseBuddyInfo(r io.Reader) ([]BuddyInfo, error) {
for i := 0; i < arraySize; i++ {
sizes[i], err = strconv.ParseFloat(parts[i+4], 64)
if err != nil {
- return nil, fmt.Errorf("invalid value in buddyinfo: %w", err)
+ return nil, fmt.Errorf("%w: Invalid valid in buddyinfo: %f: %w", ErrFileParse, sizes[i], err)
}
}
diff --git a/vendor/github.com/prometheus/procfs/cpuinfo.go b/vendor/github.com/prometheus/procfs/cpuinfo.go
index 06968ca2ed..f0950bb495 100644
--- a/vendor/github.com/prometheus/procfs/cpuinfo.go
+++ b/vendor/github.com/prometheus/procfs/cpuinfo.go
@@ -79,7 +79,7 @@ func parseCPUInfoX86(info []byte) ([]CPUInfo, error) {
// find the first "processor" line
firstLine := firstNonEmptyLine(scanner)
if !strings.HasPrefix(firstLine, "processor") || !strings.Contains(firstLine, ":") {
- return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine)
+ return nil, fmt.Errorf("%w: Cannot parse line: %q", ErrFileParse, firstLine)
}
field := strings.SplitN(firstLine, ": ", 2)
v, err := strconv.ParseUint(field[1], 0, 32)
@@ -192,9 +192,10 @@ func parseCPUInfoARM(info []byte) ([]CPUInfo, error) {
scanner := bufio.NewScanner(bytes.NewReader(info))
firstLine := firstNonEmptyLine(scanner)
- match, _ := regexp.MatchString("^[Pp]rocessor", firstLine)
+ match, err := regexp.MatchString("^[Pp]rocessor", firstLine)
if !match || !strings.Contains(firstLine, ":") {
- return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine)
+ return nil, fmt.Errorf("%w: Cannot parse line: %q: %w", ErrFileParse, firstLine, err)
+
}
field := strings.SplitN(firstLine, ": ", 2)
cpuinfo := []CPUInfo{}
@@ -258,7 +259,7 @@ func parseCPUInfoS390X(info []byte) ([]CPUInfo, error) {
firstLine := firstNonEmptyLine(scanner)
if !strings.HasPrefix(firstLine, "vendor_id") || !strings.Contains(firstLine, ":") {
- return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine)
+ return nil, fmt.Errorf("%w: Cannot parse line: %q", ErrFileParse, firstLine)
}
field := strings.SplitN(firstLine, ": ", 2)
cpuinfo := []CPUInfo{}
@@ -283,7 +284,7 @@ func parseCPUInfoS390X(info []byte) ([]CPUInfo, error) {
if strings.HasPrefix(line, "processor") {
match := cpuinfoS390XProcessorRegexp.FindStringSubmatch(line)
if len(match) < 2 {
- return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine)
+ return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine)
}
cpu := commonCPUInfo
v, err := strconv.ParseUint(match[1], 0, 32)
@@ -343,7 +344,7 @@ func parseCPUInfoMips(info []byte) ([]CPUInfo, error) {
// find the first "processor" line
firstLine := firstNonEmptyLine(scanner)
if !strings.HasPrefix(firstLine, "system type") || !strings.Contains(firstLine, ":") {
- return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine)
+ return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine)
}
field := strings.SplitN(firstLine, ": ", 2)
cpuinfo := []CPUInfo{}
@@ -385,7 +386,7 @@ func parseCPUInfoLoong(info []byte) ([]CPUInfo, error) {
// find the first "processor" line
firstLine := firstNonEmptyLine(scanner)
if !strings.HasPrefix(firstLine, "system type") || !strings.Contains(firstLine, ":") {
- return nil, errors.New("invalid cpuinfo file: " + firstLine)
+ return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine)
}
field := strings.SplitN(firstLine, ": ", 2)
cpuinfo := []CPUInfo{}
@@ -421,7 +422,7 @@ func parseCPUInfoPPC(info []byte) ([]CPUInfo, error) {
firstLine := firstNonEmptyLine(scanner)
if !strings.HasPrefix(firstLine, "processor") || !strings.Contains(firstLine, ":") {
- return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine)
+ return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine)
}
field := strings.SplitN(firstLine, ": ", 2)
v, err := strconv.ParseUint(field[1], 0, 32)
@@ -466,7 +467,7 @@ func parseCPUInfoRISCV(info []byte) ([]CPUInfo, error) {
firstLine := firstNonEmptyLine(scanner)
if !strings.HasPrefix(firstLine, "processor") || !strings.Contains(firstLine, ":") {
- return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine)
+ return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine)
}
field := strings.SplitN(firstLine, ": ", 2)
v, err := strconv.ParseUint(field[1], 0, 32)
diff --git a/vendor/github.com/prometheus/procfs/crypto.go b/vendor/github.com/prometheus/procfs/crypto.go
index 5048ad1f21..5f2a37a78b 100644
--- a/vendor/github.com/prometheus/procfs/crypto.go
+++ b/vendor/github.com/prometheus/procfs/crypto.go
@@ -55,12 +55,13 @@ func (fs FS) Crypto() ([]Crypto, error) {
path := fs.proc.Path("crypto")
b, err := util.ReadFileNoStat(path)
if err != nil {
- return nil, fmt.Errorf("error reading crypto %q: %w", path, err)
+ return nil, fmt.Errorf("%w: Cannot read file %v: %w", ErrFileRead, b, err)
+
}
crypto, err := parseCrypto(bytes.NewReader(b))
if err != nil {
- return nil, fmt.Errorf("error parsing crypto %q: %w", path, err)
+ return nil, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, crypto, err)
}
return crypto, nil
@@ -83,7 +84,7 @@ func parseCrypto(r io.Reader) ([]Crypto, error) {
kv := strings.Split(text, ":")
if len(kv) != 2 {
- return nil, fmt.Errorf("malformed crypto line: %q", text)
+ return nil, fmt.Errorf("%w: Cannot parse line: %q", ErrFileParse, text)
}
k := strings.TrimSpace(kv[0])
diff --git a/vendor/github.com/prometheus/procfs/fs.go b/vendor/github.com/prometheus/procfs/fs.go
index 60c551e026..4980c875bf 100644
--- a/vendor/github.com/prometheus/procfs/fs.go
+++ b/vendor/github.com/prometheus/procfs/fs.go
@@ -20,8 +20,8 @@ import (
// FS represents the pseudo-filesystem sys, which provides an interface to
// kernel data structures.
type FS struct {
- proc fs.FS
- real bool
+ proc fs.FS
+ isReal bool
}
// DefaultMountPoint is the common mount point of the proc filesystem.
@@ -41,10 +41,10 @@ func NewFS(mountPoint string) (FS, error) {
return FS{}, err
}
- real, err := isRealProc(mountPoint)
+ isReal, err := isRealProc(mountPoint)
if err != nil {
return FS{}, err
}
- return FS{fs, real}, nil
+ return FS{fs, isReal}, nil
}
diff --git a/vendor/github.com/prometheus/procfs/fs_statfs_notype.go b/vendor/github.com/prometheus/procfs/fs_statfs_notype.go
index 8005769689..134767d69a 100644
--- a/vendor/github.com/prometheus/procfs/fs_statfs_notype.go
+++ b/vendor/github.com/prometheus/procfs/fs_statfs_notype.go
@@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-//go:build netbsd || openbsd || solaris || windows
-// +build netbsd openbsd solaris windows
+//go:build !freebsd && !linux
+// +build !freebsd,!linux
package procfs
diff --git a/vendor/github.com/prometheus/procfs/fs_statfs_type.go b/vendor/github.com/prometheus/procfs/fs_statfs_type.go
index 6233217ad2..80df79c319 100644
--- a/vendor/github.com/prometheus/procfs/fs_statfs_type.go
+++ b/vendor/github.com/prometheus/procfs/fs_statfs_type.go
@@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-//go:build !netbsd && !openbsd && !solaris && !windows
-// +build !netbsd,!openbsd,!solaris,!windows
+//go:build freebsd || linux
+// +build freebsd linux
package procfs
diff --git a/vendor/github.com/prometheus/procfs/fscache.go b/vendor/github.com/prometheus/procfs/fscache.go
index f8070e6e2b..cf2e3eaa03 100644
--- a/vendor/github.com/prometheus/procfs/fscache.go
+++ b/vendor/github.com/prometheus/procfs/fscache.go
@@ -236,7 +236,7 @@ func (fs FS) Fscacheinfo() (Fscacheinfo, error) {
m, err := parseFscacheinfo(bytes.NewReader(b))
if err != nil {
- return Fscacheinfo{}, fmt.Errorf("failed to parse Fscacheinfo: %w", err)
+ return Fscacheinfo{}, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, m, err)
}
return *m, nil
@@ -245,7 +245,7 @@ func (fs FS) Fscacheinfo() (Fscacheinfo, error) {
func setFSCacheFields(fields []string, setFields ...*uint64) error {
var err error
if len(fields) < len(setFields) {
- return fmt.Errorf("Insufficient number of fields, expected %v, got %v", len(setFields), len(fields))
+ return fmt.Errorf("%w: Expected %d, but got %d: %w", ErrFileParse, len(setFields), len(fields), err)
}
for i := range setFields {
@@ -263,7 +263,7 @@ func parseFscacheinfo(r io.Reader) (*Fscacheinfo, error) {
for s.Scan() {
fields := strings.Fields(s.Text())
if len(fields) < 2 {
- return nil, fmt.Errorf("malformed Fscacheinfo line: %q", s.Text())
+ return nil, fmt.Errorf("%w: malformed Fscacheinfo line: %q", ErrFileParse, s.Text())
}
switch fields[0] {
diff --git a/vendor/github.com/prometheus/procfs/ipvs.go b/vendor/github.com/prometheus/procfs/ipvs.go
index 391c07957e..bc3a20c932 100644
--- a/vendor/github.com/prometheus/procfs/ipvs.go
+++ b/vendor/github.com/prometheus/procfs/ipvs.go
@@ -221,15 +221,16 @@ func parseIPPort(s string) (net.IP, uint16, error) {
case 46:
ip = net.ParseIP(s[1:40])
if ip == nil {
- return nil, 0, fmt.Errorf("invalid IPv6 address: %s", s[1:40])
+ return nil, 0, fmt.Errorf("%w: Invalid IPv6 addr %s: %w", ErrFileParse, s[1:40], err)
}
default:
- return nil, 0, fmt.Errorf("unexpected IP:Port: %s", s)
+ return nil, 0, fmt.Errorf("%w: Unexpected IP:Port %s: %w", ErrFileParse, s, err)
}
portString := s[len(s)-4:]
if len(portString) != 4 {
- return nil, 0, fmt.Errorf("unexpected port string format: %s", portString)
+ return nil, 0,
+ fmt.Errorf("%w: Unexpected port string format %s: %w", ErrFileParse, portString, err)
}
port, err := strconv.ParseUint(portString, 16, 16)
if err != nil {
diff --git a/vendor/github.com/prometheus/procfs/loadavg.go b/vendor/github.com/prometheus/procfs/loadavg.go
index 0096cafbdf..332e76c17f 100644
--- a/vendor/github.com/prometheus/procfs/loadavg.go
+++ b/vendor/github.com/prometheus/procfs/loadavg.go
@@ -44,14 +44,14 @@ func parseLoad(loadavgBytes []byte) (*LoadAvg, error) {
loads := make([]float64, 3)
parts := strings.Fields(string(loadavgBytes))
if len(parts) < 3 {
- return nil, fmt.Errorf("malformed loadavg line: too few fields in loadavg string: %q", string(loadavgBytes))
+ return nil, fmt.Errorf("%w: Malformed line %q", ErrFileParse, string(loadavgBytes))
}
var err error
for i, load := range parts[0:3] {
loads[i], err = strconv.ParseFloat(load, 64)
if err != nil {
- return nil, fmt.Errorf("could not parse load %q: %w", load, err)
+ return nil, fmt.Errorf("%w: Cannot parse load: %f: %w", ErrFileParse, loads[i], err)
}
}
return &LoadAvg{
diff --git a/vendor/github.com/prometheus/procfs/mdstat.go b/vendor/github.com/prometheus/procfs/mdstat.go
index a95c889cb9..67a9d2b448 100644
--- a/vendor/github.com/prometheus/procfs/mdstat.go
+++ b/vendor/github.com/prometheus/procfs/mdstat.go
@@ -23,7 +23,7 @@ import (
var (
statusLineRE = regexp.MustCompile(`(\d+) blocks .*\[(\d+)/(\d+)\] \[([U_]+)\]`)
- recoveryLineBlocksRE = regexp.MustCompile(`\((\d+)/\d+\)`)
+ recoveryLineBlocksRE = regexp.MustCompile(`\((\d+/\d+)\)`)
recoveryLinePctRE = regexp.MustCompile(`= (.+)%`)
recoveryLineFinishRE = regexp.MustCompile(`finish=(.+)min`)
recoveryLineSpeedRE = regexp.MustCompile(`speed=(.+)[A-Z]`)
@@ -50,6 +50,8 @@ type MDStat struct {
BlocksTotal int64
// Number of blocks on the device that are in sync.
BlocksSynced int64
+ // Number of blocks on the device that need to be synced.
+ BlocksToBeSynced int64
// progress percentage of current sync
BlocksSyncedPct float64
// estimated finishing time for current sync (in minutes)
@@ -70,7 +72,7 @@ func (fs FS) MDStat() ([]MDStat, error) {
}
mdstat, err := parseMDStat(data)
if err != nil {
- return nil, fmt.Errorf("error parsing mdstat %q: %w", fs.proc.Path("mdstat"), err)
+ return nil, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, fs.proc.Path("mdstat"), err)
}
return mdstat, nil
}
@@ -90,13 +92,13 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
deviceFields := strings.Fields(line)
if len(deviceFields) < 3 {
- return nil, fmt.Errorf("not enough fields in mdline (expected at least 3): %s", line)
+ return nil, fmt.Errorf("%w: Expected 3+ lines, got %q", ErrFileParse, line)
}
mdName := deviceFields[0] // mdx
state := deviceFields[2] // active or inactive
if len(lines) <= i+3 {
- return nil, fmt.Errorf("error parsing %q: too few lines for md device", mdName)
+ return nil, fmt.Errorf("%w: Too few lines for md device: %q", ErrFileParse, mdName)
}
// Failed disks have the suffix (F) & Spare disks have the suffix (S).
@@ -105,7 +107,7 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
active, total, down, size, err := evalStatusLine(lines[i], lines[i+1])
if err != nil {
- return nil, fmt.Errorf("error parsing md device lines: %w", err)
+ return nil, fmt.Errorf("%w: Cannot parse md device lines: %v: %w", ErrFileParse, active, err)
}
syncLineIdx := i + 2
@@ -115,7 +117,8 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
// If device is syncing at the moment, get the number of currently
// synced bytes, otherwise that number equals the size of the device.
- syncedBlocks := size
+ blocksSynced := size
+ blocksToBeSynced := size
speed := float64(0)
finish := float64(0)
pct := float64(0)
@@ -136,11 +139,11 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
// Handle case when resync=PENDING or resync=DELAYED.
if strings.Contains(lines[syncLineIdx], "PENDING") ||
strings.Contains(lines[syncLineIdx], "DELAYED") {
- syncedBlocks = 0
+ blocksSynced = 0
} else {
- syncedBlocks, pct, finish, speed, err = evalRecoveryLine(lines[syncLineIdx])
+ blocksSynced, blocksToBeSynced, pct, finish, speed, err = evalRecoveryLine(lines[syncLineIdx])
if err != nil {
- return nil, fmt.Errorf("error parsing sync line in md device %q: %w", mdName, err)
+ return nil, fmt.Errorf("%w: Cannot parse sync line in md device: %q: %w", ErrFileParse, mdName, err)
}
}
}
@@ -154,7 +157,8 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
DisksSpare: spare,
DisksTotal: total,
BlocksTotal: size,
- BlocksSynced: syncedBlocks,
+ BlocksSynced: blocksSynced,
+ BlocksToBeSynced: blocksToBeSynced,
BlocksSyncedPct: pct,
BlocksSyncedFinishTime: finish,
BlocksSyncedSpeed: speed,
@@ -168,13 +172,13 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
func evalStatusLine(deviceLine, statusLine string) (active, total, down, size int64, err error) {
statusFields := strings.Fields(statusLine)
if len(statusFields) < 1 {
- return 0, 0, 0, 0, fmt.Errorf("unexpected statusLine %q", statusLine)
+ return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
}
sizeStr := statusFields[0]
size, err = strconv.ParseInt(sizeStr, 10, 64)
if err != nil {
- return 0, 0, 0, 0, fmt.Errorf("unexpected statusLine %q: %w", statusLine, err)
+ return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
}
if strings.Contains(deviceLine, "raid0") || strings.Contains(deviceLine, "linear") {
@@ -189,65 +193,71 @@ func evalStatusLine(deviceLine, statusLine string) (active, total, down, size in
matches := statusLineRE.FindStringSubmatch(statusLine)
if len(matches) != 5 {
- return 0, 0, 0, 0, fmt.Errorf("couldn't find all the substring matches: %s", statusLine)
+ return 0, 0, 0, 0, fmt.Errorf("%w: Could not fild all substring matches %s: %w", ErrFileParse, statusLine, err)
}
total, err = strconv.ParseInt(matches[2], 10, 64)
if err != nil {
- return 0, 0, 0, 0, fmt.Errorf("unexpected statusLine %q: %w", statusLine, err)
+ return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
}
active, err = strconv.ParseInt(matches[3], 10, 64)
if err != nil {
- return 0, 0, 0, 0, fmt.Errorf("unexpected statusLine %q: %w", statusLine, err)
+ return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected active %d: %w", ErrFileParse, active, err)
}
down = int64(strings.Count(matches[4], "_"))
return active, total, down, size, nil
}
-func evalRecoveryLine(recoveryLine string) (syncedBlocks int64, pct float64, finish float64, speed float64, err error) {
+func evalRecoveryLine(recoveryLine string) (blocksSynced int64, blocksToBeSynced int64, pct float64, finish float64, speed float64, err error) {
matches := recoveryLineBlocksRE.FindStringSubmatch(recoveryLine)
if len(matches) != 2 {
- return 0, 0, 0, 0, fmt.Errorf("unexpected recoveryLine: %s", recoveryLine)
+ return 0, 0, 0, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine blocks %s: %w", ErrFileParse, recoveryLine, err)
}
- syncedBlocks, err = strconv.ParseInt(matches[1], 10, 64)
+ blocks := strings.Split(matches[1], "/")
+ blocksSynced, err = strconv.ParseInt(blocks[0], 10, 64)
if err != nil {
- return 0, 0, 0, 0, fmt.Errorf("error parsing int from recoveryLine %q: %w", recoveryLine, err)
+ return 0, 0, 0, 0, 0, fmt.Errorf("%w: Unable to parse recovery blocks synced %q: %w", ErrFileParse, matches[1], err)
+ }
+
+ blocksToBeSynced, err = strconv.ParseInt(blocks[1], 10, 64)
+ if err != nil {
+ return blocksSynced, 0, 0, 0, 0, fmt.Errorf("%w: Unable to parse recovery to be synced blocks %q: %w", ErrFileParse, matches[2], err)
}
// Get percentage complete
matches = recoveryLinePctRE.FindStringSubmatch(recoveryLine)
if len(matches) != 2 {
- return syncedBlocks, 0, 0, 0, fmt.Errorf("unexpected recoveryLine matching percentage: %s", recoveryLine)
+ return blocksSynced, blocksToBeSynced, 0, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine matching percentage %s", ErrFileParse, recoveryLine)
}
pct, err = strconv.ParseFloat(strings.TrimSpace(matches[1]), 64)
if err != nil {
- return syncedBlocks, 0, 0, 0, fmt.Errorf("error parsing float from recoveryLine %q: %w", recoveryLine, err)
+ return blocksSynced, blocksToBeSynced, 0, 0, 0, fmt.Errorf("%w: Error parsing float from recoveryLine %q", ErrFileParse, recoveryLine)
}
// Get time expected left to complete
matches = recoveryLineFinishRE.FindStringSubmatch(recoveryLine)
if len(matches) != 2 {
- return syncedBlocks, pct, 0, 0, fmt.Errorf("unexpected recoveryLine matching est. finish time: %s", recoveryLine)
+ return blocksSynced, blocksToBeSynced, pct, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine matching est. finish time: %s", ErrFileParse, recoveryLine)
}
finish, err = strconv.ParseFloat(matches[1], 64)
if err != nil {
- return syncedBlocks, pct, 0, 0, fmt.Errorf("error parsing float from recoveryLine %q: %w", recoveryLine, err)
+ return blocksSynced, blocksToBeSynced, pct, 0, 0, fmt.Errorf("%w: Unable to parse float from recoveryLine: %q", ErrFileParse, recoveryLine)
}
// Get recovery speed
matches = recoveryLineSpeedRE.FindStringSubmatch(recoveryLine)
if len(matches) != 2 {
- return syncedBlocks, pct, finish, 0, fmt.Errorf("unexpected recoveryLine matching speed: %s", recoveryLine)
+ return blocksSynced, blocksToBeSynced, pct, finish, 0, fmt.Errorf("%w: Unexpected recoveryLine value: %s", ErrFileParse, recoveryLine)
}
speed, err = strconv.ParseFloat(matches[1], 64)
if err != nil {
- return syncedBlocks, pct, finish, 0, fmt.Errorf("error parsing float from recoveryLine %q: %w", recoveryLine, err)
+ return blocksSynced, blocksToBeSynced, pct, finish, 0, fmt.Errorf("%w: Error parsing float from recoveryLine: %q: %w", ErrFileParse, recoveryLine, err)
}
- return syncedBlocks, pct, finish, speed, nil
+ return blocksSynced, blocksToBeSynced, pct, finish, speed, nil
}
func evalComponentDevices(deviceFields []string) []string {
diff --git a/vendor/github.com/prometheus/procfs/meminfo.go b/vendor/github.com/prometheus/procfs/meminfo.go
index f65e174e57..4b2c4050a3 100644
--- a/vendor/github.com/prometheus/procfs/meminfo.go
+++ b/vendor/github.com/prometheus/procfs/meminfo.go
@@ -126,6 +126,7 @@ type Meminfo struct {
VmallocUsed *uint64
// largest contiguous block of vmalloc area which is free
VmallocChunk *uint64
+ Percpu *uint64
HardwareCorrupted *uint64
AnonHugePages *uint64
ShmemHugePages *uint64
@@ -140,6 +141,55 @@ type Meminfo struct {
DirectMap4k *uint64
DirectMap2M *uint64
DirectMap1G *uint64
+
+ // The struct fields below are the byte-normalized counterparts to the
+ // existing struct fields. Values are normalized using the optional
+ // unit field in the meminfo line.
+ MemTotalBytes *uint64
+ MemFreeBytes *uint64
+ MemAvailableBytes *uint64
+ BuffersBytes *uint64
+ CachedBytes *uint64
+ SwapCachedBytes *uint64
+ ActiveBytes *uint64
+ InactiveBytes *uint64
+ ActiveAnonBytes *uint64
+ InactiveAnonBytes *uint64
+ ActiveFileBytes *uint64
+ InactiveFileBytes *uint64
+ UnevictableBytes *uint64
+ MlockedBytes *uint64
+ SwapTotalBytes *uint64
+ SwapFreeBytes *uint64
+ DirtyBytes *uint64
+ WritebackBytes *uint64
+ AnonPagesBytes *uint64
+ MappedBytes *uint64
+ ShmemBytes *uint64
+ SlabBytes *uint64
+ SReclaimableBytes *uint64
+ SUnreclaimBytes *uint64
+ KernelStackBytes *uint64
+ PageTablesBytes *uint64
+ NFSUnstableBytes *uint64
+ BounceBytes *uint64
+ WritebackTmpBytes *uint64
+ CommitLimitBytes *uint64
+ CommittedASBytes *uint64
+ VmallocTotalBytes *uint64
+ VmallocUsedBytes *uint64
+ VmallocChunkBytes *uint64
+ PercpuBytes *uint64
+ HardwareCorruptedBytes *uint64
+ AnonHugePagesBytes *uint64
+ ShmemHugePagesBytes *uint64
+ ShmemPmdMappedBytes *uint64
+ CmaTotalBytes *uint64
+ CmaFreeBytes *uint64
+ HugepagesizeBytes *uint64
+ DirectMap4kBytes *uint64
+ DirectMap2MBytes *uint64
+ DirectMap1GBytes *uint64
}
// Meminfo returns an information about current kernel/system memory statistics.
@@ -152,7 +202,7 @@ func (fs FS) Meminfo() (Meminfo, error) {
m, err := parseMemInfo(bytes.NewReader(b))
if err != nil {
- return Meminfo{}, fmt.Errorf("failed to parse meminfo: %w", err)
+ return Meminfo{}, fmt.Errorf("%w: %w", ErrFileParse, err)
}
return *m, nil
@@ -162,114 +212,176 @@ func parseMemInfo(r io.Reader) (*Meminfo, error) {
var m Meminfo
s := bufio.NewScanner(r)
for s.Scan() {
- // Each line has at least a name and value; we ignore the unit.
fields := strings.Fields(s.Text())
- if len(fields) < 2 {
- return nil, fmt.Errorf("malformed meminfo line: %q", s.Text())
- }
+ var val, valBytes uint64
- v, err := strconv.ParseUint(fields[1], 0, 64)
+ val, err := strconv.ParseUint(fields[1], 0, 64)
if err != nil {
return nil, err
}
+ switch len(fields) {
+ case 2:
+ // No unit present, use the parsed the value as bytes directly.
+ valBytes = val
+ case 3:
+ // Unit present in optional 3rd field, convert it to
+ // bytes. The only unit supported within the Linux
+ // kernel is `kB`.
+ if fields[2] != "kB" {
+ return nil, fmt.Errorf("%w: Unsupported unit in optional 3rd field %q", ErrFileParse, fields[2])
+ }
+
+ valBytes = 1024 * val
+
+ default:
+ return nil, fmt.Errorf("%w: Malformed line %q", ErrFileParse, s.Text())
+ }
+
switch fields[0] {
case "MemTotal:":
- m.MemTotal = &v
+ m.MemTotal = &val
+ m.MemTotalBytes = &valBytes
case "MemFree:":
- m.MemFree = &v
+ m.MemFree = &val
+ m.MemFreeBytes = &valBytes
case "MemAvailable:":
- m.MemAvailable = &v
+ m.MemAvailable = &val
+ m.MemAvailableBytes = &valBytes
case "Buffers:":
- m.Buffers = &v
+ m.Buffers = &val
+ m.BuffersBytes = &valBytes
case "Cached:":
- m.Cached = &v
+ m.Cached = &val
+ m.CachedBytes = &valBytes
case "SwapCached:":
- m.SwapCached = &v
+ m.SwapCached = &val
+ m.SwapCachedBytes = &valBytes
case "Active:":
- m.Active = &v
+ m.Active = &val
+ m.ActiveBytes = &valBytes
case "Inactive:":
- m.Inactive = &v
+ m.Inactive = &val
+ m.InactiveBytes = &valBytes
case "Active(anon):":
- m.ActiveAnon = &v
+ m.ActiveAnon = &val
+ m.ActiveAnonBytes = &valBytes
case "Inactive(anon):":
- m.InactiveAnon = &v
+ m.InactiveAnon = &val
+ m.InactiveAnonBytes = &valBytes
case "Active(file):":
- m.ActiveFile = &v
+ m.ActiveFile = &val
+ m.ActiveFileBytes = &valBytes
case "Inactive(file):":
- m.InactiveFile = &v
+ m.InactiveFile = &val
+ m.InactiveFileBytes = &valBytes
case "Unevictable:":
- m.Unevictable = &v
+ m.Unevictable = &val
+ m.UnevictableBytes = &valBytes
case "Mlocked:":
- m.Mlocked = &v
+ m.Mlocked = &val
+ m.MlockedBytes = &valBytes
case "SwapTotal:":
- m.SwapTotal = &v
+ m.SwapTotal = &val
+ m.SwapTotalBytes = &valBytes
case "SwapFree:":
- m.SwapFree = &v
+ m.SwapFree = &val
+ m.SwapFreeBytes = &valBytes
case "Dirty:":
- m.Dirty = &v
+ m.Dirty = &val
+ m.DirtyBytes = &valBytes
case "Writeback:":
- m.Writeback = &v
+ m.Writeback = &val
+ m.WritebackBytes = &valBytes
case "AnonPages:":
- m.AnonPages = &v
+ m.AnonPages = &val
+ m.AnonPagesBytes = &valBytes
case "Mapped:":
- m.Mapped = &v
+ m.Mapped = &val
+ m.MappedBytes = &valBytes
case "Shmem:":
- m.Shmem = &v
+ m.Shmem = &val
+ m.ShmemBytes = &valBytes
case "Slab:":
- m.Slab = &v
+ m.Slab = &val
+ m.SlabBytes = &valBytes
case "SReclaimable:":
- m.SReclaimable = &v
+ m.SReclaimable = &val
+ m.SReclaimableBytes = &valBytes
case "SUnreclaim:":
- m.SUnreclaim = &v
+ m.SUnreclaim = &val
+ m.SUnreclaimBytes = &valBytes
case "KernelStack:":
- m.KernelStack = &v
+ m.KernelStack = &val
+ m.KernelStackBytes = &valBytes
case "PageTables:":
- m.PageTables = &v
+ m.PageTables = &val
+ m.PageTablesBytes = &valBytes
case "NFS_Unstable:":
- m.NFSUnstable = &v
+ m.NFSUnstable = &val
+ m.NFSUnstableBytes = &valBytes
case "Bounce:":
- m.Bounce = &v
+ m.Bounce = &val
+ m.BounceBytes = &valBytes
case "WritebackTmp:":
- m.WritebackTmp = &v
+ m.WritebackTmp = &val
+ m.WritebackTmpBytes = &valBytes
case "CommitLimit:":
- m.CommitLimit = &v
+ m.CommitLimit = &val
+ m.CommitLimitBytes = &valBytes
case "Committed_AS:":
- m.CommittedAS = &v
+ m.CommittedAS = &val
+ m.CommittedASBytes = &valBytes
case "VmallocTotal:":
- m.VmallocTotal = &v
+ m.VmallocTotal = &val
+ m.VmallocTotalBytes = &valBytes
case "VmallocUsed:":
- m.VmallocUsed = &v
+ m.VmallocUsed = &val
+ m.VmallocUsedBytes = &valBytes
case "VmallocChunk:":
- m.VmallocChunk = &v
+ m.VmallocChunk = &val
+ m.VmallocChunkBytes = &valBytes
+ case "Percpu:":
+ m.Percpu = &val
+ m.PercpuBytes = &valBytes
case "HardwareCorrupted:":
- m.HardwareCorrupted = &v
+ m.HardwareCorrupted = &val
+ m.HardwareCorruptedBytes = &valBytes
case "AnonHugePages:":
- m.AnonHugePages = &v
+ m.AnonHugePages = &val
+ m.AnonHugePagesBytes = &valBytes
case "ShmemHugePages:":
- m.ShmemHugePages = &v
+ m.ShmemHugePages = &val
+ m.ShmemHugePagesBytes = &valBytes
case "ShmemPmdMapped:":
- m.ShmemPmdMapped = &v
+ m.ShmemPmdMapped = &val
+ m.ShmemPmdMappedBytes = &valBytes
case "CmaTotal:":
- m.CmaTotal = &v
+ m.CmaTotal = &val
+ m.CmaTotalBytes = &valBytes
case "CmaFree:":
- m.CmaFree = &v
+ m.CmaFree = &val
+ m.CmaFreeBytes = &valBytes
case "HugePages_Total:":
- m.HugePagesTotal = &v
+ m.HugePagesTotal = &val
case "HugePages_Free:":
- m.HugePagesFree = &v
+ m.HugePagesFree = &val
case "HugePages_Rsvd:":
- m.HugePagesRsvd = &v
+ m.HugePagesRsvd = &val
case "HugePages_Surp:":
- m.HugePagesSurp = &v
+ m.HugePagesSurp = &val
case "Hugepagesize:":
- m.Hugepagesize = &v
+ m.Hugepagesize = &val
+ m.HugepagesizeBytes = &valBytes
case "DirectMap4k:":
- m.DirectMap4k = &v
+ m.DirectMap4k = &val
+ m.DirectMap4kBytes = &valBytes
case "DirectMap2M:":
- m.DirectMap2M = &v
+ m.DirectMap2M = &val
+ m.DirectMap2MBytes = &valBytes
case "DirectMap1G:":
- m.DirectMap1G = &v
+ m.DirectMap1G = &val
+ m.DirectMap1GBytes = &valBytes
}
}
diff --git a/vendor/github.com/prometheus/procfs/mountinfo.go b/vendor/github.com/prometheus/procfs/mountinfo.go
index 59f4d50558..a704c5e735 100644
--- a/vendor/github.com/prometheus/procfs/mountinfo.go
+++ b/vendor/github.com/prometheus/procfs/mountinfo.go
@@ -78,11 +78,11 @@ func parseMountInfoString(mountString string) (*MountInfo, error) {
mountInfo := strings.Split(mountString, " ")
mountInfoLength := len(mountInfo)
if mountInfoLength < 10 {
- return nil, fmt.Errorf("couldn't find enough fields in mount string: %s", mountString)
+ return nil, fmt.Errorf("%w: Too few fields in mount string: %s", ErrFileParse, mountString)
}
if mountInfo[mountInfoLength-4] != "-" {
- return nil, fmt.Errorf("couldn't find separator in expected field: %s", mountInfo[mountInfoLength-4])
+ return nil, fmt.Errorf("%w: couldn't find separator in expected field: %s", ErrFileParse, mountInfo[mountInfoLength-4])
}
mount := &MountInfo{
@@ -98,18 +98,18 @@ func parseMountInfoString(mountString string) (*MountInfo, error) {
mount.MountID, err = strconv.Atoi(mountInfo[0])
if err != nil {
- return nil, fmt.Errorf("failed to parse mount ID")
+ return nil, fmt.Errorf("%w: mount ID: %q", ErrFileParse, mount.MountID)
}
mount.ParentID, err = strconv.Atoi(mountInfo[1])
if err != nil {
- return nil, fmt.Errorf("failed to parse parent ID")
+ return nil, fmt.Errorf("%w: parent ID: %q", ErrFileParse, mount.ParentID)
}
// Has optional fields, which is a space separated list of values.
// Example: shared:2 master:7
if mountInfo[6] != "" {
mount.OptionalFields, err = mountOptionsParseOptionalFields(mountInfo[6 : mountInfoLength-4])
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("%w: %w", ErrFileParse, err)
}
}
return mount, nil
diff --git a/vendor/github.com/prometheus/procfs/mountstats.go b/vendor/github.com/prometheus/procfs/mountstats.go
index 7f68890cff..75a3b6c810 100644
--- a/vendor/github.com/prometheus/procfs/mountstats.go
+++ b/vendor/github.com/prometheus/procfs/mountstats.go
@@ -44,6 +44,14 @@ const (
fieldTransport11TCPLen = 13
fieldTransport11UDPLen = 10
+
+ // kernel version >= 4.14 MaxLen
+ // See: https://elixir.bootlin.com/linux/v6.4.8/source/net/sunrpc/xprtrdma/xprt_rdma.h#L393
+ fieldTransport11RDMAMaxLen = 28
+
+ // kernel version <= 4.2 MinLen
+ // See: https://elixir.bootlin.com/linux/v4.2.8/source/net/sunrpc/xprtrdma/xprt_rdma.h#L331
+ fieldTransport11RDMAMinLen = 20
)
// A Mount is a device mount parsed from /proc/[pid]/mountstats.
@@ -80,7 +88,7 @@ type MountStatsNFS struct {
// Statistics broken down by filesystem operation.
Operations []NFSOperationStats
// Statistics about the NFS RPC transport.
- Transport NFSTransportStats
+ Transport []NFSTransportStats
}
// mountStats implements MountStats.
@@ -186,8 +194,6 @@ type NFSOperationStats struct {
CumulativeTotalResponseMilliseconds uint64
// Duration from when a request was enqueued to when it was completely handled.
CumulativeTotalRequestMilliseconds uint64
- // The average time from the point the client sends RPC requests until it receives the response.
- AverageRTTMilliseconds float64
// The count of operations that complete with tk_status < 0. These statuses usually indicate error conditions.
Errors uint64
}
@@ -233,6 +239,33 @@ type NFSTransportStats struct {
// A running counter, incremented on each request as the current size of the
// pending queue.
CumulativePendingQueue uint64
+
+ // Stats below only available with stat version 1.1.
+ // Transport over RDMA
+
+ // accessed when sending a call
+ ReadChunkCount uint64
+ WriteChunkCount uint64
+ ReplyChunkCount uint64
+ TotalRdmaRequest uint64
+
+ // rarely accessed error counters
+ PullupCopyCount uint64
+ HardwayRegisterCount uint64
+ FailedMarshalCount uint64
+ BadReplyCount uint64
+ MrsRecovered uint64
+ MrsOrphaned uint64
+ MrsAllocated uint64
+ EmptySendctxQ uint64
+
+ // accessed when receiving a reply
+ TotalRdmaReply uint64
+ FixupCopyCount uint64
+ ReplyWaitsForSend uint64
+ LocalInvNeeded uint64
+ NomsgCallCount uint64
+ BcallCount uint64
}
// parseMountStats parses a /proc/[pid]/mountstats file and returns a slice
@@ -266,7 +299,7 @@ func parseMountStats(r io.Reader) ([]*Mount, error) {
if len(ss) > deviceEntryLen {
// Only NFSv3 and v4 are supported for parsing statistics
if m.Type != nfs3Type && m.Type != nfs4Type {
- return nil, fmt.Errorf("cannot parse MountStats for fstype %q", m.Type)
+ return nil, fmt.Errorf("%w: Cannot parse MountStats for %q", ErrFileParse, m.Type)
}
statVersion := strings.TrimPrefix(ss[8], statVersionPrefix)
@@ -290,7 +323,7 @@ func parseMountStats(r io.Reader) ([]*Mount, error) {
// device [device] mounted on [mount] with fstype [type]
func parseMount(ss []string) (*Mount, error) {
if len(ss) < deviceEntryLen {
- return nil, fmt.Errorf("invalid device entry: %v", ss)
+ return nil, fmt.Errorf("%w: Invalid device %q", ErrFileParse, ss)
}
// Check for specific words appearing at specific indices to ensure
@@ -308,7 +341,7 @@ func parseMount(ss []string) (*Mount, error) {
for _, f := range format {
if ss[f.i] != f.s {
- return nil, fmt.Errorf("invalid device entry: %v", ss)
+ return nil, fmt.Errorf("%w: Invalid device %q", ErrFileParse, ss)
}
}
@@ -345,7 +378,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e
switch ss[0] {
case fieldOpts:
if len(ss) < 2 {
- return nil, fmt.Errorf("not enough information for NFS stats: %v", ss)
+ return nil, fmt.Errorf("%w: Incomplete information for NFS stats: %v", ErrFileParse, ss)
}
if stats.Opts == nil {
stats.Opts = map[string]string{}
@@ -360,7 +393,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e
}
case fieldAge:
if len(ss) < 2 {
- return nil, fmt.Errorf("not enough information for NFS stats: %v", ss)
+ return nil, fmt.Errorf("%w: Incomplete information for NFS stats: %v", ErrFileParse, ss)
}
// Age integer is in seconds
d, err := time.ParseDuration(ss[1] + "s")
@@ -371,7 +404,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e
stats.Age = d
case fieldBytes:
if len(ss) < 2 {
- return nil, fmt.Errorf("not enough information for NFS stats: %v", ss)
+ return nil, fmt.Errorf("%w: Incomplete information for NFS stats: %v", ErrFileParse, ss)
}
bstats, err := parseNFSBytesStats(ss[1:])
if err != nil {
@@ -381,7 +414,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e
stats.Bytes = *bstats
case fieldEvents:
if len(ss) < 2 {
- return nil, fmt.Errorf("not enough information for NFS stats: %v", ss)
+ return nil, fmt.Errorf("%w: Incomplete information for NFS events: %v", ErrFileParse, ss)
}
estats, err := parseNFSEventsStats(ss[1:])
if err != nil {
@@ -391,7 +424,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e
stats.Events = *estats
case fieldTransport:
if len(ss) < 3 {
- return nil, fmt.Errorf("not enough information for NFS transport stats: %v", ss)
+ return nil, fmt.Errorf("%w: Incomplete information for NFS transport stats: %v", ErrFileParse, ss)
}
tstats, err := parseNFSTransportStats(ss[1:], statVersion)
@@ -399,7 +432,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e
return nil, err
}
- stats.Transport = *tstats
+ stats.Transport = append(stats.Transport, *tstats)
}
// When encountering "per-operation statistics", we must break this
@@ -430,7 +463,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e
// integer fields.
func parseNFSBytesStats(ss []string) (*NFSBytesStats, error) {
if len(ss) != fieldBytesLen {
- return nil, fmt.Errorf("invalid NFS bytes stats: %v", ss)
+ return nil, fmt.Errorf("%w: Invalid NFS bytes stats: %v", ErrFileParse, ss)
}
ns := make([]uint64, 0, fieldBytesLen)
@@ -459,7 +492,7 @@ func parseNFSBytesStats(ss []string) (*NFSBytesStats, error) {
// integer fields.
func parseNFSEventsStats(ss []string) (*NFSEventsStats, error) {
if len(ss) != fieldEventsLen {
- return nil, fmt.Errorf("invalid NFS events stats: %v", ss)
+ return nil, fmt.Errorf("%w: invalid NFS events stats: %v", ErrFileParse, ss)
}
ns := make([]uint64, 0, fieldEventsLen)
@@ -523,7 +556,7 @@ func parseNFSOperationStats(s *bufio.Scanner) ([]NFSOperationStats, error) {
}
if len(ss) < minFields {
- return nil, fmt.Errorf("invalid NFS per-operations stats: %v", ss)
+ return nil, fmt.Errorf("%w: invalid NFS per-operations stats: %v", ErrFileParse, ss)
}
// Skip string operation name for integers
@@ -547,9 +580,6 @@ func parseNFSOperationStats(s *bufio.Scanner) ([]NFSOperationStats, error) {
CumulativeTotalResponseMilliseconds: ns[6],
CumulativeTotalRequestMilliseconds: ns[7],
}
- if ns[0] != 0 {
- opStats.AverageRTTMilliseconds = float64(ns[6]) / float64(ns[0])
- }
if len(ns) > 8 {
opStats.Errors = ns[8]
@@ -576,10 +606,10 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
} else if protocol == "udp" {
expectedLength = fieldTransport10UDPLen
} else {
- return nil, fmt.Errorf("invalid NFS protocol \"%s\" in stats 1.0 statement: %v", protocol, ss)
+ return nil, fmt.Errorf("%w: Invalid NFS protocol \"%s\" in stats 1.0 statement: %v", ErrFileParse, protocol, ss)
}
if len(ss) != expectedLength {
- return nil, fmt.Errorf("invalid NFS transport stats 1.0 statement: %v", ss)
+ return nil, fmt.Errorf("%w: Invalid NFS transport stats 1.0 statement: %v", ErrFileParse, ss)
}
case statVersion11:
var expectedLength int
@@ -587,14 +617,17 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
expectedLength = fieldTransport11TCPLen
} else if protocol == "udp" {
expectedLength = fieldTransport11UDPLen
+ } else if protocol == "rdma" {
+ expectedLength = fieldTransport11RDMAMinLen
} else {
- return nil, fmt.Errorf("invalid NFS protocol \"%s\" in stats 1.1 statement: %v", protocol, ss)
+ return nil, fmt.Errorf("%w: invalid NFS protocol \"%s\" in stats 1.1 statement: %v", ErrFileParse, protocol, ss)
}
- if len(ss) != expectedLength {
- return nil, fmt.Errorf("invalid NFS transport stats 1.1 statement: %v", ss)
+ if (len(ss) != expectedLength && (protocol == "tcp" || protocol == "udp")) ||
+ (protocol == "rdma" && len(ss) < expectedLength) {
+ return nil, fmt.Errorf("%w: invalid NFS transport stats 1.1 statement: %v, protocol: %v", ErrFileParse, ss, protocol)
}
default:
- return nil, fmt.Errorf("unrecognized NFS transport stats version: %q", statVersion)
+ return nil, fmt.Errorf("%w: Unrecognized NFS transport stats version: %q, protocol: %v", ErrFileParse, statVersion, protocol)
}
// Allocate enough for v1.1 stats since zero value for v1.1 stats will be okay
@@ -604,7 +637,9 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
// Note: slice length must be set to length of v1.1 stats to avoid a panic when
// only v1.0 stats are present.
// See: https://github.com/prometheus/node_exporter/issues/571.
- ns := make([]uint64, fieldTransport11TCPLen)
+ //
+ // Note: NFS Over RDMA slice length is fieldTransport11RDMAMaxLen
+ ns := make([]uint64, fieldTransport11RDMAMaxLen+3)
for i, s := range ss {
n, err := strconv.ParseUint(s, 10, 64)
if err != nil {
@@ -622,9 +657,14 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
// we set them to 0 here.
if protocol == "udp" {
ns = append(ns[:2], append(make([]uint64, 3), ns[2:]...)...)
+ } else if protocol == "tcp" {
+ ns = append(ns[:fieldTransport11TCPLen], make([]uint64, fieldTransport11RDMAMaxLen-fieldTransport11TCPLen+3)...)
+ } else if protocol == "rdma" {
+ ns = append(ns[:fieldTransport10TCPLen], append(make([]uint64, 3), ns[fieldTransport10TCPLen:]...)...)
}
return &NFSTransportStats{
+ // NFS xprt over tcp or udp
Protocol: protocol,
Port: ns[0],
Bind: ns[1],
@@ -636,8 +676,32 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
BadTransactionIDs: ns[7],
CumulativeActiveRequests: ns[8],
CumulativeBacklog: ns[9],
- MaximumRPCSlotsUsed: ns[10],
- CumulativeSendingQueue: ns[11],
- CumulativePendingQueue: ns[12],
+
+ // NFS xprt over tcp or udp
+ // And statVersion 1.1
+ MaximumRPCSlotsUsed: ns[10],
+ CumulativeSendingQueue: ns[11],
+ CumulativePendingQueue: ns[12],
+
+ // NFS xprt over rdma
+ // And stat Version 1.1
+ ReadChunkCount: ns[13],
+ WriteChunkCount: ns[14],
+ ReplyChunkCount: ns[15],
+ TotalRdmaRequest: ns[16],
+ PullupCopyCount: ns[17],
+ HardwayRegisterCount: ns[18],
+ FailedMarshalCount: ns[19],
+ BadReplyCount: ns[20],
+ MrsRecovered: ns[21],
+ MrsOrphaned: ns[22],
+ MrsAllocated: ns[23],
+ EmptySendctxQ: ns[24],
+ TotalRdmaReply: ns[25],
+ FixupCopyCount: ns[26],
+ ReplyWaitsForSend: ns[27],
+ LocalInvNeeded: ns[28],
+ NomsgCallCount: ns[29],
+ BcallCount: ns[30],
}, nil
}
diff --git a/vendor/github.com/prometheus/procfs/net_conntrackstat.go b/vendor/github.com/prometheus/procfs/net_conntrackstat.go
index 64a0e94606..316df5fbb7 100644
--- a/vendor/github.com/prometheus/procfs/net_conntrackstat.go
+++ b/vendor/github.com/prometheus/procfs/net_conntrackstat.go
@@ -58,7 +58,7 @@ func readConntrackStat(path string) ([]ConntrackStatEntry, error) {
stat, err := parseConntrackStat(bytes.NewReader(b))
if err != nil {
- return nil, fmt.Errorf("failed to read conntrack stats from %q: %w", path, err)
+ return nil, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, path, err)
}
return stat, nil
@@ -86,11 +86,12 @@ func parseConntrackStat(r io.Reader) ([]ConntrackStatEntry, error) {
func parseConntrackStatEntry(fields []string) (*ConntrackStatEntry, error) {
entries, err := util.ParseHexUint64s(fields)
if err != nil {
- return nil, fmt.Errorf("invalid conntrackstat entry, couldn't parse fields: %s", err)
+ return nil, fmt.Errorf("%w: Cannot parse entry: %d: %w", ErrFileParse, entries, err)
}
numEntries := len(entries)
if numEntries < 16 || numEntries > 17 {
- return nil, fmt.Errorf("invalid conntrackstat entry, invalid number of fields: %d", numEntries)
+ return nil,
+ fmt.Errorf("%w: invalid conntrackstat entry, invalid number of fields: %d", ErrFileParse, numEntries)
}
stats := &ConntrackStatEntry{
diff --git a/vendor/github.com/prometheus/procfs/net_ip_socket.go b/vendor/github.com/prometheus/procfs/net_ip_socket.go
index 7fd57d7f46..b70f1fc7a4 100644
--- a/vendor/github.com/prometheus/procfs/net_ip_socket.go
+++ b/vendor/github.com/prometheus/procfs/net_ip_socket.go
@@ -50,10 +50,13 @@ type (
// UsedSockets shows the total number of parsed lines representing the
// number of used sockets.
UsedSockets uint64
+ // Drops shows the total number of dropped packets of all UPD sockets.
+ Drops *uint64
}
// netIPSocketLine represents the fields parsed from a single line
// in /proc/net/{t,u}dp{,6}. Fields which are not used by IPSocket are skipped.
+ // Drops is non-nil for udp{,6}, but nil for tcp{,6}.
// For the proc file format details, see https://linux.die.net/man/5/proc.
netIPSocketLine struct {
Sl uint64
@@ -66,6 +69,7 @@ type (
RxQueue uint64
UID uint64
Inode uint64
+ Drops *uint64
}
)
@@ -77,13 +81,14 @@ func newNetIPSocket(file string) (NetIPSocket, error) {
defer f.Close()
var netIPSocket NetIPSocket
+ isUDP := strings.Contains(file, "udp")
lr := io.LimitReader(f, readLimit)
s := bufio.NewScanner(lr)
s.Scan() // skip first line with headers
for s.Scan() {
fields := strings.Fields(s.Text())
- line, err := parseNetIPSocketLine(fields)
+ line, err := parseNetIPSocketLine(fields, isUDP)
if err != nil {
return nil, err
}
@@ -104,19 +109,25 @@ func newNetIPSocketSummary(file string) (*NetIPSocketSummary, error) {
defer f.Close()
var netIPSocketSummary NetIPSocketSummary
+ var udpPacketDrops uint64
+ isUDP := strings.Contains(file, "udp")
lr := io.LimitReader(f, readLimit)
s := bufio.NewScanner(lr)
s.Scan() // skip first line with headers
for s.Scan() {
fields := strings.Fields(s.Text())
- line, err := parseNetIPSocketLine(fields)
+ line, err := parseNetIPSocketLine(fields, isUDP)
if err != nil {
return nil, err
}
netIPSocketSummary.TxQueueLength += line.TxQueue
netIPSocketSummary.RxQueueLength += line.RxQueue
netIPSocketSummary.UsedSockets++
+ if isUDP {
+ udpPacketDrops += *line.Drops
+ netIPSocketSummary.Drops = &udpPacketDrops
+ }
}
if err := s.Err(); err != nil {
return nil, err
@@ -130,7 +141,7 @@ func parseIP(hexIP string) (net.IP, error) {
var byteIP []byte
byteIP, err := hex.DecodeString(hexIP)
if err != nil {
- return nil, fmt.Errorf("cannot parse address field in socket line %q", hexIP)
+ return nil, fmt.Errorf("%w: Cannot parse socket field in %q: %w", ErrFileParse, hexIP, err)
}
switch len(byteIP) {
case 4:
@@ -144,16 +155,17 @@ func parseIP(hexIP string) (net.IP, error) {
}
return i, nil
default:
- return nil, fmt.Errorf("Unable to parse IP %s", hexIP)
+ return nil, fmt.Errorf("%w: Unable to parse IP %s: %v", ErrFileParse, hexIP, nil)
}
}
// parseNetIPSocketLine parses a single line, represented by a list of fields.
-func parseNetIPSocketLine(fields []string) (*netIPSocketLine, error) {
+func parseNetIPSocketLine(fields []string, isUDP bool) (*netIPSocketLine, error) {
line := &netIPSocketLine{}
if len(fields) < 10 {
return nil, fmt.Errorf(
- "cannot parse net socket line as it has less then 10 columns %q",
+ "%w: Less than 10 columns found %q",
+ ErrFileParse,
strings.Join(fields, " "),
)
}
@@ -162,64 +174,74 @@ func parseNetIPSocketLine(fields []string) (*netIPSocketLine, error) {
// sl
s := strings.Split(fields[0], ":")
if len(s) != 2 {
- return nil, fmt.Errorf("cannot parse sl field in socket line %q", fields[0])
+ return nil, fmt.Errorf("%w: Unable to parse sl field in line %q", ErrFileParse, fields[0])
}
if line.Sl, err = strconv.ParseUint(s[0], 0, 64); err != nil {
- return nil, fmt.Errorf("cannot parse sl value in socket line: %w", err)
+ return nil, fmt.Errorf("%w: Unable to parse sl field in %q: %w", ErrFileParse, line.Sl, err)
}
// local_address
l := strings.Split(fields[1], ":")
if len(l) != 2 {
- return nil, fmt.Errorf("cannot parse local_address field in socket line %q", fields[1])
+ return nil, fmt.Errorf("%w: Unable to parse local_address field in %q", ErrFileParse, fields[1])
}
if line.LocalAddr, err = parseIP(l[0]); err != nil {
return nil, err
}
if line.LocalPort, err = strconv.ParseUint(l[1], 16, 64); err != nil {
- return nil, fmt.Errorf("cannot parse local_address port value in socket line: %w", err)
+ return nil, fmt.Errorf("%w: Unable to parse local_address port value line %q: %w", ErrFileParse, line.LocalPort, err)
}
// remote_address
r := strings.Split(fields[2], ":")
if len(r) != 2 {
- return nil, fmt.Errorf("cannot parse rem_address field in socket line %q", fields[1])
+ return nil, fmt.Errorf("%w: Unable to parse rem_address field in %q", ErrFileParse, fields[1])
}
if line.RemAddr, err = parseIP(r[0]); err != nil {
return nil, err
}
if line.RemPort, err = strconv.ParseUint(r[1], 16, 64); err != nil {
- return nil, fmt.Errorf("cannot parse rem_address port value in socket line: %w", err)
+ return nil, fmt.Errorf("%w: Cannot parse rem_address port value in %q: %w", ErrFileParse, line.RemPort, err)
}
// st
if line.St, err = strconv.ParseUint(fields[3], 16, 64); err != nil {
- return nil, fmt.Errorf("cannot parse st value in socket line: %w", err)
+ return nil, fmt.Errorf("%w: Cannot parse st value in %q: %w", ErrFileParse, line.St, err)
}
// tx_queue and rx_queue
q := strings.Split(fields[4], ":")
if len(q) != 2 {
return nil, fmt.Errorf(
- "cannot parse tx/rx queues in socket line as it has a missing colon %q",
+ "%w: Missing colon for tx/rx queues in socket line %q",
+ ErrFileParse,
fields[4],
)
}
if line.TxQueue, err = strconv.ParseUint(q[0], 16, 64); err != nil {
- return nil, fmt.Errorf("cannot parse tx_queue value in socket line: %w", err)
+ return nil, fmt.Errorf("%w: Cannot parse tx_queue value in %q: %w", ErrFileParse, line.TxQueue, err)
}
if line.RxQueue, err = strconv.ParseUint(q[1], 16, 64); err != nil {
- return nil, fmt.Errorf("cannot parse rx_queue value in socket line: %w", err)
+ return nil, fmt.Errorf("%w: Cannot parse trx_queue value in %q: %w", ErrFileParse, line.RxQueue, err)
}
// uid
if line.UID, err = strconv.ParseUint(fields[7], 0, 64); err != nil {
- return nil, fmt.Errorf("cannot parse uid value in socket line: %w", err)
+ return nil, fmt.Errorf("%w: Cannot parse UID value in %q: %w", ErrFileParse, line.UID, err)
}
// inode
if line.Inode, err = strconv.ParseUint(fields[9], 0, 64); err != nil {
- return nil, fmt.Errorf("cannot parse inode value in socket line: %w", err)
+ return nil, fmt.Errorf("%w: Cannot parse inode value in %q: %w", ErrFileParse, line.Inode, err)
+ }
+
+ // drops
+ if isUDP {
+ drops, err := strconv.ParseUint(fields[12], 0, 64)
+ if err != nil {
+ return nil, fmt.Errorf("%w: Cannot parse drops value in %q: %w", ErrFileParse, drops, err)
+ }
+ line.Drops = &drops
}
return line, nil
diff --git a/vendor/github.com/prometheus/procfs/net_protocols.go b/vendor/github.com/prometheus/procfs/net_protocols.go
index 374b6f73f8..b6c77b709f 100644
--- a/vendor/github.com/prometheus/procfs/net_protocols.go
+++ b/vendor/github.com/prometheus/procfs/net_protocols.go
@@ -131,7 +131,7 @@ func (ps NetProtocolStats) parseLine(rawLine string) (*NetProtocolStatLine, erro
} else if fields[6] == disabled {
line.Slab = false
} else {
- return nil, fmt.Errorf("unable to parse capability for protocol: %s", line.Name)
+ return nil, fmt.Errorf("%w: capability for protocol: %s", ErrFileParse, line.Name)
}
line.ModuleName = fields[7]
@@ -173,7 +173,7 @@ func (pc *NetProtocolCapabilities) parseCapabilities(capabilities []string) erro
} else if capabilities[i] == "n" {
*capabilityFields[i] = false
} else {
- return fmt.Errorf("unable to parse capability block for protocol: position %d", i)
+ return fmt.Errorf("%w: capability block for protocol: position %d", ErrFileParse, i)
}
}
return nil
diff --git a/vendor/github.com/prometheus/procfs/net_route.go b/vendor/github.com/prometheus/procfs/net_route.go
new file mode 100644
index 0000000000..deb7029fe1
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/net_route.go
@@ -0,0 +1,143 @@
+// Copyright 2023 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 procfs
+
+import (
+ "bufio"
+ "bytes"
+ "fmt"
+ "io"
+ "strconv"
+ "strings"
+
+ "github.com/prometheus/procfs/internal/util"
+)
+
+const (
+ blackholeRepresentation string = "*"
+ blackholeIfaceName string = "blackhole"
+ routeLineColumns int = 11
+)
+
+// A NetRouteLine represents one line from net/route.
+type NetRouteLine struct {
+ Iface string
+ Destination uint32
+ Gateway uint32
+ Flags uint32
+ RefCnt uint32
+ Use uint32
+ Metric uint32
+ Mask uint32
+ MTU uint32
+ Window uint32
+ IRTT uint32
+}
+
+func (fs FS) NetRoute() ([]NetRouteLine, error) {
+ return readNetRoute(fs.proc.Path("net", "route"))
+}
+
+func readNetRoute(path string) ([]NetRouteLine, error) {
+ b, err := util.ReadFileNoStat(path)
+ if err != nil {
+ return nil, err
+ }
+
+ routelines, err := parseNetRoute(bytes.NewReader(b))
+ if err != nil {
+ return nil, fmt.Errorf("failed to read net route from %s: %w", path, err)
+ }
+ return routelines, nil
+}
+
+func parseNetRoute(r io.Reader) ([]NetRouteLine, error) {
+ var routelines []NetRouteLine
+
+ scanner := bufio.NewScanner(r)
+ scanner.Scan()
+ for scanner.Scan() {
+ fields := strings.Fields(scanner.Text())
+ routeline, err := parseNetRouteLine(fields)
+ if err != nil {
+ return nil, err
+ }
+ routelines = append(routelines, *routeline)
+ }
+ return routelines, nil
+}
+
+func parseNetRouteLine(fields []string) (*NetRouteLine, error) {
+ if len(fields) != routeLineColumns {
+ return nil, fmt.Errorf("invalid routeline, num of digits: %d", len(fields))
+ }
+ iface := fields[0]
+ if iface == blackholeRepresentation {
+ iface = blackholeIfaceName
+ }
+ destination, err := strconv.ParseUint(fields[1], 16, 32)
+ if err != nil {
+ return nil, err
+ }
+ gateway, err := strconv.ParseUint(fields[2], 16, 32)
+ if err != nil {
+ return nil, err
+ }
+ flags, err := strconv.ParseUint(fields[3], 10, 32)
+ if err != nil {
+ return nil, err
+ }
+ refcnt, err := strconv.ParseUint(fields[4], 10, 32)
+ if err != nil {
+ return nil, err
+ }
+ use, err := strconv.ParseUint(fields[5], 10, 32)
+ if err != nil {
+ return nil, err
+ }
+ metric, err := strconv.ParseUint(fields[6], 10, 32)
+ if err != nil {
+ return nil, err
+ }
+ mask, err := strconv.ParseUint(fields[7], 16, 32)
+ if err != nil {
+ return nil, err
+ }
+ mtu, err := strconv.ParseUint(fields[8], 10, 32)
+ if err != nil {
+ return nil, err
+ }
+ window, err := strconv.ParseUint(fields[9], 10, 32)
+ if err != nil {
+ return nil, err
+ }
+ irtt, err := strconv.ParseUint(fields[10], 10, 32)
+ if err != nil {
+ return nil, err
+ }
+ routeline := &NetRouteLine{
+ Iface: iface,
+ Destination: uint32(destination),
+ Gateway: uint32(gateway),
+ Flags: uint32(flags),
+ RefCnt: uint32(refcnt),
+ Use: uint32(use),
+ Metric: uint32(metric),
+ Mask: uint32(mask),
+ MTU: uint32(mtu),
+ Window: uint32(window),
+ IRTT: uint32(irtt),
+ }
+ return routeline, nil
+}
diff --git a/vendor/github.com/prometheus/procfs/net_sockstat.go b/vendor/github.com/prometheus/procfs/net_sockstat.go
index e36f4872dd..fae62b13d9 100644
--- a/vendor/github.com/prometheus/procfs/net_sockstat.go
+++ b/vendor/github.com/prometheus/procfs/net_sockstat.go
@@ -16,7 +16,6 @@ package procfs
import (
"bufio"
"bytes"
- "errors"
"fmt"
"io"
"strings"
@@ -70,7 +69,7 @@ func readSockstat(name string) (*NetSockstat, error) {
stat, err := parseSockstat(bytes.NewReader(b))
if err != nil {
- return nil, fmt.Errorf("failed to read sockstats from %q: %w", name, err)
+ return nil, fmt.Errorf("%w: sockstats from %q: %w", ErrFileRead, name, err)
}
return stat, nil
@@ -84,13 +83,13 @@ func parseSockstat(r io.Reader) (*NetSockstat, error) {
// Expect a minimum of a protocol and one key/value pair.
fields := strings.Split(s.Text(), " ")
if len(fields) < 3 {
- return nil, fmt.Errorf("malformed sockstat line: %q", s.Text())
+ return nil, fmt.Errorf("%w: Malformed sockstat line: %q", ErrFileParse, s.Text())
}
// The remaining fields are key/value pairs.
kvs, err := parseSockstatKVs(fields[1:])
if err != nil {
- return nil, fmt.Errorf("error parsing sockstat key/value pairs from %q: %w", s.Text(), err)
+ return nil, fmt.Errorf("%w: sockstat key/value pairs from %q: %w", ErrFileParse, s.Text(), err)
}
// The first field is the protocol. We must trim its colon suffix.
@@ -119,7 +118,7 @@ func parseSockstat(r io.Reader) (*NetSockstat, error) {
// parseSockstatKVs parses a string slice into a map of key/value pairs.
func parseSockstatKVs(kvs []string) (map[string]int, error) {
if len(kvs)%2 != 0 {
- return nil, errors.New("odd number of fields in key/value pairs")
+ return nil, fmt.Errorf("%w:: Odd number of fields in key/value pairs %q", ErrFileParse, kvs)
}
// Iterate two values at a time to gather key/value pairs.
diff --git a/vendor/github.com/prometheus/procfs/net_softnet.go b/vendor/github.com/prometheus/procfs/net_softnet.go
index 540cea52c6..71c8059f4d 100644
--- a/vendor/github.com/prometheus/procfs/net_softnet.go
+++ b/vendor/github.com/prometheus/procfs/net_softnet.go
@@ -64,7 +64,7 @@ func (fs FS) NetSoftnetStat() ([]SoftnetStat, error) {
entries, err := parseSoftnet(bytes.NewReader(b))
if err != nil {
- return nil, fmt.Errorf("failed to parse /proc/net/softnet_stat: %w", err)
+ return nil, fmt.Errorf("%w: /proc/net/softnet_stat: %w", ErrFileParse, err)
}
return entries, nil
@@ -83,7 +83,7 @@ func parseSoftnet(r io.Reader) ([]SoftnetStat, error) {
softnetStat := SoftnetStat{}
if width < minColumns {
- return nil, fmt.Errorf("%d columns were detected, but at least %d were expected", width, minColumns)
+ return nil, fmt.Errorf("%w: detected %d columns, but expected at least %d", ErrFileParse, width, minColumns)
}
// Linux 2.6.23 https://elixir.bootlin.com/linux/v2.6.23/source/net/core/dev.c#L2347
diff --git a/vendor/github.com/prometheus/procfs/net_tls_stat.go b/vendor/github.com/prometheus/procfs/net_tls_stat.go
new file mode 100644
index 0000000000..13994c1782
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/net_tls_stat.go
@@ -0,0 +1,119 @@
+// Copyright 2023 Prometheus Team
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 procfs
+
+import (
+ "bufio"
+ "fmt"
+ "os"
+ "strconv"
+ "strings"
+)
+
+// TLSStat struct represents data in /proc/net/tls_stat.
+// See https://docs.kernel.org/networking/tls.html#statistics
+type TLSStat struct {
+ // number of TX sessions currently installed where host handles cryptography
+ TLSCurrTxSw int
+ // number of RX sessions currently installed where host handles cryptography
+ TLSCurrRxSw int
+ // number of TX sessions currently installed where NIC handles cryptography
+ TLSCurrTxDevice int
+ // number of RX sessions currently installed where NIC handles cryptography
+ TLSCurrRxDevice int
+ //number of TX sessions opened with host cryptography
+ TLSTxSw int
+ //number of RX sessions opened with host cryptography
+ TLSRxSw int
+ // number of TX sessions opened with NIC cryptography
+ TLSTxDevice int
+ // number of RX sessions opened with NIC cryptography
+ TLSRxDevice int
+ // record decryption failed (e.g. due to incorrect authentication tag)
+ TLSDecryptError int
+ // number of RX resyncs sent to NICs handling cryptography
+ TLSRxDeviceResync int
+ // number of RX records which had to be re-decrypted due to TLS_RX_EXPECT_NO_PAD mis-prediction. Note that this counter will also increment for non-data records.
+ TLSDecryptRetry int
+ // number of data RX records which had to be re-decrypted due to TLS_RX_EXPECT_NO_PAD mis-prediction.
+ TLSRxNoPadViolation int
+}
+
+// NewTLSStat reads the tls_stat statistics.
+func NewTLSStat() (TLSStat, error) {
+ fs, err := NewFS(DefaultMountPoint)
+ if err != nil {
+ return TLSStat{}, err
+ }
+
+ return fs.NewTLSStat()
+}
+
+// NewTLSStat reads the tls_stat statistics.
+func (fs FS) NewTLSStat() (TLSStat, error) {
+ file, err := os.Open(fs.proc.Path("net/tls_stat"))
+ if err != nil {
+ return TLSStat{}, err
+ }
+ defer file.Close()
+
+ var (
+ tlsstat = TLSStat{}
+ s = bufio.NewScanner(file)
+ )
+
+ for s.Scan() {
+ fields := strings.Fields(s.Text())
+
+ if len(fields) != 2 {
+ return TLSStat{}, fmt.Errorf("%w: %q line %q", ErrFileParse, file.Name(), s.Text())
+ }
+
+ name := fields[0]
+ value, err := strconv.Atoi(fields[1])
+ if err != nil {
+ return TLSStat{}, err
+ }
+
+ switch name {
+ case "TlsCurrTxSw":
+ tlsstat.TLSCurrTxSw = value
+ case "TlsCurrRxSw":
+ tlsstat.TLSCurrRxSw = value
+ case "TlsCurrTxDevice":
+ tlsstat.TLSCurrTxDevice = value
+ case "TlsCurrRxDevice":
+ tlsstat.TLSCurrRxDevice = value
+ case "TlsTxSw":
+ tlsstat.TLSTxSw = value
+ case "TlsRxSw":
+ tlsstat.TLSRxSw = value
+ case "TlsTxDevice":
+ tlsstat.TLSTxDevice = value
+ case "TlsRxDevice":
+ tlsstat.TLSRxDevice = value
+ case "TlsDecryptError":
+ tlsstat.TLSDecryptError = value
+ case "TlsRxDeviceResync":
+ tlsstat.TLSRxDeviceResync = value
+ case "TlsDecryptRetry":
+ tlsstat.TLSDecryptRetry = value
+ case "TlsRxNoPadViolation":
+ tlsstat.TLSRxNoPadViolation = value
+ }
+
+ }
+
+ return tlsstat, s.Err()
+}
diff --git a/vendor/github.com/prometheus/procfs/net_unix.go b/vendor/github.com/prometheus/procfs/net_unix.go
index 98aa8e1c31..d868cebdaa 100644
--- a/vendor/github.com/prometheus/procfs/net_unix.go
+++ b/vendor/github.com/prometheus/procfs/net_unix.go
@@ -108,14 +108,14 @@ func parseNetUNIX(r io.Reader) (*NetUNIX, error) {
line := s.Text()
item, err := nu.parseLine(line, hasInode, minFields)
if err != nil {
- return nil, fmt.Errorf("failed to parse /proc/net/unix data %q: %w", line, err)
+ return nil, fmt.Errorf("%w: /proc/net/unix encountered data %q: %w", ErrFileParse, line, err)
}
nu.Rows = append(nu.Rows, item)
}
if err := s.Err(); err != nil {
- return nil, fmt.Errorf("failed to scan /proc/net/unix data: %w", err)
+ return nil, fmt.Errorf("%w: /proc/net/unix encountered data: %w", ErrFileParse, err)
}
return &nu, nil
@@ -126,7 +126,7 @@ func (u *NetUNIX) parseLine(line string, hasInode bool, min int) (*NetUNIXLine,
l := len(fields)
if l < min {
- return nil, fmt.Errorf("expected at least %d fields but got %d", min, l)
+ return nil, fmt.Errorf("%w: expected at least %d fields but got %d", ErrFileParse, min, l)
}
// Field offsets are as follows:
@@ -136,29 +136,29 @@ func (u *NetUNIX) parseLine(line string, hasInode bool, min int) (*NetUNIXLine,
users, err := u.parseUsers(fields[1])
if err != nil {
- return nil, fmt.Errorf("failed to parse ref count %q: %w", fields[1], err)
+ return nil, fmt.Errorf("%w: ref count %q: %w", ErrFileParse, fields[1], err)
}
flags, err := u.parseFlags(fields[3])
if err != nil {
- return nil, fmt.Errorf("failed to parse flags %q: %w", fields[3], err)
+ return nil, fmt.Errorf("%w: Unable to parse flags %q: %w", ErrFileParse, fields[3], err)
}
typ, err := u.parseType(fields[4])
if err != nil {
- return nil, fmt.Errorf("failed to parse type %q: %w", fields[4], err)
+ return nil, fmt.Errorf("%w: Failed to parse type %q: %w", ErrFileParse, fields[4], err)
}
state, err := u.parseState(fields[5])
if err != nil {
- return nil, fmt.Errorf("failed to parse state %q: %w", fields[5], err)
+ return nil, fmt.Errorf("%w: Failed to parse state %q: %w", ErrFileParse, fields[5], err)
}
var inode uint64
if hasInode {
inode, err = u.parseInode(fields[6])
if err != nil {
- return nil, fmt.Errorf("failed to parse inode %q: %w", fields[6], err)
+ return nil, fmt.Errorf("%w failed to parse inode %q: %w", ErrFileParse, fields[6], err)
}
}
diff --git a/vendor/github.com/prometheus/procfs/net_wireless.go b/vendor/github.com/prometheus/procfs/net_wireless.go
index c80fb15424..7c597bc870 100644
--- a/vendor/github.com/prometheus/procfs/net_wireless.go
+++ b/vendor/github.com/prometheus/procfs/net_wireless.go
@@ -68,7 +68,7 @@ func (fs FS) Wireless() ([]*Wireless, error) {
m, err := parseWireless(bytes.NewReader(b))
if err != nil {
- return nil, fmt.Errorf("failed to parse wireless: %w", err)
+ return nil, fmt.Errorf("%w: wireless: %w", ErrFileParse, err)
}
return m, nil
@@ -97,64 +97,64 @@ func parseWireless(r io.Reader) ([]*Wireless, error) {
parts := strings.Split(line, ":")
if len(parts) != 2 {
- return nil, fmt.Errorf("expected 2 parts after splitting line by ':', got %d for line %q", len(parts), line)
+ return nil, fmt.Errorf("%w: expected 2 parts after splitting line by ':', got %d for line %q", ErrFileParse, len(parts), line)
}
name := strings.TrimSpace(parts[0])
stats := strings.Fields(parts[1])
if len(stats) < 10 {
- return nil, fmt.Errorf("invalid number of fields in line %d, expected at least 10, got %d: %q", n, len(stats), line)
+ return nil, fmt.Errorf("%w: invalid number of fields in line %d, expected 10+, got %d: %q", ErrFileParse, n, len(stats), line)
}
status, err := strconv.ParseUint(stats[0], 16, 16)
if err != nil {
- return nil, fmt.Errorf("invalid status in line %d: %q", n, line)
+ return nil, fmt.Errorf("%w: invalid status in line %d: %q", ErrFileParse, n, line)
}
qlink, err := strconv.Atoi(strings.TrimSuffix(stats[1], "."))
if err != nil {
- return nil, fmt.Errorf("failed to parse Quality:link as integer %q: %w", qlink, err)
+ return nil, fmt.Errorf("%w: parse Quality:link as integer %q: %w", ErrFileParse, qlink, err)
}
qlevel, err := strconv.Atoi(strings.TrimSuffix(stats[2], "."))
if err != nil {
- return nil, fmt.Errorf("failed to parse Quality:level as integer %q: %w", qlevel, err)
+ return nil, fmt.Errorf("%w: Quality:level as integer %q: %w", ErrFileParse, qlevel, err)
}
qnoise, err := strconv.Atoi(strings.TrimSuffix(stats[3], "."))
if err != nil {
- return nil, fmt.Errorf("failed to parse Quality:noise as integer %q: %w", qnoise, err)
+ return nil, fmt.Errorf("%w: Quality:noise as integer %q: %w", ErrFileParse, qnoise, err)
}
dnwid, err := strconv.Atoi(stats[4])
if err != nil {
- return nil, fmt.Errorf("failed to parse Discarded:nwid as integer %q: %w", dnwid, err)
+ return nil, fmt.Errorf("%w: Discarded:nwid as integer %q: %w", ErrFileParse, dnwid, err)
}
dcrypt, err := strconv.Atoi(stats[5])
if err != nil {
- return nil, fmt.Errorf("failed to parse Discarded:crypt as integer %q: %w", dcrypt, err)
+ return nil, fmt.Errorf("%w: Discarded:crypt as integer %q: %w", ErrFileParse, dcrypt, err)
}
dfrag, err := strconv.Atoi(stats[6])
if err != nil {
- return nil, fmt.Errorf("failed to parse Discarded:frag as integer %q: %w", dfrag, err)
+ return nil, fmt.Errorf("%w: Discarded:frag as integer %q: %w", ErrFileParse, dfrag, err)
}
dretry, err := strconv.Atoi(stats[7])
if err != nil {
- return nil, fmt.Errorf("failed to parse Discarded:retry as integer %q: %w", dretry, err)
+ return nil, fmt.Errorf("%w: Discarded:retry as integer %q: %w", ErrFileParse, dretry, err)
}
dmisc, err := strconv.Atoi(stats[8])
if err != nil {
- return nil, fmt.Errorf("failed to parse Discarded:misc as integer %q: %w", dmisc, err)
+ return nil, fmt.Errorf("%w: Discarded:misc as integer %q: %w", ErrFileParse, dmisc, err)
}
mbeacon, err := strconv.Atoi(stats[9])
if err != nil {
- return nil, fmt.Errorf("failed to parse Missed:beacon as integer %q: %w", mbeacon, err)
+ return nil, fmt.Errorf("%w: Missed:beacon as integer %q: %w", ErrFileParse, mbeacon, err)
}
w := &Wireless{
@@ -175,7 +175,7 @@ func parseWireless(r io.Reader) ([]*Wireless, error) {
}
if err := scanner.Err(); err != nil {
- return nil, fmt.Errorf("failed to scan /proc/net/wireless: %w", err)
+ return nil, fmt.Errorf("%w: Failed to scan /proc/net/wireless: %w", ErrFileRead, err)
}
return interfaces, nil
diff --git a/vendor/github.com/prometheus/procfs/net_xfrm.go b/vendor/github.com/prometheus/procfs/net_xfrm.go
index f9d9d243db..932ef20468 100644
--- a/vendor/github.com/prometheus/procfs/net_xfrm.go
+++ b/vendor/github.com/prometheus/procfs/net_xfrm.go
@@ -115,7 +115,7 @@ func (fs FS) NewXfrmStat() (XfrmStat, error) {
fields := strings.Fields(s.Text())
if len(fields) != 2 {
- return XfrmStat{}, fmt.Errorf("couldn't parse %q line %q", file.Name(), s.Text())
+ return XfrmStat{}, fmt.Errorf("%w: %q line %q", ErrFileParse, file.Name(), s.Text())
}
name := fields[0]
diff --git a/vendor/github.com/prometheus/procfs/proc.go b/vendor/github.com/prometheus/procfs/proc.go
index 48f39dafd2..142796368f 100644
--- a/vendor/github.com/prometheus/procfs/proc.go
+++ b/vendor/github.com/prometheus/procfs/proc.go
@@ -15,6 +15,7 @@ package procfs
import (
"bytes"
+ "errors"
"fmt"
"io"
"os"
@@ -35,6 +36,12 @@ type Proc struct {
// Procs represents a list of Proc structs.
type Procs []Proc
+var (
+ ErrFileParse = errors.New("Error Parsing File")
+ ErrFileRead = errors.New("Error Reading File")
+ ErrMountPoint = errors.New("Error Accessing Mount point")
+)
+
func (p Procs) Len() int { return len(p) }
func (p Procs) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p Procs) Less(i, j int) bool { return p[i].PID < p[j].PID }
@@ -42,7 +49,7 @@ func (p Procs) Less(i, j int) bool { return p[i].PID < p[j].PID }
// Self returns a process for the current process read via /proc/self.
func Self() (Proc, error) {
fs, err := NewFS(DefaultMountPoint)
- if err != nil {
+ if err != nil || errors.Unwrap(err) == ErrMountPoint {
return Proc{}, err
}
return fs.Self()
@@ -104,7 +111,7 @@ func (fs FS) AllProcs() (Procs, error) {
names, err := d.Readdirnames(-1)
if err != nil {
- return Procs{}, fmt.Errorf("could not read %q: %w", d.Name(), err)
+ return Procs{}, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, names, err)
}
p := Procs{}
@@ -130,7 +137,7 @@ func (p Proc) CmdLine() ([]string, error) {
return []string{}, nil
}
- return strings.Split(string(bytes.TrimRight(data, string("\x00"))), string(byte(0))), nil
+ return strings.Split(string(bytes.TrimRight(data, "\x00")), "\x00"), nil
}
// Wchan returns the wchan (wait channel) of a process.
@@ -205,7 +212,7 @@ func (p Proc) FileDescriptors() ([]uintptr, error) {
for i, n := range names {
fd, err := strconv.ParseInt(n, 10, 32)
if err != nil {
- return nil, fmt.Errorf("could not parse fd %q: %w", n, err)
+ return nil, fmt.Errorf("%w: Cannot parse line: %v: %w", ErrFileParse, i, err)
}
fds[i] = uintptr(fd)
}
@@ -237,7 +244,7 @@ func (p Proc) FileDescriptorTargets() ([]string, error) {
// a process.
func (p Proc) FileDescriptorsLen() (int, error) {
// Use fast path if available (Linux v6.2): https://github.com/torvalds/linux/commit/f1f1f2569901
- if p.fs.real {
+ if p.fs.isReal {
stat, err := os.Stat(p.path("fd"))
if err != nil {
return 0, err
@@ -290,7 +297,7 @@ func (p Proc) fileDescriptors() ([]string, error) {
names, err := d.Readdirnames(-1)
if err != nil {
- return nil, fmt.Errorf("could not read %q: %w", d.Name(), err)
+ return nil, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, names, err)
}
return names, nil
diff --git a/vendor/github.com/prometheus/procfs/proc_cgroup.go b/vendor/github.com/prometheus/procfs/proc_cgroup.go
index ea83a75ffc..daeed7f571 100644
--- a/vendor/github.com/prometheus/procfs/proc_cgroup.go
+++ b/vendor/github.com/prometheus/procfs/proc_cgroup.go
@@ -51,7 +51,7 @@ func parseCgroupString(cgroupStr string) (*Cgroup, error) {
fields := strings.SplitN(cgroupStr, ":", 3)
if len(fields) < 3 {
- return nil, fmt.Errorf("at least 3 fields required, found %d fields in cgroup string: %s", len(fields), cgroupStr)
+ return nil, fmt.Errorf("%w: 3+ fields required, found %d fields in cgroup string: %s", ErrFileParse, len(fields), cgroupStr)
}
cgroup := &Cgroup{
@@ -60,7 +60,7 @@ func parseCgroupString(cgroupStr string) (*Cgroup, error) {
}
cgroup.HierarchyID, err = strconv.Atoi(fields[0])
if err != nil {
- return nil, fmt.Errorf("failed to parse hierarchy ID")
+ return nil, fmt.Errorf("%w: hierarchy ID: %q", ErrFileParse, cgroup.HierarchyID)
}
if fields[1] != "" {
ssNames := strings.Split(fields[1], ",")
diff --git a/vendor/github.com/prometheus/procfs/proc_cgroups.go b/vendor/github.com/prometheus/procfs/proc_cgroups.go
index 24d4dce9cf..5dd4938999 100644
--- a/vendor/github.com/prometheus/procfs/proc_cgroups.go
+++ b/vendor/github.com/prometheus/procfs/proc_cgroups.go
@@ -46,7 +46,7 @@ func parseCgroupSummaryString(CgroupSummaryStr string) (*CgroupSummary, error) {
fields := strings.Fields(CgroupSummaryStr)
// require at least 4 fields
if len(fields) < 4 {
- return nil, fmt.Errorf("at least 4 fields required, found %d fields in cgroup info string: %s", len(fields), CgroupSummaryStr)
+ return nil, fmt.Errorf("%w: 4+ fields required, found %d fields in cgroup info string: %s", ErrFileParse, len(fields), CgroupSummaryStr)
}
CgroupSummary := &CgroupSummary{
@@ -54,15 +54,15 @@ func parseCgroupSummaryString(CgroupSummaryStr string) (*CgroupSummary, error) {
}
CgroupSummary.Hierarchy, err = strconv.Atoi(fields[1])
if err != nil {
- return nil, fmt.Errorf("failed to parse hierarchy ID")
+ return nil, fmt.Errorf("%w: Unable to parse hierarchy ID from %q", ErrFileParse, fields[1])
}
CgroupSummary.Cgroups, err = strconv.Atoi(fields[2])
if err != nil {
- return nil, fmt.Errorf("failed to parse Cgroup Num")
+ return nil, fmt.Errorf("%w: Unable to parse Cgroup Num from %q", ErrFileParse, fields[2])
}
CgroupSummary.Enabled, err = strconv.Atoi(fields[3])
if err != nil {
- return nil, fmt.Errorf("failed to parse Enabled")
+ return nil, fmt.Errorf("%w: Unable to parse Enabled from %q", ErrFileParse, fields[3])
}
return CgroupSummary, nil
}
diff --git a/vendor/github.com/prometheus/procfs/proc_fdinfo.go b/vendor/github.com/prometheus/procfs/proc_fdinfo.go
index 1bbdd4a8e9..fa761b3529 100644
--- a/vendor/github.com/prometheus/procfs/proc_fdinfo.go
+++ b/vendor/github.com/prometheus/procfs/proc_fdinfo.go
@@ -26,6 +26,7 @@ var (
rPos = regexp.MustCompile(`^pos:\s+(\d+)$`)
rFlags = regexp.MustCompile(`^flags:\s+(\d+)$`)
rMntID = regexp.MustCompile(`^mnt_id:\s+(\d+)$`)
+ rIno = regexp.MustCompile(`^ino:\s+(\d+)$`)
rInotify = regexp.MustCompile(`^inotify`)
rInotifyParts = regexp.MustCompile(`^inotify\s+wd:([0-9a-f]+)\s+ino:([0-9a-f]+)\s+sdev:([0-9a-f]+)(?:\s+mask:([0-9a-f]+))?`)
)
@@ -40,6 +41,8 @@ type ProcFDInfo struct {
Flags string
// Mount point ID
MntID string
+ // Inode number
+ Ino string
// List of inotify lines (structured) in the fdinfo file (kernel 3.8+ only)
InotifyInfos []InotifyInfo
}
@@ -51,7 +54,7 @@ func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) {
return nil, err
}
- var text, pos, flags, mntid string
+ var text, pos, flags, mntid, ino string
var inotify []InotifyInfo
scanner := bufio.NewScanner(bytes.NewReader(data))
@@ -63,6 +66,8 @@ func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) {
flags = rFlags.FindStringSubmatch(text)[1]
} else if rMntID.MatchString(text) {
mntid = rMntID.FindStringSubmatch(text)[1]
+ } else if rIno.MatchString(text) {
+ ino = rIno.FindStringSubmatch(text)[1]
} else if rInotify.MatchString(text) {
newInotify, err := parseInotifyInfo(text)
if err != nil {
@@ -77,6 +82,7 @@ func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) {
Pos: pos,
Flags: flags,
MntID: mntid,
+ Ino: ino,
InotifyInfos: inotify,
}
@@ -111,7 +117,7 @@ func parseInotifyInfo(line string) (*InotifyInfo, error) {
}
return i, nil
}
- return nil, fmt.Errorf("invalid inode entry: %q", line)
+ return nil, fmt.Errorf("%w: invalid inode entry: %q", ErrFileParse, line)
}
// ProcFDInfos represents a list of ProcFDInfo structs.
diff --git a/vendor/github.com/prometheus/procfs/proc_interrupts.go b/vendor/github.com/prometheus/procfs/proc_interrupts.go
index 9df79c2379..86b4b45246 100644
--- a/vendor/github.com/prometheus/procfs/proc_interrupts.go
+++ b/vendor/github.com/prometheus/procfs/proc_interrupts.go
@@ -66,7 +66,7 @@ func parseInterrupts(r io.Reader) (Interrupts, error) {
continue
}
if len(parts) < 2 {
- return nil, fmt.Errorf("not enough fields in interrupts (expected at least 2 fields but got %d): %s", len(parts), parts)
+ return nil, fmt.Errorf("%w: Not enough fields in interrupts (expected 2+ fields but got %d): %s", ErrFileParse, len(parts), parts)
}
intName := parts[0][:len(parts[0])-1] // remove trailing :
diff --git a/vendor/github.com/prometheus/procfs/proc_limits.go b/vendor/github.com/prometheus/procfs/proc_limits.go
index 7a1388185a..9530b14bc6 100644
--- a/vendor/github.com/prometheus/procfs/proc_limits.go
+++ b/vendor/github.com/prometheus/procfs/proc_limits.go
@@ -103,7 +103,7 @@ func (p Proc) Limits() (ProcLimits, error) {
//fields := limitsMatch.Split(s.Text(), limitsFields)
fields := limitsMatch.FindStringSubmatch(s.Text())
if len(fields) != limitsFields {
- return ProcLimits{}, fmt.Errorf("couldn't parse %q line %q", f.Name(), s.Text())
+ return ProcLimits{}, fmt.Errorf("%w: couldn't parse %q line %q", ErrFileParse, f.Name(), s.Text())
}
switch fields[1] {
@@ -154,7 +154,7 @@ func parseUint(s string) (uint64, error) {
}
i, err := strconv.ParseUint(s, 10, 64)
if err != nil {
- return 0, fmt.Errorf("couldn't parse value %q: %w", s, err)
+ return 0, fmt.Errorf("%w: couldn't parse value %q: %w", ErrFileParse, s, err)
}
return i, nil
}
diff --git a/vendor/github.com/prometheus/procfs/proc_maps.go b/vendor/github.com/prometheus/procfs/proc_maps.go
index f1bcbf32bb..7e75c286b5 100644
--- a/vendor/github.com/prometheus/procfs/proc_maps.go
+++ b/vendor/github.com/prometheus/procfs/proc_maps.go
@@ -63,17 +63,17 @@ type ProcMap struct {
// parseDevice parses the device token of a line and converts it to a dev_t
// (mkdev) like structure.
func parseDevice(s string) (uint64, error) {
- toks := strings.Split(s, ":")
- if len(toks) < 2 {
- return 0, fmt.Errorf("unexpected number of fields")
+ i := strings.Index(s, ":")
+ if i == -1 {
+ return 0, fmt.Errorf("%w: expected separator `:` in %s", ErrFileParse, s)
}
- major, err := strconv.ParseUint(toks[0], 16, 0)
+ major, err := strconv.ParseUint(s[0:i], 16, 0)
if err != nil {
return 0, err
}
- minor, err := strconv.ParseUint(toks[1], 16, 0)
+ minor, err := strconv.ParseUint(s[i+1:], 16, 0)
if err != nil {
return 0, err
}
@@ -93,17 +93,17 @@ func parseAddress(s string) (uintptr, error) {
// parseAddresses parses the start-end address.
func parseAddresses(s string) (uintptr, uintptr, error) {
- toks := strings.Split(s, "-")
- if len(toks) < 2 {
- return 0, 0, fmt.Errorf("invalid address")
+ idx := strings.Index(s, "-")
+ if idx == -1 {
+ return 0, 0, fmt.Errorf("%w: expected separator `-` in %s", ErrFileParse, s)
}
- saddr, err := parseAddress(toks[0])
+ saddr, err := parseAddress(s[0:idx])
if err != nil {
return 0, 0, err
}
- eaddr, err := parseAddress(toks[1])
+ eaddr, err := parseAddress(s[idx+1:])
if err != nil {
return 0, 0, err
}
@@ -114,7 +114,7 @@ func parseAddresses(s string) (uintptr, uintptr, error) {
// parsePermissions parses a token and returns any that are set.
func parsePermissions(s string) (*ProcMapPermissions, error) {
if len(s) < 4 {
- return nil, fmt.Errorf("invalid permissions token")
+ return nil, fmt.Errorf("%w: invalid permissions token", ErrFileParse)
}
perms := ProcMapPermissions{}
@@ -141,7 +141,7 @@ func parsePermissions(s string) (*ProcMapPermissions, error) {
func parseProcMap(text string) (*ProcMap, error) {
fields := strings.Fields(text)
if len(fields) < 5 {
- return nil, fmt.Errorf("truncated procmap entry")
+ return nil, fmt.Errorf("%w: truncated procmap entry", ErrFileParse)
}
saddr, eaddr, err := parseAddresses(fields[0])
diff --git a/vendor/github.com/prometheus/procfs/proc_netstat.go b/vendor/github.com/prometheus/procfs/proc_netstat.go
index 6a43bb2459..8e3ff4d794 100644
--- a/vendor/github.com/prometheus/procfs/proc_netstat.go
+++ b/vendor/github.com/prometheus/procfs/proc_netstat.go
@@ -195,8 +195,8 @@ func parseProcNetstat(r io.Reader, fileName string) (ProcNetstat, error) {
// Remove trailing :.
protocol := strings.TrimSuffix(nameParts[0], ":")
if len(nameParts) != len(valueParts) {
- return procNetstat, fmt.Errorf("mismatch field count mismatch in %s: %s",
- fileName, protocol)
+ return procNetstat, fmt.Errorf("%w: mismatch field count mismatch in %s: %s",
+ ErrFileParse, fileName, protocol)
}
for i := 1; i < len(nameParts); i++ {
value, err := strconv.ParseFloat(valueParts[i], 64)
diff --git a/vendor/github.com/prometheus/procfs/proc_ns.go b/vendor/github.com/prometheus/procfs/proc_ns.go
index 391b4cbd11..0f8f847f95 100644
--- a/vendor/github.com/prometheus/procfs/proc_ns.go
+++ b/vendor/github.com/prometheus/procfs/proc_ns.go
@@ -40,7 +40,7 @@ func (p Proc) Namespaces() (Namespaces, error) {
names, err := d.Readdirnames(-1)
if err != nil {
- return nil, fmt.Errorf("failed to read contents of ns dir: %w", err)
+ return nil, fmt.Errorf("%w: failed to read contents of ns dir: %w", ErrFileRead, err)
}
ns := make(Namespaces, len(names))
@@ -52,13 +52,13 @@ func (p Proc) Namespaces() (Namespaces, error) {
fields := strings.SplitN(target, ":", 2)
if len(fields) != 2 {
- return nil, fmt.Errorf("failed to parse namespace type and inode from %q", target)
+ return nil, fmt.Errorf("%w: namespace type and inode from %q", ErrFileParse, target)
}
typ := fields[0]
inode, err := strconv.ParseUint(strings.Trim(fields[1], "[]"), 10, 32)
if err != nil {
- return nil, fmt.Errorf("failed to parse inode from %q: %w", fields[1], err)
+ return nil, fmt.Errorf("%w: inode from %q: %w", ErrFileParse, fields[1], err)
}
ns[name] = Namespace{typ, uint32(inode)}
diff --git a/vendor/github.com/prometheus/procfs/proc_psi.go b/vendor/github.com/prometheus/procfs/proc_psi.go
index a68fe15290..ccd35f153a 100644
--- a/vendor/github.com/prometheus/procfs/proc_psi.go
+++ b/vendor/github.com/prometheus/procfs/proc_psi.go
@@ -61,14 +61,14 @@ type PSIStats struct {
func (fs FS) PSIStatsForResource(resource string) (PSIStats, error) {
data, err := util.ReadFileNoStat(fs.proc.Path(fmt.Sprintf("%s/%s", "pressure", resource)))
if err != nil {
- return PSIStats{}, fmt.Errorf("psi_stats: unavailable for %q: %w", resource, err)
+ return PSIStats{}, fmt.Errorf("%w: psi_stats: unavailable for %q: %w", ErrFileRead, resource, err)
}
- return parsePSIStats(resource, bytes.NewReader(data))
+ return parsePSIStats(bytes.NewReader(data))
}
// parsePSIStats parses the specified file for pressure stall information.
-func parsePSIStats(resource string, r io.Reader) (PSIStats, error) {
+func parsePSIStats(r io.Reader) (PSIStats, error) {
psiStats := PSIStats{}
scanner := bufio.NewScanner(r)
diff --git a/vendor/github.com/prometheus/procfs/proc_smaps.go b/vendor/github.com/prometheus/procfs/proc_smaps.go
index 0e97d99575..09060e8208 100644
--- a/vendor/github.com/prometheus/procfs/proc_smaps.go
+++ b/vendor/github.com/prometheus/procfs/proc_smaps.go
@@ -127,7 +127,7 @@ func (s *ProcSMapsRollup) parseLine(line string) error {
}
v := strings.TrimSpace(kv[1])
- v = strings.TrimRight(v, " kB")
+ v = strings.TrimSuffix(v, " kB")
vKBytes, err := strconv.ParseUint(v, 10, 64)
if err != nil {
@@ -135,12 +135,12 @@ func (s *ProcSMapsRollup) parseLine(line string) error {
}
vBytes := vKBytes * 1024
- s.addValue(k, v, vKBytes, vBytes)
+ s.addValue(k, vBytes)
return nil
}
-func (s *ProcSMapsRollup) addValue(k string, vString string, vUint uint64, vUintBytes uint64) {
+func (s *ProcSMapsRollup) addValue(k string, vUintBytes uint64) {
switch k {
case "Rss":
s.Rss += vUintBytes
diff --git a/vendor/github.com/prometheus/procfs/proc_snmp.go b/vendor/github.com/prometheus/procfs/proc_snmp.go
index 6c46b71884..b9d2cf642a 100644
--- a/vendor/github.com/prometheus/procfs/proc_snmp.go
+++ b/vendor/github.com/prometheus/procfs/proc_snmp.go
@@ -159,8 +159,8 @@ func parseSnmp(r io.Reader, fileName string) (ProcSnmp, error) {
// Remove trailing :.
protocol := strings.TrimSuffix(nameParts[0], ":")
if len(nameParts) != len(valueParts) {
- return procSnmp, fmt.Errorf("mismatch field count mismatch in %s: %s",
- fileName, protocol)
+ return procSnmp, fmt.Errorf("%w: mismatch field count mismatch in %s: %s",
+ ErrFileParse, fileName, protocol)
}
for i := 1; i < len(nameParts); i++ {
value, err := strconv.ParseFloat(valueParts[i], 64)
diff --git a/vendor/github.com/prometheus/procfs/proc_stat.go b/vendor/github.com/prometheus/procfs/proc_stat.go
index 14b249f4fc..06a8d931c9 100644
--- a/vendor/github.com/prometheus/procfs/proc_stat.go
+++ b/vendor/github.com/prometheus/procfs/proc_stat.go
@@ -110,6 +110,11 @@ type ProcStat struct {
Policy uint
// Aggregated block I/O delays, measured in clock ticks (centiseconds).
DelayAcctBlkIOTicks uint64
+ // Guest time of the process (time spent running a virtual CPU for a guest
+ // operating system), measured in clock ticks.
+ GuestTime int
+ // Guest time of the process's children, measured in clock ticks.
+ CGuestTime int
proc FS
}
@@ -138,7 +143,7 @@ func (p Proc) Stat() (ProcStat, error) {
)
if l < 0 || r < 0 {
- return ProcStat{}, fmt.Errorf("unexpected format, couldn't extract comm %q", data)
+ return ProcStat{}, fmt.Errorf("%w: unexpected format, couldn't extract comm %q", ErrFileParse, data)
}
s.Comm = string(data[l+1 : r])
@@ -189,6 +194,8 @@ func (p Proc) Stat() (ProcStat, error) {
&s.RTPriority,
&s.Policy,
&s.DelayAcctBlkIOTicks,
+ &s.GuestTime,
+ &s.CGuestTime,
)
if err != nil {
return ProcStat{}, err
diff --git a/vendor/github.com/prometheus/procfs/proc_status.go b/vendor/github.com/prometheus/procfs/proc_status.go
index c055d075db..a055197c63 100644
--- a/vendor/github.com/prometheus/procfs/proc_status.go
+++ b/vendor/github.com/prometheus/procfs/proc_status.go
@@ -15,6 +15,7 @@ package procfs
import (
"bytes"
+ "math/bits"
"sort"
"strconv"
"strings"
@@ -23,7 +24,7 @@ import (
)
// ProcStatus provides status information about the process,
-// read from /proc/[pid]/stat.
+// read from /proc/[pid]/status.
type ProcStatus struct {
// The process ID.
PID int
@@ -32,6 +33,8 @@ type ProcStatus struct {
// Thread group ID.
TGID int
+ // List of Pid namespace.
+ NSpids []uint64
// Peak virtual memory size.
VmPeak uint64 // nolint:revive
@@ -74,9 +77,9 @@ type ProcStatus struct {
NonVoluntaryCtxtSwitches uint64
// UIDs of the process (Real, effective, saved set, and filesystem UIDs)
- UIDs [4]string
+ UIDs [4]uint64
// GIDs of the process (Real, effective, saved set, and filesystem GIDs)
- GIDs [4]string
+ GIDs [4]uint64
// CpusAllowedList: List of cpu cores processes are allowed to run on.
CpusAllowedList []uint64
@@ -111,22 +114,39 @@ func (p Proc) NewStatus() (ProcStatus, error) {
// convert kB to B
vBytes := vKBytes * 1024
- s.fillStatus(k, v, vKBytes, vBytes)
+ err = s.fillStatus(k, v, vKBytes, vBytes)
+ if err != nil {
+ return ProcStatus{}, err
+ }
}
return s, nil
}
-func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintBytes uint64) {
+func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintBytes uint64) error {
switch k {
case "Tgid":
s.TGID = int(vUint)
case "Name":
s.Name = vString
case "Uid":
- copy(s.UIDs[:], strings.Split(vString, "\t"))
+ var err error
+ for i, v := range strings.Split(vString, "\t") {
+ s.UIDs[i], err = strconv.ParseUint(v, 10, bits.UintSize)
+ if err != nil {
+ return err
+ }
+ }
case "Gid":
- copy(s.GIDs[:], strings.Split(vString, "\t"))
+ var err error
+ for i, v := range strings.Split(vString, "\t") {
+ s.GIDs[i], err = strconv.ParseUint(v, 10, bits.UintSize)
+ if err != nil {
+ return err
+ }
+ }
+ case "NSpid":
+ s.NSpids = calcNSPidsList(vString)
case "VmPeak":
s.VmPeak = vUintBytes
case "VmSize":
@@ -169,6 +189,7 @@ func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintByt
s.CpusAllowedList = calcCpusAllowedList(vString)
}
+ return nil
}
// TotalCtxtSwitches returns the total context switch.
@@ -200,3 +221,18 @@ func calcCpusAllowedList(cpuString string) []uint64 {
sort.Slice(g, func(i, j int) bool { return g[i] < g[j] })
return g
}
+
+func calcNSPidsList(nspidsString string) []uint64 {
+ s := strings.Split(nspidsString, " ")
+ var nspids []uint64
+
+ for _, nspid := range s {
+ nspid, _ := strconv.ParseUint(nspid, 10, 64)
+ if nspid == 0 {
+ continue
+ }
+ nspids = append(nspids, nspid)
+ }
+
+ return nspids
+}
diff --git a/vendor/github.com/prometheus/procfs/proc_sys.go b/vendor/github.com/prometheus/procfs/proc_sys.go
index d46533ebf4..5eefbe2ef8 100644
--- a/vendor/github.com/prometheus/procfs/proc_sys.go
+++ b/vendor/github.com/prometheus/procfs/proc_sys.go
@@ -44,7 +44,7 @@ func (fs FS) SysctlInts(sysctl string) ([]int, error) {
vp := util.NewValueParser(f)
values[i] = vp.Int()
if err := vp.Err(); err != nil {
- return nil, fmt.Errorf("field %d in sysctl %s is not a valid int: %w", i, sysctl, err)
+ return nil, fmt.Errorf("%w: field %d in sysctl %s is not a valid int: %w", ErrFileParse, i, sysctl, err)
}
}
return values, nil
diff --git a/vendor/github.com/prometheus/procfs/slab.go b/vendor/github.com/prometheus/procfs/slab.go
index bc9aaf5c28..8611c90177 100644
--- a/vendor/github.com/prometheus/procfs/slab.go
+++ b/vendor/github.com/prometheus/procfs/slab.go
@@ -68,7 +68,7 @@ func parseV21SlabEntry(line string) (*Slab, error) {
l := slabSpace.ReplaceAllString(line, " ")
s := strings.Split(l, " ")
if len(s) != 16 {
- return nil, fmt.Errorf("unable to parse: %q", line)
+ return nil, fmt.Errorf("%w: unable to parse: %q", ErrFileParse, line)
}
var err error
i := &Slab{Name: s[0]}
diff --git a/vendor/github.com/prometheus/procfs/softirqs.go b/vendor/github.com/prometheus/procfs/softirqs.go
index 559129cbca..28708e0745 100644
--- a/vendor/github.com/prometheus/procfs/softirqs.go
+++ b/vendor/github.com/prometheus/procfs/softirqs.go
@@ -57,7 +57,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
)
if !scanner.Scan() {
- return Softirqs{}, fmt.Errorf("softirqs empty")
+ return Softirqs{}, fmt.Errorf("%w: softirqs empty", ErrFileRead)
}
for scanner.Scan() {
@@ -74,7 +74,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.Hi = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.Hi[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse %q (HI%d): %w", count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (HI%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "TIMER:":
@@ -82,7 +82,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.Timer = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.Timer[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse %q (TIMER%d): %w", count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (TIMER%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "NET_TX:":
@@ -90,7 +90,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.NetTx = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.NetTx[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse %q (NET_TX%d): %w", count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (NET_TX%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "NET_RX:":
@@ -98,7 +98,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.NetRx = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.NetRx[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse %q (NET_RX%d): %w", count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (NET_RX%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "BLOCK:":
@@ -106,7 +106,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.Block = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.Block[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse %q (BLOCK%d): %w", count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (BLOCK%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "IRQ_POLL:":
@@ -114,7 +114,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.IRQPoll = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.IRQPoll[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse %q (IRQ_POLL%d): %w", count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (IRQ_POLL%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "TASKLET:":
@@ -122,7 +122,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.Tasklet = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.Tasklet[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse %q (TASKLET%d): %w", count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (TASKLET%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "SCHED:":
@@ -130,7 +130,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.Sched = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.Sched[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse %q (SCHED%d): %w", count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (SCHED%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "HRTIMER:":
@@ -138,7 +138,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.HRTimer = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.HRTimer[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse %q (HRTIMER%d): %w", count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (HRTIMER%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "RCU:":
@@ -146,14 +146,14 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.RCU = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.RCU[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse %q (RCU%d): %w", count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (RCU%d): %w", ErrFileParse, count, i, err)
}
}
}
}
if err := scanner.Err(); err != nil {
- return Softirqs{}, fmt.Errorf("couldn't parse softirqs: %w", err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse softirqs: %w", ErrFileParse, err)
}
return softirqs, scanner.Err()
diff --git a/vendor/github.com/prometheus/procfs/stat.go b/vendor/github.com/prometheus/procfs/stat.go
index 586af48af9..e36b41c18a 100644
--- a/vendor/github.com/prometheus/procfs/stat.go
+++ b/vendor/github.com/prometheus/procfs/stat.go
@@ -93,10 +93,10 @@ func parseCPUStat(line string) (CPUStat, int64, error) {
&cpuStat.Guest, &cpuStat.GuestNice)
if err != nil && err != io.EOF {
- return CPUStat{}, -1, fmt.Errorf("couldn't parse %q (cpu): %w", line, err)
+ return CPUStat{}, -1, fmt.Errorf("%w: couldn't parse %q (cpu): %w", ErrFileParse, line, err)
}
if count == 0 {
- return CPUStat{}, -1, fmt.Errorf("couldn't parse %q (cpu): 0 elements parsed", line)
+ return CPUStat{}, -1, fmt.Errorf("%w: couldn't parse %q (cpu): 0 elements parsed", ErrFileParse, line)
}
cpuStat.User /= userHZ
@@ -116,7 +116,7 @@ func parseCPUStat(line string) (CPUStat, int64, error) {
cpuID, err := strconv.ParseInt(cpu[3:], 10, 64)
if err != nil {
- return CPUStat{}, -1, fmt.Errorf("couldn't parse %q (cpu/cpuid): %w", line, err)
+ return CPUStat{}, -1, fmt.Errorf("%w: couldn't parse %q (cpu/cpuid): %w", ErrFileParse, line, err)
}
return cpuStat, cpuID, nil
@@ -136,7 +136,7 @@ func parseSoftIRQStat(line string) (SoftIRQStat, uint64, error) {
&softIRQStat.Hrtimer, &softIRQStat.Rcu)
if err != nil {
- return SoftIRQStat{}, 0, fmt.Errorf("couldn't parse %q (softirq): %w", line, err)
+ return SoftIRQStat{}, 0, fmt.Errorf("%w: couldn't parse %q (softirq): %w", ErrFileParse, line, err)
}
return softIRQStat, total, nil
@@ -187,6 +187,10 @@ func parseStat(r io.Reader, fileName string) (Stat, error) {
err error
)
+ // Increase default scanner buffer to handle very long `intr` lines.
+ buf := make([]byte, 0, 8*1024)
+ scanner.Buffer(buf, 1024*1024)
+
for scanner.Scan() {
line := scanner.Text()
parts := strings.Fields(scanner.Text())
@@ -197,34 +201,34 @@ func parseStat(r io.Reader, fileName string) (Stat, error) {
switch {
case parts[0] == "btime":
if stat.BootTime, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("couldn't parse %q (btime): %w", parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (btime): %w", ErrFileParse, parts[1], err)
}
case parts[0] == "intr":
if stat.IRQTotal, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("couldn't parse %q (intr): %w", parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (intr): %w", ErrFileParse, parts[1], err)
}
numberedIRQs := parts[2:]
stat.IRQ = make([]uint64, len(numberedIRQs))
for i, count := range numberedIRQs {
if stat.IRQ[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Stat{}, fmt.Errorf("couldn't parse %q (intr%d): %w", count, i, err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (intr%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "ctxt":
if stat.ContextSwitches, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("couldn't parse %q (ctxt): %w", parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (ctxt): %w", ErrFileParse, parts[1], err)
}
case parts[0] == "processes":
if stat.ProcessCreated, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("couldn't parse %q (processes): %w", parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (processes): %w", ErrFileParse, parts[1], err)
}
case parts[0] == "procs_running":
if stat.ProcessesRunning, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("couldn't parse %q (procs_running): %w", parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (procs_running): %w", ErrFileParse, parts[1], err)
}
case parts[0] == "procs_blocked":
if stat.ProcessesBlocked, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("couldn't parse %q (procs_blocked): %w", parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (procs_blocked): %w", ErrFileParse, parts[1], err)
}
case parts[0] == "softirq":
softIRQStats, total, err := parseSoftIRQStat(line)
@@ -247,7 +251,7 @@ func parseStat(r io.Reader, fileName string) (Stat, error) {
}
if err := scanner.Err(); err != nil {
- return Stat{}, fmt.Errorf("couldn't parse %q: %w", fileName, err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q: %w", ErrFileParse, fileName, err)
}
return stat, nil
diff --git a/vendor/github.com/prometheus/procfs/swaps.go b/vendor/github.com/prometheus/procfs/swaps.go
index 15edc2212b..65fec834bf 100644
--- a/vendor/github.com/prometheus/procfs/swaps.go
+++ b/vendor/github.com/prometheus/procfs/swaps.go
@@ -64,7 +64,7 @@ func parseSwapString(swapString string) (*Swap, error) {
swapFields := strings.Fields(swapString)
swapLength := len(swapFields)
if swapLength < 5 {
- return nil, fmt.Errorf("too few fields in swap string: %s", swapString)
+ return nil, fmt.Errorf("%w: too few fields in swap string: %s", ErrFileParse, swapString)
}
swap := &Swap{
@@ -74,15 +74,15 @@ func parseSwapString(swapString string) (*Swap, error) {
swap.Size, err = strconv.Atoi(swapFields[2])
if err != nil {
- return nil, fmt.Errorf("invalid swap size: %s", swapFields[2])
+ return nil, fmt.Errorf("%w: invalid swap size: %s: %w", ErrFileParse, swapFields[2], err)
}
swap.Used, err = strconv.Atoi(swapFields[3])
if err != nil {
- return nil, fmt.Errorf("invalid swap used: %s", swapFields[3])
+ return nil, fmt.Errorf("%w: invalid swap used: %s: %w", ErrFileParse, swapFields[3], err)
}
swap.Priority, err = strconv.Atoi(swapFields[4])
if err != nil {
- return nil, fmt.Errorf("invalid swap priority: %s", swapFields[4])
+ return nil, fmt.Errorf("%w: invalid swap priority: %s: %w", ErrFileParse, swapFields[4], err)
}
return swap, nil
diff --git a/vendor/github.com/prometheus/procfs/thread.go b/vendor/github.com/prometheus/procfs/thread.go
index 490c14708d..80e0e947be 100644
--- a/vendor/github.com/prometheus/procfs/thread.go
+++ b/vendor/github.com/prometheus/procfs/thread.go
@@ -45,7 +45,7 @@ func (fs FS) AllThreads(pid int) (Procs, error) {
names, err := d.Readdirnames(-1)
if err != nil {
- return Procs{}, fmt.Errorf("could not read %q: %w", d.Name(), err)
+ return Procs{}, fmt.Errorf("%w: could not read %q: %w", ErrFileRead, d.Name(), err)
}
t := Procs{}
@@ -55,7 +55,7 @@ func (fs FS) AllThreads(pid int) (Procs, error) {
continue
}
- t = append(t, Proc{PID: int(tid), fs: FS{fsi.FS(taskPath), fs.real}})
+ t = append(t, Proc{PID: int(tid), fs: FS{fsi.FS(taskPath), fs.isReal}})
}
return t, nil
@@ -67,12 +67,12 @@ func (fs FS) Thread(pid, tid int) (Proc, error) {
if _, err := os.Stat(taskPath); err != nil {
return Proc{}, err
}
- return Proc{PID: tid, fs: FS{fsi.FS(taskPath), fs.real}}, nil
+ return Proc{PID: tid, fs: FS{fsi.FS(taskPath), fs.isReal}}, nil
}
// Thread returns a process for a given TID of Proc.
func (proc Proc) Thread(tid int) (Proc, error) {
- tfs := FS{fsi.FS(proc.path("task")), proc.fs.real}
+ tfs := FS{fsi.FS(proc.path("task")), proc.fs.isReal}
if _, err := os.Stat(tfs.proc.Path(strconv.Itoa(tid))); err != nil {
return Proc{}, err
}
diff --git a/vendor/github.com/prometheus/procfs/vm.go b/vendor/github.com/prometheus/procfs/vm.go
index cdedcae996..51c49d89e8 100644
--- a/vendor/github.com/prometheus/procfs/vm.go
+++ b/vendor/github.com/prometheus/procfs/vm.go
@@ -86,7 +86,7 @@ func (fs FS) VM() (*VM, error) {
return nil, err
}
if !file.Mode().IsDir() {
- return nil, fmt.Errorf("%s is not a directory", path)
+ return nil, fmt.Errorf("%w: %s is not a directory", ErrFileRead, path)
}
files, err := os.ReadDir(path)
diff --git a/vendor/github.com/prometheus/procfs/zoneinfo.go b/vendor/github.com/prometheus/procfs/zoneinfo.go
index c745a4c04f..e54d94b090 100644
--- a/vendor/github.com/prometheus/procfs/zoneinfo.go
+++ b/vendor/github.com/prometheus/procfs/zoneinfo.go
@@ -75,11 +75,11 @@ var nodeZoneRE = regexp.MustCompile(`(\d+), zone\s+(\w+)`)
func (fs FS) Zoneinfo() ([]Zoneinfo, error) {
data, err := os.ReadFile(fs.proc.Path("zoneinfo"))
if err != nil {
- return nil, fmt.Errorf("error reading zoneinfo %q: %w", fs.proc.Path("zoneinfo"), err)
+ return nil, fmt.Errorf("%w: error reading zoneinfo %q: %w", ErrFileRead, fs.proc.Path("zoneinfo"), err)
}
zoneinfo, err := parseZoneinfo(data)
if err != nil {
- return nil, fmt.Errorf("error parsing zoneinfo %q: %w", fs.proc.Path("zoneinfo"), err)
+ return nil, fmt.Errorf("%w: error parsing zoneinfo %q: %w", ErrFileParse, fs.proc.Path("zoneinfo"), err)
}
return zoneinfo, nil
}
diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md
index b042c896f2..d1d4a85fd7 100644
--- a/vendor/github.com/sirupsen/logrus/README.md
+++ b/vendor/github.com/sirupsen/logrus/README.md
@@ -9,7 +9,7 @@ the last thing you want from your Logging library (again...).
This does not mean Logrus is dead. Logrus will continue to be maintained for
security, (backwards compatible) bug fixes, and performance (where we are
-limited by the interface).
+limited by the interface).
I believe Logrus' biggest contribution is to have played a part in today's
widespread use of structured logging in Golang. There doesn't seem to be a
@@ -43,7 +43,7 @@ plain text):
With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash
or Splunk:
-```json
+```text
{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the
ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"}
@@ -99,7 +99,7 @@ time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcr
```
Note that this does add measurable overhead - the cost will depend on the version of Go, but is
between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your
-environment via benchmarks:
+environment via benchmarks:
```
go test -bench=.*CallerTracing
```
@@ -317,6 +317,8 @@ log.SetLevel(log.InfoLevel)
It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose
environment if your application has that.
+Note: If you want different log levels for global (`log.SetLevel(...)`) and syslog logging, please check the [syslog hook README](hooks/syslog/README.md#different-log-levels-for-local-and-remote-logging).
+
#### Entries
Besides the fields added with `WithField` or `WithFields` some fields are
diff --git a/vendor/github.com/sirupsen/logrus/writer.go b/vendor/github.com/sirupsen/logrus/writer.go
index 72e8e3a1b6..074fd4b8bd 100644
--- a/vendor/github.com/sirupsen/logrus/writer.go
+++ b/vendor/github.com/sirupsen/logrus/writer.go
@@ -4,6 +4,7 @@ import (
"bufio"
"io"
"runtime"
+ "strings"
)
// Writer at INFO level. See WriterLevel for details.
@@ -20,15 +21,18 @@ func (logger *Logger) WriterLevel(level Level) *io.PipeWriter {
return NewEntry(logger).WriterLevel(level)
}
+// Writer returns an io.Writer that writes to the logger at the info log level
func (entry *Entry) Writer() *io.PipeWriter {
return entry.WriterLevel(InfoLevel)
}
+// WriterLevel returns an io.Writer that writes to the logger at the given log level
func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {
reader, writer := io.Pipe()
var printFunc func(args ...interface{})
+ // Determine which log function to use based on the specified log level
switch level {
case TraceLevel:
printFunc = entry.Trace
@@ -48,23 +52,51 @@ func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {
printFunc = entry.Print
}
+ // Start a new goroutine to scan the input and write it to the logger using the specified print function.
+ // It splits the input into chunks of up to 64KB to avoid buffer overflows.
go entry.writerScanner(reader, printFunc)
+
+ // Set a finalizer function to close the writer when it is garbage collected
runtime.SetFinalizer(writer, writerFinalizer)
return writer
}
+// writerScanner scans the input from the reader and writes it to the logger
func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) {
scanner := bufio.NewScanner(reader)
+
+ // Set the buffer size to the maximum token size to avoid buffer overflows
+ scanner.Buffer(make([]byte, bufio.MaxScanTokenSize), bufio.MaxScanTokenSize)
+
+ // Define a split function to split the input into chunks of up to 64KB
+ chunkSize := bufio.MaxScanTokenSize // 64KB
+ splitFunc := func(data []byte, atEOF bool) (int, []byte, error) {
+ if len(data) >= chunkSize {
+ return chunkSize, data[:chunkSize], nil
+ }
+
+ return bufio.ScanLines(data, atEOF)
+ }
+
+ // Use the custom split function to split the input
+ scanner.Split(splitFunc)
+
+ // Scan the input and write it to the logger using the specified print function
for scanner.Scan() {
- printFunc(scanner.Text())
+ printFunc(strings.TrimRight(scanner.Text(), "\r\n"))
}
+
+ // If there was an error while scanning the input, log an error
if err := scanner.Err(); err != nil {
entry.Errorf("Error while reading from Writer: %s", err)
}
+
+ // Close the reader when we are done
reader.Close()
}
+// WriterFinalizer is a finalizer function that closes then given writer when it is garbage collected
func writerFinalizer(writer *io.PipeWriter) {
writer.Close()
}
diff --git a/vendor/github.com/spf13/cobra/.golangci.yml b/vendor/github.com/spf13/cobra/.golangci.yml
index 2578d94b5e..2c8f4808c1 100644
--- a/vendor/github.com/spf13/cobra/.golangci.yml
+++ b/vendor/github.com/spf13/cobra/.golangci.yml
@@ -19,44 +19,39 @@ linters:
disable-all: true
enable:
#- bodyclose
- - deadcode
+ # - deadcode ! deprecated since v1.49.0; replaced by 'unused'
#- depguard
#- dogsled
#- dupl
- errcheck
#- exhaustive
#- funlen
- - gas
#- gochecknoinits
- goconst
- #- gocritic
+ - gocritic
#- gocyclo
- #- gofmt
+ - gofmt
- goimports
- - golint
#- gomnd
#- goprintffuncname
- #- gosec
- #- gosimple
+ - gosec
+ - gosimple
- govet
- ineffassign
- - interfacer
#- lll
- - maligned
- - megacheck
- #- misspell
+ - misspell
#- nakedret
#- noctx
- #- nolintlint
+ - nolintlint
#- rowserrcheck
#- scopelint
- #- staticcheck
- - structcheck
- #- stylecheck
+ - staticcheck
+ #- structcheck ! deprecated since v1.49.0; replaced by 'unused'
+ - stylecheck
#- typecheck
- unconvert
#- unparam
- #- unused
- - varcheck
+ - unused
+ # - varcheck ! deprecated since v1.49.0; replaced by 'unused'
#- whitespace
fast: false
diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md
index 592c0b8ab0..6444f4b7f6 100644
--- a/vendor/github.com/spf13/cobra/README.md
+++ b/vendor/github.com/spf13/cobra/README.md
@@ -4,7 +4,7 @@ Cobra is a library for creating powerful modern CLI applications.
Cobra is used in many Go projects such as [Kubernetes](https://kubernetes.io/),
[Hugo](https://gohugo.io), and [GitHub CLI](https://github.com/cli/cli) to
-name a few. [This list](./projects_using_cobra.md) contains a more extensive list of projects using Cobra.
+name a few. [This list](site/content/projects_using_cobra.md) contains a more extensive list of projects using Cobra.
[](https://github.com/spf13/cobra/actions?query=workflow%3ATest)
[](https://pkg.go.dev/github.com/spf13/cobra)
@@ -80,7 +80,7 @@ which maintains the same interface while adding POSIX compliance.
# Installing
Using Cobra is easy. First, use `go get` to install the latest version
-of the library.
+of the library.
```
go get -u github.com/spf13/cobra@latest
@@ -105,8 +105,8 @@ go install github.com/spf13/cobra-cli@latest
For complete details on using the Cobra-CLI generator, please read [The Cobra Generator README](https://github.com/spf13/cobra-cli/blob/main/README.md)
-For complete details on using the Cobra library, please read the [The Cobra User Guide](user_guide.md).
+For complete details on using the Cobra library, please read the [The Cobra User Guide](site/content/user_guide.md).
# License
-Cobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt)
+Cobra is released under the Apache 2.0 license. See [LICENSE.txt](LICENSE.txt)
diff --git a/vendor/github.com/spf13/cobra/active_help.go b/vendor/github.com/spf13/cobra/active_help.go
index 2d0239437a..25c30e3ccc 100644
--- a/vendor/github.com/spf13/cobra/active_help.go
+++ b/vendor/github.com/spf13/cobra/active_help.go
@@ -17,15 +17,14 @@ package cobra
import (
"fmt"
"os"
- "strings"
)
const (
activeHelpMarker = "_activeHelp_ "
// The below values should not be changed: programs will be using them explicitly
// in their user documentation, and users will be using them explicitly.
- activeHelpEnvVarSuffix = "_ACTIVE_HELP"
- activeHelpGlobalEnvVar = "COBRA_ACTIVE_HELP"
+ activeHelpEnvVarSuffix = "ACTIVE_HELP"
+ activeHelpGlobalEnvVar = configEnvVarGlobalPrefix + "_" + activeHelpEnvVarSuffix
activeHelpGlobalDisable = "0"
)
@@ -42,7 +41,7 @@ func AppendActiveHelp(compArray []string, activeHelpStr string) []string {
// GetActiveHelpConfig returns the value of the ActiveHelp environment variable
// _ACTIVE_HELP where is the name of the root command in upper
-// case, with all - replaced by _.
+// case, with all non-ASCII-alphanumeric characters replaced by `_`.
// It will always return "0" if the global environment variable COBRA_ACTIVE_HELP
// is set to "0".
func GetActiveHelpConfig(cmd *Command) string {
@@ -55,9 +54,7 @@ func GetActiveHelpConfig(cmd *Command) string {
// activeHelpEnvVar returns the name of the program-specific ActiveHelp environment
// variable. It has the format _ACTIVE_HELP where is the name of the
-// root command in upper case, with all - replaced by _.
+// root command in upper case, with all non-ASCII-alphanumeric characters replaced by `_`.
func activeHelpEnvVar(name string) string {
- // This format should not be changed: users will be using it explicitly.
- activeHelpEnvVar := strings.ToUpper(fmt.Sprintf("%s%s", name, activeHelpEnvVarSuffix))
- return strings.ReplaceAll(activeHelpEnvVar, "-", "_")
+ return configEnvVar(name, activeHelpEnvVarSuffix)
}
diff --git a/vendor/github.com/spf13/cobra/active_help.md b/vendor/github.com/spf13/cobra/active_help.md
deleted file mode 100644
index 5e7f59af38..0000000000
--- a/vendor/github.com/spf13/cobra/active_help.md
+++ /dev/null
@@ -1,157 +0,0 @@
-# Active Help
-
-Active Help is a framework provided by Cobra which allows a program to define messages (hints, warnings, etc) that will be printed during program usage. It aims to make it easier for your users to learn how to use your program. If configured by the program, Active Help is printed when the user triggers shell completion.
-
-For example,
-```
-bash-5.1$ helm repo add [tab]
-You must choose a name for the repo you are adding.
-
-bash-5.1$ bin/helm package [tab]
-Please specify the path to the chart to package
-
-bash-5.1$ bin/helm package [tab][tab]
-bin/ internal/ scripts/ pkg/ testdata/
-```
-
-**Hint**: A good place to use Active Help messages is when the normal completion system does not provide any suggestions. In such cases, Active Help nicely supplements the normal shell completions to guide the user in knowing what is expected by the program.
-## Supported shells
-
-Active Help is currently only supported for the following shells:
-- Bash (using [bash completion V2](shell_completions.md#bash-completion-v2) only). Note that bash 4.4 or higher is required for the prompt to appear when an Active Help message is printed.
-- Zsh
-
-## Adding Active Help messages
-
-As Active Help uses the shell completion system, the implementation of Active Help messages is done by enhancing custom dynamic completions. If you are not familiar with dynamic completions, please refer to [Shell Completions](shell_completions.md).
-
-Adding Active Help is done through the use of the `cobra.AppendActiveHelp(...)` function, where the program repeatedly adds Active Help messages to the list of completions. Keep reading for details.
-
-### Active Help for nouns
-
-Adding Active Help when completing a noun is done within the `ValidArgsFunction(...)` of a command. Please notice the use of `cobra.AppendActiveHelp(...)` in the following example:
-
-```go
-cmd := &cobra.Command{
- Use: "add [NAME] [URL]",
- Short: "add a chart repository",
- Args: require.ExactArgs(2),
- RunE: func(cmd *cobra.Command, args []string) error {
- return addRepo(args)
- },
- ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- var comps []string
- if len(args) == 0 {
- comps = cobra.AppendActiveHelp(comps, "You must choose a name for the repo you are adding")
- } else if len(args) == 1 {
- comps = cobra.AppendActiveHelp(comps, "You must specify the URL for the repo you are adding")
- } else {
- comps = cobra.AppendActiveHelp(comps, "This command does not take any more arguments")
- }
- return comps, cobra.ShellCompDirectiveNoFileComp
- },
-}
-```
-The example above defines the completions (none, in this specific example) as well as the Active Help messages for the `helm repo add` command. It yields the following behavior:
-```
-bash-5.1$ helm repo add [tab]
-You must choose a name for the repo you are adding
-
-bash-5.1$ helm repo add grafana [tab]
-You must specify the URL for the repo you are adding
-
-bash-5.1$ helm repo add grafana https://grafana.github.io/helm-charts [tab]
-This command does not take any more arguments
-```
-**Hint**: As can be seen in the above example, a good place to use Active Help messages is when the normal completion system does not provide any suggestions. In such cases, Active Help nicely supplements the normal shell completions.
-
-### Active Help for flags
-
-Providing Active Help for flags is done in the same fashion as for nouns, but using the completion function registered for the flag. For example:
-```go
-_ = cmd.RegisterFlagCompletionFunc("version", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- if len(args) != 2 {
- return cobra.AppendActiveHelp(nil, "You must first specify the chart to install before the --version flag can be completed"), cobra.ShellCompDirectiveNoFileComp
- }
- return compVersionFlag(args[1], toComplete)
- })
-```
-The example above prints an Active Help message when not enough information was given by the user to complete the `--version` flag.
-```
-bash-5.1$ bin/helm install myrelease --version 2.0.[tab]
-You must first specify the chart to install before the --version flag can be completed
-
-bash-5.1$ bin/helm install myrelease bitnami/solr --version 2.0.[tab][tab]
-2.0.1 2.0.2 2.0.3
-```
-
-## User control of Active Help
-
-You may want to allow your users to disable Active Help or choose between different levels of Active Help. It is entirely up to the program to define the type of configurability of Active Help that it wants to offer, if any.
-Allowing to configure Active Help is entirely optional; you can use Active Help in your program without doing anything about Active Help configuration.
-
-The way to configure Active Help is to use the program's Active Help environment
-variable. That variable is named `_ACTIVE_HELP` where `` is the name of your
-program in uppercase with any `-` replaced by an `_`. The variable should be set by the user to whatever
-Active Help configuration values are supported by the program.
-
-For example, say `helm` has chosen to support three levels for Active Help: `on`, `off`, `local`. Then a user
-would set the desired behavior to `local` by doing `export HELM_ACTIVE_HELP=local` in their shell.
-
-For simplicity, when in `cmd.ValidArgsFunction(...)` or a flag's completion function, the program should read the
-Active Help configuration using the `cobra.GetActiveHelpConfig(cmd)` function and select what Active Help messages
-should or should not be added (instead of reading the environment variable directly).
-
-For example:
-```go
-ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- activeHelpLevel := cobra.GetActiveHelpConfig(cmd)
-
- var comps []string
- if len(args) == 0 {
- if activeHelpLevel != "off" {
- comps = cobra.AppendActiveHelp(comps, "You must choose a name for the repo you are adding")
- }
- } else if len(args) == 1 {
- if activeHelpLevel != "off" {
- comps = cobra.AppendActiveHelp(comps, "You must specify the URL for the repo you are adding")
- }
- } else {
- if activeHelpLevel == "local" {
- comps = cobra.AppendActiveHelp(comps, "This command does not take any more arguments")
- }
- }
- return comps, cobra.ShellCompDirectiveNoFileComp
-},
-```
-**Note 1**: If the `_ACTIVE_HELP` environment variable is set to the string "0", Cobra will automatically disable all Active Help output (even if some output was specified by the program using the `cobra.AppendActiveHelp(...)` function). Using "0" can simplify your code in situations where you want to blindly disable Active Help without having to call `cobra.GetActiveHelpConfig(cmd)` explicitly.
-
-**Note 2**: If a user wants to disable Active Help for every single program based on Cobra, she can set the environment variable `COBRA_ACTIVE_HELP` to "0". In this case `cobra.GetActiveHelpConfig(cmd)` will return "0" no matter what the variable `_ACTIVE_HELP` is set to.
-
-**Note 3**: If the user does not set `_ACTIVE_HELP` or `COBRA_ACTIVE_HELP` (which will be a common case), the default value for the Active Help configuration returned by `cobra.GetActiveHelpConfig(cmd)` will be the empty string.
-## Active Help with Cobra's default completion command
-
-Cobra provides a default `completion` command for programs that wish to use it.
-When using the default `completion` command, Active Help is configurable in the same
-fashion as described above using environment variables. You may wish to document this in more
-details for your users.
-
-## Debugging Active Help
-
-Debugging your Active Help code is done in the same way as debugging your dynamic completion code, which is with Cobra's hidden `__complete` command. Please refer to [debugging shell completion](shell_completions.md#debugging) for details.
-
-When debugging with the `__complete` command, if you want to specify different Active Help configurations, you should use the active help environment variable. That variable is named `_ACTIVE_HELP` where any `-` is replaced by an `_`. For example, we can test deactivating some Active Help as shown below:
-```
-$ HELM_ACTIVE_HELP=1 bin/helm __complete install wordpress bitnami/h
-bitnami/haproxy
-bitnami/harbor
-_activeHelp_ WARNING: cannot re-use a name that is still in use
-:0
-Completion ended with directive: ShellCompDirectiveDefault
-
-$ HELM_ACTIVE_HELP=0 bin/helm __complete install wordpress bitnami/h
-bitnami/haproxy
-bitnami/harbor
-:0
-Completion ended with directive: ShellCompDirectiveDefault
-```
diff --git a/vendor/github.com/spf13/cobra/args.go b/vendor/github.com/spf13/cobra/args.go
index e79ec33a81..ed1e70ceaa 100644
--- a/vendor/github.com/spf13/cobra/args.go
+++ b/vendor/github.com/spf13/cobra/args.go
@@ -52,9 +52,9 @@ func OnlyValidArgs(cmd *Command, args []string) error {
if len(cmd.ValidArgs) > 0 {
// Remove any description that may be included in ValidArgs.
// A description is following a tab character.
- var validArgs []string
+ validArgs := make([]string, 0, len(cmd.ValidArgs))
for _, v := range cmd.ValidArgs {
- validArgs = append(validArgs, strings.Split(v, "\t")[0])
+ validArgs = append(validArgs, strings.SplitN(v, "\t", 2)[0])
}
for _, v := range args {
if !stringInSlice(v, validArgs) {
diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go
index 10c78847de..f4d198cbcb 100644
--- a/vendor/github.com/spf13/cobra/bash_completions.go
+++ b/vendor/github.com/spf13/cobra/bash_completions.go
@@ -85,7 +85,7 @@ __%[1]s_handle_go_custom_completion()
local out requestComp lastParam lastChar comp directive args
# Prepare the command to request completions for the program.
- # Calling ${words[0]} instead of directly %[1]s allows to handle aliases
+ # Calling ${words[0]} instead of directly %[1]s allows handling aliases
args=("${words[@]:1}")
# Disable ActiveHelp which is not supported for bash completion v1
requestComp="%[8]s=0 ${words[0]} %[2]s ${args[*]}"
@@ -597,19 +597,16 @@ func writeRequiredFlag(buf io.StringWriter, cmd *Command) {
if nonCompletableFlag(flag) {
return
}
- for key := range flag.Annotations {
- switch key {
- case BashCompOneRequiredFlag:
- format := " must_have_one_flag+=(\"--%s"
- if flag.Value.Type() != "bool" {
- format += "="
- }
- format += cbn
- WriteStringAndCheck(buf, fmt.Sprintf(format, flag.Name))
-
- if len(flag.Shorthand) > 0 {
- WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_flag+=(\"-%s"+cbn, flag.Shorthand))
- }
+ if _, ok := flag.Annotations[BashCompOneRequiredFlag]; ok {
+ format := " must_have_one_flag+=(\"--%s"
+ if flag.Value.Type() != "bool" {
+ format += "="
+ }
+ format += cbn
+ WriteStringAndCheck(buf, fmt.Sprintf(format, flag.Name))
+
+ if len(flag.Shorthand) > 0 {
+ WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_flag+=(\"-%s"+cbn, flag.Shorthand))
}
}
})
@@ -621,7 +618,7 @@ func writeRequiredNouns(buf io.StringWriter, cmd *Command) {
for _, value := range cmd.ValidArgs {
// Remove any description that may be included following a tab character.
// Descriptions are not supported by bash completion.
- value = strings.Split(value, "\t")[0]
+ value = strings.SplitN(value, "\t", 2)[0]
WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_noun+=(%q)\n", value))
}
if cmd.ValidArgsFunction != nil {
diff --git a/vendor/github.com/spf13/cobra/bash_completions.md b/vendor/github.com/spf13/cobra/bash_completions.md
deleted file mode 100644
index 52919b2fa6..0000000000
--- a/vendor/github.com/spf13/cobra/bash_completions.md
+++ /dev/null
@@ -1,93 +0,0 @@
-# Generating Bash Completions For Your cobra.Command
-
-Please refer to [Shell Completions](shell_completions.md) for details.
-
-## Bash legacy dynamic completions
-
-For backward compatibility, Cobra still supports its legacy dynamic completion solution (described below). Unlike the `ValidArgsFunction` solution, the legacy solution will only work for Bash shell-completion and not for other shells. This legacy solution can be used along-side `ValidArgsFunction` and `RegisterFlagCompletionFunc()`, as long as both solutions are not used for the same command. This provides a path to gradually migrate from the legacy solution to the new solution.
-
-**Note**: Cobra's default `completion` command uses bash completion V2. If you are currently using Cobra's legacy dynamic completion solution, you should not use the default `completion` command but continue using your own.
-
-The legacy solution allows you to inject bash functions into the bash completion script. Those bash functions are responsible for providing the completion choices for your own completions.
-
-Some code that works in kubernetes:
-
-```bash
-const (
- bash_completion_func = `__kubectl_parse_get()
-{
- local kubectl_output out
- if kubectl_output=$(kubectl get --no-headers "$1" 2>/dev/null); then
- out=($(echo "${kubectl_output}" | awk '{print $1}'))
- COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) )
- fi
-}
-
-__kubectl_get_resource()
-{
- if [[ ${#nouns[@]} -eq 0 ]]; then
- return 1
- fi
- __kubectl_parse_get ${nouns[${#nouns[@]} -1]}
- if [[ $? -eq 0 ]]; then
- return 0
- fi
-}
-
-__kubectl_custom_func() {
- case ${last_command} in
- kubectl_get | kubectl_describe | kubectl_delete | kubectl_stop)
- __kubectl_get_resource
- return
- ;;
- *)
- ;;
- esac
-}
-`)
-```
-
-And then I set that in my command definition:
-
-```go
-cmds := &cobra.Command{
- Use: "kubectl",
- Short: "kubectl controls the Kubernetes cluster manager",
- Long: `kubectl controls the Kubernetes cluster manager.
-
-Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`,
- Run: runHelp,
- BashCompletionFunction: bash_completion_func,
-}
-```
-
-The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__kubectl_custom_func()` (`___custom_func()`) to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__kubectl_customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__kubectl_custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`. `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`. So it will call `__kubectl_parse_get pod`. `__kubectl_parse_get` will actually call out to kubernetes and get any pods. It will then set `COMPREPLY` to valid pods!
-
-Similarly, for flags:
-
-```go
- annotation := make(map[string][]string)
- annotation[cobra.BashCompCustom] = []string{"__kubectl_get_namespaces"}
-
- flag := &pflag.Flag{
- Name: "namespace",
- Usage: usage,
- Annotations: annotation,
- }
- cmd.Flags().AddFlag(flag)
-```
-
-In addition add the `__kubectl_get_namespaces` implementation in the `BashCompletionFunction`
-value, e.g.:
-
-```bash
-__kubectl_get_namespaces()
-{
- local template
- template="{{ range .items }}{{ .metadata.name }} {{ end }}"
- local kubectl_out
- if kubectl_out=$(kubectl get -o template --template="${template}" namespace 2>/dev/null); then
- COMPREPLY=( $( compgen -W "${kubectl_out}[*]" -- "$cur" ) )
- fi
-}
-```
diff --git a/vendor/github.com/spf13/cobra/bash_completionsV2.go b/vendor/github.com/spf13/cobra/bash_completionsV2.go
index 19b09560c1..1cce5c329c 100644
--- a/vendor/github.com/spf13/cobra/bash_completionsV2.go
+++ b/vendor/github.com/spf13/cobra/bash_completionsV2.go
@@ -57,7 +57,7 @@ __%[1]s_get_completion_results() {
local requestComp lastParam lastChar args
# Prepare the command to request completions for the program.
- # Calling ${words[0]} instead of directly %[1]s allows to handle aliases
+ # Calling ${words[0]} instead of directly %[1]s allows handling aliases
args=("${words[@]:1}")
requestComp="${words[0]} %[2]s ${args[*]}"
diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go
index b07b44a0ce..e0b0947b04 100644
--- a/vendor/github.com/spf13/cobra/cobra.go
+++ b/vendor/github.com/spf13/cobra/cobra.go
@@ -43,12 +43,13 @@ var initializers []func()
var finalizers []func()
const (
- defaultPrefixMatching = false
- defaultCommandSorting = true
- defaultCaseInsensitive = false
+ defaultPrefixMatching = false
+ defaultCommandSorting = true
+ defaultCaseInsensitive = false
+ defaultTraverseRunHooks = false
)
-// EnablePrefixMatching allows to set automatic prefix matching. Automatic prefix matching can be a dangerous thing
+// EnablePrefixMatching allows setting automatic prefix matching. Automatic prefix matching can be a dangerous thing
// to automatically enable in CLI tools.
// Set this to true to enable it.
var EnablePrefixMatching = defaultPrefixMatching
@@ -60,6 +61,10 @@ var EnableCommandSorting = defaultCommandSorting
// EnableCaseInsensitive allows case-insensitive commands names. (case sensitive by default)
var EnableCaseInsensitive = defaultCaseInsensitive
+// EnableTraverseRunHooks executes persistent pre-run and post-run hooks from all parents.
+// By default this is disabled, which means only the first run hook to be found is executed.
+var EnableTraverseRunHooks = defaultTraverseRunHooks
+
// MousetrapHelpText enables an information splash screen on Windows
// if the CLI is started from explorer.exe.
// To disable the mousetrap, just set this variable to blank string ("").
@@ -188,8 +193,6 @@ func ld(s, t string, ignoreCase bool) int {
d := make([][]int, len(s)+1)
for i := range d {
d[i] = make([]int, len(t)+1)
- }
- for i := range d {
d[i][0] = i
}
for j := range d[0] {
diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go
index 01f7c6f1c5..54748fc67e 100644
--- a/vendor/github.com/spf13/cobra/command.go
+++ b/vendor/github.com/spf13/cobra/command.go
@@ -30,7 +30,10 @@ import (
flag "github.com/spf13/pflag"
)
-const FlagSetByCobraAnnotation = "cobra_annotation_flag_set_by_cobra"
+const (
+ FlagSetByCobraAnnotation = "cobra_annotation_flag_set_by_cobra"
+ CommandDisplayNameAnnotation = "cobra_annotation_command_display_name"
+)
// FParseErrWhitelist configures Flag parse errors to be ignored
type FParseErrWhitelist flag.ParseErrorsWhitelist
@@ -99,7 +102,7 @@ type Command struct {
Deprecated string
// Annotations are key/value pairs that can be used by applications to identify or
- // group commands.
+ // group commands or set special options.
Annotations map[string]string
// Version defines the version for this command. If this value is non-empty and the command does not
@@ -115,6 +118,8 @@ type Command struct {
// * PostRun()
// * PersistentPostRun()
// All functions get the same args, the arguments after the command name.
+ // The *PreRun and *PostRun functions will only be executed if the Run function of the current
+ // command has been declared.
//
// PersistentPreRun: children of this command will inherit and execute.
PersistentPreRun func(cmd *Command, args []string)
@@ -149,8 +154,10 @@ type Command struct {
// pflags contains persistent flags.
pflags *flag.FlagSet
// lflags contains local flags.
+ // This field does not represent internal state, it's used as a cache to optimise LocalFlags function call
lflags *flag.FlagSet
// iflags contains inherited flags.
+ // This field does not represent internal state, it's used as a cache to optimise InheritedFlags function call
iflags *flag.FlagSet
// parentsPflags is all persistent flags of cmd's parents.
parentsPflags *flag.FlagSet
@@ -181,6 +188,9 @@ type Command struct {
// versionTemplate is the version template defined by user.
versionTemplate string
+ // errPrefix is the error message prefix defined by user.
+ errPrefix string
+
// inReader is a reader defined by the user that replaces stdin
inReader io.Reader
// outWriter is a writer defined by the user that replaces stdout
@@ -346,6 +356,11 @@ func (c *Command) SetVersionTemplate(s string) {
c.versionTemplate = s
}
+// SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix.
+func (c *Command) SetErrPrefix(s string) {
+ c.errPrefix = s
+}
+
// SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands.
// The user should not have a cyclic dependency on commands.
func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) {
@@ -595,6 +610,18 @@ func (c *Command) VersionTemplate() string {
`
}
+// ErrPrefix return error message prefix for the command
+func (c *Command) ErrPrefix() string {
+ if c.errPrefix != "" {
+ return c.errPrefix
+ }
+
+ if c.HasParent() {
+ return c.parent.ErrPrefix()
+ }
+ return "Error:"
+}
+
func hasNoOptDefVal(name string, fs *flag.FlagSet) bool {
flag := fs.Lookup(name)
if flag == nil {
@@ -681,7 +708,7 @@ Loop:
// This is not a flag or a flag value. Check to see if it matches what we're looking for, and if so,
// return the args, excluding the one at this position.
if s == x {
- ret := []string{}
+ ret := make([]string, 0, len(args)-1)
ret = append(ret, args[:pos]...)
ret = append(ret, args[pos+1:]...)
return ret
@@ -729,14 +756,14 @@ func (c *Command) findSuggestions(arg string) string {
if c.SuggestionsMinimumDistance <= 0 {
c.SuggestionsMinimumDistance = 2
}
- suggestionsString := ""
+ var sb strings.Builder
if suggestions := c.SuggestionsFor(arg); len(suggestions) > 0 {
- suggestionsString += "\n\nDid you mean this?\n"
+ sb.WriteString("\n\nDid you mean this?\n")
for _, s := range suggestions {
- suggestionsString += fmt.Sprintf("\t%v\n", s)
+ _, _ = fmt.Fprintf(&sb, "\t%v\n", s)
}
}
- return suggestionsString
+ return sb.String()
}
func (c *Command) findNext(next string) *Command {
@@ -752,7 +779,9 @@ func (c *Command) findNext(next string) *Command {
}
if len(matches) == 1 {
- return matches[0]
+ // Temporarily disable gosec G602, which produces a false positive.
+ // See https://github.com/securego/gosec/issues/1005.
+ return matches[0] // #nosec G602
}
return nil
@@ -846,7 +875,7 @@ func (c *Command) ArgsLenAtDash() int {
func (c *Command) execute(a []string) (err error) {
if c == nil {
- return fmt.Errorf("Called Execute() on a nil Command")
+ return fmt.Errorf("called Execute() on a nil Command")
}
if len(c.Deprecated) > 0 {
@@ -910,15 +939,31 @@ func (c *Command) execute(a []string) (err error) {
return err
}
+ parents := make([]*Command, 0, 5)
for p := c; p != nil; p = p.Parent() {
+ if EnableTraverseRunHooks {
+ // When EnableTraverseRunHooks is set:
+ // - Execute all persistent pre-runs from the root parent till this command.
+ // - Execute all persistent post-runs from this command till the root parent.
+ parents = append([]*Command{p}, parents...)
+ } else {
+ // Otherwise, execute only the first found persistent hook.
+ parents = append(parents, p)
+ }
+ }
+ for _, p := range parents {
if p.PersistentPreRunE != nil {
if err := p.PersistentPreRunE(c, argWoFlags); err != nil {
return err
}
- break
+ if !EnableTraverseRunHooks {
+ break
+ }
} else if p.PersistentPreRun != nil {
p.PersistentPreRun(c, argWoFlags)
- break
+ if !EnableTraverseRunHooks {
+ break
+ }
}
}
if c.PreRunE != nil {
@@ -955,10 +1000,14 @@ func (c *Command) execute(a []string) (err error) {
if err := p.PersistentPostRunE(c, argWoFlags); err != nil {
return err
}
- break
+ if !EnableTraverseRunHooks {
+ break
+ }
} else if p.PersistentPostRun != nil {
p.PersistentPostRun(c, argWoFlags)
- break
+ if !EnableTraverseRunHooks {
+ break
+ }
}
}
@@ -1048,7 +1097,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
c = cmd
}
if !c.SilenceErrors {
- c.PrintErrln("Error:", err.Error())
+ c.PrintErrln(c.ErrPrefix(), err.Error())
c.PrintErrf("Run '%v --help' for usage.\n", c.CommandPath())
}
return c, err
@@ -1077,7 +1126,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
// If root command has SilenceErrors flagged,
// all subcommands should respect it
if !cmd.SilenceErrors && !c.SilenceErrors {
- c.PrintErrln("Error:", err.Error())
+ c.PrintErrln(cmd.ErrPrefix(), err.Error())
}
// If root command has SilenceUsage flagged,
@@ -1140,10 +1189,11 @@ func (c *Command) InitDefaultHelpFlag() {
c.mergePersistentFlags()
if c.Flags().Lookup("help") == nil {
usage := "help for "
- if c.Name() == "" {
+ name := c.displayName()
+ if name == "" {
usage += "this command"
} else {
- usage += c.Name()
+ usage += name
}
c.Flags().BoolP("help", "h", false, usage)
_ = c.Flags().SetAnnotation("help", FlagSetByCobraAnnotation, []string{"true"})
@@ -1189,7 +1239,7 @@ func (c *Command) InitDefaultHelpCmd() {
Use: "help [command]",
Short: "Help about any command",
Long: `Help provides help for any command in the application.
-Simply type ` + c.Name() + ` help [path to command] for full details.`,
+Simply type ` + c.displayName() + ` help [path to command] for full details.`,
ValidArgsFunction: func(c *Command, args []string, toComplete string) ([]string, ShellCompDirective) {
var completions []string
cmd, _, e := c.Root().Find(args)
@@ -1380,16 +1430,24 @@ func (c *Command) CommandPath() string {
if c.HasParent() {
return c.Parent().CommandPath() + " " + c.Name()
}
+ return c.displayName()
+}
+
+func (c *Command) displayName() string {
+ if displayName, ok := c.Annotations[CommandDisplayNameAnnotation]; ok {
+ return displayName
+ }
return c.Name()
}
// UseLine puts out the full usage for a given command (including parents).
func (c *Command) UseLine() string {
var useline string
+ use := strings.Replace(c.Use, c.Name(), c.displayName(), 1)
if c.HasParent() {
- useline = c.parent.CommandPath() + " " + c.Use
+ useline = c.parent.CommandPath() + " " + use
} else {
- useline = c.Use
+ useline = use
}
if c.DisableFlagsInUseLine {
return useline
@@ -1591,7 +1649,7 @@ func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) f
// to this command (local and persistent declared here and by all parents).
func (c *Command) Flags() *flag.FlagSet {
if c.flags == nil {
- c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+ c.flags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError)
if c.flagErrorBuf == nil {
c.flagErrorBuf = new(bytes.Buffer)
}
@@ -1602,10 +1660,11 @@ func (c *Command) Flags() *flag.FlagSet {
}
// LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands.
+// This function does not modify the flags of the current command, it's purpose is to return the current state.
func (c *Command) LocalNonPersistentFlags() *flag.FlagSet {
persistentFlags := c.PersistentFlags()
- out := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+ out := flag.NewFlagSet(c.displayName(), flag.ContinueOnError)
c.LocalFlags().VisitAll(func(f *flag.Flag) {
if persistentFlags.Lookup(f.Name) == nil {
out.AddFlag(f)
@@ -1615,11 +1674,12 @@ func (c *Command) LocalNonPersistentFlags() *flag.FlagSet {
}
// LocalFlags returns the local FlagSet specifically set in the current command.
+// This function does not modify the flags of the current command, it's purpose is to return the current state.
func (c *Command) LocalFlags() *flag.FlagSet {
c.mergePersistentFlags()
if c.lflags == nil {
- c.lflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+ c.lflags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError)
if c.flagErrorBuf == nil {
c.flagErrorBuf = new(bytes.Buffer)
}
@@ -1642,11 +1702,12 @@ func (c *Command) LocalFlags() *flag.FlagSet {
}
// InheritedFlags returns all flags which were inherited from parent commands.
+// This function does not modify the flags of the current command, it's purpose is to return the current state.
func (c *Command) InheritedFlags() *flag.FlagSet {
c.mergePersistentFlags()
if c.iflags == nil {
- c.iflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+ c.iflags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError)
if c.flagErrorBuf == nil {
c.flagErrorBuf = new(bytes.Buffer)
}
@@ -1667,6 +1728,7 @@ func (c *Command) InheritedFlags() *flag.FlagSet {
}
// NonInheritedFlags returns all flags which were not inherited from parent commands.
+// This function does not modify the flags of the current command, it's purpose is to return the current state.
func (c *Command) NonInheritedFlags() *flag.FlagSet {
return c.LocalFlags()
}
@@ -1674,7 +1736,7 @@ func (c *Command) NonInheritedFlags() *flag.FlagSet {
// PersistentFlags returns the persistent FlagSet specifically set in the current command.
func (c *Command) PersistentFlags() *flag.FlagSet {
if c.pflags == nil {
- c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+ c.pflags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError)
if c.flagErrorBuf == nil {
c.flagErrorBuf = new(bytes.Buffer)
}
@@ -1687,9 +1749,9 @@ func (c *Command) PersistentFlags() *flag.FlagSet {
func (c *Command) ResetFlags() {
c.flagErrorBuf = new(bytes.Buffer)
c.flagErrorBuf.Reset()
- c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+ c.flags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError)
c.flags.SetOutput(c.flagErrorBuf)
- c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+ c.pflags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError)
c.pflags.SetOutput(c.flagErrorBuf)
c.lflags = nil
@@ -1806,7 +1868,7 @@ func (c *Command) mergePersistentFlags() {
// If c.parentsPflags == nil, it makes new.
func (c *Command) updateParentsPflags() {
if c.parentsPflags == nil {
- c.parentsPflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
+ c.parentsPflags = flag.NewFlagSet(c.displayName(), flag.ContinueOnError)
c.parentsPflags.SetOutput(c.flagErrorBuf)
c.parentsPflags.SortFlags = false
}
diff --git a/vendor/github.com/spf13/cobra/completions.go b/vendor/github.com/spf13/cobra/completions.go
index ee38c4d0b8..c0c08b0572 100644
--- a/vendor/github.com/spf13/cobra/completions.go
+++ b/vendor/github.com/spf13/cobra/completions.go
@@ -17,6 +17,8 @@ package cobra
import (
"fmt"
"os"
+ "regexp"
+ "strconv"
"strings"
"sync"
@@ -145,6 +147,20 @@ func (c *Command) RegisterFlagCompletionFunc(flagName string, f func(cmd *Comman
return nil
}
+// GetFlagCompletionFunc returns the completion function for the given flag of the command, if available.
+func (c *Command) GetFlagCompletionFunc(flagName string) (func(*Command, []string, string) ([]string, ShellCompDirective), bool) {
+ flag := c.Flag(flagName)
+ if flag == nil {
+ return nil, false
+ }
+
+ flagCompletionMutex.RLock()
+ defer flagCompletionMutex.RUnlock()
+
+ completionFunc, exists := flagCompletionFunctions[flag]
+ return completionFunc, exists
+}
+
// Returns a string listing the different directive enabled in the specified parameter
func (d ShellCompDirective) string() string {
var directives []string
@@ -197,24 +213,29 @@ func (c *Command) initCompleteCmd(args []string) {
// 2- Even without completions, we need to print the directive
}
- noDescriptions := (cmd.CalledAs() == ShellCompNoDescRequestCmd)
+ noDescriptions := cmd.CalledAs() == ShellCompNoDescRequestCmd
+ if !noDescriptions {
+ if doDescriptions, err := strconv.ParseBool(getEnvConfig(cmd, configEnvVarSuffixDescriptions)); err == nil {
+ noDescriptions = !doDescriptions
+ }
+ }
+ noActiveHelp := GetActiveHelpConfig(finalCmd) == activeHelpGlobalDisable
+ out := finalCmd.OutOrStdout()
for _, comp := range completions {
- if GetActiveHelpConfig(finalCmd) == activeHelpGlobalDisable {
- // Remove all activeHelp entries in this case
- if strings.HasPrefix(comp, activeHelpMarker) {
- continue
- }
+ if noActiveHelp && strings.HasPrefix(comp, activeHelpMarker) {
+ // Remove all activeHelp entries if it's disabled.
+ continue
}
if noDescriptions {
// Remove any description that may be included following a tab character.
- comp = strings.Split(comp, "\t")[0]
+ comp = strings.SplitN(comp, "\t", 2)[0]
}
// Make sure we only write the first line to the output.
// This is needed if a description contains a linebreak.
// Otherwise the shell scripts will interpret the other lines as new flags
// and could therefore provide a wrong completion.
- comp = strings.Split(comp, "\n")[0]
+ comp = strings.SplitN(comp, "\n", 2)[0]
// Finally trim the completion. This is especially important to get rid
// of a trailing tab when there are no description following it.
@@ -223,14 +244,14 @@ func (c *Command) initCompleteCmd(args []string) {
// although there is no description).
comp = strings.TrimSpace(comp)
- // Print each possible completion to stdout for the completion script to consume.
- fmt.Fprintln(finalCmd.OutOrStdout(), comp)
+ // Print each possible completion to the output for the completion script to consume.
+ fmt.Fprintln(out, comp)
}
// As the last printout, print the completion directive for the completion script to parse.
// The directive integer must be that last character following a single colon (:).
// The completion script expects :
- fmt.Fprintf(finalCmd.OutOrStdout(), ":%d\n", directive)
+ fmt.Fprintf(out, ":%d\n", directive)
// Print some helpful info to stderr for the user to understand.
// Output from stderr must be ignored by the completion script.
@@ -277,15 +298,19 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi
}
if err != nil {
// Unable to find the real command. E.g., someInvalidCmd
- return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("Unable to find a command for arguments: %v", trimmedArgs)
+ return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("unable to find a command for arguments: %v", trimmedArgs)
}
finalCmd.ctx = c.ctx
// These flags are normally added when `execute()` is called on `finalCmd`,
// however, when doing completion, we don't call `finalCmd.execute()`.
- // Let's add the --help and --version flag ourselves.
- finalCmd.InitDefaultHelpFlag()
- finalCmd.InitDefaultVersionFlag()
+ // Let's add the --help and --version flag ourselves but only if the finalCmd
+ // has not disabled flag parsing; if flag parsing is disabled, it is up to the
+ // finalCmd itself to handle the completion of *all* flags.
+ if !finalCmd.DisableFlagParsing {
+ finalCmd.InitDefaultHelpFlag()
+ finalCmd.InitDefaultVersionFlag()
+ }
// Check if we are doing flag value completion before parsing the flags.
// This is important because if we are completing a flag value, we need to also
@@ -389,6 +414,11 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi
finalCmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) {
doCompleteFlags(flag)
})
+ // Try to complete non-inherited flags even if DisableFlagParsing==true.
+ // This allows programs to tell Cobra about flags for completion even
+ // if the actual parsing of flags is not done by Cobra.
+ // For instance, Helm uses this to provide flag name completion for
+ // some of its plugins.
finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) {
doCompleteFlags(flag)
})
@@ -876,3 +906,34 @@ func CompError(msg string) {
func CompErrorln(msg string) {
CompError(fmt.Sprintf("%s\n", msg))
}
+
+// These values should not be changed: users will be using them explicitly.
+const (
+ configEnvVarGlobalPrefix = "COBRA"
+ configEnvVarSuffixDescriptions = "COMPLETION_DESCRIPTIONS"
+)
+
+var configEnvVarPrefixSubstRegexp = regexp.MustCompile(`[^A-Z0-9_]`)
+
+// configEnvVar returns the name of the program-specific configuration environment
+// variable. It has the format _ where is the name of the
+// root command in upper case, with all non-ASCII-alphanumeric characters replaced by `_`.
+func configEnvVar(name, suffix string) string {
+ // This format should not be changed: users will be using it explicitly.
+ v := strings.ToUpper(fmt.Sprintf("%s_%s", name, suffix))
+ v = configEnvVarPrefixSubstRegexp.ReplaceAllString(v, "_")
+ return v
+}
+
+// getEnvConfig returns the value of the configuration environment variable
+// _ where is the name of the root command in upper
+// case, with all non-ASCII-alphanumeric characters replaced by `_`.
+// If the value is empty or not set, the value of the environment variable
+// COBRA_ is returned instead.
+func getEnvConfig(cmd *Command, suffix string) string {
+ v := os.Getenv(configEnvVar(cmd.Root().Name(), suffix))
+ if v == "" {
+ v = os.Getenv(configEnvVar(configEnvVarGlobalPrefix, suffix))
+ }
+ return v
+}
diff --git a/vendor/github.com/spf13/cobra/fish_completions.go b/vendor/github.com/spf13/cobra/fish_completions.go
index 12ca0d2b11..12d61b6911 100644
--- a/vendor/github.com/spf13/cobra/fish_completions.go
+++ b/vendor/github.com/spf13/cobra/fish_completions.go
@@ -113,7 +113,7 @@ function __%[1]s_clear_perform_completion_once_result
__%[1]s_debug ""
__%[1]s_debug "========= clearing previously set __%[1]s_perform_completion_once_result variable =========="
set --erase __%[1]s_perform_completion_once_result
- __%[1]s_debug "Succesfully erased the variable __%[1]s_perform_completion_once_result"
+ __%[1]s_debug "Successfully erased the variable __%[1]s_perform_completion_once_result"
end
function __%[1]s_requires_order_preservation
diff --git a/vendor/github.com/spf13/cobra/fish_completions.md b/vendor/github.com/spf13/cobra/fish_completions.md
deleted file mode 100644
index 19b2ed1293..0000000000
--- a/vendor/github.com/spf13/cobra/fish_completions.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## Generating Fish Completions For Your cobra.Command
-
-Please refer to [Shell Completions](shell_completions.md) for details.
-
diff --git a/vendor/github.com/spf13/cobra/flag_groups.go b/vendor/github.com/spf13/cobra/flag_groups.go
index b35fde1554..560612fd33 100644
--- a/vendor/github.com/spf13/cobra/flag_groups.go
+++ b/vendor/github.com/spf13/cobra/flag_groups.go
@@ -23,8 +23,9 @@ import (
)
const (
- requiredAsGroup = "cobra_annotation_required_if_others_set"
- mutuallyExclusive = "cobra_annotation_mutually_exclusive"
+ requiredAsGroupAnnotation = "cobra_annotation_required_if_others_set"
+ oneRequiredAnnotation = "cobra_annotation_one_required"
+ mutuallyExclusiveAnnotation = "cobra_annotation_mutually_exclusive"
)
// MarkFlagsRequiredTogether marks the given flags with annotations so that Cobra errors
@@ -36,7 +37,23 @@ func (c *Command) MarkFlagsRequiredTogether(flagNames ...string) {
if f == nil {
panic(fmt.Sprintf("Failed to find flag %q and mark it as being required in a flag group", v))
}
- if err := c.Flags().SetAnnotation(v, requiredAsGroup, append(f.Annotations[requiredAsGroup], strings.Join(flagNames, " "))); err != nil {
+ if err := c.Flags().SetAnnotation(v, requiredAsGroupAnnotation, append(f.Annotations[requiredAsGroupAnnotation], strings.Join(flagNames, " "))); err != nil {
+ // Only errs if the flag isn't found.
+ panic(err)
+ }
+ }
+}
+
+// MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors
+// if the command is invoked without at least one flag from the given set of flags.
+func (c *Command) MarkFlagsOneRequired(flagNames ...string) {
+ c.mergePersistentFlags()
+ for _, v := range flagNames {
+ f := c.Flags().Lookup(v)
+ if f == nil {
+ panic(fmt.Sprintf("Failed to find flag %q and mark it as being in a one-required flag group", v))
+ }
+ if err := c.Flags().SetAnnotation(v, oneRequiredAnnotation, append(f.Annotations[oneRequiredAnnotation], strings.Join(flagNames, " "))); err != nil {
// Only errs if the flag isn't found.
panic(err)
}
@@ -53,13 +70,13 @@ func (c *Command) MarkFlagsMutuallyExclusive(flagNames ...string) {
panic(fmt.Sprintf("Failed to find flag %q and mark it as being in a mutually exclusive flag group", v))
}
// Each time this is called is a single new entry; this allows it to be a member of multiple groups if needed.
- if err := c.Flags().SetAnnotation(v, mutuallyExclusive, append(f.Annotations[mutuallyExclusive], strings.Join(flagNames, " "))); err != nil {
+ if err := c.Flags().SetAnnotation(v, mutuallyExclusiveAnnotation, append(f.Annotations[mutuallyExclusiveAnnotation], strings.Join(flagNames, " "))); err != nil {
panic(err)
}
}
}
-// ValidateFlagGroups validates the mutuallyExclusive/requiredAsGroup logic and returns the
+// ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the
// first error encountered.
func (c *Command) ValidateFlagGroups() error {
if c.DisableFlagParsing {
@@ -71,15 +88,20 @@ func (c *Command) ValidateFlagGroups() error {
// groupStatus format is the list of flags as a unique ID,
// then a map of each flag name and whether it is set or not.
groupStatus := map[string]map[string]bool{}
+ oneRequiredGroupStatus := map[string]map[string]bool{}
mutuallyExclusiveGroupStatus := map[string]map[string]bool{}
flags.VisitAll(func(pflag *flag.Flag) {
- processFlagForGroupAnnotation(flags, pflag, requiredAsGroup, groupStatus)
- processFlagForGroupAnnotation(flags, pflag, mutuallyExclusive, mutuallyExclusiveGroupStatus)
+ processFlagForGroupAnnotation(flags, pflag, requiredAsGroupAnnotation, groupStatus)
+ processFlagForGroupAnnotation(flags, pflag, oneRequiredAnnotation, oneRequiredGroupStatus)
+ processFlagForGroupAnnotation(flags, pflag, mutuallyExclusiveAnnotation, mutuallyExclusiveGroupStatus)
})
if err := validateRequiredFlagGroups(groupStatus); err != nil {
return err
}
+ if err := validateOneRequiredFlagGroups(oneRequiredGroupStatus); err != nil {
+ return err
+ }
if err := validateExclusiveFlagGroups(mutuallyExclusiveGroupStatus); err != nil {
return err
}
@@ -108,7 +130,7 @@ func processFlagForGroupAnnotation(flags *flag.FlagSet, pflag *flag.Flag, annota
continue
}
- groupStatus[group] = map[string]bool{}
+ groupStatus[group] = make(map[string]bool, len(flagnames))
for _, name := range flagnames {
groupStatus[group][name] = false
}
@@ -142,6 +164,27 @@ func validateRequiredFlagGroups(data map[string]map[string]bool) error {
return nil
}
+func validateOneRequiredFlagGroups(data map[string]map[string]bool) error {
+ keys := sortedKeys(data)
+ for _, flagList := range keys {
+ flagnameAndStatus := data[flagList]
+ var set []string
+ for flagname, isSet := range flagnameAndStatus {
+ if isSet {
+ set = append(set, flagname)
+ }
+ }
+ if len(set) >= 1 {
+ continue
+ }
+
+ // Sort values, so they can be tested/scripted against consistently.
+ sort.Strings(set)
+ return fmt.Errorf("at least one of the flags in the group [%v] is required", flagList)
+ }
+ return nil
+}
+
func validateExclusiveFlagGroups(data map[string]map[string]bool) error {
keys := sortedKeys(data)
for _, flagList := range keys {
@@ -176,6 +219,7 @@ func sortedKeys(m map[string]map[string]bool) []string {
// enforceFlagGroupsForCompletion will do the following:
// - when a flag in a group is present, other flags in the group will be marked required
+// - when none of the flags in a one-required group are present, all flags in the group will be marked required
// - when a flag in a mutually exclusive group is present, other flags in the group will be marked as hidden
// This allows the standard completion logic to behave appropriately for flag groups
func (c *Command) enforceFlagGroupsForCompletion() {
@@ -185,10 +229,12 @@ func (c *Command) enforceFlagGroupsForCompletion() {
flags := c.Flags()
groupStatus := map[string]map[string]bool{}
+ oneRequiredGroupStatus := map[string]map[string]bool{}
mutuallyExclusiveGroupStatus := map[string]map[string]bool{}
c.Flags().VisitAll(func(pflag *flag.Flag) {
- processFlagForGroupAnnotation(flags, pflag, requiredAsGroup, groupStatus)
- processFlagForGroupAnnotation(flags, pflag, mutuallyExclusive, mutuallyExclusiveGroupStatus)
+ processFlagForGroupAnnotation(flags, pflag, requiredAsGroupAnnotation, groupStatus)
+ processFlagForGroupAnnotation(flags, pflag, oneRequiredAnnotation, oneRequiredGroupStatus)
+ processFlagForGroupAnnotation(flags, pflag, mutuallyExclusiveAnnotation, mutuallyExclusiveGroupStatus)
})
// If a flag that is part of a group is present, we make all the other flags
@@ -204,6 +250,26 @@ func (c *Command) enforceFlagGroupsForCompletion() {
}
}
+ // If none of the flags of a one-required group are present, we make all the flags
+ // of that group required so that the shell completion suggests them automatically
+ for flagList, flagnameAndStatus := range oneRequiredGroupStatus {
+ isSet := false
+
+ for _, isSet = range flagnameAndStatus {
+ if isSet {
+ break
+ }
+ }
+
+ // None of the flags of the group are set, mark all flags in the group
+ // as required
+ if !isSet {
+ for _, fName := range strings.Split(flagList, " ") {
+ _ = c.MarkFlagRequired(fName)
+ }
+ }
+ }
+
// If a flag that is mutually exclusive to others is present, we hide the other
// flags of that group so the shell completion does not suggest them
for flagList, flagnameAndStatus := range mutuallyExclusiveGroupStatus {
diff --git a/vendor/github.com/spf13/cobra/powershell_completions.go b/vendor/github.com/spf13/cobra/powershell_completions.go
index 177d2755f2..a830b7bcad 100644
--- a/vendor/github.com/spf13/cobra/powershell_completions.go
+++ b/vendor/github.com/spf13/cobra/powershell_completions.go
@@ -28,8 +28,8 @@ import (
func genPowerShellComp(buf io.StringWriter, name string, includeDesc bool) {
// Variables should not contain a '-' or ':' character
nameForVar := name
- nameForVar = strings.Replace(nameForVar, "-", "_", -1)
- nameForVar = strings.Replace(nameForVar, ":", "_", -1)
+ nameForVar = strings.ReplaceAll(nameForVar, "-", "_")
+ nameForVar = strings.ReplaceAll(nameForVar, ":", "_")
compCmd := ShellCompRequestCmd
if !includeDesc {
@@ -47,7 +47,7 @@ filter __%[1]s_escapeStringWithSpecialChars {
`+" $_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|\"|`|\\||<|>|&','`$&'"+`
}
-[scriptblock]$__%[2]sCompleterBlock = {
+[scriptblock]${__%[2]sCompleterBlock} = {
param(
$WordToComplete,
$CommandAst,
@@ -122,7 +122,7 @@ filter __%[1]s_escapeStringWithSpecialChars {
__%[1]s_debug "Calling $RequestComp"
# First disable ActiveHelp which is not supported for Powershell
- $env:%[10]s=0
+ ${env:%[10]s}=0
#call the command store the output in $out and redirect stderr and stdout to null
# $Out is an array contains each line per element
@@ -279,7 +279,7 @@ filter __%[1]s_escapeStringWithSpecialChars {
}
}
-Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock $__%[2]sCompleterBlock
+Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock ${__%[2]sCompleterBlock}
`, name, nameForVar, compCmd,
ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp,
ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))
diff --git a/vendor/github.com/spf13/cobra/powershell_completions.md b/vendor/github.com/spf13/cobra/powershell_completions.md
deleted file mode 100644
index c449f1e5c0..0000000000
--- a/vendor/github.com/spf13/cobra/powershell_completions.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Generating PowerShell Completions For Your Own cobra.Command
-
-Please refer to [Shell Completions](shell_completions.md#powershell-completions) for details.
diff --git a/vendor/github.com/spf13/cobra/projects_using_cobra.md b/vendor/github.com/spf13/cobra/projects_using_cobra.md
deleted file mode 100644
index 8a291eb20e..0000000000
--- a/vendor/github.com/spf13/cobra/projects_using_cobra.md
+++ /dev/null
@@ -1,64 +0,0 @@
-## Projects using Cobra
-
-- [Allero](https://github.com/allero-io/allero)
-- [Arewefastyet](https://benchmark.vitess.io)
-- [Arduino CLI](https://github.com/arduino/arduino-cli)
-- [Bleve](https://blevesearch.com/)
-- [Cilium](https://cilium.io/)
-- [CloudQuery](https://github.com/cloudquery/cloudquery)
-- [CockroachDB](https://www.cockroachlabs.com/)
-- [Constellation](https://github.com/edgelesssys/constellation)
-- [Cosmos SDK](https://github.com/cosmos/cosmos-sdk)
-- [Datree](https://github.com/datreeio/datree)
-- [Delve](https://github.com/derekparker/delve)
-- [Docker (distribution)](https://github.com/docker/distribution)
-- [Etcd](https://etcd.io/)
-- [Gardener](https://github.com/gardener/gardenctl)
-- [Giant Swarm's gsctl](https://github.com/giantswarm/gsctl)
-- [Git Bump](https://github.com/erdaltsksn/git-bump)
-- [GitHub CLI](https://github.com/cli/cli)
-- [GitHub Labeler](https://github.com/erdaltsksn/gh-label)
-- [Golangci-lint](https://golangci-lint.run)
-- [GopherJS](https://github.com/gopherjs/gopherjs)
-- [GoReleaser](https://goreleaser.com)
-- [Helm](https://helm.sh)
-- [Hugo](https://gohugo.io)
-- [Infracost](https://github.com/infracost/infracost)
-- [Istio](https://istio.io)
-- [Kool](https://github.com/kool-dev/kool)
-- [Kubernetes](https://kubernetes.io/)
-- [Kubescape](https://github.com/kubescape/kubescape)
-- [KubeVirt](https://github.com/kubevirt/kubevirt)
-- [Linkerd](https://linkerd.io/)
-- [Mattermost-server](https://github.com/mattermost/mattermost-server)
-- [Mercure](https://mercure.rocks/)
-- [Meroxa CLI](https://github.com/meroxa/cli)
-- [Metal Stack CLI](https://github.com/metal-stack/metalctl)
-- [Moby (former Docker)](https://github.com/moby/moby)
-- [Moldy](https://github.com/Moldy-Community/moldy)
-- [Multi-gitter](https://github.com/lindell/multi-gitter)
-- [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack)
-- [nFPM](https://nfpm.goreleaser.com)
-- [Okteto](https://github.com/okteto/okteto)
-- [OpenShift](https://www.openshift.com/)
-- [Ory Hydra](https://github.com/ory/hydra)
-- [Ory Kratos](https://github.com/ory/kratos)
-- [Pixie](https://github.com/pixie-io/pixie)
-- [Polygon Edge](https://github.com/0xPolygon/polygon-edge)
-- [Pouch](https://github.com/alibaba/pouch)
-- [ProjectAtomic (enterprise)](https://www.projectatomic.io/)
-- [Prototool](https://github.com/uber/prototool)
-- [Pulumi](https://www.pulumi.com)
-- [QRcp](https://github.com/claudiodangelis/qrcp)
-- [Random](https://github.com/erdaltsksn/random)
-- [Rclone](https://rclone.org/)
-- [Scaleway CLI](https://github.com/scaleway/scaleway-cli)
-- [Sia](https://github.com/SiaFoundation/siad)
-- [Skaffold](https://skaffold.dev/)
-- [Tendermint](https://github.com/tendermint/tendermint)
-- [Twitch CLI](https://github.com/twitchdev/twitch-cli)
-- [UpCloud CLI (`upctl`)](https://github.com/UpCloudLtd/upcloud-cli)
-- [Vitess](https://vitess.io)
-- VMware's [Tanzu Community Edition](https://github.com/vmware-tanzu/community-edition) & [Tanzu Framework](https://github.com/vmware-tanzu/tanzu-framework)
-- [Werf](https://werf.io/)
-- [ZITADEL](https://github.com/zitadel/zitadel)
diff --git a/vendor/github.com/spf13/cobra/shell_completions.md b/vendor/github.com/spf13/cobra/shell_completions.md
deleted file mode 100644
index 065c0621d4..0000000000
--- a/vendor/github.com/spf13/cobra/shell_completions.md
+++ /dev/null
@@ -1,576 +0,0 @@
-# Generating shell completions
-
-Cobra can generate shell completions for multiple shells.
-The currently supported shells are:
-- Bash
-- Zsh
-- fish
-- PowerShell
-
-Cobra will automatically provide your program with a fully functional `completion` command,
-similarly to how it provides the `help` command.
-
-## Creating your own completion command
-
-If you do not wish to use the default `completion` command, you can choose to
-provide your own, which will take precedence over the default one. (This also provides
-backwards-compatibility with programs that already have their own `completion` command.)
-
-If you are using the `cobra-cli` generator,
-which can be found at [spf13/cobra-cli](https://github.com/spf13/cobra-cli),
-you can create a completion command by running
-
-```bash
-cobra-cli add completion
-```
-and then modifying the generated `cmd/completion.go` file to look something like this
-(writing the shell script to stdout allows the most flexible use):
-
-```go
-var completionCmd = &cobra.Command{
- Use: "completion [bash|zsh|fish|powershell]",
- Short: "Generate completion script",
- Long: fmt.Sprintf(`To load completions:
-
-Bash:
-
- $ source <(%[1]s completion bash)
-
- # To load completions for each session, execute once:
- # Linux:
- $ %[1]s completion bash > /etc/bash_completion.d/%[1]s
- # macOS:
- $ %[1]s completion bash > $(brew --prefix)/etc/bash_completion.d/%[1]s
-
-Zsh:
-
- # If shell completion is not already enabled in your environment,
- # you will need to enable it. You can execute the following once:
-
- $ echo "autoload -U compinit; compinit" >> ~/.zshrc
-
- # To load completions for each session, execute once:
- $ %[1]s completion zsh > "${fpath[1]}/_%[1]s"
-
- # You will need to start a new shell for this setup to take effect.
-
-fish:
-
- $ %[1]s completion fish | source
-
- # To load completions for each session, execute once:
- $ %[1]s completion fish > ~/.config/fish/completions/%[1]s.fish
-
-PowerShell:
-
- PS> %[1]s completion powershell | Out-String | Invoke-Expression
-
- # To load completions for every new session, run:
- PS> %[1]s completion powershell > %[1]s.ps1
- # and source this file from your PowerShell profile.
-`,cmd.Root().Name()),
- DisableFlagsInUseLine: true,
- ValidArgs: []string{"bash", "zsh", "fish", "powershell"},
- Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),
- Run: func(cmd *cobra.Command, args []string) {
- switch args[0] {
- case "bash":
- cmd.Root().GenBashCompletion(os.Stdout)
- case "zsh":
- cmd.Root().GenZshCompletion(os.Stdout)
- case "fish":
- cmd.Root().GenFishCompletion(os.Stdout, true)
- case "powershell":
- cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout)
- }
- },
-}
-```
-
-**Note:** The cobra generator may include messages printed to stdout, for example, if the config file is loaded; this will break the auto-completion script so must be removed.
-
-## Adapting the default completion command
-
-Cobra provides a few options for the default `completion` command. To configure such options you must set
-the `CompletionOptions` field on the *root* command.
-
-To tell Cobra *not* to provide the default `completion` command:
-```
-rootCmd.CompletionOptions.DisableDefaultCmd = true
-```
-
-To tell Cobra to mark the default `completion` command as *hidden*:
-```
-rootCmd.CompletionOptions.HiddenDefaultCmd = true
-```
-
-To tell Cobra *not* to provide the user with the `--no-descriptions` flag to the completion sub-commands:
-```
-rootCmd.CompletionOptions.DisableNoDescFlag = true
-```
-
-To tell Cobra to completely disable descriptions for completions:
-```
-rootCmd.CompletionOptions.DisableDescriptions = true
-```
-
-# Customizing completions
-
-The generated completion scripts will automatically handle completing commands and flags. However, you can make your completions much more powerful by providing information to complete your program's nouns and flag values.
-
-## Completion of nouns
-
-### Static completion of nouns
-
-Cobra allows you to provide a pre-defined list of completion choices for your nouns using the `ValidArgs` field.
-For example, if you want `kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them.
-Some simplified code from `kubectl get` looks like:
-
-```go
-validArgs = []string{ "pod", "node", "service", "replicationcontroller" }
-
-cmd := &cobra.Command{
- Use: "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)",
- Short: "Display one or many resources",
- Long: get_long,
- Example: get_example,
- Run: func(cmd *cobra.Command, args []string) {
- cobra.CheckErr(RunGet(f, out, cmd, args))
- },
- ValidArgs: validArgs,
-}
-```
-
-Notice we put the `ValidArgs` field on the `get` sub-command. Doing so will give results like:
-
-```bash
-$ kubectl get [tab][tab]
-node pod replicationcontroller service
-```
-
-#### Aliases for nouns
-
-If your nouns have aliases, you can define them alongside `ValidArgs` using `ArgAliases`:
-
-```go
-argAliases = []string { "pods", "nodes", "services", "svc", "replicationcontrollers", "rc" }
-
-cmd := &cobra.Command{
- ...
- ValidArgs: validArgs,
- ArgAliases: argAliases
-}
-```
-
-The aliases are shown to the user on tab completion only if no completions were found within sub-commands or `ValidArgs`.
-
-### Dynamic completion of nouns
-
-In some cases it is not possible to provide a list of completions in advance. Instead, the list of completions must be determined at execution-time. In a similar fashion as for static completions, you can use the `ValidArgsFunction` field to provide a Go function that Cobra will execute when it needs the list of completion choices for the nouns of a command. Note that either `ValidArgs` or `ValidArgsFunction` can be used for a single cobra command, but not both.
-Simplified code from `helm status` looks like:
-
-```go
-cmd := &cobra.Command{
- Use: "status RELEASE_NAME",
- Short: "Display the status of the named release",
- Long: status_long,
- RunE: func(cmd *cobra.Command, args []string) {
- RunGet(args[0])
- },
- ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- if len(args) != 0 {
- return nil, cobra.ShellCompDirectiveNoFileComp
- }
- return getReleasesFromCluster(toComplete), cobra.ShellCompDirectiveNoFileComp
- },
-}
-```
-Where `getReleasesFromCluster()` is a Go function that obtains the list of current Helm releases running on the Kubernetes cluster.
-Notice we put the `ValidArgsFunction` on the `status` sub-command. Let's assume the Helm releases on the cluster are: `harbor`, `notary`, `rook` and `thanos` then this dynamic completion will give results like:
-
-```bash
-$ helm status [tab][tab]
-harbor notary rook thanos
-```
-You may have noticed the use of `cobra.ShellCompDirective`. These directives are bit fields allowing to control some shell completion behaviors for your particular completion. You can combine them with the bit-or operator such as `cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp`
-```go
-// Indicates that the shell will perform its default behavior after completions
-// have been provided (this implies none of the other directives).
-ShellCompDirectiveDefault
-
-// Indicates an error occurred and completions should be ignored.
-ShellCompDirectiveError
-
-// Indicates that the shell should not add a space after the completion,
-// even if there is a single completion provided.
-ShellCompDirectiveNoSpace
-
-// Indicates that the shell should not provide file completion even when
-// no completion is provided.
-ShellCompDirectiveNoFileComp
-
-// Indicates that the returned completions should be used as file extension filters.
-// For example, to complete only files of the form *.json or *.yaml:
-// return []string{"yaml", "json"}, ShellCompDirectiveFilterFileExt
-// For flags, using MarkFlagFilename() and MarkPersistentFlagFilename()
-// is a shortcut to using this directive explicitly.
-//
-ShellCompDirectiveFilterFileExt
-
-// Indicates that only directory names should be provided in file completion.
-// For example:
-// return nil, ShellCompDirectiveFilterDirs
-// For flags, using MarkFlagDirname() is a shortcut to using this directive explicitly.
-//
-// To request directory names within another directory, the returned completions
-// should specify a single directory name within which to search. For example,
-// to complete directories within "themes/":
-// return []string{"themes"}, ShellCompDirectiveFilterDirs
-//
-ShellCompDirectiveFilterDirs
-
-// ShellCompDirectiveKeepOrder indicates that the shell should preserve the order
-// in which the completions are provided
-ShellCompDirectiveKeepOrder
-```
-
-***Note***: When using the `ValidArgsFunction`, Cobra will call your registered function after having parsed all flags and arguments provided in the command-line. You therefore don't need to do this parsing yourself. For example, when a user calls `helm status --namespace my-rook-ns [tab][tab]`, Cobra will call your registered `ValidArgsFunction` after having parsed the `--namespace` flag, as it would have done when calling the `RunE` function.
-
-#### Debugging
-
-Cobra achieves dynamic completion through the use of a hidden command called by the completion script. To debug your Go completion code, you can call this hidden command directly:
-```bash
-$ helm __complete status har
-harbor
-:4
-Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr
-```
-***Important:*** If the noun to complete is empty (when the user has not yet typed any letters of that noun), you must pass an empty parameter to the `__complete` command:
-```bash
-$ helm __complete status ""
-harbor
-notary
-rook
-thanos
-:4
-Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr
-```
-Calling the `__complete` command directly allows you to run the Go debugger to troubleshoot your code. You can also add printouts to your code; Cobra provides the following functions to use for printouts in Go completion code:
-```go
-// Prints to the completion script debug file (if BASH_COMP_DEBUG_FILE
-// is set to a file path) and optionally prints to stderr.
-cobra.CompDebug(msg string, printToStdErr bool) {
-cobra.CompDebugln(msg string, printToStdErr bool)
-
-// Prints to the completion script debug file (if BASH_COMP_DEBUG_FILE
-// is set to a file path) and to stderr.
-cobra.CompError(msg string)
-cobra.CompErrorln(msg string)
-```
-***Important:*** You should **not** leave traces that print directly to stdout in your completion code as they will be interpreted as completion choices by the completion script. Instead, use the cobra-provided debugging traces functions mentioned above.
-
-## Completions for flags
-
-### Mark flags as required
-
-Most of the time completions will only show sub-commands. But if a flag is required to make a sub-command work, you probably want it to show up when the user types [tab][tab]. You can mark a flag as 'Required' like so:
-
-```go
-cmd.MarkFlagRequired("pod")
-cmd.MarkFlagRequired("container")
-```
-
-and you'll get something like
-
-```bash
-$ kubectl exec [tab][tab]
--c --container= -p --pod=
-```
-
-### Specify dynamic flag completion
-
-As for nouns, Cobra provides a way of defining dynamic completion of flags. To provide a Go function that Cobra will execute when it needs the list of completion choices for a flag, you must register the function using the `command.RegisterFlagCompletionFunc()` function.
-
-```go
-flagName := "output"
-cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- return []string{"json", "table", "yaml"}, cobra.ShellCompDirectiveDefault
-})
-```
-Notice that calling `RegisterFlagCompletionFunc()` is done through the `command` with which the flag is associated. In our example this dynamic completion will give results like so:
-
-```bash
-$ helm status --output [tab][tab]
-json table yaml
-```
-
-#### Debugging
-
-You can also easily debug your Go completion code for flags:
-```bash
-$ helm __complete status --output ""
-json
-table
-yaml
-:4
-Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr
-```
-***Important:*** You should **not** leave traces that print to stdout in your completion code as they will be interpreted as completion choices by the completion script. Instead, use the cobra-provided debugging traces functions mentioned further above.
-
-### Specify valid filename extensions for flags that take a filename
-
-To limit completions of flag values to file names with certain extensions you can either use the different `MarkFlagFilename()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterFileExt`, like so:
-```go
-flagName := "output"
-cmd.MarkFlagFilename(flagName, "yaml", "json")
-```
-or
-```go
-flagName := "output"
-cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- return []string{"yaml", "json"}, ShellCompDirectiveFilterFileExt})
-```
-
-### Limit flag completions to directory names
-
-To limit completions of flag values to directory names you can either use the `MarkFlagDirname()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterDirs`, like so:
-```go
-flagName := "output"
-cmd.MarkFlagDirname(flagName)
-```
-or
-```go
-flagName := "output"
-cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- return nil, cobra.ShellCompDirectiveFilterDirs
-})
-```
-To limit completions of flag values to directory names *within another directory* you can use a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterDirs` like so:
-```go
-flagName := "output"
-cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- return []string{"themes"}, cobra.ShellCompDirectiveFilterDirs
-})
-```
-### Descriptions for completions
-
-Cobra provides support for completion descriptions. Such descriptions are supported for each shell
-(however, for bash, it is only available in the [completion V2 version](#bash-completion-v2)).
-For commands and flags, Cobra will provide the descriptions automatically, based on usage information.
-For example, using zsh:
-```
-$ helm s[tab]
-search -- search for a keyword in charts
-show -- show information of a chart
-status -- displays the status of the named release
-```
-while using fish:
-```
-$ helm s[tab]
-search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release)
-```
-
-Cobra allows you to add descriptions to your own completions. Simply add the description text after each completion, following a `\t` separator. This technique applies to completions returned by `ValidArgs`, `ValidArgsFunction` and `RegisterFlagCompletionFunc()`. For example:
-```go
-ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
- return []string{"harbor\tAn image registry", "thanos\tLong-term metrics"}, cobra.ShellCompDirectiveNoFileComp
-}}
-```
-or
-```go
-ValidArgs: []string{"bash\tCompletions for bash", "zsh\tCompletions for zsh"}
-```
-
-If you don't want to show descriptions in the completions, you can add `--no-descriptions` to the default `completion` command to disable them, like:
-
-```bash
-$ source <(helm completion bash)
-$ helm completion [tab][tab]
-bash (generate autocompletion script for bash) powershell (generate autocompletion script for powershell)
-fish (generate autocompletion script for fish) zsh (generate autocompletion script for zsh)
-
-$ source <(helm completion bash --no-descriptions)
-$ helm completion [tab][tab]
-bash fish powershell zsh
-```
-## Bash completions
-
-### Dependencies
-
-The bash completion script generated by Cobra requires the `bash_completion` package. You should update the help text of your completion command to show how to install the `bash_completion` package ([Kubectl docs](https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion))
-
-### Aliases
-
-You can also configure `bash` aliases for your program and they will also support completions.
-
-```bash
-alias aliasname=origcommand
-complete -o default -F __start_origcommand aliasname
-
-# and now when you run `aliasname` completion will make
-# suggestions as it did for `origcommand`.
-
-$ aliasname
-completion firstcommand secondcommand
-```
-### Bash legacy dynamic completions
-
-For backward compatibility, Cobra still supports its bash legacy dynamic completion solution.
-Please refer to [Bash Completions](bash_completions.md) for details.
-
-### Bash completion V2
-
-Cobra provides two versions for bash completion. The original bash completion (which started it all!) can be used by calling
-`GenBashCompletion()` or `GenBashCompletionFile()`.
-
-A new V2 bash completion version is also available. This version can be used by calling `GenBashCompletionV2()` or
-`GenBashCompletionFileV2()`. The V2 version does **not** support the legacy dynamic completion
-(see [Bash Completions](bash_completions.md)) but instead works only with the Go dynamic completion
-solution described in this document.
-Unless your program already uses the legacy dynamic completion solution, it is recommended that you use the bash
-completion V2 solution which provides the following extra features:
-- Supports completion descriptions (like the other shells)
-- Small completion script of less than 300 lines (v1 generates scripts of thousands of lines; `kubectl` for example has a bash v1 completion script of over 13K lines)
-- Streamlined user experience thanks to a completion behavior aligned with the other shells
-
-`Bash` completion V2 supports descriptions for completions. When calling `GenBashCompletionV2()` or `GenBashCompletionFileV2()`
-you must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra
-will provide the description automatically based on usage information. You can choose to make this option configurable by
-your users.
-
-```
-# With descriptions
-$ helm s[tab][tab]
-search (search for a keyword in charts) status (display the status of the named release)
-show (show information of a chart)
-
-# Without descriptions
-$ helm s[tab][tab]
-search show status
-```
-**Note**: Cobra's default `completion` command uses bash completion V2. If for some reason you need to use bash completion V1, you will need to implement your own `completion` command.
-## Zsh completions
-
-Cobra supports native zsh completion generated from the root `cobra.Command`.
-The generated completion script should be put somewhere in your `$fpath` and be named
-`_`. You will need to start a new shell for the completions to become available.
-
-Zsh supports descriptions for completions. Cobra will provide the description automatically,
-based on usage information. Cobra provides a way to completely disable such descriptions by
-using `GenZshCompletionNoDesc()` or `GenZshCompletionFileNoDesc()`. You can choose to make
-this a configurable option to your users.
-```
-# With descriptions
-$ helm s[tab]
-search -- search for a keyword in charts
-show -- show information of a chart
-status -- displays the status of the named release
-
-# Without descriptions
-$ helm s[tab]
-search show status
-```
-*Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`.
-
-### Limitations
-
-* Custom completions implemented in Bash scripting (legacy) are not supported and will be ignored for `zsh` (including the use of the `BashCompCustom` flag annotation).
- * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`).
-* The function `MarkFlagCustom()` is not supported and will be ignored for `zsh`.
- * You should instead use `RegisterFlagCompletionFunc()`.
-
-### Zsh completions standardization
-
-Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backward-compatible, some small changes in behavior were introduced.
-Please refer to [Zsh Completions](zsh_completions.md) for details.
-
-## fish completions
-
-Cobra supports native fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users.
-```
-# With descriptions
-$ helm s[tab]
-search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release)
-
-# Without descriptions
-$ helm s[tab]
-search show status
-```
-*Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`.
-
-### Limitations
-
-* Custom completions implemented in bash scripting (legacy) are not supported and will be ignored for `fish` (including the use of the `BashCompCustom` flag annotation).
- * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`).
-* The function `MarkFlagCustom()` is not supported and will be ignored for `fish`.
- * You should instead use `RegisterFlagCompletionFunc()`.
-* The following flag completion annotations are not supported and will be ignored for `fish`:
- * `BashCompFilenameExt` (filtering by file extension)
- * `BashCompSubdirsInDir` (filtering by directory)
-* The functions corresponding to the above annotations are consequently not supported and will be ignored for `fish`:
- * `MarkFlagFilename()` and `MarkPersistentFlagFilename()` (filtering by file extension)
- * `MarkFlagDirname()` and `MarkPersistentFlagDirname()` (filtering by directory)
-* Similarly, the following completion directives are not supported and will be ignored for `fish`:
- * `ShellCompDirectiveFilterFileExt` (filtering by file extension)
- * `ShellCompDirectiveFilterDirs` (filtering by directory)
-
-## PowerShell completions
-
-Cobra supports native PowerShell completions generated from the root `cobra.Command`. You can use the `command.GenPowerShellCompletion()` or `command.GenPowerShellCompletionFile()` functions. To include descriptions use `command.GenPowerShellCompletionWithDesc()` and `command.GenPowerShellCompletionFileWithDesc()`. Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users.
-
-The script is designed to support all three PowerShell completion modes:
-
-* TabCompleteNext (default windows style - on each key press the next option is displayed)
-* Complete (works like bash)
-* MenuComplete (works like zsh)
-
-You set the mode with `Set-PSReadLineKeyHandler -Key Tab -Function `. Descriptions are only displayed when using the `Complete` or `MenuComplete` mode.
-
-Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles.
-
-```
-# With descriptions and Mode 'Complete'
-$ helm s[tab]
-search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release)
-
-# With descriptions and Mode 'MenuComplete' The description of the current selected value will be displayed below the suggestions.
-$ helm s[tab]
-search show status
-
-search for a keyword in charts
-
-# Without descriptions
-$ helm s[tab]
-search show status
-```
-### Aliases
-
-You can also configure `powershell` aliases for your program and they will also support completions.
-
-```
-$ sal aliasname origcommand
-$ Register-ArgumentCompleter -CommandName 'aliasname' -ScriptBlock $__origcommandCompleterBlock
-
-# and now when you run `aliasname` completion will make
-# suggestions as it did for `origcommand`.
-
-$ aliasname
-completion firstcommand secondcommand
-```
-The name of the completer block variable is of the form `$__CompleterBlock` where every `-` and `:` in the program name have been replaced with `_`, to respect powershell naming syntax.
-
-### Limitations
-
-* Custom completions implemented in bash scripting (legacy) are not supported and will be ignored for `powershell` (including the use of the `BashCompCustom` flag annotation).
- * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`).
-* The function `MarkFlagCustom()` is not supported and will be ignored for `powershell`.
- * You should instead use `RegisterFlagCompletionFunc()`.
-* The following flag completion annotations are not supported and will be ignored for `powershell`:
- * `BashCompFilenameExt` (filtering by file extension)
- * `BashCompSubdirsInDir` (filtering by directory)
-* The functions corresponding to the above annotations are consequently not supported and will be ignored for `powershell`:
- * `MarkFlagFilename()` and `MarkPersistentFlagFilename()` (filtering by file extension)
- * `MarkFlagDirname()` and `MarkPersistentFlagDirname()` (filtering by directory)
-* Similarly, the following completion directives are not supported and will be ignored for `powershell`:
- * `ShellCompDirectiveFilterFileExt` (filtering by file extension)
- * `ShellCompDirectiveFilterDirs` (filtering by directory)
diff --git a/vendor/github.com/spf13/cobra/user_guide.md b/vendor/github.com/spf13/cobra/user_guide.md
deleted file mode 100644
index 85201d840c..0000000000
--- a/vendor/github.com/spf13/cobra/user_guide.md
+++ /dev/null
@@ -1,726 +0,0 @@
-# User Guide
-
-While you are welcome to provide your own organization, typically a Cobra-based
-application will follow the following organizational structure:
-
-```
- ▾ appName/
- ▾ cmd/
- add.go
- your.go
- commands.go
- here.go
- main.go
-```
-
-In a Cobra app, typically the main.go file is very bare. It serves one purpose: initializing Cobra.
-
-```go
-package main
-
-import (
- "{pathToYourApp}/cmd"
-)
-
-func main() {
- cmd.Execute()
-}
-```
-
-## Using the Cobra Generator
-
-Cobra-CLI is its own program that will create your application and add any
-commands you want. It's the easiest way to incorporate Cobra into your application.
-
-For complete details on using the Cobra generator, please refer to [The Cobra-CLI Generator README](https://github.com/spf13/cobra-cli/blob/main/README.md)
-
-## Using the Cobra Library
-
-To manually implement Cobra you need to create a bare main.go file and a rootCmd file.
-You will optionally provide additional commands as you see fit.
-
-### Create rootCmd
-
-Cobra doesn't require any special constructors. Simply create your commands.
-
-Ideally you place this in app/cmd/root.go:
-
-```go
-var rootCmd = &cobra.Command{
- Use: "hugo",
- Short: "Hugo is a very fast static site generator",
- Long: `A Fast and Flexible Static Site Generator built with
- love by spf13 and friends in Go.
- Complete documentation is available at https://gohugo.io/documentation/`,
- Run: func(cmd *cobra.Command, args []string) {
- // Do Stuff Here
- },
-}
-
-func Execute() {
- if err := rootCmd.Execute(); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}
-```
-
-You will additionally define flags and handle configuration in your init() function.
-
-For example cmd/root.go:
-
-```go
-package cmd
-
-import (
- "fmt"
- "os"
-
- "github.com/spf13/cobra"
- "github.com/spf13/viper"
-)
-
-var (
- // Used for flags.
- cfgFile string
- userLicense string
-
- rootCmd = &cobra.Command{
- Use: "cobra-cli",
- Short: "A generator for Cobra based Applications",
- Long: `Cobra is a CLI library for Go that empowers applications.
-This application is a tool to generate the needed files
-to quickly create a Cobra application.`,
- }
-)
-
-// Execute executes the root command.
-func Execute() error {
- return rootCmd.Execute()
-}
-
-func init() {
- cobra.OnInitialize(initConfig)
-
- rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)")
- rootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "author name for copyright attribution")
- rootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "name of license for the project")
- rootCmd.PersistentFlags().Bool("viper", true, "use Viper for configuration")
- viper.BindPFlag("author", rootCmd.PersistentFlags().Lookup("author"))
- viper.BindPFlag("useViper", rootCmd.PersistentFlags().Lookup("viper"))
- viper.SetDefault("author", "NAME HERE ")
- viper.SetDefault("license", "apache")
-
- rootCmd.AddCommand(addCmd)
- rootCmd.AddCommand(initCmd)
-}
-
-func initConfig() {
- if cfgFile != "" {
- // Use config file from the flag.
- viper.SetConfigFile(cfgFile)
- } else {
- // Find home directory.
- home, err := os.UserHomeDir()
- cobra.CheckErr(err)
-
- // Search config in home directory with name ".cobra" (without extension).
- viper.AddConfigPath(home)
- viper.SetConfigType("yaml")
- viper.SetConfigName(".cobra")
- }
-
- viper.AutomaticEnv()
-
- if err := viper.ReadInConfig(); err == nil {
- fmt.Println("Using config file:", viper.ConfigFileUsed())
- }
-}
-```
-
-### Create your main.go
-
-With the root command you need to have your main function execute it.
-Execute should be run on the root for clarity, though it can be called on any command.
-
-In a Cobra app, typically the main.go file is very bare. It serves one purpose: to initialize Cobra.
-
-```go
-package main
-
-import (
- "{pathToYourApp}/cmd"
-)
-
-func main() {
- cmd.Execute()
-}
-```
-
-### Create additional commands
-
-Additional commands can be defined and typically are each given their own file
-inside of the cmd/ directory.
-
-If you wanted to create a version command you would create cmd/version.go and
-populate it with the following:
-
-```go
-package cmd
-
-import (
- "fmt"
-
- "github.com/spf13/cobra"
-)
-
-func init() {
- rootCmd.AddCommand(versionCmd)
-}
-
-var versionCmd = &cobra.Command{
- Use: "version",
- Short: "Print the version number of Hugo",
- Long: `All software has versions. This is Hugo's`,
- Run: func(cmd *cobra.Command, args []string) {
- fmt.Println("Hugo Static Site Generator v0.9 -- HEAD")
- },
-}
-```
-
-### Organizing subcommands
-
-A command may have subcommands which in turn may have other subcommands. This is achieved by using
-`AddCommand`. In some cases, especially in larger applications, each subcommand may be defined in
-its own go package.
-
-The suggested approach is for the parent command to use `AddCommand` to add its most immediate
-subcommands. For example, consider the following directory structure:
-
-```text
-├── cmd
-│ ├── root.go
-│ └── sub1
-│ ├── sub1.go
-│ └── sub2
-│ ├── leafA.go
-│ ├── leafB.go
-│ └── sub2.go
-└── main.go
-```
-
-In this case:
-
-* The `init` function of `root.go` adds the command defined in `sub1.go` to the root command.
-* The `init` function of `sub1.go` adds the command defined in `sub2.go` to the sub1 command.
-* The `init` function of `sub2.go` adds the commands defined in `leafA.go` and `leafB.go` to the
- sub2 command.
-
-This approach ensures the subcommands are always included at compile time while avoiding cyclic
-references.
-
-### Returning and handling errors
-
-If you wish to return an error to the caller of a command, `RunE` can be used.
-
-```go
-package cmd
-
-import (
- "fmt"
-
- "github.com/spf13/cobra"
-)
-
-func init() {
- rootCmd.AddCommand(tryCmd)
-}
-
-var tryCmd = &cobra.Command{
- Use: "try",
- Short: "Try and possibly fail at something",
- RunE: func(cmd *cobra.Command, args []string) error {
- if err := someFunc(); err != nil {
- return err
- }
- return nil
- },
-}
-```
-
-The error can then be caught at the execute function call.
-
-## Working with Flags
-
-Flags provide modifiers to control how the action command operates.
-
-### Assign flags to a command
-
-Since the flags are defined and used in different locations, we need to
-define a variable outside with the correct scope to assign the flag to
-work with.
-
-```go
-var Verbose bool
-var Source string
-```
-
-There are two different approaches to assign a flag.
-
-### Persistent Flags
-
-A flag can be 'persistent', meaning that this flag will be available to the
-command it's assigned to as well as every command under that command. For
-global flags, assign a flag as a persistent flag on the root.
-
-```go
-rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output")
-```
-
-### Local Flags
-
-A flag can also be assigned locally, which will only apply to that specific command.
-
-```go
-localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from")
-```
-
-### Local Flag on Parent Commands
-
-By default, Cobra only parses local flags on the target command, and any local flags on
-parent commands are ignored. By enabling `Command.TraverseChildren`, Cobra will
-parse local flags on each command before executing the target command.
-
-```go
-command := cobra.Command{
- Use: "print [OPTIONS] [COMMANDS]",
- TraverseChildren: true,
-}
-```
-
-### Bind Flags with Config
-
-You can also bind your flags with [viper](https://github.com/spf13/viper):
-```go
-var author string
-
-func init() {
- rootCmd.PersistentFlags().StringVar(&author, "author", "YOUR NAME", "Author name for copyright attribution")
- viper.BindPFlag("author", rootCmd.PersistentFlags().Lookup("author"))
-}
-```
-
-In this example, the persistent flag `author` is bound with `viper`.
-**Note**: the variable `author` will not be set to the value from config,
-when the `--author` flag is provided by user.
-
-More in [viper documentation](https://github.com/spf13/viper#working-with-flags).
-
-### Required flags
-
-Flags are optional by default. If instead you wish your command to report an error
-when a flag has not been set, mark it as required:
-```go
-rootCmd.Flags().StringVarP(&Region, "region", "r", "", "AWS region (required)")
-rootCmd.MarkFlagRequired("region")
-```
-
-Or, for persistent flags:
-```go
-rootCmd.PersistentFlags().StringVarP(&Region, "region", "r", "", "AWS region (required)")
-rootCmd.MarkPersistentFlagRequired("region")
-```
-
-### Flag Groups
-
-If you have different flags that must be provided together (e.g. if they provide the `--username` flag they MUST provide the `--password` flag as well) then
-Cobra can enforce that requirement:
-```go
-rootCmd.Flags().StringVarP(&u, "username", "u", "", "Username (required if password is set)")
-rootCmd.Flags().StringVarP(&pw, "password", "p", "", "Password (required if username is set)")
-rootCmd.MarkFlagsRequiredTogether("username", "password")
-```
-
-You can also prevent different flags from being provided together if they represent mutually
-exclusive options such as specifying an output format as either `--json` or `--yaml` but never both:
-```go
-rootCmd.Flags().BoolVar(&ofJson, "json", false, "Output in JSON")
-rootCmd.Flags().BoolVar(&ofYaml, "yaml", false, "Output in YAML")
-rootCmd.MarkFlagsMutuallyExclusive("json", "yaml")
-```
-
-In both of these cases:
- - both local and persistent flags can be used
- - **NOTE:** the group is only enforced on commands where every flag is defined
- - a flag may appear in multiple groups
- - a group may contain any number of flags
-
-## Positional and Custom Arguments
-
-Validation of positional arguments can be specified using the `Args` field of `Command`.
-The following validators are built in:
-
-- Number of arguments:
- - `NoArgs` - report an error if there are any positional args.
- - `ArbitraryArgs` - accept any number of args.
- - `MinimumNArgs(int)` - report an error if less than N positional args are provided.
- - `MaximumNArgs(int)` - report an error if more than N positional args are provided.
- - `ExactArgs(int)` - report an error if there are not exactly N positional args.
- - `RangeArgs(min, max)` - report an error if the number of args is not between `min` and `max`.
-- Content of the arguments:
- - `OnlyValidArgs` - report an error if there are any positional args not specified in the `ValidArgs` field of `Command`, which can optionally be set to a list of valid values for positional args.
-
-If `Args` is undefined or `nil`, it defaults to `ArbitraryArgs`.
-
-Moreover, `MatchAll(pargs ...PositionalArgs)` enables combining existing checks with arbitrary other checks.
-For instance, if you want to report an error if there are not exactly N positional args OR if there are any positional
-args that are not in the `ValidArgs` field of `Command`, you can call `MatchAll` on `ExactArgs` and `OnlyValidArgs`, as
-shown below:
-
-```go
-var cmd = &cobra.Command{
- Short: "hello",
- Args: cobra.MatchAll(cobra.ExactArgs(2), cobra.OnlyValidArgs),
- Run: func(cmd *cobra.Command, args []string) {
- fmt.Println("Hello, World!")
- },
-}
-```
-
-It is possible to set any custom validator that satisfies `func(cmd *cobra.Command, args []string) error`.
-For example:
-
-```go
-var cmd = &cobra.Command{
- Short: "hello",
- Args: func(cmd *cobra.Command, args []string) error {
- // Optionally run one of the validators provided by cobra
- if err := cobra.MinimumNArgs(1)(cmd, args); err != nil {
- return err
- }
- // Run the custom validation logic
- if myapp.IsValidColor(args[0]) {
- return nil
- }
- return fmt.Errorf("invalid color specified: %s", args[0])
- },
- Run: func(cmd *cobra.Command, args []string) {
- fmt.Println("Hello, World!")
- },
-}
-```
-
-## Example
-
-In the example below, we have defined three commands. Two are at the top level
-and one (cmdTimes) is a child of one of the top commands. In this case the root
-is not executable, meaning that a subcommand is required. This is accomplished
-by not providing a 'Run' for the 'rootCmd'.
-
-We have only defined one flag for a single command.
-
-More documentation about flags is available at https://github.com/spf13/pflag
-
-```go
-package main
-
-import (
- "fmt"
- "strings"
-
- "github.com/spf13/cobra"
-)
-
-func main() {
- var echoTimes int
-
- var cmdPrint = &cobra.Command{
- Use: "print [string to print]",
- Short: "Print anything to the screen",
- Long: `print is for printing anything back to the screen.
-For many years people have printed back to the screen.`,
- Args: cobra.MinimumNArgs(1),
- Run: func(cmd *cobra.Command, args []string) {
- fmt.Println("Print: " + strings.Join(args, " "))
- },
- }
-
- var cmdEcho = &cobra.Command{
- Use: "echo [string to echo]",
- Short: "Echo anything to the screen",
- Long: `echo is for echoing anything back.
-Echo works a lot like print, except it has a child command.`,
- Args: cobra.MinimumNArgs(1),
- Run: func(cmd *cobra.Command, args []string) {
- fmt.Println("Echo: " + strings.Join(args, " "))
- },
- }
-
- var cmdTimes = &cobra.Command{
- Use: "times [string to echo]",
- Short: "Echo anything to the screen more times",
- Long: `echo things multiple times back to the user by providing
-a count and a string.`,
- Args: cobra.MinimumNArgs(1),
- Run: func(cmd *cobra.Command, args []string) {
- for i := 0; i < echoTimes; i++ {
- fmt.Println("Echo: " + strings.Join(args, " "))
- }
- },
- }
-
- cmdTimes.Flags().IntVarP(&echoTimes, "times", "t", 1, "times to echo the input")
-
- var rootCmd = &cobra.Command{Use: "app"}
- rootCmd.AddCommand(cmdPrint, cmdEcho)
- cmdEcho.AddCommand(cmdTimes)
- rootCmd.Execute()
-}
-```
-
-For a more complete example of a larger application, please checkout [Hugo](https://gohugo.io/).
-
-## Help Command
-
-Cobra automatically adds a help command to your application when you have subcommands.
-This will be called when a user runs 'app help'. Additionally, help will also
-support all other commands as input. Say, for instance, you have a command called
-'create' without any additional configuration; Cobra will work when 'app help
-create' is called. Every command will automatically have the '--help' flag added.
-
-### Example
-
-The following output is automatically generated by Cobra. Nothing beyond the
-command and flag definitions are needed.
-
- $ cobra-cli help
-
- Cobra is a CLI library for Go that empowers applications.
- This application is a tool to generate the needed files
- to quickly create a Cobra application.
-
- Usage:
- cobra-cli [command]
-
- Available Commands:
- add Add a command to a Cobra Application
- completion Generate the autocompletion script for the specified shell
- help Help about any command
- init Initialize a Cobra Application
-
- Flags:
- -a, --author string author name for copyright attribution (default "YOUR NAME")
- --config string config file (default is $HOME/.cobra.yaml)
- -h, --help help for cobra-cli
- -l, --license string name of license for the project
- --viper use Viper for configuration
-
- Use "cobra-cli [command] --help" for more information about a command.
-
-
-Help is just a command like any other. There is no special logic or behavior
-around it. In fact, you can provide your own if you want.
-
-### Grouping commands in help
-
-Cobra supports grouping of available commands in the help output. To group commands, each group must be explicitly
-defined using `AddGroup()` on the parent command. Then a subcommand can be added to a group using the `GroupID` element
-of that subcommand. The groups will appear in the help output in the same order as they are defined using different
-calls to `AddGroup()`. If you use the generated `help` or `completion` commands, you can set their group ids using
-`SetHelpCommandGroupId()` and `SetCompletionCommandGroupId()` on the root command, respectively.
-
-### Defining your own help
-
-You can provide your own Help command or your own template for the default command to use
-with the following functions:
-
-```go
-cmd.SetHelpCommand(cmd *Command)
-cmd.SetHelpFunc(f func(*Command, []string))
-cmd.SetHelpTemplate(s string)
-```
-
-The latter two will also apply to any children commands.
-
-## Usage Message
-
-When the user provides an invalid flag or invalid command, Cobra responds by
-showing the user the 'usage'.
-
-### Example
-You may recognize this from the help above. That's because the default help
-embeds the usage as part of its output.
-
- $ cobra-cli --invalid
- Error: unknown flag: --invalid
- Usage:
- cobra-cli [command]
-
- Available Commands:
- add Add a command to a Cobra Application
- completion Generate the autocompletion script for the specified shell
- help Help about any command
- init Initialize a Cobra Application
-
- Flags:
- -a, --author string author name for copyright attribution (default "YOUR NAME")
- --config string config file (default is $HOME/.cobra.yaml)
- -h, --help help for cobra-cli
- -l, --license string name of license for the project
- --viper use Viper for configuration
-
- Use "cobra [command] --help" for more information about a command.
-
-### Defining your own usage
-You can provide your own usage function or template for Cobra to use.
-Like help, the function and template are overridable through public methods:
-
-```go
-cmd.SetUsageFunc(f func(*Command) error)
-cmd.SetUsageTemplate(s string)
-```
-
-## Version Flag
-
-Cobra adds a top-level '--version' flag if the Version field is set on the root command.
-Running an application with the '--version' flag will print the version to stdout using
-the version template. The template can be customized using the
-`cmd.SetVersionTemplate(s string)` function.
-
-## PreRun and PostRun Hooks
-
-It is possible to run functions before or after the main `Run` function of your command. The `PersistentPreRun` and `PreRun` functions will be executed before `Run`. `PersistentPostRun` and `PostRun` will be executed after `Run`. The `Persistent*Run` functions will be inherited by children if they do not declare their own. These functions are run in the following order:
-
-- `PersistentPreRun`
-- `PreRun`
-- `Run`
-- `PostRun`
-- `PersistentPostRun`
-
-An example of two commands which use all of these features is below. When the subcommand is executed, it will run the root command's `PersistentPreRun` but not the root command's `PersistentPostRun`:
-
-```go
-package main
-
-import (
- "fmt"
-
- "github.com/spf13/cobra"
-)
-
-func main() {
-
- var rootCmd = &cobra.Command{
- Use: "root [sub]",
- Short: "My root command",
- PersistentPreRun: func(cmd *cobra.Command, args []string) {
- fmt.Printf("Inside rootCmd PersistentPreRun with args: %v\n", args)
- },
- PreRun: func(cmd *cobra.Command, args []string) {
- fmt.Printf("Inside rootCmd PreRun with args: %v\n", args)
- },
- Run: func(cmd *cobra.Command, args []string) {
- fmt.Printf("Inside rootCmd Run with args: %v\n", args)
- },
- PostRun: func(cmd *cobra.Command, args []string) {
- fmt.Printf("Inside rootCmd PostRun with args: %v\n", args)
- },
- PersistentPostRun: func(cmd *cobra.Command, args []string) {
- fmt.Printf("Inside rootCmd PersistentPostRun with args: %v\n", args)
- },
- }
-
- var subCmd = &cobra.Command{
- Use: "sub [no options!]",
- Short: "My subcommand",
- PreRun: func(cmd *cobra.Command, args []string) {
- fmt.Printf("Inside subCmd PreRun with args: %v\n", args)
- },
- Run: func(cmd *cobra.Command, args []string) {
- fmt.Printf("Inside subCmd Run with args: %v\n", args)
- },
- PostRun: func(cmd *cobra.Command, args []string) {
- fmt.Printf("Inside subCmd PostRun with args: %v\n", args)
- },
- PersistentPostRun: func(cmd *cobra.Command, args []string) {
- fmt.Printf("Inside subCmd PersistentPostRun with args: %v\n", args)
- },
- }
-
- rootCmd.AddCommand(subCmd)
-
- rootCmd.SetArgs([]string{""})
- rootCmd.Execute()
- fmt.Println()
- rootCmd.SetArgs([]string{"sub", "arg1", "arg2"})
- rootCmd.Execute()
-}
-```
-
-Output:
-```
-Inside rootCmd PersistentPreRun with args: []
-Inside rootCmd PreRun with args: []
-Inside rootCmd Run with args: []
-Inside rootCmd PostRun with args: []
-Inside rootCmd PersistentPostRun with args: []
-
-Inside rootCmd PersistentPreRun with args: [arg1 arg2]
-Inside subCmd PreRun with args: [arg1 arg2]
-Inside subCmd Run with args: [arg1 arg2]
-Inside subCmd PostRun with args: [arg1 arg2]
-Inside subCmd PersistentPostRun with args: [arg1 arg2]
-```
-
-## Suggestions when "unknown command" happens
-
-Cobra will print automatic suggestions when "unknown command" errors happen. This allows Cobra to behave similarly to the `git` command when a typo happens. For example:
-
-```
-$ hugo srever
-Error: unknown command "srever" for "hugo"
-
-Did you mean this?
- server
-
-Run 'hugo --help' for usage.
-```
-
-Suggestions are automatically generated based on existing subcommands and use an implementation of [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance). Every registered command that matches a minimum distance of 2 (ignoring case) will be displayed as a suggestion.
-
-If you need to disable suggestions or tweak the string distance in your command, use:
-
-```go
-command.DisableSuggestions = true
-```
-
-or
-
-```go
-command.SuggestionsMinimumDistance = 1
-```
-
-You can also explicitly set names for which a given command will be suggested using the `SuggestFor` attribute. This allows suggestions for strings that are not close in terms of string distance, but make sense in your set of commands but for which
-you don't want aliases. Example:
-
-```
-$ kubectl remove
-Error: unknown command "remove" for "kubectl"
-
-Did you mean this?
- delete
-
-Run 'kubectl help' for usage.
-```
-
-## Generating documentation for your command
-
-Cobra can generate documentation based on subcommands, flags, etc. Read more about it in the [docs generation documentation](doc/README.md).
-
-## Generating shell completions
-
-Cobra can generate a shell-completion file for the following shells: bash, zsh, fish, PowerShell. If you add more information to your commands, these completions can be amazingly powerful and flexible. Read more about it in [Shell Completions](shell_completions.md).
-
-## Providing Active Help
-
-Cobra makes use of the shell-completion system to define a framework allowing you to provide Active Help to your users. Active Help are messages (hints, warnings, etc) printed as the program is being used. Read more about it in [Active Help](active_help.md).
diff --git a/vendor/github.com/spf13/cobra/zsh_completions.md b/vendor/github.com/spf13/cobra/zsh_completions.md
deleted file mode 100644
index 7cff61787f..0000000000
--- a/vendor/github.com/spf13/cobra/zsh_completions.md
+++ /dev/null
@@ -1,48 +0,0 @@
-## Generating Zsh Completion For Your cobra.Command
-
-Please refer to [Shell Completions](shell_completions.md) for details.
-
-## Zsh completions standardization
-
-Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backwards-compatible, some small changes in behavior were introduced.
-
-### Deprecation summary
-
-See further below for more details on these deprecations.
-
-* `cmd.MarkZshCompPositionalArgumentFile(pos, []string{})` is no longer needed. It is therefore **deprecated** and silently ignored.
-* `cmd.MarkZshCompPositionalArgumentFile(pos, glob[])` is **deprecated** and silently ignored.
- * Instead use `ValidArgsFunction` with `ShellCompDirectiveFilterFileExt`.
-* `cmd.MarkZshCompPositionalArgumentWords()` is **deprecated** and silently ignored.
- * Instead use `ValidArgsFunction`.
-
-### Behavioral changes
-
-**Noun completion**
-|Old behavior|New behavior|
-|---|---|
-|No file completion by default (opposite of bash)|File completion by default; use `ValidArgsFunction` with `ShellCompDirectiveNoFileComp` to turn off file completion on a per-argument basis|
-|Completion of flag names without the `-` prefix having been typed|Flag names are only completed if the user has typed the first `-`|
-`cmd.MarkZshCompPositionalArgumentFile(pos, []string{})` used to turn on file completion on a per-argument position basis|File completion for all arguments by default; `cmd.MarkZshCompPositionalArgumentFile()` is **deprecated** and silently ignored|
-|`cmd.MarkZshCompPositionalArgumentFile(pos, glob[])` used to turn on file completion **with glob filtering** on a per-argument position basis (zsh-specific)|`cmd.MarkZshCompPositionalArgumentFile()` is **deprecated** and silently ignored; use `ValidArgsFunction` with `ShellCompDirectiveFilterFileExt` for file **extension** filtering (not full glob filtering)|
-|`cmd.MarkZshCompPositionalArgumentWords(pos, words[])` used to provide completion choices on a per-argument position basis (zsh-specific)|`cmd.MarkZshCompPositionalArgumentWords()` is **deprecated** and silently ignored; use `ValidArgsFunction` to achieve the same behavior|
-
-**Flag-value completion**
-
-|Old behavior|New behavior|
-|---|---|
-|No file completion by default (opposite of bash)|File completion by default; use `RegisterFlagCompletionFunc()` with `ShellCompDirectiveNoFileComp` to turn off file completion|
-|`cmd.MarkFlagFilename(flag, []string{})` and similar used to turn on file completion|File completion by default; `cmd.MarkFlagFilename(flag, []string{})` no longer needed in this context and silently ignored|
-|`cmd.MarkFlagFilename(flag, glob[])` used to turn on file completion **with glob filtering** (syntax of `[]string{"*.yaml", "*.yml"}` incompatible with bash)|Will continue to work, however, support for bash syntax is added and should be used instead so as to work for all shells (`[]string{"yaml", "yml"}`)|
-|`cmd.MarkFlagDirname(flag)` only completes directories (zsh-specific)|Has been added for all shells|
-|Completion of a flag name does not repeat, unless flag is of type `*Array` or `*Slice` (not supported by bash)|Retained for `zsh` and added to `fish`|
-|Completion of a flag name does not provide the `=` form (unlike bash)|Retained for `zsh` and added to `fish`|
-
-**Improvements**
-
-* Custom completion support (`ValidArgsFunction` and `RegisterFlagCompletionFunc()`)
-* File completion by default if no other completions found
-* Handling of required flags
-* File extension filtering no longer mutually exclusive with bash usage
-* Completion of directory names *within* another directory
-* Support for `=` form of flags
diff --git a/vendor/github.com/x448/float16/.travis.yml b/vendor/github.com/x448/float16/.travis.yml
new file mode 100644
index 0000000000..8902bdaaff
--- /dev/null
+++ b/vendor/github.com/x448/float16/.travis.yml
@@ -0,0 +1,13 @@
+language: go
+
+go:
+ - 1.11.x
+
+env:
+ - GO111MODULE=on
+
+script:
+ - go test -short -coverprofile=coverage.txt -covermode=count ./...
+
+after_success:
+ - bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/x448/float16/LICENSE b/vendor/github.com/x448/float16/LICENSE
new file mode 100644
index 0000000000..bf6e357854
--- /dev/null
+++ b/vendor/github.com/x448/float16/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/vendor/github.com/x448/float16/README.md b/vendor/github.com/x448/float16/README.md
new file mode 100644
index 0000000000..b524b8135d
--- /dev/null
+++ b/vendor/github.com/x448/float16/README.md
@@ -0,0 +1,133 @@
+# Float16 (Binary16) in Go/Golang
+[](https://travis-ci.org/x448/float16)
+[](https://codecov.io/gh/x448/float16)
+[](https://goreportcard.com/report/github.com/x448/float16)
+[](https://github.com/x448/float16/releases)
+[](https://raw.githubusercontent.com/x448/float16/master/LICENSE)
+
+`float16` package provides [IEEE 754 half-precision floating-point format (binary16)](https://en.wikipedia.org/wiki/Half-precision_floating-point_format) with IEEE 754 default rounding for conversions. IEEE 754-2008 refers to this 16-bit floating-point format as binary16.
+
+IEEE 754 default rounding ("Round-to-Nearest RoundTiesToEven") is considered the most accurate and statistically unbiased estimate of the true result.
+
+All possible 4+ billion floating-point conversions with this library are verified to be correct.
+
+Lowercase "float16" refers to IEEE 754 binary16. And capitalized "Float16" refers to exported Go data type provided by this library.
+
+## Features
+Current features include:
+
+* float16 to float32 conversions use lossless conversion.
+* float32 to float16 conversions use IEEE 754-2008 "Round-to-Nearest RoundTiesToEven".
+* conversions using pure Go take about 2.65 ns/op on a desktop amd64.
+* unit tests provide 100% code coverage and check all possible 4+ billion conversions.
+* other functions include: IsInf(), IsNaN(), IsNormal(), PrecisionFromfloat32(), String(), etc.
+* all functions in this library use zero allocs except String().
+
+## Status
+This library is used by [fxamacker/cbor](https://github.com/fxamacker/cbor) and is ready for production use on supported platforms. The version number < 1.0 indicates more functions and options are planned but not yet published.
+
+Current status:
+
+* core API is done and breaking API changes are unlikely.
+* 100% of unit tests pass:
+ * short mode (`go test -short`) tests around 65765 conversions in 0.005s.
+ * normal mode (`go test`) tests all possible 4+ billion conversions in about 95s.
+* 100% code coverage with both short mode and normal mode.
+* tested on amd64 but it should work on all little-endian platforms supported by Go.
+
+Roadmap:
+
+* add functions for fast batch conversions leveraging SIMD when supported by hardware.
+* speed up unit test when verifying all possible 4+ billion conversions.
+* test on additional platforms.
+
+## Float16 to Float32 Conversion
+Conversions from float16 to float32 are lossless conversions. All 65536 possible float16 to float32 conversions (in pure Go) are confirmed to be correct.
+
+Unit tests take a fraction of a second to check all 65536 expected values for float16 to float32 conversions.
+
+## Float32 to Float16 Conversion
+Conversions from float32 to float16 use IEEE 754 default rounding ("Round-to-Nearest RoundTiesToEven"). All 4294967296 possible float32 to float16 conversions (in pure Go) are confirmed to be correct.
+
+Unit tests in normal mode take about 1-2 minutes to check all 4+ billion float32 input values and results for Fromfloat32(), FromNaN32ps(), and PrecisionFromfloat32().
+
+Unit tests in short mode use a small subset (around 229 float32 inputs) and finish in under 0.01 second while still reaching 100% code coverage.
+
+## Usage
+Install with `go get github.com/x448/float16`.
+```
+// Convert float32 to float16
+pi := float32(math.Pi)
+pi16 := float16.Fromfloat32(pi)
+
+// Convert float16 to float32
+pi32 := pi16.Float32()
+
+// PrecisionFromfloat32() is faster than the overhead of calling a function.
+// This example only converts if there's no data loss and input is not a subnormal.
+if float16.PrecisionFromfloat32(pi) == float16.PrecisionExact {
+ pi16 := float16.Fromfloat32(pi)
+}
+```
+
+## Float16 Type and API
+Float16 (capitalized) is a Go type with uint16 as the underlying state. There are 6 exported functions and 9 exported methods.
+```
+package float16 // import "github.com/x448/float16"
+
+// Exported types and consts
+type Float16 uint16
+const ErrInvalidNaNValue = float16Error("float16: invalid NaN value, expected IEEE 754 NaN")
+
+// Exported functions
+Fromfloat32(f32 float32) Float16 // Float16 number converted from f32 using IEEE 754 default rounding
+ with identical results to AMD and Intel F16C hardware. NaN inputs
+ are converted with quiet bit always set on, to be like F16C.
+
+FromNaN32ps(nan float32) (Float16, error) // Float16 NaN without modifying quiet bit.
+ // The "ps" suffix means "preserve signaling".
+ // Returns sNaN and ErrInvalidNaNValue if nan isn't a NaN.
+
+Frombits(b16 uint16) Float16 // Float16 number corresponding to b16 (IEEE 754 binary16 rep.)
+NaN() Float16 // Float16 of IEEE 754 binary16 not-a-number
+Inf(sign int) Float16 // Float16 of IEEE 754 binary16 infinity according to sign
+
+PrecisionFromfloat32(f32 float32) Precision // quickly indicates exact, ..., overflow, underflow
+ // (inline and < 1 ns/op)
+// Exported methods
+(f Float16) Float32() float32 // float32 number converted from f16 using lossless conversion
+(f Float16) Bits() uint16 // the IEEE 754 binary16 representation of f
+(f Float16) IsNaN() bool // true if f is not-a-number (NaN)
+(f Float16) IsQuietNaN() bool // true if f is a quiet not-a-number (NaN)
+(f Float16) IsInf(sign int) bool // true if f is infinite based on sign (-1=NegInf, 0=any, 1=PosInf)
+(f Float16) IsFinite() bool // true if f is not infinite or NaN
+(f Float16) IsNormal() bool // true if f is not zero, infinite, subnormal, or NaN.
+(f Float16) Signbit() bool // true if f is negative or negative zero
+(f Float16) String() string // string representation of f to satisfy fmt.Stringer interface
+```
+See [API](https://godoc.org/github.com/x448/float16) at godoc.org for more info.
+
+## Benchmarks
+Conversions (in pure Go) are around 2.65 ns/op for float16 -> float32 and float32 -> float16 on amd64. Speeds can vary depending on input value.
+
+```
+All functions have zero allocations except float16.String().
+
+FromFloat32pi-2 2.59ns ± 0% // speed using Fromfloat32() to convert a float32 of math.Pi to Float16
+ToFloat32pi-2 2.69ns ± 0% // speed using Float32() to convert a float16 of math.Pi to float32
+Frombits-2 0.29ns ± 5% // speed using Frombits() to cast a uint16 to Float16
+
+PrecisionFromFloat32-2 0.29ns ± 1% // speed using PrecisionFromfloat32() to check for overflows, etc.
+```
+
+## System Requirements
+* Tested on Go 1.11, 1.12, and 1.13 but it should also work with older versions.
+* Tested on amd64 but it should also work on all little-endian platforms supported by Go.
+
+## Special Thanks
+Special thanks to Kathryn Long (starkat99) for creating [half-rs](https://github.com/starkat99/half-rs), a very nice rust implementation of float16.
+
+## License
+Copyright (c) 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker
+
+Licensed under [MIT License](LICENSE)
diff --git a/vendor/github.com/x448/float16/float16.go b/vendor/github.com/x448/float16/float16.go
new file mode 100644
index 0000000000..1a0e6dad00
--- /dev/null
+++ b/vendor/github.com/x448/float16/float16.go
@@ -0,0 +1,302 @@
+// Copyright 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker
+//
+// Special thanks to Kathryn Long for her Rust implementation
+// of float16 at github.com/starkat99/half-rs (MIT license)
+
+package float16
+
+import (
+ "math"
+ "strconv"
+)
+
+// Float16 represents IEEE 754 half-precision floating-point numbers (binary16).
+type Float16 uint16
+
+// Precision indicates whether the conversion to Float16 is
+// exact, subnormal without dropped bits, inexact, underflow, or overflow.
+type Precision int
+
+const (
+
+ // PrecisionExact is for non-subnormals that don't drop bits during conversion.
+ // All of these can round-trip. Should always convert to float16.
+ PrecisionExact Precision = iota
+
+ // PrecisionUnknown is for subnormals that don't drop bits during conversion but
+ // not all of these can round-trip so precision is unknown without more effort.
+ // Only 2046 of these can round-trip and the rest cannot round-trip.
+ PrecisionUnknown
+
+ // PrecisionInexact is for dropped significand bits and cannot round-trip.
+ // Some of these are subnormals. Cannot round-trip float32->float16->float32.
+ PrecisionInexact
+
+ // PrecisionUnderflow is for Underflows. Cannot round-trip float32->float16->float32.
+ PrecisionUnderflow
+
+ // PrecisionOverflow is for Overflows. Cannot round-trip float32->float16->float32.
+ PrecisionOverflow
+)
+
+// PrecisionFromfloat32 returns Precision without performing
+// the conversion. Conversions from both Infinity and NaN
+// values will always report PrecisionExact even if NaN payload
+// or NaN-Quiet-Bit is lost. This function is kept simple to
+// allow inlining and run < 0.5 ns/op, to serve as a fast filter.
+func PrecisionFromfloat32(f32 float32) Precision {
+ u32 := math.Float32bits(f32)
+
+ if u32 == 0 || u32 == 0x80000000 {
+ // +- zero will always be exact conversion
+ return PrecisionExact
+ }
+
+ const COEFMASK uint32 = 0x7fffff // 23 least significant bits
+ const EXPSHIFT uint32 = 23
+ const EXPBIAS uint32 = 127
+ const EXPMASK uint32 = uint32(0xff) << EXPSHIFT
+ const DROPMASK uint32 = COEFMASK >> 10
+
+ exp := int32(((u32 & EXPMASK) >> EXPSHIFT) - EXPBIAS)
+ coef := u32 & COEFMASK
+
+ if exp == 128 {
+ // +- infinity or NaN
+ // apps may want to do extra checks for NaN separately
+ return PrecisionExact
+ }
+
+ // https://en.wikipedia.org/wiki/Half-precision_floating-point_format says,
+ // "Decimals between 2^−24 (minimum positive subnormal) and 2^−14 (maximum subnormal): fixed interval 2^−24"
+ if exp < -24 {
+ return PrecisionUnderflow
+ }
+ if exp > 15 {
+ return PrecisionOverflow
+ }
+ if (coef & DROPMASK) != uint32(0) {
+ // these include subnormals and non-subnormals that dropped bits
+ return PrecisionInexact
+ }
+
+ if exp < -14 {
+ // Subnormals. Caller may want to test these further.
+ // There are 2046 subnormals that can successfully round-trip f32->f16->f32
+ // and 20 of those 2046 have 32-bit input coef == 0.
+ // RFC 7049 and 7049bis Draft 12 don't precisely define "preserves value"
+ // so some protocols and libraries will choose to handle subnormals differently
+ // when deciding to encode them to CBOR float32 vs float16.
+ return PrecisionUnknown
+ }
+
+ return PrecisionExact
+}
+
+// Frombits returns the float16 number corresponding to the IEEE 754 binary16
+// representation u16, with the sign bit of u16 and the result in the same bit
+// position. Frombits(Bits(x)) == x.
+func Frombits(u16 uint16) Float16 {
+ return Float16(u16)
+}
+
+// Fromfloat32 returns a Float16 value converted from f32. Conversion uses
+// IEEE default rounding (nearest int, with ties to even).
+func Fromfloat32(f32 float32) Float16 {
+ return Float16(f32bitsToF16bits(math.Float32bits(f32)))
+}
+
+// ErrInvalidNaNValue indicates a NaN was not received.
+const ErrInvalidNaNValue = float16Error("float16: invalid NaN value, expected IEEE 754 NaN")
+
+type float16Error string
+
+func (e float16Error) Error() string { return string(e) }
+
+// FromNaN32ps converts nan to IEEE binary16 NaN while preserving both
+// signaling and payload. Unlike Fromfloat32(), which can only return
+// qNaN because it sets quiet bit = 1, this can return both sNaN and qNaN.
+// If the result is infinity (sNaN with empty payload), then the
+// lowest bit of payload is set to make the result a NaN.
+// Returns ErrInvalidNaNValue and 0x7c01 (sNaN) if nan isn't IEEE 754 NaN.
+// This function was kept simple to be able to inline.
+func FromNaN32ps(nan float32) (Float16, error) {
+ const SNAN = Float16(uint16(0x7c01)) // signalling NaN
+
+ u32 := math.Float32bits(nan)
+ sign := u32 & 0x80000000
+ exp := u32 & 0x7f800000
+ coef := u32 & 0x007fffff
+
+ if (exp != 0x7f800000) || (coef == 0) {
+ return SNAN, ErrInvalidNaNValue
+ }
+
+ u16 := uint16((sign >> 16) | uint32(0x7c00) | (coef >> 13))
+
+ if (u16 & 0x03ff) == 0 {
+ // result became infinity, make it NaN by setting lowest bit in payload
+ u16 = u16 | 0x0001
+ }
+
+ return Float16(u16), nil
+}
+
+// NaN returns a Float16 of IEEE 754 binary16 not-a-number (NaN).
+// Returned NaN value 0x7e01 has all exponent bits = 1 with the
+// first and last bits = 1 in the significand. This is consistent
+// with Go's 64-bit math.NaN(). Canonical CBOR in RFC 7049 uses 0x7e00.
+func NaN() Float16 {
+ return Float16(0x7e01)
+}
+
+// Inf returns a Float16 with an infinity value with the specified sign.
+// A sign >= returns positive infinity.
+// A sign < 0 returns negative infinity.
+func Inf(sign int) Float16 {
+ if sign >= 0 {
+ return Float16(0x7c00)
+ }
+ return Float16(0x8000 | 0x7c00)
+}
+
+// Float32 returns a float32 converted from f (Float16).
+// This is a lossless conversion.
+func (f Float16) Float32() float32 {
+ u32 := f16bitsToF32bits(uint16(f))
+ return math.Float32frombits(u32)
+}
+
+// Bits returns the IEEE 754 binary16 representation of f, with the sign bit
+// of f and the result in the same bit position. Bits(Frombits(x)) == x.
+func (f Float16) Bits() uint16 {
+ return uint16(f)
+}
+
+// IsNaN reports whether f is an IEEE 754 binary16 “not-a-number” value.
+func (f Float16) IsNaN() bool {
+ return (f&0x7c00 == 0x7c00) && (f&0x03ff != 0)
+}
+
+// IsQuietNaN reports whether f is a quiet (non-signaling) IEEE 754 binary16
+// “not-a-number” value.
+func (f Float16) IsQuietNaN() bool {
+ return (f&0x7c00 == 0x7c00) && (f&0x03ff != 0) && (f&0x0200 != 0)
+}
+
+// IsInf reports whether f is an infinity (inf).
+// A sign > 0 reports whether f is positive inf.
+// A sign < 0 reports whether f is negative inf.
+// A sign == 0 reports whether f is either inf.
+func (f Float16) IsInf(sign int) bool {
+ return ((f == 0x7c00) && sign >= 0) ||
+ (f == 0xfc00 && sign <= 0)
+}
+
+// IsFinite returns true if f is neither infinite nor NaN.
+func (f Float16) IsFinite() bool {
+ return (uint16(f) & uint16(0x7c00)) != uint16(0x7c00)
+}
+
+// IsNormal returns true if f is neither zero, infinite, subnormal, or NaN.
+func (f Float16) IsNormal() bool {
+ exp := uint16(f) & uint16(0x7c00)
+ return (exp != uint16(0x7c00)) && (exp != 0)
+}
+
+// Signbit reports whether f is negative or negative zero.
+func (f Float16) Signbit() bool {
+ return (uint16(f) & uint16(0x8000)) != 0
+}
+
+// String satisfies the fmt.Stringer interface.
+func (f Float16) String() string {
+ return strconv.FormatFloat(float64(f.Float32()), 'f', -1, 32)
+}
+
+// f16bitsToF32bits returns uint32 (float32 bits) converted from specified uint16.
+func f16bitsToF32bits(in uint16) uint32 {
+ // All 65536 conversions with this were confirmed to be correct
+ // by Montgomery Edwards⁴⁴⁸ (github.com/x448).
+
+ sign := uint32(in&0x8000) << 16 // sign for 32-bit
+ exp := uint32(in&0x7c00) >> 10 // exponenent for 16-bit
+ coef := uint32(in&0x03ff) << 13 // significand for 32-bit
+
+ if exp == 0x1f {
+ if coef == 0 {
+ // infinity
+ return sign | 0x7f800000 | coef
+ }
+ // NaN
+ return sign | 0x7fc00000 | coef
+ }
+
+ if exp == 0 {
+ if coef == 0 {
+ // zero
+ return sign
+ }
+
+ // normalize subnormal numbers
+ exp++
+ for coef&0x7f800000 == 0 {
+ coef <<= 1
+ exp--
+ }
+ coef &= 0x007fffff
+ }
+
+ return sign | ((exp + (0x7f - 0xf)) << 23) | coef
+}
+
+// f32bitsToF16bits returns uint16 (Float16 bits) converted from the specified float32.
+// Conversion rounds to nearest integer with ties to even.
+func f32bitsToF16bits(u32 uint32) uint16 {
+ // Translated from Rust to Go by Montgomery Edwards⁴⁴⁸ (github.com/x448).
+ // All 4294967296 conversions with this were confirmed to be correct by x448.
+ // Original Rust implementation is by Kathryn Long (github.com/starkat99) with MIT license.
+
+ sign := u32 & 0x80000000
+ exp := u32 & 0x7f800000
+ coef := u32 & 0x007fffff
+
+ if exp == 0x7f800000 {
+ // NaN or Infinity
+ nanBit := uint32(0)
+ if coef != 0 {
+ nanBit = uint32(0x0200)
+ }
+ return uint16((sign >> 16) | uint32(0x7c00) | nanBit | (coef >> 13))
+ }
+
+ halfSign := sign >> 16
+
+ unbiasedExp := int32(exp>>23) - 127
+ halfExp := unbiasedExp + 15
+
+ if halfExp >= 0x1f {
+ return uint16(halfSign | uint32(0x7c00))
+ }
+
+ if halfExp <= 0 {
+ if 14-halfExp > 24 {
+ return uint16(halfSign)
+ }
+ coef := coef | uint32(0x00800000)
+ halfCoef := coef >> uint32(14-halfExp)
+ roundBit := uint32(1) << uint32(13-halfExp)
+ if (coef&roundBit) != 0 && (coef&(3*roundBit-1)) != 0 {
+ halfCoef++
+ }
+ return uint16(halfSign | halfCoef)
+ }
+
+ uHalfExp := uint32(halfExp) << 10
+ halfCoef := coef >> 13
+ roundBit := uint32(0x00001000)
+ if (coef&roundBit) != 0 && (coef&(3*roundBit-1)) != 0 {
+ return uint16((halfSign | uHalfExp | halfCoef) + 1)
+ }
+ return uint16(halfSign | uHalfExp | halfCoef)
+}
diff --git a/vendor/go.etcd.io/etcd/api/v3/version/version.go b/vendor/go.etcd.io/etcd/api/v3/version/version.go
index 1819ead729..6b5177fc3c 100644
--- a/vendor/go.etcd.io/etcd/api/v3/version/version.go
+++ b/vendor/go.etcd.io/etcd/api/v3/version/version.go
@@ -26,7 +26,7 @@ import (
var (
// MinClusterVersion is the min cluster version this etcd binary is compatible with.
MinClusterVersion = "3.0.0"
- Version = "3.5.10"
+ Version = "3.5.14"
APIVersion = "unknown"
// Git SHA Value will be set during build
diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go b/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go
index f4492009d6..b314e068fe 100644
--- a/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go
+++ b/vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/purge.go
@@ -25,18 +25,24 @@ import (
)
func PurgeFile(lg *zap.Logger, dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}) <-chan error {
- return purgeFile(lg, dirname, suffix, max, interval, stop, nil, nil)
+ return purgeFile(lg, dirname, suffix, max, interval, stop, nil, nil, true)
}
func PurgeFileWithDoneNotify(lg *zap.Logger, dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}) (<-chan struct{}, <-chan error) {
doneC := make(chan struct{})
- errC := purgeFile(lg, dirname, suffix, max, interval, stop, nil, doneC)
+ errC := purgeFile(lg, dirname, suffix, max, interval, stop, nil, doneC, true)
+ return doneC, errC
+}
+
+func PurgeFileWithoutFlock(lg *zap.Logger, dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}) (<-chan struct{}, <-chan error) {
+ doneC := make(chan struct{})
+ errC := purgeFile(lg, dirname, suffix, max, interval, stop, nil, doneC, false)
return doneC, errC
}
// purgeFile is the internal implementation for PurgeFile which can post purged files to purgec if non-nil.
// if donec is non-nil, the function closes it to notify its exit.
-func purgeFile(lg *zap.Logger, dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}, purgec chan<- string, donec chan<- struct{}) <-chan error {
+func purgeFile(lg *zap.Logger, dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}, purgec chan<- string, donec chan<- struct{}, flock bool) <-chan error {
if lg == nil {
lg = zap.NewNop()
}
@@ -67,20 +73,25 @@ func purgeFile(lg *zap.Logger, dirname string, suffix string, max uint, interval
fnames = newfnames
for len(newfnames) > int(max) {
f := filepath.Join(dirname, newfnames[0])
- l, err := TryLockFile(f, os.O_WRONLY, PrivateFileMode)
- if err != nil {
- lg.Warn("failed to lock file", zap.String("path", f), zap.Error(err))
- break
+ var l *LockedFile
+ if flock {
+ l, err = TryLockFile(f, os.O_WRONLY, PrivateFileMode)
+ if err != nil {
+ lg.Warn("failed to lock file", zap.String("path", f), zap.Error(err))
+ break
+ }
}
if err = os.Remove(f); err != nil {
lg.Error("failed to remove file", zap.String("path", f), zap.Error(err))
errC <- err
return
}
- if err = l.Close(); err != nil {
- lg.Error("failed to unlock/close", zap.String("path", l.Name()), zap.Error(err))
- errC <- err
- return
+ if flock {
+ if err = l.Close(); err != nil {
+ lg.Error("failed to unlock/close", zap.String("path", l.Name()), zap.Error(err))
+ errC <- err
+ return
+ }
}
lg.Info("purged", zap.String("path", f))
newfnames = newfnames[1:]
diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener.go b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener.go
index 2241d8823e..d00a93dc19 100644
--- a/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener.go
+++ b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener.go
@@ -87,11 +87,6 @@ func (l *keepAliveConn) SetKeepAlive(doKeepAlive bool) error {
return l.TCPConn.SetKeepAlive(doKeepAlive)
}
-// SetKeepAlivePeriod sets keepalive period
-func (l *keepAliveConn) SetKeepAlivePeriod(d time.Duration) error {
- return l.TCPConn.SetKeepAlivePeriod(d)
-}
-
// A tlsKeepaliveListener implements a network listener (net.Listener) for TLS connections.
type tlsKeepaliveListener struct {
net.Listener
diff --git a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_openbsd.go
similarity index 62%
rename from vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go
rename to vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_openbsd.go
index c318385cbe..024c6c2363 100644
--- a/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go
+++ b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_openbsd.go
@@ -1,4 +1,4 @@
-// Copyright 2013 Matt T. Proud
+// Copyright 2023 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,5 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Package pbutil provides record length-delimited Protocol Buffer streaming.
-package pbutil
+//go:build openbsd
+
+package transport
+
+import "time"
+
+// SetKeepAlivePeriod sets keepalive period
+func (l *keepAliveConn) SetKeepAlivePeriod(d time.Duration) error {
+ // OpenBSD has no user-settable per-socket TCP keepalive options.
+ // Refer to https://github.com/etcd-io/etcd/issues/15811.
+ return nil
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_unix.go
similarity index 69%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go
rename to vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_unix.go
index 93d3c1760c..08061f7267 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go
+++ b/vendor/go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_unix.go
@@ -1,4 +1,4 @@
-// Copyright The OpenTelemetry Authors
+// Copyright 2023 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,9 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
+//go:build !openbsd
-const (
- // ExceptionEventName is the name of the Span event representing an exception.
- ExceptionEventName = "exception"
-)
+package transport
+
+import "time"
+
+// SetKeepAlivePeriod sets keepalive period
+func (l *keepAliveConn) SetKeepAlivePeriod(d time.Duration) error {
+ return l.TCPConn.SetKeepAlivePeriod(d)
+}
diff --git a/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go b/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go
index 9e5d03ff64..49a38967e6 100644
--- a/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go
+++ b/vendor/go.etcd.io/etcd/client/pkg/v3/types/urls.go
@@ -36,20 +36,25 @@ func NewURLs(strs []string) (URLs, error) {
if err != nil {
return nil, err
}
- if u.Scheme != "http" && u.Scheme != "https" && u.Scheme != "unix" && u.Scheme != "unixs" {
+
+ switch u.Scheme {
+ case "http", "https":
+ if _, _, err := net.SplitHostPort(u.Host); err != nil {
+ return nil, fmt.Errorf(`URL address does not have the form "host:port": %s`, in)
+ }
+
+ if u.Path != "" {
+ return nil, fmt.Errorf("URL must not contain a path: %s", in)
+ }
+ case "unix", "unixs":
+ break
+ default:
return nil, fmt.Errorf("URL scheme must be http, https, unix, or unixs: %s", in)
}
- if _, _, err := net.SplitHostPort(u.Host); err != nil {
- return nil, fmt.Errorf(`URL address does not have the form "host:port": %s`, in)
- }
- if u.Path != "" {
- return nil, fmt.Errorf("URL must not contain a path: %s", in)
- }
all[i] = *u
}
us := URLs(all)
us.Sort()
-
return us, nil
}
diff --git a/vendor/go.etcd.io/etcd/client/v3/client.go b/vendor/go.etcd.io/etcd/client/v3/client.go
index efa44e8902..312d03e7a6 100644
--- a/vendor/go.etcd.io/etcd/client/v3/client.go
+++ b/vendor/go.etcd.io/etcd/client/v3/client.go
@@ -86,7 +86,7 @@ func New(cfg Config) (*Client, error) {
// service interface implementations and do not need connection management.
func NewCtxClient(ctx context.Context, opts ...Option) *Client {
cctx, cancel := context.WithCancel(ctx)
- c := &Client{ctx: cctx, cancel: cancel, lgMu: new(sync.RWMutex)}
+ c := &Client{ctx: cctx, cancel: cancel, lgMu: new(sync.RWMutex), mu: new(sync.RWMutex)}
for _, opt := range opts {
opt(c)
}
@@ -231,15 +231,30 @@ func (c *Client) dialSetupOpts(creds grpccredentials.TransportCredentials, dopts
opts = append(opts, grpc.WithInsecure())
}
+ unaryMaxRetries := defaultUnaryMaxRetries
+ if c.cfg.MaxUnaryRetries > 0 {
+ unaryMaxRetries = c.cfg.MaxUnaryRetries
+ }
+
+ backoffWaitBetween := defaultBackoffWaitBetween
+ if c.cfg.BackoffWaitBetween > 0 {
+ backoffWaitBetween = c.cfg.BackoffWaitBetween
+ }
+
+ backoffJitterFraction := defaultBackoffJitterFraction
+ if c.cfg.BackoffJitterFraction > 0 {
+ backoffJitterFraction = c.cfg.BackoffJitterFraction
+ }
+
// Interceptor retry and backoff.
// TODO: Replace all of clientv3/retry.go with RetryPolicy:
// https://github.com/grpc/grpc-proto/blob/cdd9ed5c3d3f87aef62f373b93361cf7bddc620d/grpc/service_config/service_config.proto#L130
- rrBackoff := withBackoff(c.roundRobinQuorumBackoff(defaultBackoffWaitBetween, defaultBackoffJitterFraction))
+ rrBackoff := withBackoff(c.roundRobinQuorumBackoff(backoffWaitBetween, backoffJitterFraction))
opts = append(opts,
// Disable stream retry by default since go-grpc-middleware/retry does not support client streams.
// Streams that are safe to retry are enabled individually.
grpc.WithStreamInterceptor(c.streamClientInterceptor(withMax(0), rrBackoff)),
- grpc.WithUnaryInterceptor(c.unaryClientInterceptor(withMax(defaultUnaryMaxRetries), rrBackoff)),
+ grpc.WithUnaryInterceptor(c.unaryClientInterceptor(withMax(unaryMaxRetries), rrBackoff)),
)
return opts, nil
diff --git a/vendor/go.etcd.io/etcd/client/v3/config.go b/vendor/go.etcd.io/etcd/client/v3/config.go
index 335a288732..6f5b41978d 100644
--- a/vendor/go.etcd.io/etcd/client/v3/config.go
+++ b/vendor/go.etcd.io/etcd/client/v3/config.go
@@ -88,5 +88,14 @@ type Config struct {
// PermitWithoutStream when set will allow client to send keepalive pings to server without any active streams(RPCs).
PermitWithoutStream bool `json:"permit-without-stream"`
+ // MaxUnaryRetries is the maximum number of retries for unary RPCs.
+ MaxUnaryRetries uint `json:"max-unary-retries"`
+
+ // BackoffWaitBetween is the wait time before retrying an RPC.
+ BackoffWaitBetween time.Duration `json:"backoff-wait-between"`
+
+ // BackoffJitterFraction is the jitter fraction to randomize backoff wait time.
+ BackoffJitterFraction float64 `json:"backoff-jitter-fraction"`
+
// TODO: support custom balancer picker
}
diff --git a/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go b/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go
index 7dc5ddae0f..8c50dcfa93 100644
--- a/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go
+++ b/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go
@@ -19,6 +19,7 @@ package clientv3
import (
"context"
+ "errors"
"io"
"sync"
"time"
@@ -85,7 +86,7 @@ func (c *Client) unaryClientInterceptor(optFuncs ...retryOption) grpc.UnaryClien
}
continue
}
- if !isSafeRetry(c.lg, lastErr, callOpts) {
+ if !isSafeRetry(c, lastErr, callOpts) {
return lastErr
}
}
@@ -279,7 +280,7 @@ func (s *serverStreamingRetryingStream) receiveMsgAndIndicateRetry(m interface{}
return true, err
}
- return isSafeRetry(s.client.lg, err, s.callOpts), err
+ return isSafeRetry(s.client, err, s.callOpts), err
}
func (s *serverStreamingRetryingStream) reestablishStreamAndResendBuffer(callCtx context.Context) (grpc.ClientStream, error) {
@@ -319,17 +320,28 @@ func waitRetryBackoff(ctx context.Context, attempt uint, callOpts *options) erro
}
// isSafeRetry returns "true", if request is safe for retry with the given error.
-func isSafeRetry(lg *zap.Logger, err error, callOpts *options) bool {
+func isSafeRetry(c *Client, err error, callOpts *options) bool {
if isContextError(err) {
return false
}
+
+ // Situation when learner refuses RPC it is supposed to not serve is from the server
+ // perspective not retryable.
+ // But for backward-compatibility reasons we need to support situation that
+ // customer provides mix of learners (not yet voters) and voters with an
+ // expectation to pick voter in the next attempt.
+ // TODO: Ideally client should be 'aware' which endpoint represents: leader/voter/learner with high probability.
+ if errors.Is(err, rpctypes.ErrGPRCNotSupportedForLearner) && len(c.Endpoints()) > 1 {
+ return true
+ }
+
switch callOpts.retryPolicy {
case repeatable:
return isSafeRetryImmutableRPC(err)
case nonRepeatable:
return isSafeRetryMutableRPC(err)
default:
- lg.Warn("unrecognized retry policy", zap.String("retryPolicy", callOpts.retryPolicy.String()))
+ c.lg.Warn("unrecognized retry policy", zap.String("retryPolicy", callOpts.retryPolicy.String()))
return false
}
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go
index e3e1d452b0..ab091cf6ad 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go
@@ -1,49 +1,59 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
import (
+ "google.golang.org/grpc/stats"
+
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
+ "go.opentelemetry.io/otel/metric/noop"
"go.opentelemetry.io/otel/propagation"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
"go.opentelemetry.io/otel/trace"
)
const (
- // instrumentationName is the name of this instrumentation package.
- instrumentationName = "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
+ // ScopeName is the instrumentation scope name.
+ ScopeName = "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
// GRPCStatusCodeKey is convention for numeric status code of a gRPC request.
GRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
)
-// Filter is a predicate used to determine whether a given request in
-// interceptor info should be traced. A Filter must return true if
+// InterceptorFilter is a predicate used to determine whether a given request in
+// interceptor info should be instrumented. A InterceptorFilter must return true if
// the request should be traced.
-type Filter func(*InterceptorInfo) bool
+//
+// Deprecated: Use stats handlers instead.
+type InterceptorFilter func(*InterceptorInfo) bool
+
+// Filter is a predicate used to determine whether a given request in
+// should be instrumented by the attached RPC tag info.
+// A Filter must return true if the request should be instrumented.
+type Filter func(*stats.RPCTagInfo) bool
// config is a group of options for this instrumentation.
type config struct {
- Filter Filter
- Propagators propagation.TextMapPropagator
- TracerProvider trace.TracerProvider
- MeterProvider metric.MeterProvider
+ Filter Filter
+ InterceptorFilter InterceptorFilter
+ Propagators propagation.TextMapPropagator
+ TracerProvider trace.TracerProvider
+ MeterProvider metric.MeterProvider
+ SpanStartOptions []trace.SpanStartOption
+
+ ReceivedEvent bool
+ SentEvent bool
- meter metric.Meter
- rpcServerDuration metric.Int64Histogram
+ tracer trace.Tracer
+ meter metric.Meter
+
+ rpcDuration metric.Float64Histogram
+ rpcRequestSize metric.Int64Histogram
+ rpcResponseSize metric.Int64Histogram
+ rpcRequestsPerRPC metric.Int64Histogram
+ rpcResponsesPerRPC metric.Int64Histogram
}
// Option applies an option value for a config.
@@ -52,7 +62,7 @@ type Option interface {
}
// newConfig returns a config configured with all the passed Options.
-func newConfig(opts []Option) *config {
+func newConfig(opts []Option, role string) *config {
c := &config{
Propagators: otel.GetTextMapPropagator(),
TracerProvider: otel.GetTracerProvider(),
@@ -62,14 +72,66 @@ func newConfig(opts []Option) *config {
o.apply(c)
}
+ c.tracer = c.TracerProvider.Tracer(
+ ScopeName,
+ trace.WithInstrumentationVersion(SemVersion()),
+ )
+
c.meter = c.MeterProvider.Meter(
- instrumentationName,
+ ScopeName,
metric.WithInstrumentationVersion(Version()),
metric.WithSchemaURL(semconv.SchemaURL),
)
+
var err error
- if c.rpcServerDuration, err = c.meter.Int64Histogram("rpc.server.duration", metric.WithUnit("ms")); err != nil {
+ c.rpcDuration, err = c.meter.Float64Histogram("rpc."+role+".duration",
+ metric.WithDescription("Measures the duration of inbound RPC."),
+ metric.WithUnit("ms"))
+ if err != nil {
otel.Handle(err)
+ if c.rpcDuration == nil {
+ c.rpcDuration = noop.Float64Histogram{}
+ }
+ }
+
+ c.rpcRequestSize, err = c.meter.Int64Histogram("rpc."+role+".request.size",
+ metric.WithDescription("Measures size of RPC request messages (uncompressed)."),
+ metric.WithUnit("By"))
+ if err != nil {
+ otel.Handle(err)
+ if c.rpcRequestSize == nil {
+ c.rpcRequestSize = noop.Int64Histogram{}
+ }
+ }
+
+ c.rpcResponseSize, err = c.meter.Int64Histogram("rpc."+role+".response.size",
+ metric.WithDescription("Measures size of RPC response messages (uncompressed)."),
+ metric.WithUnit("By"))
+ if err != nil {
+ otel.Handle(err)
+ if c.rpcResponseSize == nil {
+ c.rpcResponseSize = noop.Int64Histogram{}
+ }
+ }
+
+ c.rpcRequestsPerRPC, err = c.meter.Int64Histogram("rpc."+role+".requests_per_rpc",
+ metric.WithDescription("Measures the number of messages received per RPC. Should be 1 for all non-streaming RPCs."),
+ metric.WithUnit("{count}"))
+ if err != nil {
+ otel.Handle(err)
+ if c.rpcRequestsPerRPC == nil {
+ c.rpcRequestsPerRPC = noop.Int64Histogram{}
+ }
+ }
+
+ c.rpcResponsesPerRPC, err = c.meter.Int64Histogram("rpc."+role+".responses_per_rpc",
+ metric.WithDescription("Measures the number of messages received per RPC. Should be 1 for all non-streaming RPCs."),
+ metric.WithUnit("{count}"))
+ if err != nil {
+ otel.Handle(err)
+ if c.rpcResponsesPerRPC == nil {
+ c.rpcResponsesPerRPC = noop.Int64Histogram{}
+ }
}
return c
@@ -98,15 +160,32 @@ func (o tracerProviderOption) apply(c *config) {
}
// WithInterceptorFilter returns an Option to use the request filter.
-func WithInterceptorFilter(f Filter) Option {
+//
+// Deprecated: Use stats handlers instead.
+func WithInterceptorFilter(f InterceptorFilter) Option {
return interceptorFilterOption{f: f}
}
type interceptorFilterOption struct {
- f Filter
+ f InterceptorFilter
}
func (o interceptorFilterOption) apply(c *config) {
+ if o.f != nil {
+ c.InterceptorFilter = o.f
+ }
+}
+
+// WithFilter returns an Option to use the request filter.
+func WithFilter(f Filter) Option {
+ return filterOption{f: f}
+}
+
+type filterOption struct {
+ f Filter
+}
+
+func (o filterOption) apply(c *config) {
if o.f != nil {
c.Filter = o.f
}
@@ -131,3 +210,50 @@ func (o meterProviderOption) apply(c *config) {
func WithMeterProvider(mp metric.MeterProvider) Option {
return meterProviderOption{mp: mp}
}
+
+// Event type that can be recorded, see WithMessageEvents.
+type Event int
+
+// Different types of events that can be recorded, see WithMessageEvents.
+const (
+ ReceivedEvents Event = iota
+ SentEvents
+)
+
+type messageEventsProviderOption struct {
+ events []Event
+}
+
+func (m messageEventsProviderOption) apply(c *config) {
+ for _, e := range m.events {
+ switch e {
+ case ReceivedEvents:
+ c.ReceivedEvent = true
+ case SentEvents:
+ c.SentEvent = true
+ }
+ }
+}
+
+// WithMessageEvents configures the Handler to record the specified events
+// (span.AddEvent) on spans. By default only summary attributes are added at the
+// end of the request.
+//
+// Valid events are:
+// - ReceivedEvents: Record the number of bytes read after every gRPC read operation.
+// - SentEvents: Record the number of bytes written after every gRPC write operation.
+func WithMessageEvents(events ...Event) Option {
+ return messageEventsProviderOption{events: events}
+}
+
+type spanStartOption struct{ opts []trace.SpanStartOption }
+
+func (o spanStartOption) apply(c *config) {
+ c.SpanStartOptions = append(c.SpanStartOptions, o.opts...)
+}
+
+// WithSpanOptions configures an additional set of
+// trace.SpanOptions, which are applied to each new span.
+func WithSpanOptions(opts ...trace.SpanStartOption) Option {
+ return spanStartOption{opts}
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go
new file mode 100644
index 0000000000..b8b836b00f
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go
@@ -0,0 +1,11 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+/*
+Package otelgrpc is the instrumentation library for [google.golang.org/grpc].
+
+Use [NewClientHandler] with [grpc.WithStatsHandler] to instrument a gRPC client.
+
+Use [NewServerHandler] with [grpc.StatsHandler] to instrument a gRPC server.
+*/
+package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
index d4dc5de5a9..7d5ed05808 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
@@ -18,6 +7,7 @@ package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.g
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md
import (
"context"
+ "errors"
"io"
"net"
"strconv"
@@ -59,11 +49,13 @@ var (
)
// UnaryClientInterceptor returns a grpc.UnaryClientInterceptor suitable
-// for use in a grpc.Dial call.
+// for use in a grpc.NewClient call.
+//
+// Deprecated: Use [NewClientHandler] instead.
func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor {
- cfg := newConfig(opts)
+ cfg := newConfig(opts, "client")
tracer := cfg.TracerProvider.Tracer(
- instrumentationName,
+ ScopeName,
trace.WithInstrumentationVersion(Version()),
)
@@ -79,27 +71,37 @@ func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor {
Method: method,
Type: UnaryClient,
}
- if cfg.Filter != nil && !cfg.Filter(i) {
+ if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) {
return invoker(ctx, method, req, reply, cc, callOpts...)
}
- name, attr := spanInfo(method, cc.Target())
- var span trace.Span
- ctx, span = tracer.Start(
- ctx,
- name,
+ name, attr, _ := telemetryAttributes(method, cc.Target())
+
+ startOpts := append([]trace.SpanStartOption{
trace.WithSpanKind(trace.SpanKindClient),
trace.WithAttributes(attr...),
+ },
+ cfg.SpanStartOptions...,
+ )
+
+ ctx, span := tracer.Start(
+ ctx,
+ name,
+ startOpts...,
)
defer span.End()
ctx = inject(ctx, cfg.Propagators)
- messageSent.Event(ctx, 1, req)
+ if cfg.SentEvent {
+ messageSent.Event(ctx, 1, req)
+ }
err := invoker(ctx, method, req, reply, cc, callOpts...)
- messageReceived.Event(ctx, 1, reply)
+ if cfg.ReceivedEvent {
+ messageReceived.Event(ctx, 1, reply)
+ }
if err != nil {
s, _ := status.FromError(err)
@@ -113,27 +115,16 @@ func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor {
}
}
-type streamEventType int
-
-type streamEvent struct {
- Type streamEventType
- Err error
-}
-
-const (
- receiveEndEvent streamEventType = iota
- errorEvent
-)
-
// clientStream wraps around the embedded grpc.ClientStream, and intercepts the RecvMsg and
// SendMsg method call.
type clientStream struct {
grpc.ClientStream
+ desc *grpc.StreamDesc
- desc *grpc.StreamDesc
- events chan streamEvent
- eventsDone chan struct{}
- finished chan error
+ span trace.Span
+
+ receivedEvent bool
+ sentEvent bool
receivedMessageID int
sentMessageID int
@@ -145,14 +136,17 @@ func (w *clientStream) RecvMsg(m interface{}) error {
err := w.ClientStream.RecvMsg(m)
if err == nil && !w.desc.ServerStreams {
- w.sendStreamEvent(receiveEndEvent, nil)
- } else if err == io.EOF {
- w.sendStreamEvent(receiveEndEvent, nil)
+ w.endSpan(nil)
+ } else if errors.Is(err, io.EOF) {
+ w.endSpan(nil)
} else if err != nil {
- w.sendStreamEvent(errorEvent, err)
+ w.endSpan(err)
} else {
w.receivedMessageID++
- messageReceived.Event(w.Context(), w.receivedMessageID, m)
+
+ if w.receivedEvent {
+ messageReceived.Event(w.Context(), w.receivedMessageID, m)
+ }
}
return err
@@ -162,10 +156,13 @@ func (w *clientStream) SendMsg(m interface{}) error {
err := w.ClientStream.SendMsg(m)
w.sentMessageID++
- messageSent.Event(w.Context(), w.sentMessageID, m)
+
+ if w.sentEvent {
+ messageSent.Event(w.Context(), w.sentMessageID, m)
+ }
if err != nil {
- w.sendStreamEvent(errorEvent, err)
+ w.endSpan(err)
}
return err
@@ -173,9 +170,8 @@ func (w *clientStream) SendMsg(m interface{}) error {
func (w *clientStream) Header() (metadata.MD, error) {
md, err := w.ClientStream.Header()
-
if err != nil {
- w.sendStreamEvent(errorEvent, err)
+ w.endSpan(err)
}
return md, err
@@ -183,62 +179,43 @@ func (w *clientStream) Header() (metadata.MD, error) {
func (w *clientStream) CloseSend() error {
err := w.ClientStream.CloseSend()
-
if err != nil {
- w.sendStreamEvent(errorEvent, err)
+ w.endSpan(err)
}
return err
}
-func wrapClientStream(ctx context.Context, s grpc.ClientStream, desc *grpc.StreamDesc) *clientStream {
- events := make(chan streamEvent)
- eventsDone := make(chan struct{})
- finished := make(chan error)
-
- go func() {
- defer close(eventsDone)
-
- for {
- select {
- case event := <-events:
- switch event.Type {
- case receiveEndEvent:
- finished <- nil
- return
- case errorEvent:
- finished <- event.Err
- return
- }
- case <-ctx.Done():
- finished <- ctx.Err()
- return
- }
- }
- }()
-
+func wrapClientStream(s grpc.ClientStream, desc *grpc.StreamDesc, span trace.Span, cfg *config) *clientStream {
return &clientStream{
- ClientStream: s,
- desc: desc,
- events: events,
- eventsDone: eventsDone,
- finished: finished,
+ ClientStream: s,
+ span: span,
+ desc: desc,
+ receivedEvent: cfg.ReceivedEvent,
+ sentEvent: cfg.SentEvent,
}
}
-func (w *clientStream) sendStreamEvent(eventType streamEventType, err error) {
- select {
- case <-w.eventsDone:
- case w.events <- streamEvent{Type: eventType, Err: err}:
+func (w *clientStream) endSpan(err error) {
+ if err != nil {
+ s, _ := status.FromError(err)
+ w.span.SetStatus(codes.Error, s.Message())
+ w.span.SetAttributes(statusCodeAttr(s.Code()))
+ } else {
+ w.span.SetAttributes(statusCodeAttr(grpc_codes.OK))
}
+
+ w.span.End()
}
// StreamClientInterceptor returns a grpc.StreamClientInterceptor suitable
-// for use in a grpc.Dial call.
+// for use in a grpc.NewClient call.
+//
+// Deprecated: Use [NewClientHandler] instead.
func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
- cfg := newConfig(opts)
+ cfg := newConfig(opts, "client")
tracer := cfg.TracerProvider.Tracer(
- instrumentationName,
+ ScopeName,
trace.WithInstrumentationVersion(Version()),
)
@@ -254,17 +231,23 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
Method: method,
Type: StreamClient,
}
- if cfg.Filter != nil && !cfg.Filter(i) {
+ if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) {
return streamer(ctx, desc, cc, method, callOpts...)
}
- name, attr := spanInfo(method, cc.Target())
- var span trace.Span
- ctx, span = tracer.Start(
- ctx,
- name,
+ name, attr, _ := telemetryAttributes(method, cc.Target())
+
+ startOpts := append([]trace.SpanStartOption{
trace.WithSpanKind(trace.SpanKindClient),
trace.WithAttributes(attr...),
+ },
+ cfg.SpanStartOptions...,
+ )
+
+ ctx, span := tracer.Start(
+ ctx,
+ name,
+ startOpts...,
)
ctx = inject(ctx, cfg.Propagators)
@@ -277,32 +260,19 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
span.End()
return s, err
}
- stream := wrapClientStream(ctx, s, desc)
-
- go func() {
- err := <-stream.finished
-
- if err != nil {
- s, _ := status.FromError(err)
- span.SetStatus(codes.Error, s.Message())
- span.SetAttributes(statusCodeAttr(s.Code()))
- } else {
- span.SetAttributes(statusCodeAttr(grpc_codes.OK))
- }
-
- span.End()
- }()
-
+ stream := wrapClientStream(s, desc, span, cfg)
return stream, nil
}
}
// UnaryServerInterceptor returns a grpc.UnaryServerInterceptor suitable
// for use in a grpc.NewServer call.
+//
+// Deprecated: Use [NewServerHandler] instead.
func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor {
- cfg := newConfig(opts)
+ cfg := newConfig(opts, "server")
tracer := cfg.TracerProvider.Tracer(
- instrumentationName,
+ ScopeName,
trace.WithInstrumentationVersion(Version()),
)
@@ -316,43 +286,55 @@ func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor {
UnaryServerInfo: info,
Type: UnaryServer,
}
- if cfg.Filter != nil && !cfg.Filter(i) {
+ if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) {
return handler(ctx, req)
}
ctx = extract(ctx, cfg.Propagators)
+ name, attr, metricAttrs := telemetryAttributes(info.FullMethod, peerFromCtx(ctx))
+
+ startOpts := append([]trace.SpanStartOption{
+ trace.WithSpanKind(trace.SpanKindServer),
+ trace.WithAttributes(attr...),
+ },
+ cfg.SpanStartOptions...,
+ )
- name, attr := spanInfo(info.FullMethod, peerFromCtx(ctx))
ctx, span := tracer.Start(
trace.ContextWithRemoteSpanContext(ctx, trace.SpanContextFromContext(ctx)),
name,
- trace.WithSpanKind(trace.SpanKindServer),
- trace.WithAttributes(attr...),
+ startOpts...,
)
defer span.End()
- messageReceived.Event(ctx, 1, req)
+ if cfg.ReceivedEvent {
+ messageReceived.Event(ctx, 1, req)
+ }
- var statusCode grpc_codes.Code
- defer func(t time.Time) {
- elapsedTime := time.Since(t) / time.Millisecond
- attr = append(attr, semconv.RPCGRPCStatusCodeKey.Int64(int64(statusCode)))
- o := metric.WithAttributes(attr...)
- cfg.rpcServerDuration.Record(ctx, int64(elapsedTime), o)
- }(time.Now())
+ before := time.Now()
resp, err := handler(ctx, req)
+
+ s, _ := status.FromError(err)
if err != nil {
- s, _ := status.FromError(err)
statusCode, msg := serverStatus(s)
span.SetStatus(statusCode, msg)
- span.SetAttributes(statusCodeAttr(s.Code()))
- messageSent.Event(ctx, 1, s.Proto())
+ if cfg.SentEvent {
+ messageSent.Event(ctx, 1, s.Proto())
+ }
} else {
- statusCode = grpc_codes.OK
- span.SetAttributes(statusCodeAttr(grpc_codes.OK))
- messageSent.Event(ctx, 1, resp)
+ if cfg.SentEvent {
+ messageSent.Event(ctx, 1, resp)
+ }
}
+ grpcStatusCodeAttr := statusCodeAttr(s.Code())
+ span.SetAttributes(grpcStatusCodeAttr)
+
+ // Use floating point division here for higher precision (instead of Millisecond method).
+ elapsedTime := float64(time.Since(before)) / float64(time.Millisecond)
+
+ metricAttrs = append(metricAttrs, grpcStatusCodeAttr)
+ cfg.rpcDuration.Record(ctx, elapsedTime, metric.WithAttributeSet(attribute.NewSet(metricAttrs...)))
return resp, err
}
@@ -366,6 +348,9 @@ type serverStream struct {
receivedMessageID int
sentMessageID int
+
+ receivedEvent bool
+ sentEvent bool
}
func (w *serverStream) Context() context.Context {
@@ -377,7 +362,9 @@ func (w *serverStream) RecvMsg(m interface{}) error {
if err == nil {
w.receivedMessageID++
- messageReceived.Event(w.Context(), w.receivedMessageID, m)
+ if w.receivedEvent {
+ messageReceived.Event(w.Context(), w.receivedMessageID, m)
+ }
}
return err
@@ -387,24 +374,30 @@ func (w *serverStream) SendMsg(m interface{}) error {
err := w.ServerStream.SendMsg(m)
w.sentMessageID++
- messageSent.Event(w.Context(), w.sentMessageID, m)
+ if w.sentEvent {
+ messageSent.Event(w.Context(), w.sentMessageID, m)
+ }
return err
}
-func wrapServerStream(ctx context.Context, ss grpc.ServerStream) *serverStream {
+func wrapServerStream(ctx context.Context, ss grpc.ServerStream, cfg *config) *serverStream {
return &serverStream{
- ServerStream: ss,
- ctx: ctx,
+ ServerStream: ss,
+ ctx: ctx,
+ receivedEvent: cfg.ReceivedEvent,
+ sentEvent: cfg.SentEvent,
}
}
// StreamServerInterceptor returns a grpc.StreamServerInterceptor suitable
// for use in a grpc.NewServer call.
+//
+// Deprecated: Use [NewServerHandler] instead.
func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor {
- cfg := newConfig(opts)
+ cfg := newConfig(opts, "server")
tracer := cfg.TracerProvider.Tracer(
- instrumentationName,
+ ScopeName,
trace.WithInstrumentationVersion(Version()),
)
@@ -419,22 +412,28 @@ func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor {
StreamServerInfo: info,
Type: StreamServer,
}
- if cfg.Filter != nil && !cfg.Filter(i) {
- return handler(srv, wrapServerStream(ctx, ss))
+ if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) {
+ return handler(srv, wrapServerStream(ctx, ss, cfg))
}
ctx = extract(ctx, cfg.Propagators)
+ name, attr, _ := telemetryAttributes(info.FullMethod, peerFromCtx(ctx))
+
+ startOpts := append([]trace.SpanStartOption{
+ trace.WithSpanKind(trace.SpanKindServer),
+ trace.WithAttributes(attr...),
+ },
+ cfg.SpanStartOptions...,
+ )
- name, attr := spanInfo(info.FullMethod, peerFromCtx(ctx))
ctx, span := tracer.Start(
trace.ContextWithRemoteSpanContext(ctx, trace.SpanContextFromContext(ctx)),
name,
- trace.WithSpanKind(trace.SpanKindServer),
- trace.WithAttributes(attr...),
+ startOpts...,
)
defer span.End()
- err := handler(srv, wrapServerStream(ctx, ss))
+ err := handler(srv, wrapServerStream(ctx, ss, cfg))
if err != nil {
s, _ := status.FromError(err)
statusCode, msg := serverStatus(s)
@@ -448,21 +447,25 @@ func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor {
}
}
-// spanInfo returns a span name and all appropriate attributes from the gRPC
-// method and peer address.
-func spanInfo(fullMethod, peerAddress string) (string, []attribute.KeyValue) {
- attrs := []attribute.KeyValue{RPCSystemGRPC}
- name, mAttrs := internal.ParseFullMethod(fullMethod)
- attrs = append(attrs, mAttrs...)
- attrs = append(attrs, peerAttr(peerAddress)...)
- return name, attrs
+// telemetryAttributes returns a span name and span and metric attributes from
+// the gRPC method and peer address.
+func telemetryAttributes(fullMethod, peerAddress string) (string, []attribute.KeyValue, []attribute.KeyValue) {
+ name, methodAttrs := internal.ParseFullMethod(fullMethod)
+ peerAttrs := peerAttr(peerAddress)
+
+ attrs := make([]attribute.KeyValue, 0, 1+len(methodAttrs)+len(peerAttrs))
+ attrs = append(attrs, RPCSystemGRPC)
+ attrs = append(attrs, methodAttrs...)
+ metricAttrs := attrs[:1+len(methodAttrs)]
+ attrs = append(attrs, peerAttrs...)
+ return name, attrs, metricAttrs
}
// peerAttr returns attributes about the peer address.
func peerAttr(addr string) []attribute.KeyValue {
host, p, err := net.SplitHostPort(addr)
if err != nil {
- return []attribute.KeyValue(nil)
+ return nil
}
if host == "" {
@@ -470,7 +473,7 @@ func peerAttr(addr string) []attribute.KeyValue {
}
port, err := strconv.Atoi(p)
if err != nil {
- return []attribute.KeyValue(nil)
+ return nil
}
var attr []attribute.KeyValue
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go
index f6116946bf..b62f7cd7c4 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
index ae160d5875..bef07b7a3c 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
@@ -24,13 +13,21 @@ import (
// ParseFullMethod returns a span name following the OpenTelemetry semantic
// conventions as well as all applicable span attribute.KeyValue attributes based
// on a gRPC's FullMethod.
+//
+// Parsing is consistent with grpc-go implementation:
+// https://github.com/grpc/grpc-go/blob/v1.57.0/internal/grpcutil/method.go#L26-L39
func ParseFullMethod(fullMethod string) (string, []attribute.KeyValue) {
- name := strings.TrimLeft(fullMethod, "/")
- service, method, found := strings.Cut(name, "/")
- if !found {
+ if !strings.HasPrefix(fullMethod, "/") {
+ // Invalid format, does not follow `/package.service/method`.
+ return fullMethod, nil
+ }
+ name := fullMethod[1:]
+ pos := strings.LastIndex(name, "/")
+ if pos < 0 {
// Invalid format, does not follow `/package.service/method`.
return name, nil
}
+ service, method := name[:pos], name[pos+1:]
var attrs []attribute.KeyValue
if service != "" {
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go
index d91c6df237..3aa37915df 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
@@ -56,7 +45,7 @@ func (s *metadataSupplier) Keys() []string {
// requests.
// Deprecated: Unnecessary public func.
func Inject(ctx context.Context, md *metadata.MD, opts ...Option) {
- c := newConfig(opts)
+ c := newConfig(opts, "")
c.Propagators.Inject(ctx, &metadataSupplier{
metadata: md,
})
@@ -78,7 +67,7 @@ func inject(ctx context.Context, propagators propagation.TextMapPropagator) cont
// This function is meant to be used on incoming requests.
// Deprecated: Unnecessary public func.
func Extract(ctx context.Context, md *metadata.MD, opts ...Option) (baggage.Baggage, trace.SpanContext) {
- c := newConfig(opts)
+ c := newConfig(opts, "")
ctx = c.Propagators.Extract(ctx, &metadataSupplier{
metadata: md,
})
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
index b65fab308f..409c621b74 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go
new file mode 100644
index 0000000000..201867a869
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go
@@ -0,0 +1,222 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
+
+import (
+ "context"
+ "sync/atomic"
+ "time"
+
+ grpc_codes "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/peer"
+ "google.golang.org/grpc/stats"
+ "google.golang.org/grpc/status"
+
+ "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/metric"
+ semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
+ "go.opentelemetry.io/otel/trace"
+)
+
+type gRPCContextKey struct{}
+
+type gRPCContext struct {
+ messagesReceived int64
+ messagesSent int64
+ metricAttrs []attribute.KeyValue
+ record bool
+}
+
+type serverHandler struct {
+ *config
+}
+
+// NewServerHandler creates a stats.Handler for a gRPC server.
+func NewServerHandler(opts ...Option) stats.Handler {
+ h := &serverHandler{
+ config: newConfig(opts, "server"),
+ }
+
+ return h
+}
+
+// TagConn can attach some information to the given context.
+func (h *serverHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context {
+ return ctx
+}
+
+// HandleConn processes the Conn stats.
+func (h *serverHandler) HandleConn(ctx context.Context, info stats.ConnStats) {
+}
+
+// TagRPC can attach some information to the given context.
+func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {
+ ctx = extract(ctx, h.config.Propagators)
+
+ name, attrs := internal.ParseFullMethod(info.FullMethodName)
+ attrs = append(attrs, RPCSystemGRPC)
+ ctx, _ = h.tracer.Start(
+ trace.ContextWithRemoteSpanContext(ctx, trace.SpanContextFromContext(ctx)),
+ name,
+ trace.WithSpanKind(trace.SpanKindServer),
+ trace.WithAttributes(attrs...),
+ )
+
+ gctx := gRPCContext{
+ metricAttrs: attrs,
+ record: true,
+ }
+ if h.config.Filter != nil {
+ gctx.record = h.config.Filter(info)
+ }
+ return context.WithValue(ctx, gRPCContextKey{}, &gctx)
+}
+
+// HandleRPC processes the RPC stats.
+func (h *serverHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
+ isServer := true
+ h.handleRPC(ctx, rs, isServer)
+}
+
+type clientHandler struct {
+ *config
+}
+
+// NewClientHandler creates a stats.Handler for a gRPC client.
+func NewClientHandler(opts ...Option) stats.Handler {
+ h := &clientHandler{
+ config: newConfig(opts, "client"),
+ }
+
+ return h
+}
+
+// TagRPC can attach some information to the given context.
+func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {
+ name, attrs := internal.ParseFullMethod(info.FullMethodName)
+ attrs = append(attrs, RPCSystemGRPC)
+ ctx, _ = h.tracer.Start(
+ ctx,
+ name,
+ trace.WithSpanKind(trace.SpanKindClient),
+ trace.WithAttributes(attrs...),
+ )
+
+ gctx := gRPCContext{
+ metricAttrs: attrs,
+ record: true,
+ }
+ if h.config.Filter != nil {
+ gctx.record = h.config.Filter(info)
+ }
+
+ return inject(context.WithValue(ctx, gRPCContextKey{}, &gctx), h.config.Propagators)
+}
+
+// HandleRPC processes the RPC stats.
+func (h *clientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
+ isServer := false
+ h.handleRPC(ctx, rs, isServer)
+}
+
+// TagConn can attach some information to the given context.
+func (h *clientHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context {
+ return ctx
+}
+
+// HandleConn processes the Conn stats.
+func (h *clientHandler) HandleConn(context.Context, stats.ConnStats) {
+ // no-op
+}
+
+func (c *config) handleRPC(ctx context.Context, rs stats.RPCStats, isServer bool) { // nolint: revive // isServer is not a control flag.
+ span := trace.SpanFromContext(ctx)
+ var metricAttrs []attribute.KeyValue
+ var messageId int64
+
+ gctx, _ := ctx.Value(gRPCContextKey{}).(*gRPCContext)
+ if gctx != nil {
+ if !gctx.record {
+ return
+ }
+ metricAttrs = make([]attribute.KeyValue, 0, len(gctx.metricAttrs)+1)
+ metricAttrs = append(metricAttrs, gctx.metricAttrs...)
+ }
+
+ switch rs := rs.(type) {
+ case *stats.Begin:
+ case *stats.InPayload:
+ if gctx != nil {
+ messageId = atomic.AddInt64(&gctx.messagesReceived, 1)
+ c.rpcRequestSize.Record(ctx, int64(rs.Length), metric.WithAttributeSet(attribute.NewSet(metricAttrs...)))
+ }
+
+ if c.ReceivedEvent {
+ span.AddEvent("message",
+ trace.WithAttributes(
+ semconv.MessageTypeReceived,
+ semconv.MessageIDKey.Int64(messageId),
+ semconv.MessageCompressedSizeKey.Int(rs.CompressedLength),
+ semconv.MessageUncompressedSizeKey.Int(rs.Length),
+ ),
+ )
+ }
+ case *stats.OutPayload:
+ if gctx != nil {
+ messageId = atomic.AddInt64(&gctx.messagesSent, 1)
+ c.rpcResponseSize.Record(ctx, int64(rs.Length), metric.WithAttributeSet(attribute.NewSet(metricAttrs...)))
+ }
+
+ if c.SentEvent {
+ span.AddEvent("message",
+ trace.WithAttributes(
+ semconv.MessageTypeSent,
+ semconv.MessageIDKey.Int64(messageId),
+ semconv.MessageCompressedSizeKey.Int(rs.CompressedLength),
+ semconv.MessageUncompressedSizeKey.Int(rs.Length),
+ ),
+ )
+ }
+ case *stats.OutTrailer:
+ case *stats.OutHeader:
+ if p, ok := peer.FromContext(ctx); ok {
+ span.SetAttributes(peerAttr(p.Addr.String())...)
+ }
+ case *stats.End:
+ var rpcStatusAttr attribute.KeyValue
+
+ if rs.Error != nil {
+ s, _ := status.FromError(rs.Error)
+ if isServer {
+ statusCode, msg := serverStatus(s)
+ span.SetStatus(statusCode, msg)
+ } else {
+ span.SetStatus(codes.Error, s.Message())
+ }
+ rpcStatusAttr = semconv.RPCGRPCStatusCodeKey.Int(int(s.Code()))
+ } else {
+ rpcStatusAttr = semconv.RPCGRPCStatusCodeKey.Int(int(grpc_codes.OK))
+ }
+ span.SetAttributes(rpcStatusAttr)
+ span.End()
+
+ metricAttrs = append(metricAttrs, rpcStatusAttr)
+ // Allocate vararg slice once.
+ recordOpts := []metric.RecordOption{metric.WithAttributeSet(attribute.NewSet(metricAttrs...))}
+
+ // Use floating point division here for higher precision (instead of Millisecond method).
+ // Measure right before calling Record() to capture as much elapsed time as possible.
+ elapsedTime := float64(rs.EndTime.Sub(rs.BeginTime)) / float64(time.Millisecond)
+
+ c.rpcDuration.Record(ctx, elapsedTime, recordOpts...)
+ if gctx != nil {
+ c.rpcRequestsPerRPC.Record(ctx, atomic.LoadInt64(&gctx.messagesReceived), recordOpts...)
+ c.rpcResponsesPerRPC.Record(ctx, atomic.LoadInt64(&gctx.messagesSent), recordOpts...)
+ }
+ default:
+ return
+ }
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go
index 1fc5e3365d..a15d06cb0c 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go
@@ -1,22 +1,11 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
// Version is the current release version of the gRPC instrumentation.
func Version() string {
- return "0.42.0"
+ return "0.53.0"
// This string is updated by the pre_release.sh script during release
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
index 92b8cf73c9..6aae83bfd2 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -23,7 +12,7 @@ import (
)
// DefaultClient is the default Client and is used by Get, Head, Post and PostForm.
-// Please be careful of intitialization order - for example, if you change
+// Please be careful of initialization order - for example, if you change
// the global propagator, the DefaultClient might still be using the old one.
var DefaultClient = &http.Client{Transport: NewTransport(http.DefaultTransport)}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
index 303e5505e4..214acaf581 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -31,10 +20,16 @@ const (
// Server HTTP metrics.
const (
- RequestCount = "http.server.request_count" // Incoming request count total
- RequestContentLength = "http.server.request_content_length" // Incoming request bytes total
- ResponseContentLength = "http.server.response_content_length" // Incoming response bytes total
- ServerLatency = "http.server.duration" // Incoming end to end duration, microseconds
+ serverRequestSize = "http.server.request.size" // Incoming request bytes total
+ serverResponseSize = "http.server.response.size" // Incoming response bytes total
+ serverDuration = "http.server.duration" // Incoming end to end duration, milliseconds
+)
+
+// Client HTTP metrics.
+const (
+ clientRequestSize = "http.client.request.size" // Outgoing request bytes total
+ clientResponseSize = "http.client.response.size" // Outgoing response bytes total
+ clientDuration = "http.client.duration" // Outgoing end to end duration, milliseconds
)
// Filter is a predicate used to determine whether a given http.request should
@@ -42,5 +37,5 @@ const (
type Filter func(*http.Request) bool
func newTracer(tp trace.TracerProvider) trace.Tracer {
- return tp.Tracer(instrumentationName, trace.WithInstrumentationVersion(Version()))
+ return tp.Tracer(ScopeName, trace.WithInstrumentationVersion(Version()))
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
index e4fa1b8d9d..f0a9bb9efe 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -25,9 +14,8 @@ import (
"go.opentelemetry.io/otel/trace"
)
-const (
- instrumentationName = "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
-)
+// ScopeName is the instrumentation scope name.
+const ScopeName = "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
// config represents the configuration options available for the http.Handler
// and http.Transport types.
@@ -76,7 +64,7 @@ func newConfig(opts ...Option) *config {
}
c.Meter = c.MeterProvider.Meter(
- instrumentationName,
+ ScopeName,
metric.WithInstrumentationVersion(Version()),
)
@@ -112,7 +100,7 @@ func WithPublicEndpoint() Option {
})
}
-// WithPublicEndpointFn runs with every request, and allows conditionnally
+// WithPublicEndpointFn runs with every request, and allows conditionally
// configuring the Handler to link the span with an incoming span context. If
// this option is not provided or returns false, then the association is a
// child association instead of a link.
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
index 38c7f01c71..56b24b982a 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package otelhttp provides an http.Handler and functions that are intended
// to be used to add tracing by wrapping existing handlers (with Handler) and
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
index b2fbe07841..d01bdccf40 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
@@ -1,32 +1,20 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
import (
- "io"
"net/http"
"time"
"github.com/felixge/httpsnoop"
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/propagation"
- semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
"go.opentelemetry.io/otel/trace"
)
@@ -43,10 +31,13 @@ type middleware struct {
writeEvent bool
filters []Filter
spanNameFormatter func(string, *http.Request) string
- counters map[string]metric.Int64Counter
- valueRecorders map[string]metric.Float64Histogram
publicEndpoint bool
publicEndpointFn func(*http.Request) bool
+
+ traceSemconv semconv.HTTPServer
+ requestBytesCounter metric.Int64Counter
+ responseBytesCounter metric.Int64Counter
+ serverLatencyMeasure metric.Float64Histogram
}
func defaultHandlerFormatter(operation string, _ *http.Request) string {
@@ -65,6 +56,8 @@ func NewHandler(handler http.Handler, operation string, opts ...Option) http.Han
func NewMiddleware(operation string, opts ...Option) func(http.Handler) http.Handler {
h := middleware{
operation: operation,
+
+ traceSemconv: semconv.NewHTTPServer(),
}
defaultOpts := []Option{
@@ -104,21 +97,27 @@ func handleErr(err error) {
}
func (h *middleware) createMeasures() {
- h.counters = make(map[string]metric.Int64Counter)
- h.valueRecorders = make(map[string]metric.Float64Histogram)
-
- requestBytesCounter, err := h.meter.Int64Counter(RequestContentLength)
+ var err error
+ h.requestBytesCounter, err = h.meter.Int64Counter(
+ serverRequestSize,
+ metric.WithUnit("By"),
+ metric.WithDescription("Measures the size of HTTP request messages."),
+ )
handleErr(err)
- responseBytesCounter, err := h.meter.Int64Counter(ResponseContentLength)
+ h.responseBytesCounter, err = h.meter.Int64Counter(
+ serverResponseSize,
+ metric.WithUnit("By"),
+ metric.WithDescription("Measures the size of HTTP response messages."),
+ )
handleErr(err)
- serverLatencyMeasure, err := h.meter.Float64Histogram(ServerLatency)
+ h.serverLatencyMeasure, err = h.meter.Float64Histogram(
+ serverDuration,
+ metric.WithUnit("ms"),
+ metric.WithDescription("Measures the duration of inbound HTTP requests."),
+ )
handleErr(err)
-
- h.counters[RequestContentLength] = requestBytesCounter
- h.counters[ResponseContentLength] = responseBytesCounter
- h.valueRecorders[ServerLatency] = serverLatencyMeasure
}
// serveHTTP sets up tracing and calls the given next http.Handler with the span
@@ -135,12 +134,9 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
ctx := h.propagators.Extract(r.Context(), propagation.HeaderCarrier(r.Header))
opts := []trace.SpanStartOption{
- trace.WithAttributes(semconvutil.HTTPServerRequest(h.server, r)...),
- }
- if h.server != "" {
- hostAttr := semconv.NetHostName(h.server)
- opts = append(opts, trace.WithAttributes(hostAttr))
+ trace.WithAttributes(h.traceSemconv.RequestTraceAttrs(h.server, r)...),
}
+
opts = append(opts, h.spanStartOptions...)
if h.publicEndpoint || (h.publicEndpointFn != nil && h.publicEndpointFn(r.WithContext(ctx))) {
opts = append(opts, trace.WithNewRoot())
@@ -209,61 +205,48 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
WriteHeader: func(httpsnoop.WriteHeaderFunc) httpsnoop.WriteHeaderFunc {
return rww.WriteHeader
},
+ Flush: func(httpsnoop.FlushFunc) httpsnoop.FlushFunc {
+ return rww.Flush
+ },
})
- labeler := &Labeler{}
- ctx = injectLabeler(ctx, labeler)
+ labeler, found := LabelerFromContext(ctx)
+ if !found {
+ ctx = ContextWithLabeler(ctx, labeler)
+ }
next.ServeHTTP(w, r.WithContext(ctx))
- setAfterServeAttributes(span, bw.read, rww.written, rww.statusCode, bw.err, rww.err)
+ span.SetStatus(semconv.ServerStatus(rww.statusCode))
+ span.SetAttributes(h.traceSemconv.ResponseTraceAttrs(semconv.ResponseTelemetry{
+ StatusCode: rww.statusCode,
+ ReadBytes: bw.read.Load(),
+ ReadError: bw.err,
+ WriteBytes: rww.written,
+ WriteError: rww.err,
+ })...)
// Add metrics
attributes := append(labeler.Get(), semconvutil.HTTPServerRequestMetrics(h.server, r)...)
if rww.statusCode > 0 {
attributes = append(attributes, semconv.HTTPStatusCode(rww.statusCode))
}
- o := metric.WithAttributes(attributes...)
- h.counters[RequestContentLength].Add(ctx, bw.read, o)
- h.counters[ResponseContentLength].Add(ctx, rww.written, o)
+ o := metric.WithAttributeSet(attribute.NewSet(attributes...))
+ addOpts := []metric.AddOption{o} // Allocate vararg slice once.
+ h.requestBytesCounter.Add(ctx, bw.read.Load(), addOpts...)
+ h.responseBytesCounter.Add(ctx, rww.written, addOpts...)
// Use floating point division here for higher precision (instead of Millisecond method).
elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond)
- h.valueRecorders[ServerLatency].Record(ctx, elapsedTime, o)
-}
-
-func setAfterServeAttributes(span trace.Span, read, wrote int64, statusCode int, rerr, werr error) {
- attributes := []attribute.KeyValue{}
-
- // TODO: Consider adding an event after each read and write, possibly as an
- // option (defaulting to off), so as to not create needlessly verbose spans.
- if read > 0 {
- attributes = append(attributes, ReadBytesKey.Int64(read))
- }
- if rerr != nil && rerr != io.EOF {
- attributes = append(attributes, ReadErrorKey.String(rerr.Error()))
- }
- if wrote > 0 {
- attributes = append(attributes, WroteBytesKey.Int64(wrote))
- }
- if statusCode > 0 {
- attributes = append(attributes, semconv.HTTPStatusCode(statusCode))
- }
- span.SetStatus(semconvutil.HTTPServerStatus(statusCode))
-
- if werr != nil && werr != io.EOF {
- attributes = append(attributes, WriteErrorKey.String(werr.Error()))
- }
- span.SetAttributes(attributes...)
+ h.serverLatencyMeasure.Record(ctx, elapsedTime, o)
}
// WithRouteTag annotates spans and metrics with the provided route name
// with HTTP route attribute.
func WithRouteTag(route string, h http.Handler) http.Handler {
+ attr := semconv.NewHTTPServer().Route(route)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- attr := semconv.HTTPRouteKey.String(route)
-
span := trace.SpanFromContext(r.Context())
span.SetAttributes(attr)
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go
new file mode 100644
index 0000000000..3ec0ad00c8
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go
@@ -0,0 +1,82 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "fmt"
+ "net/http"
+ "os"
+ "strings"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/codes"
+)
+
+type ResponseTelemetry struct {
+ StatusCode int
+ ReadBytes int64
+ ReadError error
+ WriteBytes int64
+ WriteError error
+}
+
+type HTTPServer struct {
+ duplicate bool
+}
+
+// RequestTraceAttrs returns trace attributes for an HTTP request received by a
+// server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+func (s HTTPServer) RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue {
+ if s.duplicate {
+ return append(oldHTTPServer{}.RequestTraceAttrs(server, req), newHTTPServer{}.RequestTraceAttrs(server, req)...)
+ }
+ return oldHTTPServer{}.RequestTraceAttrs(server, req)
+}
+
+// ResponseTraceAttrs returns trace attributes for telemetry from an HTTP response.
+//
+// If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+func (s HTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue {
+ if s.duplicate {
+ return append(oldHTTPServer{}.ResponseTraceAttrs(resp), newHTTPServer{}.ResponseTraceAttrs(resp)...)
+ }
+ return oldHTTPServer{}.ResponseTraceAttrs(resp)
+}
+
+// Route returns the attribute for the route.
+func (s HTTPServer) Route(route string) attribute.KeyValue {
+ return oldHTTPServer{}.Route(route)
+}
+
+func NewHTTPServer() HTTPServer {
+ env := strings.ToLower(os.Getenv("OTEL_HTTP_CLIENT_COMPATIBILITY_MODE"))
+ return HTTPServer{duplicate: env == "http/dup"}
+}
+
+// ServerStatus returns a span status code and message for an HTTP status code
+// value returned by a server. Status codes in the 400-499 range are not
+// returned as errors.
+func ServerStatus(code int) (codes.Code, string) {
+ if code < 100 || code >= 600 {
+ return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code)
+ }
+ if code >= 500 {
+ return codes.Error, ""
+ }
+ return codes.Unset, ""
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go
new file mode 100644
index 0000000000..e7f293761b
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go
@@ -0,0 +1,91 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "net"
+ "net/http"
+ "strconv"
+ "strings"
+
+ "go.opentelemetry.io/otel/attribute"
+ semconvNew "go.opentelemetry.io/otel/semconv/v1.24.0"
+)
+
+// splitHostPort splits a network address hostport of the form "host",
+// "host%zone", "[host]", "[host%zone], "host:port", "host%zone:port",
+// "[host]:port", "[host%zone]:port", or ":port" into host or host%zone and
+// port.
+//
+// An empty host is returned if it is not provided or unparsable. A negative
+// port is returned if it is not provided or unparsable.
+func splitHostPort(hostport string) (host string, port int) {
+ port = -1
+
+ if strings.HasPrefix(hostport, "[") {
+ addrEnd := strings.LastIndex(hostport, "]")
+ if addrEnd < 0 {
+ // Invalid hostport.
+ return
+ }
+ if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 {
+ host = hostport[1:addrEnd]
+ return
+ }
+ } else {
+ if i := strings.LastIndex(hostport, ":"); i < 0 {
+ host = hostport
+ return
+ }
+ }
+
+ host, pStr, err := net.SplitHostPort(hostport)
+ if err != nil {
+ return
+ }
+
+ p, err := strconv.ParseUint(pStr, 10, 16)
+ if err != nil {
+ return
+ }
+ return host, int(p)
+}
+
+func requiredHTTPPort(https bool, port int) int { // nolint:revive
+ if https {
+ if port > 0 && port != 443 {
+ return port
+ }
+ } else {
+ if port > 0 && port != 80 {
+ return port
+ }
+ }
+ return -1
+}
+
+func serverClientIP(xForwardedFor string) string {
+ if idx := strings.Index(xForwardedFor, ","); idx >= 0 {
+ xForwardedFor = xForwardedFor[:idx]
+ }
+ return xForwardedFor
+}
+
+func netProtocol(proto string) (name string, version string) {
+ name, version, _ = strings.Cut(proto, "/")
+ name = strings.ToLower(name)
+ return name, version
+}
+
+var methodLookup = map[string]attribute.KeyValue{
+ http.MethodConnect: semconvNew.HTTPRequestMethodConnect,
+ http.MethodDelete: semconvNew.HTTPRequestMethodDelete,
+ http.MethodGet: semconvNew.HTTPRequestMethodGet,
+ http.MethodHead: semconvNew.HTTPRequestMethodHead,
+ http.MethodOptions: semconvNew.HTTPRequestMethodOptions,
+ http.MethodPatch: semconvNew.HTTPRequestMethodPatch,
+ http.MethodPost: semconvNew.HTTPRequestMethodPost,
+ http.MethodPut: semconvNew.HTTPRequestMethodPut,
+ http.MethodTrace: semconvNew.HTTPRequestMethodTrace,
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go
new file mode 100644
index 0000000000..c3e838aaa5
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go
@@ -0,0 +1,74 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "errors"
+ "io"
+ "net/http"
+
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
+ "go.opentelemetry.io/otel/attribute"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
+)
+
+type oldHTTPServer struct{}
+
+// RequestTraceAttrs returns trace attributes for an HTTP request received by a
+// server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+func (o oldHTTPServer) RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue {
+ return semconvutil.HTTPServerRequest(server, req)
+}
+
+// ResponseTraceAttrs returns trace attributes for telemetry from an HTTP response.
+//
+// If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+func (o oldHTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue {
+ attributes := []attribute.KeyValue{}
+
+ if resp.ReadBytes > 0 {
+ attributes = append(attributes, semconv.HTTPRequestContentLength(int(resp.ReadBytes)))
+ }
+ if resp.ReadError != nil && !errors.Is(resp.ReadError, io.EOF) {
+ // This is not in the semantic conventions, but is historically provided
+ attributes = append(attributes, attribute.String("http.read_error", resp.ReadError.Error()))
+ }
+ if resp.WriteBytes > 0 {
+ attributes = append(attributes, semconv.HTTPResponseContentLength(int(resp.WriteBytes)))
+ }
+ if resp.StatusCode > 0 {
+ attributes = append(attributes, semconv.HTTPStatusCode(resp.StatusCode))
+ }
+ if resp.WriteError != nil && !errors.Is(resp.WriteError, io.EOF) {
+ // This is not in the semantic conventions, but is historically provided
+ attributes = append(attributes, attribute.String("http.write_error", resp.WriteError.Error()))
+ }
+
+ return attributes
+}
+
+// Route returns the attribute for the route.
+func (o oldHTTPServer) Route(route string) attribute.KeyValue {
+ return semconv.HTTPRoute(route)
+}
+
+// HTTPStatusCode returns the attribute for the HTTP status code.
+// This is a temporary function needed by metrics. This will be removed when MetricsRequest is added.
+func HTTPStatusCode(status int) attribute.KeyValue {
+ return semconv.HTTPStatusCode(status)
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.24.0.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.24.0.go
new file mode 100644
index 0000000000..0c5d4c4608
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.24.0.go
@@ -0,0 +1,197 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "net/http"
+ "strings"
+
+ "go.opentelemetry.io/otel/attribute"
+ semconvNew "go.opentelemetry.io/otel/semconv/v1.24.0"
+)
+
+type newHTTPServer struct{}
+
+// TraceRequest returns trace attributes for an HTTP request received by a
+// server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+func (n newHTTPServer) RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue {
+ count := 3 // ServerAddress, Method, Scheme
+
+ var host string
+ var p int
+ if server == "" {
+ host, p = splitHostPort(req.Host)
+ } else {
+ // Prioritize the primary server name.
+ host, p = splitHostPort(server)
+ if p < 0 {
+ _, p = splitHostPort(req.Host)
+ }
+ }
+
+ hostPort := requiredHTTPPort(req.TLS != nil, p)
+ if hostPort > 0 {
+ count++
+ }
+
+ method, methodOriginal := n.method(req.Method)
+ if methodOriginal != (attribute.KeyValue{}) {
+ count++
+ }
+
+ scheme := n.scheme(req.TLS != nil)
+
+ if peer, peerPort := splitHostPort(req.RemoteAddr); peer != "" {
+ // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a
+ // file-path that would be interpreted with a sock family.
+ count++
+ if peerPort > 0 {
+ count++
+ }
+ }
+
+ useragent := req.UserAgent()
+ if useragent != "" {
+ count++
+ }
+
+ clientIP := serverClientIP(req.Header.Get("X-Forwarded-For"))
+ if clientIP != "" {
+ count++
+ }
+
+ if req.URL != nil && req.URL.Path != "" {
+ count++
+ }
+
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" && protoName != "http" {
+ count++
+ }
+ if protoVersion != "" {
+ count++
+ }
+
+ attrs := make([]attribute.KeyValue, 0, count)
+ attrs = append(attrs,
+ semconvNew.ServerAddress(host),
+ method,
+ scheme,
+ )
+
+ if hostPort > 0 {
+ attrs = append(attrs, semconvNew.ServerPort(hostPort))
+ }
+ if methodOriginal != (attribute.KeyValue{}) {
+ attrs = append(attrs, methodOriginal)
+ }
+
+ if peer, peerPort := splitHostPort(req.RemoteAddr); peer != "" {
+ // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a
+ // file-path that would be interpreted with a sock family.
+ attrs = append(attrs, semconvNew.NetworkPeerAddress(peer))
+ if peerPort > 0 {
+ attrs = append(attrs, semconvNew.NetworkPeerPort(peerPort))
+ }
+ }
+
+ if useragent := req.UserAgent(); useragent != "" {
+ attrs = append(attrs, semconvNew.UserAgentOriginal(useragent))
+ }
+
+ if clientIP != "" {
+ attrs = append(attrs, semconvNew.ClientAddress(clientIP))
+ }
+
+ if req.URL != nil && req.URL.Path != "" {
+ attrs = append(attrs, semconvNew.URLPath(req.URL.Path))
+ }
+
+ if protoName != "" && protoName != "http" {
+ attrs = append(attrs, semconvNew.NetworkProtocolName(protoName))
+ }
+ if protoVersion != "" {
+ attrs = append(attrs, semconvNew.NetworkProtocolVersion(protoVersion))
+ }
+
+ return attrs
+}
+
+func (n newHTTPServer) method(method string) (attribute.KeyValue, attribute.KeyValue) {
+ if method == "" {
+ return semconvNew.HTTPRequestMethodGet, attribute.KeyValue{}
+ }
+ if attr, ok := methodLookup[method]; ok {
+ return attr, attribute.KeyValue{}
+ }
+
+ orig := semconvNew.HTTPRequestMethodOriginal(method)
+ if attr, ok := methodLookup[strings.ToUpper(method)]; ok {
+ return attr, orig
+ }
+ return semconvNew.HTTPRequestMethodGet, orig
+}
+
+func (n newHTTPServer) scheme(https bool) attribute.KeyValue { // nolint:revive
+ if https {
+ return semconvNew.URLScheme("https")
+ }
+ return semconvNew.URLScheme("http")
+}
+
+// TraceResponse returns trace attributes for telemetry from an HTTP response.
+//
+// If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+func (n newHTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue {
+ var count int
+
+ if resp.ReadBytes > 0 {
+ count++
+ }
+ if resp.WriteBytes > 0 {
+ count++
+ }
+ if resp.StatusCode > 0 {
+ count++
+ }
+
+ attributes := make([]attribute.KeyValue, 0, count)
+
+ if resp.ReadBytes > 0 {
+ attributes = append(attributes,
+ semconvNew.HTTPRequestBodySize(int(resp.ReadBytes)),
+ )
+ }
+ if resp.WriteBytes > 0 {
+ attributes = append(attributes,
+ semconvNew.HTTPResponseBodySize(int(resp.WriteBytes)),
+ )
+ }
+ if resp.StatusCode > 0 {
+ attributes = append(attributes,
+ semconvNew.HTTPResponseStatusCode(resp.StatusCode),
+ )
+ }
+
+ return attributes
+}
+
+// Route returns the attribute for the route.
+func (n newHTTPServer) Route(route string) attribute.KeyValue {
+ return semconvNew.HTTPRoute(route)
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
index edf4ce3d31..7aa5f99e81 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
index d3dede9ebb..a73bb06e90 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
@@ -2,18 +2,7 @@
// source: internal/shared/semconvutil/httpconv.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
@@ -24,7 +13,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
- semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
)
// HTTPClientResponse returns trace attributes for an HTTP response received by a
@@ -43,14 +32,22 @@ func HTTPClientResponse(resp *http.Response) []attribute.KeyValue {
}
// HTTPClientRequest returns trace attributes for an HTTP request made by a client.
-// The following attributes are always returned: "http.url", "http.flavor",
-// "http.method", "net.peer.name". The following attributes are returned if the
-// related values are defined in req: "net.peer.port", "http.user_agent",
-// "http.request_content_length", "enduser.id".
+// The following attributes are always returned: "http.url", "http.method",
+// "net.peer.name". The following attributes are returned if the related values
+// are defined in req: "net.peer.port", "user_agent.original",
+// "http.request_content_length".
func HTTPClientRequest(req *http.Request) []attribute.KeyValue {
return hc.ClientRequest(req)
}
+// HTTPClientRequestMetrics returns metric attributes for an HTTP request made by a client.
+// The following attributes are always returned: "http.method", "net.peer.name".
+// The following attributes are returned if the
+// related values are defined in req: "net.peer.port".
+func HTTPClientRequestMetrics(req *http.Request) []attribute.KeyValue {
+ return hc.ClientRequestMetrics(req)
+}
+
// HTTPClientStatus returns a span status code and message for an HTTP status code
// value received by a client.
func HTTPClientStatus(code int) (codes.Code, string) {
@@ -75,10 +72,9 @@ func HTTPClientStatus(code int) (codes.Code, string) {
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "http.target", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port",
-// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id",
-// "http.client_ip".
+// "http.target", "net.host.name". The following attributes are returned if
+// they related values are defined in req: "net.host.port", "net.sock.peer.addr",
+// "net.sock.peer.port", "user_agent.original", "http.client_ip".
func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue {
return hc.ServerRequest(server, req)
}
@@ -101,8 +97,8 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue {
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port".
+// "net.host.name". The following attributes are returned if they related
+// values are defined in req: "net.host.port".
func HTTPServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue {
return hc.ServerRequestMetrics(server, req)
}
@@ -114,44 +110,12 @@ func HTTPServerStatus(code int) (codes.Code, string) {
return hc.ServerStatus(code)
}
-// HTTPRequestHeader returns the contents of h as attributes.
-//
-// Instrumentation should require an explicit configuration of which headers to
-// captured and then prune what they pass here. Including all headers can be a
-// security risk - explicit configuration helps avoid leaking sensitive
-// information.
-//
-// The User-Agent header is already captured in the http.user_agent attribute
-// from ClientRequest and ServerRequest. Instrumentation may provide an option
-// to capture that header here even though it is not recommended. Otherwise,
-// instrumentation should filter that out of what is passed.
-func HTTPRequestHeader(h http.Header) []attribute.KeyValue {
- return hc.RequestHeader(h)
-}
-
-// HTTPResponseHeader returns the contents of h as attributes.
-//
-// Instrumentation should require an explicit configuration of which headers to
-// captured and then prune what they pass here. Including all headers can be a
-// security risk - explicit configuration helps avoid leaking sensitive
-// information.
-//
-// The User-Agent header is already captured in the http.user_agent attribute
-// from ClientRequest and ServerRequest. Instrumentation may provide an option
-// to capture that header here even though it is not recommended. Otherwise,
-// instrumentation should filter that out of what is passed.
-func HTTPResponseHeader(h http.Header) []attribute.KeyValue {
- return hc.ResponseHeader(h)
-}
-
// httpConv are the HTTP semantic convention attributes defined for a version
// of the OpenTelemetry specification.
type httpConv struct {
NetConv *netConv
- EnduserIDKey attribute.Key
HTTPClientIPKey attribute.Key
- HTTPFlavorKey attribute.Key
HTTPMethodKey attribute.Key
HTTPRequestContentLengthKey attribute.Key
HTTPResponseContentLengthKey attribute.Key
@@ -161,15 +125,13 @@ type httpConv struct {
HTTPStatusCodeKey attribute.Key
HTTPTargetKey attribute.Key
HTTPURLKey attribute.Key
- HTTPUserAgentKey attribute.Key
+ UserAgentOriginalKey attribute.Key
}
var hc = &httpConv{
NetConv: nc,
- EnduserIDKey: semconv.EnduserIDKey,
HTTPClientIPKey: semconv.HTTPClientIPKey,
- HTTPFlavorKey: semconv.HTTPFlavorKey,
HTTPMethodKey: semconv.HTTPMethodKey,
HTTPRequestContentLengthKey: semconv.HTTPRequestContentLengthKey,
HTTPResponseContentLengthKey: semconv.HTTPResponseContentLengthKey,
@@ -179,7 +141,7 @@ var hc = &httpConv{
HTTPStatusCodeKey: semconv.HTTPStatusCodeKey,
HTTPTargetKey: semconv.HTTPTargetKey,
HTTPURLKey: semconv.HTTPURLKey,
- HTTPUserAgentKey: semconv.HTTPUserAgentKey,
+ UserAgentOriginalKey: semconv.UserAgentOriginalKey,
}
// ClientResponse returns attributes for an HTTP response received by a client
@@ -193,6 +155,10 @@ var hc = &httpConv{
//
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
func (c *httpConv) ClientResponse(resp *http.Response) []attribute.KeyValue {
+ /* The following semantic conventions are returned if present:
+ http.status_code int
+ http.response_content_length int
+ */
var n int
if resp.StatusCode > 0 {
n++
@@ -212,11 +178,31 @@ func (c *httpConv) ClientResponse(resp *http.Response) []attribute.KeyValue {
}
// ClientRequest returns attributes for an HTTP request made by a client. The
-// following attributes are always returned: "http.url", "http.flavor",
-// "http.method", "net.peer.name". The following attributes are returned if the
-// related values are defined in req: "net.peer.port", "http.user_agent",
-// "http.request_content_length", "enduser.id".
+// following attributes are always returned: "http.url", "http.method",
+// "net.peer.name". The following attributes are returned if the related values
+// are defined in req: "net.peer.port", "user_agent.original",
+// "http.request_content_length", "user_agent.original".
func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
+ /* The following semantic conventions are returned if present:
+ http.method string
+ user_agent.original string
+ http.url string
+ net.peer.name string
+ net.peer.port int
+ http.request_content_length int
+ */
+
+ /* The following semantic conventions are not returned:
+ http.status_code This requires the response. See ClientResponse.
+ http.response_content_length This requires the response. See ClientResponse.
+ net.sock.family This requires the socket used.
+ net.sock.peer.addr This requires the socket used.
+ net.sock.peer.name This requires the socket used.
+ net.sock.peer.port This requires the socket used.
+ http.resend_count This is something outside of a single request.
+ net.protocol.name The value is the Request is ignored, and the go client will always use "http".
+ net.protocol.version The value in the Request is ignored, and the go client will always use 1.1 or 2.0.
+ */
n := 3 // URL, peer name, proto, and method.
var h string
if req.URL != nil {
@@ -234,14 +220,10 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
if req.ContentLength > 0 {
n++
}
- userID, _, hasUserID := req.BasicAuth()
- if hasUserID {
- n++
- }
+
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.method(req.Method))
- attrs = append(attrs, c.flavor(req.Proto))
var u string
if req.URL != nil {
@@ -260,15 +242,43 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
}
if useragent != "" {
- attrs = append(attrs, c.HTTPUserAgentKey.String(useragent))
+ attrs = append(attrs, c.UserAgentOriginalKey.String(useragent))
}
if l := req.ContentLength; l > 0 {
attrs = append(attrs, c.HTTPRequestContentLengthKey.Int64(l))
}
- if hasUserID {
- attrs = append(attrs, c.EnduserIDKey.String(userID))
+ return attrs
+}
+
+// ClientRequestMetrics returns metric attributes for an HTTP request made by a client. The
+// following attributes are always returned: "http.method", "net.peer.name".
+// The following attributes are returned if the related values
+// are defined in req: "net.peer.port".
+func (c *httpConv) ClientRequestMetrics(req *http.Request) []attribute.KeyValue {
+ /* The following semantic conventions are returned if present:
+ http.method string
+ net.peer.name string
+ net.peer.port int
+ */
+
+ n := 2 // method, peer name.
+ var h string
+ if req.URL != nil {
+ h = req.URL.Host
+ }
+ peer, p := firstHostPort(h, req.Header.Get("Host"))
+ port := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", p)
+ if port > 0 {
+ n++
+ }
+
+ attrs := make([]attribute.KeyValue, 0, n)
+ attrs = append(attrs, c.method(req.Method), c.NetConv.PeerName(peer))
+
+ if port > 0 {
+ attrs = append(attrs, c.NetConv.PeerPort(port))
}
return attrs
@@ -291,18 +301,35 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "http.target", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port",
-// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id",
-// "http.client_ip".
+// "http.target", "net.host.name". The following attributes are returned if they
+// related values are defined in req: "net.host.port", "net.sock.peer.addr",
+// "net.sock.peer.port", "user_agent.original", "http.client_ip",
+// "net.protocol.name", "net.protocol.version".
func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.KeyValue {
- // TODO: This currently does not add the specification required
- // `http.target` attribute. It has too high of a cardinality to safely be
- // added. An alternate should be added, or this comment removed, when it is
- // addressed by the specification. If it is ultimately decided to continue
- // not including the attribute, the HTTPTargetKey field of the httpConv
- // should be removed as well.
-
+ /* The following semantic conventions are returned if present:
+ http.method string
+ http.scheme string
+ net.host.name string
+ net.host.port int
+ net.sock.peer.addr string
+ net.sock.peer.port int
+ user_agent.original string
+ http.client_ip string
+ net.protocol.name string Note: not set if the value is "http".
+ net.protocol.version string
+ http.target string Note: doesn't include the query parameter.
+ */
+
+ /* The following semantic conventions are not returned:
+ http.status_code This requires the response.
+ http.request_content_length This requires the len() of body, which can mutate it.
+ http.response_content_length This requires the response.
+ http.route This is not available.
+ net.sock.peer.name This would require a DNS lookup.
+ net.sock.host.addr The request doesn't have access to the underlying socket.
+ net.sock.host.port The request doesn't have access to the underlying socket.
+
+ */
n := 4 // Method, scheme, proto, and host name.
var host string
var p int
@@ -330,19 +357,31 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K
if useragent != "" {
n++
}
- userID, _, hasUserID := req.BasicAuth()
- if hasUserID {
- n++
- }
+
clientIP := serverClientIP(req.Header.Get("X-Forwarded-For"))
if clientIP != "" {
n++
}
+
+ var target string
+ if req.URL != nil {
+ target = req.URL.Path
+ if target != "" {
+ n++
+ }
+ }
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" && protoName != "http" {
+ n++
+ }
+ if protoVersion != "" {
+ n++
+ }
+
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.method(req.Method))
attrs = append(attrs, c.scheme(req.TLS != nil))
- attrs = append(attrs, c.flavor(req.Proto))
attrs = append(attrs, c.NetConv.HostName(host))
if hostPort > 0 {
@@ -359,17 +398,24 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K
}
if useragent != "" {
- attrs = append(attrs, c.HTTPUserAgentKey.String(useragent))
- }
-
- if hasUserID {
- attrs = append(attrs, c.EnduserIDKey.String(userID))
+ attrs = append(attrs, c.UserAgentOriginalKey.String(useragent))
}
if clientIP != "" {
attrs = append(attrs, c.HTTPClientIPKey.String(clientIP))
}
+ if target != "" {
+ attrs = append(attrs, c.HTTPTargetKey.String(target))
+ }
+
+ if protoName != "" && protoName != "http" {
+ attrs = append(attrs, c.NetConv.NetProtocolName.String(protoName))
+ }
+ if protoVersion != "" {
+ attrs = append(attrs, c.NetConv.NetProtocolVersion.String(protoVersion))
+ }
+
return attrs
}
@@ -391,17 +437,21 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port".
+// "net.host.name". The following attributes are returned if they related
+// values are defined in req: "net.host.port".
func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue {
- // TODO: This currently does not add the specification required
- // `http.target` attribute. It has too high of a cardinality to safely be
- // added. An alternate should be added, or this comment removed, when it is
- // addressed by the specification. If it is ultimately decided to continue
- // not including the attribute, the HTTPTargetKey field of the httpConv
- // should be removed as well.
-
- n := 4 // Method, scheme, proto, and host name.
+ /* The following semantic conventions are returned if present:
+ http.scheme string
+ http.route string
+ http.method string
+ http.status_code int
+ net.host.name string
+ net.host.port int
+ net.protocol.name string Note: not set if the value is "http".
+ net.protocol.version string
+ */
+
+ n := 3 // Method, scheme, and host name.
var host string
var p int
if server == "" {
@@ -417,16 +467,29 @@ func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attr
if hostPort > 0 {
n++
}
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" {
+ n++
+ }
+ if protoVersion != "" {
+ n++
+ }
+
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.methodMetric(req.Method))
attrs = append(attrs, c.scheme(req.TLS != nil))
- attrs = append(attrs, c.flavor(req.Proto))
attrs = append(attrs, c.NetConv.HostName(host))
if hostPort > 0 {
attrs = append(attrs, c.NetConv.HostPort(hostPort))
}
+ if protoName != "" {
+ attrs = append(attrs, c.NetConv.NetProtocolName.String(protoName))
+ }
+ if protoVersion != "" {
+ attrs = append(attrs, c.NetConv.NetProtocolVersion.String(protoVersion))
+ }
return attrs
}
@@ -455,21 +518,6 @@ func (c *httpConv) scheme(https bool) attribute.KeyValue { // nolint:revive
return c.HTTPSchemeHTTP
}
-func (c *httpConv) flavor(proto string) attribute.KeyValue {
- switch proto {
- case "HTTP/1.0":
- return c.HTTPFlavorKey.String("1.0")
- case "HTTP/1.1":
- return c.HTTPFlavorKey.String("1.1")
- case "HTTP/2":
- return c.HTTPFlavorKey.String("2.0")
- case "HTTP/3":
- return c.HTTPFlavorKey.String("3.0")
- default:
- return c.HTTPFlavorKey.String(proto)
- }
-}
-
func serverClientIP(xForwardedFor string) string {
if idx := strings.Index(xForwardedFor, ","); idx >= 0 {
xForwardedFor = xForwardedFor[:idx]
@@ -501,31 +549,6 @@ func firstHostPort(source ...string) (host string, port int) {
return
}
-// RequestHeader returns the contents of h as OpenTelemetry attributes.
-func (c *httpConv) RequestHeader(h http.Header) []attribute.KeyValue {
- return c.header("http.request.header", h)
-}
-
-// ResponseHeader returns the contents of h as OpenTelemetry attributes.
-func (c *httpConv) ResponseHeader(h http.Header) []attribute.KeyValue {
- return c.header("http.response.header", h)
-}
-
-func (c *httpConv) header(prefix string, h http.Header) []attribute.KeyValue {
- key := func(k string) attribute.Key {
- k = strings.ToLower(k)
- k = strings.ReplaceAll(k, "-", "_")
- k = fmt.Sprintf("%s.%s", prefix, k)
- return attribute.Key(k)
- }
-
- attrs := make([]attribute.KeyValue, 0, len(h))
- for k, v := range h {
- attrs = append(attrs, key(k).StringSlice(v))
- }
- return attrs
-}
-
// ClientStatus returns a span status code and message for an HTTP status code
// value received by a client.
func (c *httpConv) ClientStatus(code int) (codes.Code, string) {
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
index bde8893437..a9a9226b39 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
@@ -2,17 +2,7 @@
// source: internal/shared/semconvutil/netconv.go.tmpl
// Copyright The OpenTelemetry Authors
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
@@ -22,7 +12,7 @@ import (
"strings"
"go.opentelemetry.io/otel/attribute"
- semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
)
// NetTransport returns a trace attribute describing the transport protocol of the
@@ -32,24 +22,6 @@ func NetTransport(network string) attribute.KeyValue {
return nc.Transport(network)
}
-// NetClient returns trace attributes for a client network connection to address.
-// See net.Dial for information about acceptable address values, address should
-// be the same as the one used to create conn. If conn is nil, only network
-// peer attributes will be returned that describe address. Otherwise, the
-// socket level information about conn will also be included.
-func NetClient(address string, conn net.Conn) []attribute.KeyValue {
- return nc.Client(address, conn)
-}
-
-// NetServer returns trace attributes for a network listener listening at address.
-// See net.Listen for information about acceptable address values, address
-// should be the same as the one used to create ln. If ln is nil, only network
-// host attributes will be returned that describe address. Otherwise, the
-// socket level information about ln will also be included.
-func NetServer(address string, ln net.Listener) []attribute.KeyValue {
- return nc.Server(address, ln)
-}
-
// netConv are the network semantic convention attributes defined for a version
// of the OpenTelemetry specification.
type netConv struct {
@@ -57,6 +29,8 @@ type netConv struct {
NetHostPortKey attribute.Key
NetPeerNameKey attribute.Key
NetPeerPortKey attribute.Key
+ NetProtocolName attribute.Key
+ NetProtocolVersion attribute.Key
NetSockFamilyKey attribute.Key
NetSockPeerAddrKey attribute.Key
NetSockPeerPortKey attribute.Key
@@ -73,6 +47,8 @@ var nc = &netConv{
NetHostPortKey: semconv.NetHostPortKey,
NetPeerNameKey: semconv.NetPeerNameKey,
NetPeerPortKey: semconv.NetPeerPortKey,
+ NetProtocolName: semconv.NetProtocolNameKey,
+ NetProtocolVersion: semconv.NetProtocolVersionKey,
NetSockFamilyKey: semconv.NetSockFamilyKey,
NetSockPeerAddrKey: semconv.NetSockPeerAddrKey,
NetSockPeerPortKey: semconv.NetSockPeerPortKey,
@@ -116,57 +92,11 @@ func (c *netConv) Host(address string) []attribute.KeyValue {
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.HostName(h))
if p > 0 {
- attrs = append(attrs, c.HostPort(int(p)))
+ attrs = append(attrs, c.HostPort(p))
}
return attrs
}
-// Server returns attributes for a network listener listening at address. See
-// net.Listen for information about acceptable address values, address should
-// be the same as the one used to create ln. If ln is nil, only network host
-// attributes will be returned that describe address. Otherwise, the socket
-// level information about ln will also be included.
-func (c *netConv) Server(address string, ln net.Listener) []attribute.KeyValue {
- if ln == nil {
- return c.Host(address)
- }
-
- lAddr := ln.Addr()
- if lAddr == nil {
- return c.Host(address)
- }
-
- hostName, hostPort := splitHostPort(address)
- sockHostAddr, sockHostPort := splitHostPort(lAddr.String())
- network := lAddr.Network()
- sockFamily := family(network, sockHostAddr)
-
- n := nonZeroStr(hostName, network, sockHostAddr, sockFamily)
- n += positiveInt(hostPort, sockHostPort)
- attr := make([]attribute.KeyValue, 0, n)
- if hostName != "" {
- attr = append(attr, c.HostName(hostName))
- if hostPort > 0 {
- // Only if net.host.name is set should net.host.port be.
- attr = append(attr, c.HostPort(hostPort))
- }
- }
- if network != "" {
- attr = append(attr, c.Transport(network))
- }
- if sockFamily != "" {
- attr = append(attr, c.NetSockFamilyKey.String(sockFamily))
- }
- if sockHostAddr != "" {
- attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr))
- if sockHostPort > 0 {
- // Only if net.sock.host.addr is set should net.sock.host.port be.
- attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort))
- }
- }
- return attr
-}
-
func (c *netConv) HostName(name string) attribute.KeyValue {
return c.NetHostNameKey.String(name)
}
@@ -175,85 +105,6 @@ func (c *netConv) HostPort(port int) attribute.KeyValue {
return c.NetHostPortKey.Int(port)
}
-// Client returns attributes for a client network connection to address. See
-// net.Dial for information about acceptable address values, address should be
-// the same as the one used to create conn. If conn is nil, only network peer
-// attributes will be returned that describe address. Otherwise, the socket
-// level information about conn will also be included.
-func (c *netConv) Client(address string, conn net.Conn) []attribute.KeyValue {
- if conn == nil {
- return c.Peer(address)
- }
-
- lAddr, rAddr := conn.LocalAddr(), conn.RemoteAddr()
-
- var network string
- switch {
- case lAddr != nil:
- network = lAddr.Network()
- case rAddr != nil:
- network = rAddr.Network()
- default:
- return c.Peer(address)
- }
-
- peerName, peerPort := splitHostPort(address)
- var (
- sockFamily string
- sockPeerAddr string
- sockPeerPort int
- sockHostAddr string
- sockHostPort int
- )
-
- if lAddr != nil {
- sockHostAddr, sockHostPort = splitHostPort(lAddr.String())
- }
-
- if rAddr != nil {
- sockPeerAddr, sockPeerPort = splitHostPort(rAddr.String())
- }
-
- switch {
- case sockHostAddr != "":
- sockFamily = family(network, sockHostAddr)
- case sockPeerAddr != "":
- sockFamily = family(network, sockPeerAddr)
- }
-
- n := nonZeroStr(peerName, network, sockPeerAddr, sockHostAddr, sockFamily)
- n += positiveInt(peerPort, sockPeerPort, sockHostPort)
- attr := make([]attribute.KeyValue, 0, n)
- if peerName != "" {
- attr = append(attr, c.PeerName(peerName))
- if peerPort > 0 {
- // Only if net.peer.name is set should net.peer.port be.
- attr = append(attr, c.PeerPort(peerPort))
- }
- }
- if network != "" {
- attr = append(attr, c.Transport(network))
- }
- if sockFamily != "" {
- attr = append(attr, c.NetSockFamilyKey.String(sockFamily))
- }
- if sockPeerAddr != "" {
- attr = append(attr, c.NetSockPeerAddrKey.String(sockPeerAddr))
- if sockPeerPort > 0 {
- // Only if net.sock.peer.addr is set should net.sock.peer.port be.
- attr = append(attr, c.NetSockPeerPortKey.Int(sockPeerPort))
- }
- }
- if sockHostAddr != "" {
- attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr))
- if sockHostPort > 0 {
- // Only if net.sock.host.addr is set should net.sock.host.port be.
- attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort))
- }
- }
- return attr
-}
-
func family(network, address string) string {
switch network {
case "unix", "unixgram", "unixpacket":
@@ -269,26 +120,6 @@ func family(network, address string) string {
return ""
}
-func nonZeroStr(strs ...string) int {
- var n int
- for _, str := range strs {
- if str != "" {
- n++
- }
- }
- return n
-}
-
-func positiveInt(ints ...int) int {
- var n int
- for _, i := range ints {
- if i > 0 {
- n++
- }
- }
- return n
-}
-
// Peer returns attributes for a network peer address.
func (c *netConv) Peer(address string) []attribute.KeyValue {
h, p := splitHostPort(address)
@@ -307,7 +138,7 @@ func (c *netConv) Peer(address string) []attribute.KeyValue {
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.PeerName(h))
if p > 0 {
- attrs = append(attrs, c.PeerPort(int(p)))
+ attrs = append(attrs, c.PeerPort(p))
}
return attrs
}
@@ -366,3 +197,9 @@ func splitHostPort(hostport string) (host string, port int) {
}
return host, int(p)
}
+
+func netProtocol(proto string) (name string, version string) {
+ name, version, _ = strings.Cut(proto, "/")
+ name = strings.ToLower(name)
+ return name, version
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
index 26a51a1805..ea504e396f 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -48,8 +37,12 @@ type labelerContextKeyType int
const lablelerContextKey labelerContextKeyType = 0
-func injectLabeler(ctx context.Context, l *Labeler) context.Context {
- return context.WithValue(ctx, lablelerContextKey, l)
+// ContextWithLabeler returns a new context with the provided Labeler instance.
+// Attributes added to the specified labeler will be injected into metrics
+// emitted by the instrumentation. Only one labeller can be injected into the
+// context. Injecting it multiple times will override the previous calls.
+func ContextWithLabeler(parent context.Context, l *Labeler) context.Context {
+ return context.WithValue(parent, lablelerContextKey, l)
}
// LabelerFromContext retrieves a Labeler instance from the provided context if
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
index e835cac12e..0d3cb2e4aa 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -19,31 +8,42 @@ import (
"io"
"net/http"
"net/http/httptrace"
+ "sync/atomic"
+ "time"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
"go.opentelemetry.io/otel"
+ "go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/propagation"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
"go.opentelemetry.io/otel/trace"
)
// Transport implements the http.RoundTripper interface and wraps
-// outbound HTTP(S) requests with a span.
+// outbound HTTP(S) requests with a span and enriches it with metrics.
type Transport struct {
rt http.RoundTripper
tracer trace.Tracer
+ meter metric.Meter
propagators propagation.TextMapPropagator
spanStartOptions []trace.SpanStartOption
filters []Filter
spanNameFormatter func(string, *http.Request) string
clientTrace func(context.Context) *httptrace.ClientTrace
+
+ requestBytesCounter metric.Int64Counter
+ responseBytesCounter metric.Int64Counter
+ latencyMeasure metric.Float64Histogram
}
var _ http.RoundTripper = &Transport{}
// NewTransport wraps the provided http.RoundTripper with one that
-// starts a span and injects the span context into the outbound request headers.
+// starts a span, injects the span context into the outbound request headers,
+// and enriches it with metrics.
//
// If the provided http.RoundTripper is nil, http.DefaultTransport will be used
// as the base http.RoundTripper.
@@ -63,12 +63,14 @@ func NewTransport(base http.RoundTripper, opts ...Option) *Transport {
c := newConfig(append(defaultOpts, opts...)...)
t.applyConfig(c)
+ t.createMeasures()
return &t
}
func (t *Transport) applyConfig(c *config) {
t.tracer = c.Tracer
+ t.meter = c.Meter
t.propagators = c.Propagators
t.spanStartOptions = c.SpanStartOptions
t.filters = c.Filters
@@ -76,6 +78,30 @@ func (t *Transport) applyConfig(c *config) {
t.clientTrace = c.ClientTrace
}
+func (t *Transport) createMeasures() {
+ var err error
+ t.requestBytesCounter, err = t.meter.Int64Counter(
+ clientRequestSize,
+ metric.WithUnit("By"),
+ metric.WithDescription("Measures the size of HTTP request messages."),
+ )
+ handleErr(err)
+
+ t.responseBytesCounter, err = t.meter.Int64Counter(
+ clientResponseSize,
+ metric.WithUnit("By"),
+ metric.WithDescription("Measures the size of HTTP response messages."),
+ )
+ handleErr(err)
+
+ t.latencyMeasure, err = t.meter.Float64Histogram(
+ clientDuration,
+ metric.WithUnit("ms"),
+ metric.WithDescription("Measures the duration of outbound HTTP requests."),
+ )
+ handleErr(err)
+}
+
func defaultTransportFormatter(_ string, r *http.Request) string {
return "HTTP " + r.Method
}
@@ -84,6 +110,7 @@ func defaultTransportFormatter(_ string, r *http.Request) string {
// before handing the request to the configured base RoundTripper. The created span will
// end when the response body is closed or when a read from the body returns io.EOF.
func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
+ requestStartTime := time.Now()
for _, f := range t.filters {
if !f(r) {
// Simply pass through to the base RoundTripper if a filter rejects the request
@@ -109,7 +136,25 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
ctx = httptrace.WithClientTrace(ctx, t.clientTrace(ctx))
}
+ labeler, found := LabelerFromContext(ctx)
+ if !found {
+ ctx = ContextWithLabeler(ctx, labeler)
+ }
+
r = r.Clone(ctx) // According to RoundTripper spec, we shouldn't modify the origin request.
+
+ // use a body wrapper to determine the request size
+ var bw bodyWrapper
+ // if request body is nil or NoBody, we don't want to mutate the body as it
+ // will affect the identity of it in an unforeseeable way because we assert
+ // ReadCloser fulfills a certain interface and it is indeed nil or NoBody.
+ if r.Body != nil && r.Body != http.NoBody {
+ bw.ReadCloser = r.Body
+ // noop to prevent nil panic. not using this record fun yet.
+ bw.record = func(int64) {}
+ r.Body = &bw
+ }
+
span.SetAttributes(semconvutil.HTTPClientRequest(r)...)
t.propagators.Inject(ctx, propagation.HeaderCarrier(r.Header))
@@ -121,9 +166,29 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
return res, err
}
+ // metrics
+ metricAttrs := append(labeler.Get(), semconvutil.HTTPClientRequestMetrics(r)...)
+ if res.StatusCode > 0 {
+ metricAttrs = append(metricAttrs, semconv.HTTPStatusCode(res.StatusCode))
+ }
+ o := metric.WithAttributeSet(attribute.NewSet(metricAttrs...))
+ addOpts := []metric.AddOption{o} // Allocate vararg slice once.
+ t.requestBytesCounter.Add(ctx, bw.read.Load(), addOpts...)
+ // For handling response bytes we leverage a callback when the client reads the http response
+ readRecordFunc := func(n int64) {
+ t.responseBytesCounter.Add(ctx, n, addOpts...)
+ }
+
+ // traces
span.SetAttributes(semconvutil.HTTPClientResponse(res)...)
span.SetStatus(semconvutil.HTTPClientStatus(res.StatusCode))
- res.Body = newWrappedBody(span, res.Body)
+
+ res.Body = newWrappedBody(span, readRecordFunc, res.Body)
+
+ // Use floating point division here for higher precision (instead of Millisecond method).
+ elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond)
+
+ t.latencyMeasure.Record(ctx, elapsedTime, o)
return res, err
}
@@ -131,17 +196,17 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
// newWrappedBody returns a new and appropriately scoped *wrappedBody as an
// io.ReadCloser. If the passed body implements io.Writer, the returned value
// will implement io.ReadWriteCloser.
-func newWrappedBody(span trace.Span, body io.ReadCloser) io.ReadCloser {
+func newWrappedBody(span trace.Span, record func(n int64), body io.ReadCloser) io.ReadCloser {
// The successful protocol switch responses will have a body that
// implement an io.ReadWriteCloser. Ensure this interface type continues
// to be satisfied if that is the case.
if _, ok := body.(io.ReadWriteCloser); ok {
- return &wrappedBody{span: span, body: body}
+ return &wrappedBody{span: span, record: record, body: body}
}
// Remove the implementation of the io.ReadWriteCloser and only implement
// the io.ReadCloser.
- return struct{ io.ReadCloser }{&wrappedBody{span: span, body: body}}
+ return struct{ io.ReadCloser }{&wrappedBody{span: span, record: record, body: body}}
}
// wrappedBody is the response body type returned by the transport
@@ -153,8 +218,11 @@ func newWrappedBody(span trace.Span, body io.ReadCloser) io.ReadCloser {
// If the response body implements the io.Writer interface (i.e. for
// successful protocol switches), the wrapped body also will.
type wrappedBody struct {
- span trace.Span
- body io.ReadCloser
+ span trace.Span
+ recorded atomic.Bool
+ record func(n int64)
+ body io.ReadCloser
+ read atomic.Int64
}
var _ io.ReadWriteCloser = &wrappedBody{}
@@ -171,11 +239,14 @@ func (wb *wrappedBody) Write(p []byte) (int, error) {
func (wb *wrappedBody) Read(b []byte) (int, error) {
n, err := wb.body.Read(b)
+ // Record the number of bytes read
+ wb.read.Add(int64(n))
switch err {
case nil:
// nothing to do here but fall through to the return
case io.EOF:
+ wb.recordBytesRead()
wb.span.End()
default:
wb.span.RecordError(err)
@@ -184,7 +255,20 @@ func (wb *wrappedBody) Read(b []byte) (int, error) {
return n, err
}
+// recordBytesRead is a function that ensures the number of bytes read is recorded once and only once.
+func (wb *wrappedBody) recordBytesRead() {
+ // note: it is more performant (and equally correct) to use atomic.Bool over sync.Once here. In the event that
+ // two goroutines are racing to call this method, the number of bytes read will no longer increase. Using
+ // CompareAndSwap allows later goroutines to return quickly and not block waiting for the race winner to finish
+ // calling wb.record(wb.read.Load()).
+ if wb.recorded.CompareAndSwap(false, true) {
+ // Record the total number of bytes read
+ wb.record(wb.read.Load())
+ }
+}
+
func (wb *wrappedBody) Close() error {
+ wb.recordBytesRead()
wb.span.End()
if wb.body != nil {
return wb.body.Close()
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
index 8f3f53a958..b0957f28ce 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
@@ -1,22 +1,11 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
// Version is the current release version of the otelhttp instrumentation.
func Version() string {
- return "0.44.0"
+ return "0.53.0"
// This string is updated by the pre_release.sh script during release
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
index 11a35ed167..948f8406c0 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -18,6 +7,7 @@ import (
"context"
"io"
"net/http"
+ "sync/atomic"
"go.opentelemetry.io/otel/propagation"
)
@@ -30,14 +20,14 @@ type bodyWrapper struct {
io.ReadCloser
record func(n int64) // must not be nil
- read int64
+ read atomic.Int64
err error
}
func (w *bodyWrapper) Read(b []byte) (int, error) {
n, err := w.ReadCloser.Read(b)
n1 := int64(n)
- w.read += n1
+ w.read.Add(n1)
w.err = err
w.record(n1)
return n, err
@@ -97,3 +87,13 @@ func (w *respWriterWrapper) WriteHeader(statusCode int) {
}
w.ResponseWriter.WriteHeader(statusCode)
}
+
+func (w *respWriterWrapper) Flush() {
+ if !w.wroteHeader {
+ w.WriteHeader(http.StatusOK)
+ }
+
+ if f, ok := w.ResponseWriter.(http.Flusher); ok {
+ f.Flush()
+ }
+}
diff --git a/vendor/go.opentelemetry.io/otel/.codespellignore b/vendor/go.opentelemetry.io/otel/.codespellignore
index ae6a3bcf12..6bf3abc41e 100644
--- a/vendor/go.opentelemetry.io/otel/.codespellignore
+++ b/vendor/go.opentelemetry.io/otel/.codespellignore
@@ -3,3 +3,7 @@ fo
te
collison
consequentially
+ans
+nam
+valu
+thirdparty
diff --git a/vendor/go.opentelemetry.io/otel/.codespellrc b/vendor/go.opentelemetry.io/otel/.codespellrc
index 4afbb1fb3b..e2cb3ea944 100644
--- a/vendor/go.opentelemetry.io/otel/.codespellrc
+++ b/vendor/go.opentelemetry.io/otel/.codespellrc
@@ -5,6 +5,6 @@ check-filenames =
check-hidden =
ignore-words = .codespellignore
interactive = 1
-skip = .git,go.mod,go.sum,semconv,venv,.tools
+skip = .git,go.mod,go.sum,go.work,go.work.sum,semconv,venv,.tools
uri-ignore-words-list = *
write =
diff --git a/vendor/go.opentelemetry.io/otel/.gitignore b/vendor/go.opentelemetry.io/otel/.gitignore
index f3355c852b..895c7664be 100644
--- a/vendor/go.opentelemetry.io/otel/.gitignore
+++ b/vendor/go.opentelemetry.io/otel/.gitignore
@@ -14,12 +14,9 @@ go.work.sum
gen/
/example/dice/dice
-/example/fib/fib
-/example/fib/traces.txt
-/example/jaeger/jaeger
/example/namedtracer/namedtracer
+/example/otel-collector/otel-collector
/example/opencensus/opencensus
/example/passthrough/passthrough
/example/prometheus/prometheus
/example/zipkin/zipkin
-/example/otel-collector/otel-collector
diff --git a/vendor/go.opentelemetry.io/otel/.gitmodules b/vendor/go.opentelemetry.io/otel/.gitmodules
deleted file mode 100644
index 38a1f56982..0000000000
--- a/vendor/go.opentelemetry.io/otel/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "opentelemetry-proto"]
- path = exporters/otlp/internal/opentelemetry-proto
- url = https://github.com/open-telemetry/opentelemetry-proto
diff --git a/vendor/go.opentelemetry.io/otel/.golangci.yml b/vendor/go.opentelemetry.io/otel/.golangci.yml
index 6e8eeec00f..6d9c8b6495 100644
--- a/vendor/go.opentelemetry.io/otel/.golangci.yml
+++ b/vendor/go.opentelemetry.io/otel/.golangci.yml
@@ -11,17 +11,22 @@ linters:
enable:
- depguard
- errcheck
+ - errorlint
- godot
- - gofmt
+ - gofumpt
- goimports
+ - gosec
- gosimple
- govet
- ineffassign
- misspell
- revive
- staticcheck
+ - tenv
- typecheck
+ - unconvert
- unused
+ - unparam
issues:
# Maximum issues count per one linter.
@@ -53,6 +58,20 @@ issues:
text: "calls to (.+) only in main[(][)] or init[(][)] functions"
linters:
- revive
+ # It's okay to not run gosec in a test.
+ - path: _test\.go
+ linters:
+ - gosec
+ # Igonoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand)
+ # as we commonly use it in tests and examples.
+ - text: "G404:"
+ linters:
+ - gosec
+ # Igonoring gosec G402: TLS MinVersion too low
+ # as the https://pkg.go.dev/crypto/tls#Config handles MinVersion default well.
+ - text: "G402: TLS MinVersion too low."
+ linters:
+ - gosec
include:
# revive exported should have comment or be unexported.
- EXC0012
@@ -109,6 +128,8 @@ linters-settings:
- "**/example/**/*.go"
- "**/trace/*.go"
- "**/trace/**/*.go"
+ - "**/log/*.go"
+ - "**/log/**/*.go"
deny:
- pkg: "go.opentelemetry.io/otel/internal$"
desc: Do not use cross-module internal packages.
diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
index 3e5c35b5dc..c01e6998e0 100644
--- a/vendor/go.opentelemetry.io/otel/CHANGELOG.md
+++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
@@ -8,6 +8,353 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]
+## [1.28.0/0.50.0/0.4.0] 2024-07-02
+
+### Added
+
+- The `IsEmpty` method is added to the `Instrument` type in `go.opentelemetry.io/otel/sdk/metric`.
+ This method is used to check if an `Instrument` instance is a zero-value. (#5431)
+- Store and provide the emitted `context.Context` in `ScopeRecords` of `go.opentelemetry.io/otel/sdk/log/logtest`. (#5468)
+- The `go.opentelemetry.io/otel/semconv/v1.26.0` package.
+ The package contains semantic conventions from the `v1.26.0` version of the OpenTelemetry Semantic Conventions. (#5476)
+- The `AssertRecordEqual` method to `go.opentelemetry.io/otel/log/logtest` to allow comparison of two log records in tests. (#5499)
+- The `WithHeaders` option to `go.opentelemetry.io/otel/exporters/zipkin` to allow configuring custom http headers while exporting spans. (#5530)
+
+### Changed
+
+- `Tracer.Start` in `go.opentelemetry.io/otel/trace/noop` no longer allocates a span for empty span context. (#5457)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/example/otel-collector`. (#5490)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/example/zipkin`. (#5490)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/exporters/zipkin`. (#5490)
+ - The exporter no longer exports the deprecated "otel.library.name" or "otel.library.version" attributes.
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/sdk/resource`. (#5490)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/sdk/trace`. (#5490)
+- `SimpleProcessor.OnEmit` in `go.opentelemetry.io/otel/sdk/log` no longer allocates a slice which makes it possible to have a zero-allocation log processing using `SimpleProcessor`. (#5493)
+- Use non-generic functions in the `Start` method of `"go.opentelemetry.io/otel/sdk/trace".Trace` to reduce memory allocation. (#5497)
+- `service.instance.id` is populated for a `Resource` created with `"go.opentelemetry.io/otel/sdk/resource".Default` with a default value when `OTEL_GO_X_RESOURCE` is set. (#5520)
+- Improve performance of metric instruments in `go.opentelemetry.io/otel/sdk/metric` by removing unnecessary calls to `time.Now`. (#5545)
+
+### Fixed
+
+- Log a warning to the OpenTelemetry internal logger when a `Record` in `go.opentelemetry.io/otel/sdk/log` drops an attribute due to a limit being reached. (#5376)
+- Identify the `Tracer` returned from the global `TracerProvider` in `go.opentelemetry.io/otel/global` with its schema URL. (#5426)
+- Identify the `Meter` returned from the global `MeterProvider` in `go.opentelemetry.io/otel/global` with its schema URL. (#5426)
+- Log a warning to the OpenTelemetry internal logger when a `Span` in `go.opentelemetry.io/otel/sdk/trace` drops an attribute, event, or link due to a limit being reached. (#5434)
+- Document instrument name requirements in `go.opentelemetry.io/otel/metric`. (#5435)
+- Prevent random number generation data-race for experimental rand exemplars in `go.opentelemetry.io/otel/sdk/metric`. (#5456)
+- Fix counting number of dropped attributes of `Record` in `go.opentelemetry.io/otel/sdk/log`. (#5464)
+- Fix panic in baggage creation when a member contains `0x80` char in key or value. (#5494)
+- Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#5508)
+- Retry trace and span ID generation if it generated an invalid one in `go.opentelemetry.io/otel/sdk/trace`. (#5514)
+- Fix stale timestamps reported by the last-value aggregation. (#5517)
+- Indicate the `Exporter` in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` must be created by the `New` method. (#5521)
+- Improved performance in all `{Bool,Int64,Float64,String}SliceValue` functions of `go.opentelemetry.io/attributes` by reducing the number of allocations. (#5549)
+
+## [1.27.0/0.49.0/0.3.0] 2024-05-21
+
+### Added
+
+- Add example for `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#5242)
+- Add `RecordFactory` in `go.opentelemetry.io/otel/sdk/log/logtest` to facilitate testing exporter and processor implementations. (#5258)
+- Add `RecordFactory` in `go.opentelemetry.io/otel/log/logtest` to facilitate testing bridge implementations. (#5263)
+- The count of dropped records from the `BatchProcessor` in `go.opentelemetry.io/otel/sdk/log` is logged. (#5276)
+- Add metrics in the `otel-collector` example. (#5283)
+- Add the synchronous gauge instrument to `go.opentelemetry.io/otel/metric`. (#5304)
+ - An `int64` or `float64` synchronous gauge instrument can now be created from a `Meter`.
+ - All implementations of the API (`go.opentelemetry.io/otel/metric/noop`, `go.opentelemetry.io/otel/sdk/metric`) are updated to support this instrument.
+- Add logs to `go.opentelemetry.io/otel/example/dice`. (#5349)
+
+### Changed
+
+- The `Shutdown` method of `Exporter` in `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` ignores the context cancellation and always returns `nil`. (#5189)
+- The `ForceFlush` and `Shutdown` methods of the exporter returned by `New` in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` ignore the context cancellation and always return `nil`. (#5189)
+- Apply the value length limits to `Record` attributes in `go.opentelemetry.io/otel/sdk/log`. (#5230)
+- De-duplicate map attributes added to a `Record` in `go.opentelemetry.io/otel/sdk/log`. (#5230)
+- `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` won't print timestamps when `WithoutTimestamps` option is set. (#5241)
+- The `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` exporter won't print `AttributeValueLengthLimit` and `AttributeCountLimit` fields now, instead it prints the `DroppedAttributes` field. (#5272)
+- Improved performance in the `Stringer` implementation of `go.opentelemetry.io/otel/baggage.Member` by reducing the number of allocations. (#5286)
+- Set the start time for last-value aggregates in `go.opentelemetry.io/otel/sdk/metric`. (#5305)
+- The `Span` in `go.opentelemetry.io/otel/sdk/trace` will record links without span context if either non-empty `TraceState` or attributes are provided. (#5315)
+- Upgrade all dependencies of `go.opentelemetry.io/otel/semconv/v1.24.0` to `go.opentelemetry.io/otel/semconv/v1.25.0`. (#5374)
+
+### Fixed
+
+- Comparison of unordered maps for `go.opentelemetry.io/otel/log.KeyValue` and `go.opentelemetry.io/otel/log.Value`. (#5306)
+- Fix the empty output of `go.opentelemetry.io/otel/log.Value` in `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#5311)
+- Split the behavior of `Recorder` in `go.opentelemetry.io/otel/log/logtest` so it behaves as a `LoggerProvider` only. (#5365)
+- Fix wrong package name of the error message when parsing endpoint URL in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5371)
+- Identify the `Logger` returned from the global `LoggerProvider` in `go.opentelemetry.io/otel/log/global` with its schema URL. (#5375)
+
+## [1.26.0/0.48.0/0.2.0-alpha] 2024-04-24
+
+### Added
+
+- Add `Recorder` in `go.opentelemetry.io/otel/log/logtest` to facilitate testing the log bridge implementations. (#5134)
+- Add span flags to OTLP spans and links exported by `go.opentelemetry.io/otel/exporters/otlp/otlptrace`. (#5194)
+- Make the initial alpha release of `go.opentelemetry.io/otel/sdk/log`.
+ This new module contains the Go implementation of the OpenTelemetry Logs SDK.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- Make the initial alpha release of `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`.
+ This new module contains an OTLP exporter that transmits log telemetry using HTTP.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- Make the initial alpha release of `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`.
+ This new module contains an exporter prints log records to STDOUT.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- The `go.opentelemetry.io/otel/semconv/v1.25.0` package.
+ The package contains semantic conventions from the `v1.25.0` version of the OpenTelemetry Semantic Conventions. (#5254)
+
+### Changed
+
+- Update `go.opentelemetry.io/proto/otlp` from v1.1.0 to v1.2.0. (#5177)
+- Improve performance of baggage member character validation in `go.opentelemetry.io/otel/baggage`. (#5214)
+- The `otel-collector` example now uses docker compose to bring up services instead of kubernetes. (#5244)
+
+### Fixed
+
+- Slice attribute values in `go.opentelemetry.io/otel/attribute` are now emitted as their JSON representation. (#5159)
+
+## [1.25.0/0.47.0/0.0.8/0.1.0-alpha] 2024-04-05
+
+### Added
+
+- Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4906)
+- Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp`. (#4906)
+- Add `AddLink` method to the `Span` interface in `go.opentelemetry.io/otel/trace`. (#5032)
+- The `Enabled` method is added to the `Logger` interface in `go.opentelemetry.io/otel/log`.
+ This method is used to notify users if a log record will be emitted or not. (#5071)
+- Add `SeverityUndefined` `const` to `go.opentelemetry.io/otel/log`.
+ This value represents an unset severity level. (#5072)
+- Add `Empty` function in `go.opentelemetry.io/otel/log` to return a `KeyValue` for an empty value. (#5076)
+- Add `go.opentelemetry.io/otel/log/global` to manage the global `LoggerProvider`.
+ This package is provided with the anticipation that all functionality will be migrate to `go.opentelemetry.io/otel` when `go.opentelemetry.io/otel/log` stabilizes.
+ At which point, users will be required to migrage their code, and this package will be deprecated then removed. (#5085)
+- Add support for `Summary` metrics in the `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` exporters. (#5100)
+- Add `otel.scope.name` and `otel.scope.version` tags to spans exported by `go.opentelemetry.io/otel/exporters/zipkin`. (#5108)
+- Add support for `AddLink` to `go.opentelemetry.io/otel/bridge/opencensus`. (#5116)
+- Add `String` method to `Value` and `KeyValue` in `go.opentelemetry.io/otel/log`. (#5117)
+- Add Exemplar support to `go.opentelemetry.io/otel/exporters/prometheus`. (#5111)
+- Add metric semantic conventions to `go.opentelemetry.io/otel/semconv/v1.24.0`. Future `semconv` packages will include metric semantic conventions as well. (#4528)
+
+### Changed
+
+- `SpanFromContext` and `SpanContextFromContext` in `go.opentelemetry.io/otel/trace` no longer make a heap allocation when the passed context has no span. (#5049)
+- `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` now create a gRPC client in idle mode and with "dns" as the default resolver using [`grpc.NewClient`](https://pkg.go.dev/google.golang.org/grpc#NewClient). (#5151)
+ Because of that `WithDialOption` ignores [`grpc.WithBlock`](https://pkg.go.dev/google.golang.org/grpc#WithBlock), [`grpc.WithTimeout`](https://pkg.go.dev/google.golang.org/grpc#WithTimeout), and [`grpc.WithReturnConnectionError`](https://pkg.go.dev/google.golang.org/grpc#WithReturnConnectionError).
+ Notice that [`grpc.DialContext`](https://pkg.go.dev/google.golang.org/grpc#DialContext) which was used before is now deprecated.
+
+### Fixed
+
+- Clarify the documentation about equivalence guarantees for the `Set` and `Distinct` types in `go.opentelemetry.io/otel/attribute`. (#5027)
+- Prevent default `ErrorHandler` self-delegation. (#5137)
+- Update all dependencies to address [GO-2024-2687]. (#5139)
+
+### Removed
+
+- Drop support for [Go 1.20]. (#4967)
+
+### Deprecated
+
+- Deprecate `go.opentelemetry.io/otel/attribute.Sortable` type. (#4734)
+- Deprecate `go.opentelemetry.io/otel/attribute.NewSetWithSortable` function. (#4734)
+- Deprecate `go.opentelemetry.io/otel/attribute.NewSetWithSortableFiltered` function. (#4734)
+
+## [1.24.0/0.46.0/0.0.1-alpha] 2024-02-23
+
+This release is the last to support [Go 1.20].
+The next release will require at least [Go 1.21].
+
+### Added
+
+- Support [Go 1.22]. (#4890)
+- Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4900)
+- Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4900)
+- The `go.opentelemetry.io/otel/log` module is added.
+ This module includes OpenTelemetry Go's implementation of the Logs Bridge API.
+ This module is in an alpha state, it is subject to breaking changes.
+ See our [versioning policy](./VERSIONING.md) for more info. (#4961)
+- ARM64 platform to the compatibility testing suite. (#4994)
+
+### Fixed
+
+- Fix registration of multiple callbacks when using the global meter provider from `go.opentelemetry.io/otel`. (#4945)
+- Fix negative buckets in output of exponential histograms. (#4956)
+
+## [1.23.1] 2024-02-07
+
+### Fixed
+
+- Register all callbacks passed during observable instrument creation instead of just the last one multiple times in `go.opentelemetry.io/otel/sdk/metric`. (#4888)
+
+## [1.23.0] 2024-02-06
+
+This release contains the first stable, `v1`, release of the following modules:
+
+- `go.opentelemetry.io/otel/bridge/opencensus`
+- `go.opentelemetry.io/otel/bridge/opencensus/test`
+- `go.opentelemetry.io/otel/example/opencensus`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`
+- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric`
+
+See our [versioning policy](VERSIONING.md) for more information about these stability guarantees.
+
+### Added
+
+- Add `WithEndpointURL` option to the `exporters/otlp/otlpmetric/otlpmetricgrpc`, `exporters/otlp/otlpmetric/otlpmetrichttp`, `exporters/otlp/otlptrace/otlptracegrpc` and `exporters/otlp/otlptrace/otlptracehttp` packages. (#4808)
+- Experimental exemplar exporting is added to the metric SDK.
+ See [metric documentation](./sdk/metric/internal/x/README.md#exemplars) for more information about this feature and how to enable it. (#4871)
+- `ErrSchemaURLConflict` is added to `go.opentelemetry.io/otel/sdk/resource`.
+ This error is returned when a merge of two `Resource`s with different (non-empty) schema URL is attempted. (#4876)
+
+### Changed
+
+- The `Merge` and `New` functions in `go.opentelemetry.io/otel/sdk/resource` now returns a partial result if there is a schema URL merge conflict.
+ Instead of returning `nil` when two `Resource`s with different (non-empty) schema URLs are merged the merged `Resource`, along with the new `ErrSchemaURLConflict` error, is returned.
+ It is up to the user to decide if they want to use the returned `Resource` or not.
+ It may have desired attributes overwritten or include stale semantic conventions. (#4876)
+
+### Fixed
+
+- Fix `ContainerID` resource detection on systemd when cgroup path has a colon. (#4449)
+- Fix `go.opentelemetry.io/otel/sdk/metric` to cache instruments to avoid leaking memory when the same instrument is created multiple times. (#4820)
+- Fix missing `Mix` and `Max` values for `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` by introducing `MarshalText` and `MarshalJSON` for the `Extrema` type in `go.opentelemetry.io/sdk/metric/metricdata`. (#4827)
+
+## [1.23.0-rc.1] 2024-01-18
+
+This is a release candidate for the v1.23.0 release.
+That release is expected to include the `v1` release of the following modules:
+
+- `go.opentelemetry.io/otel/bridge/opencensus`
+- `go.opentelemetry.io/otel/bridge/opencensus/test`
+- `go.opentelemetry.io/otel/example/opencensus`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`
+- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric`
+
+See our [versioning policy](VERSIONING.md) for more information about these stability guarantees.
+
+## [1.22.0/0.45.0] 2024-01-17
+
+### Added
+
+- The `go.opentelemetry.io/otel/semconv/v1.22.0` package.
+ The package contains semantic conventions from the `v1.22.0` version of the OpenTelemetry Semantic Conventions. (#4735)
+- The `go.opentelemetry.io/otel/semconv/v1.23.0` package.
+ The package contains semantic conventions from the `v1.23.0` version of the OpenTelemetry Semantic Conventions. (#4746)
+- The `go.opentelemetry.io/otel/semconv/v1.23.1` package.
+ The package contains semantic conventions from the `v1.23.1` version of the OpenTelemetry Semantic Conventions. (#4749)
+- The `go.opentelemetry.io/otel/semconv/v1.24.0` package.
+ The package contains semantic conventions from the `v1.24.0` version of the OpenTelemetry Semantic Conventions. (#4770)
+- Add `WithResourceAsConstantLabels` option to apply resource attributes for every metric emitted by the Prometheus exporter. (#4733)
+- Experimental cardinality limiting is added to the metric SDK.
+ See [metric documentation](./sdk/metric/internal/x/README.md#cardinality-limit) for more information about this feature and how to enable it. (#4457)
+- Add `NewMemberRaw` and `NewKeyValuePropertyRaw` in `go.opentelemetry.io/otel/baggage`. (#4804)
+
+### Changed
+
+- Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.24.0`. (#4754)
+- Update transformations in `go.opentelemetry.io/otel/exporters/zipkin` to follow `v1.24.0` version of the OpenTelemetry specification. (#4754)
+- Record synchronous measurements when the passed context is canceled instead of dropping in `go.opentelemetry.io/otel/sdk/metric`.
+ If you do not want to make a measurement when the context is cancelled, you need to handle it yourself (e.g `if ctx.Err() != nil`). (#4671)
+- Improve `go.opentelemetry.io/otel/trace.TraceState`'s performance. (#4722)
+- Improve `go.opentelemetry.io/otel/propagation.TraceContext`'s performance. (#4721)
+- Improve `go.opentelemetry.io/otel/baggage` performance. (#4743)
+- Improve performance of the `(*Set).Filter` method in `go.opentelemetry.io/otel/attribute` when the passed filter does not filter out any attributes from the set. (#4774)
+- `Member.String` in `go.opentelemetry.io/otel/baggage` percent-encodes only when necessary. (#4775)
+- Improve `go.opentelemetry.io/otel/trace.Span`'s performance when adding multiple attributes. (#4818)
+- `Property.Value` in `go.opentelemetry.io/otel/baggage` now returns a raw string instead of a percent-encoded value. (#4804)
+
+### Fixed
+
+- Fix `Parse` in `go.opentelemetry.io/otel/baggage` to validate member value before percent-decoding. (#4755)
+- Fix whitespace encoding of `Member.String` in `go.opentelemetry.io/otel/baggage`. (#4756)
+- Fix observable not registered error when the asynchronous instrument has a drop aggregation in `go.opentelemetry.io/otel/sdk/metric`. (#4772)
+- Fix baggage item key so that it is not canonicalized in `go.opentelemetry.io/otel/bridge/opentracing`. (#4776)
+- Fix `go.opentelemetry.io/otel/bridge/opentracing` to properly handle baggage values that requires escaping during propagation. (#4804)
+- Fix a bug where using multiple readers resulted in incorrect asynchronous counter values in `go.opentelemetry.io/otel/sdk/metric`. (#4742)
+
+## [1.21.0/0.44.0] 2023-11-16
+
+### Removed
+
+- Remove the deprecated `go.opentelemetry.io/otel/bridge/opencensus.NewTracer`. (#4706)
+- Remove the deprecated `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` module. (#4707)
+- Remove the deprecated `go.opentelemetry.io/otel/example/view` module. (#4708)
+- Remove the deprecated `go.opentelemetry.io/otel/example/fib` module. (#4723)
+
+### Fixed
+
+- Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4719)
+- Do not parse non-protobuf responses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4719)
+
+## [1.20.0/0.43.0] 2023-11-10
+
+This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementers need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this.
+
+### Added
+
+- Add `go.opentelemetry.io/otel/bridge/opencensus.InstallTraceBridge`, which installs the OpenCensus trace bridge, and replaces `opencensus.NewTracer`. (#4567)
+- Add scope version to trace and metric bridges in `go.opentelemetry.io/otel/bridge/opencensus`. (#4584)
+- Add the `go.opentelemetry.io/otel/trace/embedded` package to be embedded in the exported trace API interfaces. (#4620)
+- Add the `go.opentelemetry.io/otel/trace/noop` package as a default no-op implementation of the trace API. (#4620)
+- Add context propagation in `go.opentelemetry.io/otel/example/dice`. (#4644)
+- Add view configuration to `go.opentelemetry.io/otel/example/prometheus`. (#4649)
+- Add `go.opentelemetry.io/otel/metric.WithExplicitBucketBoundaries`, which allows defining default explicit bucket boundaries when creating histogram instruments. (#4603)
+- Add `Version` function in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4660)
+- Add `Version` function in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4660)
+- Add Summary, SummaryDataPoint, and QuantileValue to `go.opentelemetry.io/sdk/metric/metricdata`. (#4622)
+- `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` now supports exemplars from OpenCensus. (#4585)
+- Add support for `WithExplicitBucketBoundaries` in `go.opentelemetry.io/otel/sdk/metric`. (#4605)
+- Add support for Summary metrics in `go.opentelemetry.io/otel/bridge/opencensus`. (#4668)
+
+### Deprecated
+
+- Deprecate `go.opentelemetry.io/otel/bridge/opencensus.NewTracer` in favor of `opencensus.InstallTraceBridge`. (#4567)
+- Deprecate `go.opentelemetry.io/otel/example/fib` package is in favor of `go.opentelemetry.io/otel/example/dice`. (#4618)
+- Deprecate `go.opentelemetry.io/otel/trace.NewNoopTracerProvider`.
+ Use the added `NewTracerProvider` function in `go.opentelemetry.io/otel/trace/noop` instead. (#4620)
+- Deprecate `go.opentelemetry.io/otel/example/view` package in favor of `go.opentelemetry.io/otel/example/prometheus`. (#4649)
+- Deprecate `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4693)
+
+### Changed
+
+- `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` returns a `*MetricProducer` struct instead of the metric.Producer interface. (#4583)
+- The `TracerProvider` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.TracerProvider` type.
+ This extends the `TracerProvider` interface and is is a breaking change for any existing implementation.
+ Implementers need to update their implementations based on what they want the default behavior of the interface to be.
+ See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620)
+- The `Tracer` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Tracer` type.
+ This extends the `Tracer` interface and is is a breaking change for any existing implementation.
+ Implementers need to update their implementations based on what they want the default behavior of the interface to be.
+ See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620)
+- The `Span` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Span` type.
+ This extends the `Span` interface and is is a breaking change for any existing implementation.
+ Implementers need to update their implementations based on what they want the default behavior of the interface to be.
+ See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620)
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660)
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660)
+- Retry for `502 Bad Gateway` and `504 Gateway Timeout` HTTP statuses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4670)
+- Retry for `502 Bad Gateway` and `504 Gateway Timeout` HTTP statuses in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4670)
+- Retry for `RESOURCE_EXHAUSTED` only if RetryInfo is returned in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4669)
+- Retry for `RESOURCE_EXHAUSTED` only if RetryInfo is returned in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#4669)
+- Retry temporary HTTP request failures in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4679)
+- Retry temporary HTTP request failures in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#4679)
+
+### Fixed
+
+- Fix improper parsing of characters such us `+`, `/` by `Parse` in `go.opentelemetry.io/otel/baggage` as they were rendered as a whitespace. (#4667)
+- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_RESOURCE_ATTRIBUTES` in `go.opentelemetry.io/otel/sdk/resource` as they were rendered as a whitespace. (#4699)
+- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` as they were rendered as a whitespace. (#4699)
+- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_METRICS_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` as they were rendered as a whitespace. (#4699)
+- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracegrpc` as they were rendered as a whitespace. (#4699)
+- Fix improper parsing of characters such us `+`, `/` passed via `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_EXPORTER_OTLP_TRACES_HEADERS` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp` as they were rendered as a whitespace. (#4699)
+- In `go.opentelemetry.op/otel/exporters/prometheus`, the exporter no longer `Collect`s metrics after `Shutdown` is invoked. (#4648)
+- Fix documentation for `WithCompressor` in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#4695)
+- Fix documentation for `WithCompressor` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4695)
+
## [1.19.0/0.42.0/0.0.7] 2023-09-28
This release contains the first stable release of the OpenTelemetry Go [metric SDK].
@@ -621,7 +968,7 @@ The next release will require at least [Go 1.19].
- Exported `Status` codes in the `go.opentelemetry.io/otel/exporters/zipkin` exporter are now exported as all upper case values. (#3340)
- `Aggregation`s from `go.opentelemetry.io/otel/sdk/metric` with no data are not exported. (#3394, #3436)
- Re-enabled Attribute Filters in the Metric SDK. (#3396)
-- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggragation. (#3408)
+- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggregation. (#3408)
- Do not report empty partial-success responses in the `go.opentelemetry.io/otel/exporters/otlp` exporters. (#3438, #3432)
- Handle partial success responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` exporters. (#3162, #3440)
- Prevent duplicate Prometheus description, unit, and type. (#3469)
@@ -1666,7 +2013,7 @@ with major version 0.
- `NewExporter` from `exporters/otlp` now takes a `ProtocolDriver` as a parameter. (#1369)
- Many OTLP Exporter options became gRPC ProtocolDriver options. (#1369)
- Unify endpoint API that related to OTel exporter. (#1401)
-- Optimize metric histogram aggregator to re-use its slice of buckets. (#1435)
+- Optimize metric histogram aggregator to reuse its slice of buckets. (#1435)
- Metric aggregator Count() and histogram Bucket.Counts are consistently `uint64`. (1430)
- Histogram aggregator accepts functional options, uses default boundaries if none given. (#1434)
- `SamplingResult` now passed a `Tracestate` from the parent `SpanContext` (#1432)
@@ -2656,7 +3003,18 @@ It contains api and sdk for trace and meter.
- CircleCI build CI manifest files.
- CODEOWNERS file to track owners of this project.
-[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.19.0...HEAD
+[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.28.0...HEAD
+[1.28.0/0.50.0/0.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.28.0
+[1.27.0/0.49.0/0.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.27.0
+[1.26.0/0.48.0/0.2.0-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.26.0
+[1.25.0/0.47.0/0.0.8/0.1.0-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.25.0
+[1.24.0/0.46.0/0.0.1-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.24.0
+[1.23.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.1
+[1.23.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0
+[1.23.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0-rc.1
+[1.22.0/0.45.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.22.0
+[1.21.0/0.44.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.21.0
+[1.20.0/0.43.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.20.0
[1.19.0/0.42.0/0.0.7]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0
[1.19.0-rc.1/0.42.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0-rc.1
[1.18.0/0.41.0/0.0.6]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.18.0
@@ -2728,10 +3086,14 @@ It contains api and sdk for trace and meter.
[0.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.1
[0.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.0
+[Go 1.22]: https://go.dev/doc/go1.22
+[Go 1.21]: https://go.dev/doc/go1.21
[Go 1.20]: https://go.dev/doc/go1.20
[Go 1.19]: https://go.dev/doc/go1.19
[Go 1.18]: https://go.dev/doc/go1.18
-[Go 1.19]: https://go.dev/doc/go1.19
[metric API]:https://pkg.go.dev/go.opentelemetry.io/otel/metric
[metric SDK]:https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric
+[trace API]:https://pkg.go.dev/go.opentelemetry.io/otel/trace
+
+[GO-2024-2687]: https://pkg.go.dev/vuln/GO-2024-2687
diff --git a/vendor/go.opentelemetry.io/otel/CODEOWNERS b/vendor/go.opentelemetry.io/otel/CODEOWNERS
index 623740007d..2025549332 100644
--- a/vendor/go.opentelemetry.io/otel/CODEOWNERS
+++ b/vendor/go.opentelemetry.io/otel/CODEOWNERS
@@ -12,6 +12,6 @@
# https://help.github.com/en/articles/about-code-owners
#
-* @MrAlias @Aneurysm9 @evantorrie @XSAM @dashpole @MadVikingGod @pellared @hanyuancheung @dmathieu
+* @MrAlias @XSAM @dashpole @MadVikingGod @pellared @hanyuancheung @dmathieu
-CODEOWNERS @MrAlias @MadVikingGod @pellared
\ No newline at end of file
+CODEOWNERS @MrAlias @MadVikingGod @pellared @dashpole @XSAM @dmathieu
diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
index a00dbca7b0..b86572f58e 100644
--- a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
+++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
@@ -90,6 +90,10 @@ git push
Open a pull request against the main `opentelemetry-go` repo. Be sure to add the pull
request ID to the entry you added to `CHANGELOG.md`.
+Avoid rebasing and force-pushing to your branch to facilitate reviewing the pull request.
+Rewriting Git history makes it difficult to keep track of iterations during code review.
+All pull requests are squashed to a single commit upon merge to `main`.
+
### How to Receive Comments
* If the PR is not ready for review, please put `[WIP]` in the title,
@@ -197,6 +201,16 @@ You can install and run a "local Go Doc site" in the following way:
[`go.opentelemetry.io/otel/metric`](https://pkg.go.dev/go.opentelemetry.io/otel/metric)
is an example of a very well-documented package.
+### README files
+
+Each (non-internal, non-test, non-documentation) package must contain a
+`README.md` file containing at least a title, and a `pkg.go.dev` badge.
+
+The README should not be a repetition of Go doc comments.
+
+You can verify the presence of all README files with the `make verify-readmes`
+command.
+
## Style Guide
One of the primary goals of this project is that it is actually used by
@@ -556,6 +570,9 @@ functionality should be added, each one will need their own super-set
interfaces and will duplicate the pattern. For this reason, the simple targeted
interface that defines the specific functionality should be preferred.
+See also:
+[Keeping Your Modules Compatible: Working with interfaces](https://go.dev/blog/module-compatibility#working-with-interfaces).
+
### Testing
The tests should never leak goroutines.
@@ -587,27 +604,48 @@ this.
[^3]: https://github.com/open-telemetry/opentelemetry-go/issues/3548
+### Ignoring context cancellation
+
+OpenTelemetry API implementations need to ignore the cancellation of the context that are
+passed when recording a value (e.g. starting a span, recording a measurement, emitting a log).
+Recording methods should not return an error describing the cancellation state of the context
+when they complete, nor should they abort any work.
+
+This rule may not apply if the OpenTelemetry specification defines a timeout mechanism for
+the method. In that case the context cancellation can be used for the timeout with the
+restriction that this behavior is documented for the method. Otherwise, timeouts
+are expected to be handled by the user calling the API, not the implementation.
+
+Stoppage of the telemetry pipeline is handled by calling the appropriate `Shutdown` method
+of a provider. It is assumed the context passed from a user is not used for this purpose.
+
+Outside of the direct recording of telemetry from the API (e.g. exporting telemetry,
+force flushing telemetry, shutting down a signal provider) the context cancellation
+should be honored. This means all work done on behalf of the user provided context
+should be canceled.
+
## Approvers and Maintainers
### Approvers
-- [Evan Torrie](https://github.com/evantorrie), Verizon Media
-- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics
-- [David Ashpole](https://github.com/dashpole), Google
- [Chester Cheung](https://github.com/hanyuancheung), Tencent
-- [Damien Mathieu](https://github.com/dmathieu), Elastic
-- [Anthony Mirabella](https://github.com/Aneurysm9), AWS
### Maintainers
- [Aaron Clawson](https://github.com/MadVikingGod), LightStep
+- [Damien Mathieu](https://github.com/dmathieu), Elastic
+- [David Ashpole](https://github.com/dashpole), Google
- [Robert Pająk](https://github.com/pellared), Splunk
+- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics
- [Tyler Yahn](https://github.com/MrAlias), Splunk
### Emeritus
+- [Liz Fong-Jones](https://github.com/lizthegrey), Honeycomb
- [Gustavo Silva Paiva](https://github.com/paivagustavo), LightStep
- [Josh MacDonald](https://github.com/jmacd), LightStep
+- [Anthony Mirabella](https://github.com/Aneurysm9), AWS
+- [Evan Torrie](https://github.com/evantorrie), Yahoo
### Become an Approver or a Maintainer
diff --git a/vendor/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile
index 5c311706b0..f33619f76a 100644
--- a/vendor/go.opentelemetry.io/otel/Makefile
+++ b/vendor/go.opentelemetry.io/otel/Makefile
@@ -1,16 +1,5 @@
# Copyright The OpenTelemetry Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
TOOLS_MOD_DIR := ./internal/tools
@@ -25,8 +14,8 @@ TIMEOUT = 60
.DEFAULT_GOAL := precommit
.PHONY: precommit ci
-precommit: generate dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix test-default
-ci: generate dependabot-check license-check lint vanity-import-check build test-default check-clean-work-tree test-coverage
+precommit: generate license-check misspell go-mod-tidy golangci-lint-fix verify-readmes verify-mods test-default
+ci: generate license-check lint vanity-import-check verify-readmes verify-mods build test-default check-clean-work-tree test-coverage
# Tools
@@ -34,7 +23,7 @@ TOOLS = $(CURDIR)/.tools
$(TOOLS):
@mkdir -p $@
-$(TOOLS)/%: | $(TOOLS)
+$(TOOLS)/%: $(TOOLS_MOD_DIR)/go.mod | $(TOOLS)
cd $(TOOLS_MOD_DIR) && \
$(GO) build -o $@ $(PACKAGE)
@@ -50,9 +39,6 @@ $(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/build-tools/crosslink
SEMCONVKIT = $(TOOLS)/semconvkit
$(TOOLS)/semconvkit: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/semconvkit
-DBOTCONF = $(TOOLS)/dbotconf
-$(TOOLS)/dbotconf: PACKAGE=go.opentelemetry.io/build-tools/dbotconf
-
GOLANGCI_LINT = $(TOOLS)/golangci-lint
$(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint
@@ -77,8 +63,11 @@ $(GOTMPL): PACKAGE=go.opentelemetry.io/build-tools/gotmpl
GORELEASE = $(TOOLS)/gorelease
$(GORELEASE): PACKAGE=golang.org/x/exp/cmd/gorelease
+GOVULNCHECK = $(TOOLS)/govulncheck
+$(TOOLS)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck
+
.PHONY: tools
-tools: $(CROSSLINK) $(DBOTCONF) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE)
+tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE)
# Virtualized python tools via docker
@@ -107,7 +96,7 @@ $(PYTOOLS):
@$(DOCKERPY) bash -c "python3 -m venv $(VENVDIR) && $(PIP) install --upgrade pip"
# Install python packages into the virtual environment.
-$(PYTOOLS)/%: | $(PYTOOLS)
+$(PYTOOLS)/%: $(PYTOOLS)
@$(DOCKERPY) $(PIP) install -r requirements.txt
CODESPELL = $(PYTOOLS)/codespell
@@ -121,18 +110,18 @@ generate: go-generate vanity-import-fix
.PHONY: go-generate
go-generate: $(OTEL_GO_MOD_DIRS:%=go-generate/%)
go-generate/%: DIR=$*
-go-generate/%: | $(STRINGER) $(GOTMPL)
+go-generate/%: $(STRINGER) $(GOTMPL)
@echo "$(GO) generate $(DIR)/..." \
&& cd $(DIR) \
&& PATH="$(TOOLS):$${PATH}" $(GO) generate ./...
.PHONY: vanity-import-fix
-vanity-import-fix: | $(PORTO)
+vanity-import-fix: $(PORTO)
@$(PORTO) --include-internal -w .
# Generate go.work file for local development.
.PHONY: go-work
-go-work: | $(CROSSLINK)
+go-work: $(CROSSLINK)
$(CROSSLINK) work --root=$(shell pwd)
# Build
@@ -175,7 +164,7 @@ test/%:
COVERAGE_MODE = atomic
COVERAGE_PROFILE = coverage.out
.PHONY: test-coverage
-test-coverage: | $(GOCOVMERGE)
+test-coverage: $(GOCOVMERGE)
@set -e; \
printf "" > coverage.txt; \
for dir in $(ALL_COVERAGE_MOD_DIRS); do \
@@ -189,45 +178,65 @@ test-coverage: | $(GOCOVMERGE)
done; \
$(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt
+# Adding a directory will include all benchmarks in that directory if a filter is not specified.
+BENCHMARK_TARGETS := sdk/trace
+.PHONY: benchmark
+benchmark: $(BENCHMARK_TARGETS:%=benchmark/%)
+BENCHMARK_FILTER = .
+# You can override the filter for a particular directory by adding a rule here.
+benchmark/sdk/trace: BENCHMARK_FILTER = SpanWithAttributes_8/AlwaysSample
+benchmark/%:
+ @echo "$(GO) test -timeout $(TIMEOUT)s -run=xxxxxMatchNothingxxxxx -bench=$(BENCHMARK_FILTER) $*..." \
+ && cd $* \
+ $(foreach filter, $(BENCHMARK_FILTER), && $(GO) test -timeout $(TIMEOUT)s -run=xxxxxMatchNothingxxxxx -bench=$(filter))
+
.PHONY: golangci-lint golangci-lint-fix
golangci-lint-fix: ARGS=--fix
golangci-lint-fix: golangci-lint
golangci-lint: $(OTEL_GO_MOD_DIRS:%=golangci-lint/%)
golangci-lint/%: DIR=$*
-golangci-lint/%: | $(GOLANGCI_LINT)
+golangci-lint/%: $(GOLANGCI_LINT)
@echo 'golangci-lint $(if $(ARGS),$(ARGS) ,)$(DIR)' \
&& cd $(DIR) \
&& $(GOLANGCI_LINT) run --allow-serial-runners $(ARGS)
.PHONY: crosslink
-crosslink: | $(CROSSLINK)
+crosslink: $(CROSSLINK)
@echo "Updating intra-repository dependencies in all go modules" \
&& $(CROSSLINK) --root=$(shell pwd) --prune
.PHONY: go-mod-tidy
go-mod-tidy: $(ALL_GO_MOD_DIRS:%=go-mod-tidy/%)
go-mod-tidy/%: DIR=$*
-go-mod-tidy/%: | crosslink
+go-mod-tidy/%: crosslink
@echo "$(GO) mod tidy in $(DIR)" \
&& cd $(DIR) \
- && $(GO) mod tidy -compat=1.20
+ && $(GO) mod tidy -compat=1.21
.PHONY: lint-modules
lint-modules: go-mod-tidy
.PHONY: lint
-lint: misspell lint-modules golangci-lint
+lint: misspell lint-modules golangci-lint govulncheck
.PHONY: vanity-import-check
-vanity-import-check: | $(PORTO)
+vanity-import-check: $(PORTO)
@$(PORTO) --include-internal -l . || ( echo "(run: make vanity-import-fix)"; exit 1 )
.PHONY: misspell
-misspell: | $(MISSPELL)
+misspell: $(MISSPELL)
@$(MISSPELL) -w $(ALL_DOCS)
+.PHONY: govulncheck
+govulncheck: $(OTEL_GO_MOD_DIRS:%=govulncheck/%)
+govulncheck/%: DIR=$*
+govulncheck/%: $(GOVULNCHECK)
+ @echo "govulncheck ./... in $(DIR)" \
+ && cd $(DIR) \
+ && $(GOVULNCHECK) ./...
+
.PHONY: codespell
-codespell: | $(CODESPELL)
+codespell: $(CODESPELL)
@$(DOCKERPY) $(CODESPELL)
.PHONY: license-check
@@ -240,15 +249,6 @@ license-check:
exit 1; \
fi
-DEPENDABOT_CONFIG = .github/dependabot.yml
-.PHONY: dependabot-check
-dependabot-check: | $(DBOTCONF)
- @$(DBOTCONF) verify $(DEPENDABOT_CONFIG) || ( echo "(run: make dependabot-generate)"; exit 1 )
-
-.PHONY: dependabot-generate
-dependabot-generate: | $(DBOTCONF)
- @$(DBOTCONF) generate > $(DEPENDABOT_CONFIG)
-
.PHONY: check-clean-work-tree
check-clean-work-tree:
@if ! git diff --quiet; then \
@@ -261,13 +261,11 @@ check-clean-work-tree:
SEMCONVPKG ?= "semconv/"
.PHONY: semconv-generate
-semconv-generate: | $(SEMCONVGEN) $(SEMCONVKIT)
+semconv-generate: $(SEMCONVGEN) $(SEMCONVKIT)
[ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry semantic-conventions tag"; exit 1 )
[ "$(OTEL_SEMCONV_REPO)" ] || ( echo "OTEL_SEMCONV_REPO unset: missing path to opentelemetry semantic-conventions repo"; exit 1 )
- $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=span -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
$(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=attribute_group -p conventionType=trace -f attribute_group.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
- $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=event -p conventionType=event -f event.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
- $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
+ $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=metric -f metric.go -t "$(SEMCONVPKG)/metric_template.j2" -s "$(TAG)"
$(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)"
.PHONY: gorelease
@@ -279,13 +277,25 @@ gorelease/%:| $(GORELEASE)
&& $(GORELEASE) \
|| echo ""
+.PHONY: verify-mods
+verify-mods: $(MULTIMOD)
+ $(MULTIMOD) verify
+
.PHONY: prerelease
-prerelease: | $(MULTIMOD)
+prerelease: verify-mods
@[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 )
- $(MULTIMOD) verify && $(MULTIMOD) prerelease -m ${MODSET}
+ $(MULTIMOD) prerelease -m ${MODSET}
COMMIT ?= "HEAD"
.PHONY: add-tags
-add-tags: | $(MULTIMOD)
+add-tags: verify-mods
@[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 )
- $(MULTIMOD) verify && $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT}
+ $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT}
+
+.PHONY: lint-markdown
+lint-markdown:
+ docker run -v "$(CURDIR):$(WORKDIR)" avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md
+
+.PHONY: verify-readmes
+verify-readmes:
+ ./verify_readmes.sh
diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md
index 634326ef83..5a89093173 100644
--- a/vendor/go.opentelemetry.io/otel/README.md
+++ b/vendor/go.opentelemetry.io/otel/README.md
@@ -11,17 +11,11 @@ It provides a set of APIs to directly measure performance and behavior of your s
## Project Status
-| Signal | Status | Project |
-|---------|------------|-----------------------|
-| Traces | Stable | N/A |
-| Metrics | Mixed [1] | [Go: Metric SDK (GA)] |
-| Logs | Frozen [2] | N/A |
-
-[Go: Metric SDK (GA)]: https://github.com/orgs/open-telemetry/projects/34
-
-- [1]: [Metrics API](https://pkg.go.dev/go.opentelemetry.io/otel/metric) is Stable. [Metrics SDK](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric) is Beta.
-- [2]: The Logs signal development is halted for this project while we stabilize the Metrics SDK.
- No Logs Pull Requests are currently being accepted.
+| Signal | Status |
+|---------|--------------------|
+| Traces | Stable |
+| Metrics | Stable |
+| Logs | Beta[^1] |
Progress and status specific to this repository is tracked in our
[project boards](https://github.com/open-telemetry/opentelemetry-go/projects)
@@ -31,6 +25,8 @@ and
Project versioning information and stability guarantees can be found in the
[versioning documentation](VERSIONING.md).
+[^1]: https://github.com/orgs/open-telemetry/projects/43
+
### Compatibility
OpenTelemetry-Go ensures compatibility with the current supported versions of
@@ -53,23 +49,25 @@ Currently, this project supports the following environments.
| OS | Go Version | Architecture |
|---------|------------|--------------|
+| Ubuntu | 1.22 | amd64 |
| Ubuntu | 1.21 | amd64 |
-| Ubuntu | 1.20 | amd64 |
+| Ubuntu | 1.22 | 386 |
| Ubuntu | 1.21 | 386 |
-| Ubuntu | 1.20 | 386 |
+| Linux | 1.22 | arm64 |
+| Linux | 1.21 | arm64 |
+| MacOS | 1.22 | amd64 |
| MacOS | 1.21 | amd64 |
-| MacOS | 1.20 | amd64 |
+| Windows | 1.22 | amd64 |
| Windows | 1.21 | amd64 |
-| Windows | 1.20 | amd64 |
+| Windows | 1.22 | 386 |
| Windows | 1.21 | 386 |
-| Windows | 1.20 | 386 |
While this project should work for other systems, no compatibility guarantees
are made for those systems currently.
## Getting Started
-You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/go/getting-started/).
+You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/languages/go/getting-started/).
OpenTelemetry's goal is to provide a single set of APIs to capture distributed
traces and metrics from your application and send them to an observability
@@ -99,12 +97,12 @@ export pipeline to send that telemetry to an observability platform.
All officially supported exporters for the OpenTelemetry project are contained in the [exporters directory](./exporters).
-| Exporter | Metrics | Traces |
-|---------------------------------------|:-------:|:------:|
-| [OTLP](./exporters/otlp/) | ✓ | ✓ |
-| [Prometheus](./exporters/prometheus/) | ✓ | |
-| [stdout](./exporters/stdout/) | ✓ | ✓ |
-| [Zipkin](./exporters/zipkin/) | | ✓ |
+| Exporter | Logs | Metrics | Traces |
+|---------------------------------------|:----:|:-------:|:------:|
+| [OTLP](./exporters/otlp/) | ✓ | ✓ | ✓ |
+| [Prometheus](./exporters/prometheus/) | | ✓ | |
+| [stdout](./exporters/stdout/) | ✓ | ✓ | ✓ |
+| [Zipkin](./exporters/zipkin/) | | | ✓ |
## Contributing
diff --git a/vendor/go.opentelemetry.io/otel/RELEASING.md b/vendor/go.opentelemetry.io/otel/RELEASING.md
index 82ce3ee46a..940f57f3d8 100644
--- a/vendor/go.opentelemetry.io/otel/RELEASING.md
+++ b/vendor/go.opentelemetry.io/otel/RELEASING.md
@@ -27,6 +27,12 @@ You can run `make gorelease` that runs [gorelease](https://pkg.go.dev/golang.org
You can check/report problems with `gorelease` [here](https://golang.org/issues/26420).
+## Verify changes for contrib repository
+
+If the changes in the main repository are going to affect the contrib repository, it is important to verify that the changes are compatible with the contrib repository.
+
+Follow [the steps](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md#verify-otel-changes) in the contrib repository to verify OTel changes.
+
## Pre-Release
First, decide which module sets will be released and update their versions
@@ -123,12 +129,12 @@ Once verified be sure to [make a release for the `contrib` repository](https://g
### Website Documentation
-Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/instrumentation/go].
+Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/languages/go].
Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate.
[OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions
-[Go instrumentation documentation]: https://opentelemetry.io/docs/instrumentation/go/
-[content/en/docs/instrumentation/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/instrumentation/go
+[Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/
+[content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go
### Demo Repository
diff --git a/vendor/go.opentelemetry.io/otel/attribute/README.md b/vendor/go.opentelemetry.io/otel/attribute/README.md
new file mode 100644
index 0000000000..5b3da8f14c
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/attribute/README.md
@@ -0,0 +1,3 @@
+# Attribute
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/attribute)
diff --git a/vendor/go.opentelemetry.io/otel/attribute/doc.go b/vendor/go.opentelemetry.io/otel/attribute/doc.go
index dafe7424df..eef51ebc2a 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/doc.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package attribute provides key and value attributes.
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/encoder.go b/vendor/go.opentelemetry.io/otel/attribute/encoder.go
index fe2bc5766c..318e42fcab 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/encoder.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/encoder.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/filter.go b/vendor/go.opentelemetry.io/otel/attribute/filter.go
index 638c213d59..be9cd922d8 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/filter.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/filter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/iterator.go b/vendor/go.opentelemetry.io/otel/attribute/iterator.go
index 841b271fb7..f2ba89ce4b 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/iterator.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/iterator.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/key.go b/vendor/go.opentelemetry.io/otel/attribute/key.go
index 0656a04e43..d9a22c6502 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/key.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/key.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/kv.go b/vendor/go.opentelemetry.io/otel/attribute/kv.go
index 1ddf3ce058..3028f9a40f 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/kv.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/kv.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/set.go b/vendor/go.opentelemetry.io/otel/attribute/set.go
index 9f9303d4f1..bff9c7fdbb 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/set.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/set.go
@@ -1,24 +1,14 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
import (
+ "cmp"
"encoding/json"
"reflect"
+ "slices"
"sort"
- "sync"
)
type (
@@ -26,23 +16,33 @@ type (
// immutable set of attributes, with an internal cache for storing
// attribute encodings.
//
- // This type supports the Equivalent method of comparison using values of
- // type Distinct.
+ // This type will remain comparable for backwards compatibility. The
+ // equivalence of Sets across versions is not guaranteed to be stable.
+ // Prior versions may find two Sets to be equal or not when compared
+ // directly (i.e. ==), but subsequent versions may not. Users should use
+ // the Equals method to ensure stable equivalence checking.
+ //
+ // Users should also use the Distinct returned from Equivalent as a map key
+ // instead of a Set directly. In addition to that type providing guarantees
+ // on stable equivalence, it may also provide performance improvements.
Set struct {
equivalent Distinct
}
- // Distinct wraps a variable-size array of KeyValue, constructed with keys
- // in sorted order. This can be used as a map key or for equality checking
- // between Sets.
+ // Distinct is a unique identifier of a Set.
+ //
+ // Distinct is designed to be ensures equivalence stability: comparisons
+ // will return the save value across versions. For this reason, Distinct
+ // should always be used as a map key instead of a Set.
Distinct struct {
iface interface{}
}
- // Sortable implements sort.Interface, used for sorting KeyValue. This is
- // an exported type to support a memory optimization. A pointer to one of
- // these is needed for the call to sort.Stable(), which the caller may
- // provide in order to avoid an allocation. See NewSetWithSortable().
+ // Sortable implements sort.Interface, used for sorting KeyValue.
+ //
+ // Deprecated: This type is no longer used. It was added as a performance
+ // optimization for Go < 1.21 that is no longer needed (Go < 1.21 is no
+ // longer supported by the module).
Sortable []KeyValue
)
@@ -56,12 +56,6 @@ var (
iface: [0]KeyValue{},
},
}
-
- // sortables is a pool of Sortables used to create Sets with a user does
- // not provide one.
- sortables = sync.Pool{
- New: func() interface{} { return new(Sortable) },
- }
)
// EmptySet returns a reference to a Set with no elements.
@@ -187,13 +181,7 @@ func empty() Set {
// Except for empty sets, this method adds an additional allocation compared
// with calls that include a Sortable.
func NewSet(kvs ...KeyValue) Set {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty()
- }
- srt := sortables.Get().(*Sortable)
- s, _ := NewSetWithSortableFiltered(kvs, srt, nil)
- sortables.Put(srt)
+ s, _ := NewSetWithFiltered(kvs, nil)
return s
}
@@ -201,12 +189,10 @@ func NewSet(kvs ...KeyValue) Set {
// NewSetWithSortableFiltered for more details.
//
// This call includes a Sortable option as a memory optimization.
-func NewSetWithSortable(kvs []KeyValue, tmp *Sortable) Set {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty()
- }
- s, _ := NewSetWithSortableFiltered(kvs, tmp, nil)
+//
+// Deprecated: Use [NewSet] instead.
+func NewSetWithSortable(kvs []KeyValue, _ *Sortable) Set {
+ s, _ := NewSetWithFiltered(kvs, nil)
return s
}
@@ -220,10 +206,37 @@ func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) {
if len(kvs) == 0 {
return empty(), nil
}
- srt := sortables.Get().(*Sortable)
- s, filtered := NewSetWithSortableFiltered(kvs, srt, filter)
- sortables.Put(srt)
- return s, filtered
+
+ // Stable sort so the following de-duplication can implement
+ // last-value-wins semantics.
+ slices.SortStableFunc(kvs, func(a, b KeyValue) int {
+ return cmp.Compare(a.Key, b.Key)
+ })
+
+ position := len(kvs) - 1
+ offset := position - 1
+
+ // The requirements stated above require that the stable
+ // result be placed in the end of the input slice, while
+ // overwritten values are swapped to the beginning.
+ //
+ // De-duplicate with last-value-wins semantics. Preserve
+ // duplicate values at the beginning of the input slice.
+ for ; offset >= 0; offset-- {
+ if kvs[offset].Key == kvs[position].Key {
+ continue
+ }
+ position--
+ kvs[offset], kvs[position] = kvs[position], kvs[offset]
+ }
+ kvs = kvs[position:]
+
+ if filter != nil {
+ if div := filteredToFront(kvs, filter); div != 0 {
+ return Set{equivalent: computeDistinct(kvs[div:])}, kvs[:div]
+ }
+ }
+ return Set{equivalent: computeDistinct(kvs)}, nil
}
// NewSetWithSortableFiltered returns a new Set.
@@ -249,82 +262,71 @@ func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) {
//
// The second []KeyValue return value is a list of attributes that were
// excluded by the Filter (if non-nil).
-func NewSetWithSortableFiltered(kvs []KeyValue, tmp *Sortable, filter Filter) (Set, []KeyValue) {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty(), nil
- }
-
- *tmp = kvs
-
- // Stable sort so the following de-duplication can implement
- // last-value-wins semantics.
- sort.Stable(tmp)
-
- *tmp = nil
-
- position := len(kvs) - 1
- offset := position - 1
-
- // The requirements stated above require that the stable
- // result be placed in the end of the input slice, while
- // overwritten values are swapped to the beginning.
- //
- // De-duplicate with last-value-wins semantics. Preserve
- // duplicate values at the beginning of the input slice.
- for ; offset >= 0; offset-- {
- if kvs[offset].Key == kvs[position].Key {
- continue
- }
- position--
- kvs[offset], kvs[position] = kvs[position], kvs[offset]
- }
- if filter != nil {
- return filterSet(kvs[position:], filter)
- }
- return Set{
- equivalent: computeDistinct(kvs[position:]),
- }, nil
+//
+// Deprecated: Use [NewSetWithFiltered] instead.
+func NewSetWithSortableFiltered(kvs []KeyValue, _ *Sortable, filter Filter) (Set, []KeyValue) {
+ return NewSetWithFiltered(kvs, filter)
}
-// filterSet reorders kvs so that included keys are contiguous at the end of
-// the slice, while excluded keys precede the included keys.
-func filterSet(kvs []KeyValue, filter Filter) (Set, []KeyValue) {
- var excluded []KeyValue
-
- // Move attributes that do not match the filter so they're adjacent before
- // calling computeDistinct().
- distinctPosition := len(kvs)
-
- // Swap indistinct keys forward and distinct keys toward the
- // end of the slice.
- offset := len(kvs) - 1
- for ; offset >= 0; offset-- {
- if filter(kvs[offset]) {
- distinctPosition--
- kvs[offset], kvs[distinctPosition] = kvs[distinctPosition], kvs[offset]
- continue
+// filteredToFront filters slice in-place using keep function. All KeyValues that need to
+// be removed are moved to the front. All KeyValues that need to be kept are
+// moved (in-order) to the back. The index for the first KeyValue to be kept is
+// returned.
+func filteredToFront(slice []KeyValue, keep Filter) int {
+ n := len(slice)
+ j := n
+ for i := n - 1; i >= 0; i-- {
+ if keep(slice[i]) {
+ j--
+ slice[i], slice[j] = slice[j], slice[i]
}
}
- excluded = kvs[:distinctPosition]
-
- return Set{
- equivalent: computeDistinct(kvs[distinctPosition:]),
- }, excluded
+ return j
}
// Filter returns a filtered copy of this Set. See the documentation for
// NewSetWithSortableFiltered for more details.
func (l *Set) Filter(re Filter) (Set, []KeyValue) {
if re == nil {
- return Set{
- equivalent: l.equivalent,
- }, nil
+ return *l, nil
+ }
+
+ // Iterate in reverse to the first attribute that will be filtered out.
+ n := l.Len()
+ first := n - 1
+ for ; first >= 0; first-- {
+ kv, _ := l.Get(first)
+ if !re(kv) {
+ break
+ }
+ }
+
+ // No attributes will be dropped, return the immutable Set l and nil.
+ if first < 0 {
+ return *l, nil
}
- // Note: This could be refactored to avoid the temporary slice
- // allocation, if it proves to be expensive.
- return filterSet(l.ToSlice(), re)
+ // Copy now that we know we need to return a modified set.
+ //
+ // Do not do this in-place on the underlying storage of *Set l. Sets are
+ // immutable and filtering should not change this.
+ slice := l.ToSlice()
+
+ // Don't re-iterate the slice if only slice[0] is filtered.
+ if first == 0 {
+ // It is safe to assume len(slice) >= 1 given we found at least one
+ // attribute above that needs to be filtered out.
+ return Set{equivalent: computeDistinct(slice[1:])}, slice[:1]
+ }
+
+ // Move the filtered slice[first] to the front (preserving order).
+ kv := slice[first]
+ copy(slice[1:first+1], slice[:first])
+ slice[0] = kv
+
+ // Do not re-evaluate re(slice[first+1:]).
+ div := filteredToFront(slice[1:first+1], re) + 1
+ return Set{equivalent: computeDistinct(slice[div:])}, slice[:div]
}
// computeDistinct returns a Distinct using either the fixed- or
@@ -404,7 +406,7 @@ func (l *Set) MarshalJSON() ([]byte, error) {
return json.Marshal(l.equivalent.iface)
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Set.
func (l Set) MarshalLog() interface{} {
kvs := make(map[string]string)
for _, kv := range l.ToSlice() {
diff --git a/vendor/go.opentelemetry.io/otel/attribute/value.go b/vendor/go.opentelemetry.io/otel/attribute/value.go
index cb21dd5c09..9ea0ecbbd2 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/value.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/value.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
@@ -242,15 +231,27 @@ func (v Value) Emit() string {
case BOOL:
return strconv.FormatBool(v.AsBool())
case INT64SLICE:
- return fmt.Sprint(v.asInt64Slice())
+ j, err := json.Marshal(v.asInt64Slice())
+ if err != nil {
+ return fmt.Sprintf("invalid: %v", v.asInt64Slice())
+ }
+ return string(j)
case INT64:
return strconv.FormatInt(v.AsInt64(), 10)
case FLOAT64SLICE:
- return fmt.Sprint(v.asFloat64Slice())
+ j, err := json.Marshal(v.asFloat64Slice())
+ if err != nil {
+ return fmt.Sprintf("invalid: %v", v.asFloat64Slice())
+ }
+ return string(j)
case FLOAT64:
return fmt.Sprint(v.AsFloat64())
case STRINGSLICE:
- return fmt.Sprint(v.asStringSlice())
+ j, err := json.Marshal(v.asStringSlice())
+ if err != nil {
+ return fmt.Sprintf("invalid: %v", v.asStringSlice())
+ }
+ return string(j)
case STRING:
return v.stringly
default:
diff --git a/vendor/go.opentelemetry.io/otel/baggage/README.md b/vendor/go.opentelemetry.io/otel/baggage/README.md
new file mode 100644
index 0000000000..7d798435e1
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/baggage/README.md
@@ -0,0 +1,3 @@
+# Baggage
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/baggage)
diff --git a/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/baggage/baggage.go
index 9e6b3b7b52..c40c896cc6 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/baggage"
@@ -18,8 +7,8 @@ import (
"errors"
"fmt"
"net/url"
- "regexp"
"strings"
+ "unicode/utf8"
"go.opentelemetry.io/otel/internal/baggage"
)
@@ -32,16 +21,6 @@ const (
listDelimiter = ","
keyValueDelimiter = "="
propertyDelimiter = ";"
-
- keyDef = `([\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5a\x5e-\x7a\x7c\x7e]+)`
- valueDef = `([\x21\x23-\x2b\x2d-\x3a\x3c-\x5B\x5D-\x7e]*)`
- keyValueDef = `\s*` + keyDef + `\s*` + keyValueDelimiter + `\s*` + valueDef + `\s*`
-)
-
-var (
- keyRe = regexp.MustCompile(`^` + keyDef + `$`)
- valueRe = regexp.MustCompile(`^` + valueDef + `$`)
- propertyRe = regexp.MustCompile(`^(?:\s*` + keyDef + `\s*|` + keyValueDef + `)$`)
)
var (
@@ -67,7 +46,7 @@ type Property struct {
//
// If key is invalid, an error will be returned.
func NewKeyProperty(key string) (Property, error) {
- if !keyRe.MatchString(key) {
+ if !validateKey(key) {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
}
@@ -77,14 +56,29 @@ func NewKeyProperty(key string) (Property, error) {
// NewKeyValueProperty returns a new Property for key with value.
//
-// If key or value are invalid, an error will be returned.
+// The passed key must be compliant with W3C Baggage specification.
+// The passed value must be percent-encoded as defined in W3C Baggage specification.
+//
+// Notice: Consider using [NewKeyValuePropertyRaw] instead
+// that does not require percent-encoding of the value.
func NewKeyValueProperty(key, value string) (Property, error) {
- if !keyRe.MatchString(key) {
- return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
+ if !validateValue(value) {
+ return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value)
}
- if !valueRe.MatchString(value) {
+ decodedValue, err := url.PathUnescape(value)
+ if err != nil {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value)
}
+ return NewKeyValuePropertyRaw(key, decodedValue)
+}
+
+// NewKeyValuePropertyRaw returns a new Property for key with value.
+//
+// The passed key must be compliant with W3C Baggage specification.
+func NewKeyValuePropertyRaw(key, value string) (Property, error) {
+ if !validateKey(key) {
+ return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
+ }
p := Property{
key: key,
@@ -106,20 +100,11 @@ func parseProperty(property string) (Property, error) {
return newInvalidProperty(), nil
}
- match := propertyRe.FindStringSubmatch(property)
- if len(match) != 4 {
+ p, ok := parsePropertyInternal(property)
+ if !ok {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidProperty, property)
}
- var p Property
- if match[1] != "" {
- p.key = match[1]
- } else {
- p.key = match[2]
- p.value = match[3]
- p.hasValue = true
- }
-
return p, nil
}
@@ -130,12 +115,9 @@ func (p Property) validate() error {
return fmt.Errorf("invalid property: %w", err)
}
- if !keyRe.MatchString(p.key) {
+ if !validateKey(p.key) {
return errFunc(fmt.Errorf("%w: %q", errInvalidKey, p.key))
}
- if p.hasValue && !valueRe.MatchString(p.value) {
- return errFunc(fmt.Errorf("%w: %q", errInvalidValue, p.value))
- }
if !p.hasValue && p.value != "" {
return errFunc(errors.New("inconsistent value"))
}
@@ -154,11 +136,11 @@ func (p Property) Value() (string, bool) {
return p.value, p.hasValue
}
-// String encodes Property into a string compliant with the W3C Baggage
+// String encodes Property into a header string compliant with the W3C Baggage
// specification.
func (p Property) String() string {
if p.hasValue {
- return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, p.value)
+ return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, valueEscape(p.value))
}
return p.key
}
@@ -218,7 +200,7 @@ func (p properties) validate() error {
return nil
}
-// String encodes properties into a string compliant with the W3C Baggage
+// String encodes properties into a header string compliant with the W3C Baggage
// specification.
func (p properties) String() string {
props := make([]string, len(p))
@@ -240,11 +222,28 @@ type Member struct {
hasData bool
}
-// NewMember returns a new Member from the passed arguments. The key will be
-// used directly while the value will be url decoded after validation. An error
-// is returned if the created Member would be invalid according to the W3C
-// Baggage specification.
+// NewMember returns a new Member from the passed arguments.
+//
+// The passed key must be compliant with W3C Baggage specification.
+// The passed value must be percent-encoded as defined in W3C Baggage specification.
+//
+// Notice: Consider using [NewMemberRaw] instead
+// that does not require percent-encoding of the value.
func NewMember(key, value string, props ...Property) (Member, error) {
+ if !validateValue(value) {
+ return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
+ }
+ decodedValue, err := url.PathUnescape(value)
+ if err != nil {
+ return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
+ }
+ return NewMemberRaw(key, decodedValue, props...)
+}
+
+// NewMemberRaw returns a new Member from the passed arguments.
+//
+// The passed key must be compliant with W3C Baggage specification.
+func NewMemberRaw(key, value string, props ...Property) (Member, error) {
m := Member{
key: key,
value: value,
@@ -254,11 +253,6 @@ func NewMember(key, value string, props ...Property) (Member, error) {
if err := m.validate(); err != nil {
return newInvalidMember(), err
}
- decodedValue, err := url.QueryUnescape(value)
- if err != nil {
- return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
- }
- m.value = decodedValue
return m, nil
}
@@ -274,11 +268,7 @@ func parseMember(member string) (Member, error) {
return newInvalidMember(), fmt.Errorf("%w: %d", errMemberBytes, n)
}
- var (
- key, value string
- props properties
- )
-
+ var props properties
keyValue, properties, found := strings.Cut(member, propertyDelimiter)
if found {
// Parse the member properties.
@@ -299,36 +289,34 @@ func parseMember(member string) (Member, error) {
}
// "Leading and trailing whitespaces are allowed but MUST be trimmed
// when converting the header into a data structure."
- key = strings.TrimSpace(k)
- var err error
- value, err = url.QueryUnescape(strings.TrimSpace(v))
- if err != nil {
- return newInvalidMember(), fmt.Errorf("%w: %q", err, value)
- }
- if !keyRe.MatchString(key) {
+ key := strings.TrimSpace(k)
+ if !validateKey(key) {
return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidKey, key)
}
- if !valueRe.MatchString(value) {
- return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
+
+ val := strings.TrimSpace(v)
+ if !validateValue(val) {
+ return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, v)
}
+ // Decode a percent-encoded value.
+ value, err := url.PathUnescape(val)
+ if err != nil {
+ return newInvalidMember(), fmt.Errorf("%w: %w", errInvalidValue, err)
+ }
return Member{key: key, value: value, properties: props, hasData: true}, nil
}
// validate ensures m conforms to the W3C Baggage specification.
-// A key is just an ASCII string, but a value must be URL encoded UTF-8,
-// returning an error otherwise.
+// A key must be an ASCII string, returning an error otherwise.
func (m Member) validate() error {
if !m.hasData {
return fmt.Errorf("%w: %q", errInvalidMember, m)
}
- if !keyRe.MatchString(m.key) {
+ if !validateKey(m.key) {
return fmt.Errorf("%w: %q", errInvalidKey, m.key)
}
- if !valueRe.MatchString(m.value) {
- return fmt.Errorf("%w: %q", errInvalidValue, m.value)
- }
return m.properties.validate()
}
@@ -341,13 +329,15 @@ func (m Member) Value() string { return m.value }
// Properties returns a copy of the Member properties.
func (m Member) Properties() []Property { return m.properties.Copy() }
-// String encodes Member into a string compliant with the W3C Baggage
+// String encodes Member into a header string compliant with the W3C Baggage
// specification.
func (m Member) String() string {
- // A key is just an ASCII string, but a value is URL encoded UTF-8.
- s := fmt.Sprintf("%s%s%s", m.key, keyValueDelimiter, url.QueryEscape(m.value))
+ // A key is just an ASCII string. A value is restricted to be
+ // US-ASCII characters excluding CTLs, whitespace,
+ // DQUOTE, comma, semicolon, and backslash.
+ s := m.key + keyValueDelimiter + valueEscape(m.value)
if len(m.properties) > 0 {
- s = fmt.Sprintf("%s%s%s", s, propertyDelimiter, m.properties.String())
+ s += propertyDelimiter + m.properties.String()
}
return s
}
@@ -536,9 +526,8 @@ func (b Baggage) Len() int {
return len(b.list)
}
-// String encodes Baggage into a string compliant with the W3C Baggage
-// specification. The returned string will be invalid if the Baggage contains
-// any invalid list-members.
+// String encodes Baggage into a header string compliant with the W3C Baggage
+// specification.
func (b Baggage) String() string {
members := make([]string, 0, len(b.list))
for k, v := range b.list {
@@ -550,3 +539,372 @@ func (b Baggage) String() string {
}
return strings.Join(members, listDelimiter)
}
+
+// parsePropertyInternal attempts to decode a Property from the passed string.
+// It follows the spec at https://www.w3.org/TR/baggage/#definition.
+func parsePropertyInternal(s string) (p Property, ok bool) {
+ // For the entire function we will use " key = value " as an example.
+ // Attempting to parse the key.
+ // First skip spaces at the beginning "< >key = value " (they could be empty).
+ index := skipSpace(s, 0)
+
+ // Parse the key: " = value ".
+ keyStart := index
+ keyEnd := index
+ for _, c := range s[keyStart:] {
+ if !validateKeyChar(c) {
+ break
+ }
+ keyEnd++
+ }
+
+ // If we couldn't find any valid key character,
+ // it means the key is either empty or invalid.
+ if keyStart == keyEnd {
+ return
+ }
+
+ // Skip spaces after the key: " key< >= value ".
+ index = skipSpace(s, keyEnd)
+
+ if index == len(s) {
+ // A key can have no value, like: " key ".
+ ok = true
+ p.key = s[keyStart:keyEnd]
+ return
+ }
+
+ // If we have not reached the end and we can't find the '=' delimiter,
+ // it means the property is invalid.
+ if s[index] != keyValueDelimiter[0] {
+ return
+ }
+
+ // Attempting to parse the value.
+ // Match: " key =< >value ".
+ index = skipSpace(s, index+1)
+
+ // Match the value string: " key = ".
+ // A valid property can be: " key =".
+ // Therefore, we don't have to check if the value is empty.
+ valueStart := index
+ valueEnd := index
+ for _, c := range s[valueStart:] {
+ if !validateValueChar(c) {
+ break
+ }
+ valueEnd++
+ }
+
+ // Skip all trailing whitespaces: " key = value< >".
+ index = skipSpace(s, valueEnd)
+
+ // If after looking for the value and skipping whitespaces
+ // we have not reached the end, it means the property is
+ // invalid, something like: " key = value value1".
+ if index != len(s) {
+ return
+ }
+
+ // Decode a percent-encoded value.
+ value, err := url.PathUnescape(s[valueStart:valueEnd])
+ if err != nil {
+ return
+ }
+
+ ok = true
+ p.key = s[keyStart:keyEnd]
+ p.hasValue = true
+
+ p.value = value
+ return
+}
+
+func skipSpace(s string, offset int) int {
+ i := offset
+ for ; i < len(s); i++ {
+ c := s[i]
+ if c != ' ' && c != '\t' {
+ break
+ }
+ }
+ return i
+}
+
+var safeKeyCharset = [utf8.RuneSelf]bool{
+ // 0x23 to 0x27
+ '#': true,
+ '$': true,
+ '%': true,
+ '&': true,
+ '\'': true,
+
+ // 0x30 to 0x39
+ '0': true,
+ '1': true,
+ '2': true,
+ '3': true,
+ '4': true,
+ '5': true,
+ '6': true,
+ '7': true,
+ '8': true,
+ '9': true,
+
+ // 0x41 to 0x5a
+ 'A': true,
+ 'B': true,
+ 'C': true,
+ 'D': true,
+ 'E': true,
+ 'F': true,
+ 'G': true,
+ 'H': true,
+ 'I': true,
+ 'J': true,
+ 'K': true,
+ 'L': true,
+ 'M': true,
+ 'N': true,
+ 'O': true,
+ 'P': true,
+ 'Q': true,
+ 'R': true,
+ 'S': true,
+ 'T': true,
+ 'U': true,
+ 'V': true,
+ 'W': true,
+ 'X': true,
+ 'Y': true,
+ 'Z': true,
+
+ // 0x5e to 0x7a
+ '^': true,
+ '_': true,
+ '`': true,
+ 'a': true,
+ 'b': true,
+ 'c': true,
+ 'd': true,
+ 'e': true,
+ 'f': true,
+ 'g': true,
+ 'h': true,
+ 'i': true,
+ 'j': true,
+ 'k': true,
+ 'l': true,
+ 'm': true,
+ 'n': true,
+ 'o': true,
+ 'p': true,
+ 'q': true,
+ 'r': true,
+ 's': true,
+ 't': true,
+ 'u': true,
+ 'v': true,
+ 'w': true,
+ 'x': true,
+ 'y': true,
+ 'z': true,
+
+ // remainder
+ '!': true,
+ '*': true,
+ '+': true,
+ '-': true,
+ '.': true,
+ '|': true,
+ '~': true,
+}
+
+func validateKey(s string) bool {
+ if len(s) == 0 {
+ return false
+ }
+
+ for _, c := range s {
+ if !validateKeyChar(c) {
+ return false
+ }
+ }
+
+ return true
+}
+
+func validateKeyChar(c int32) bool {
+ return c >= 0 && c < int32(utf8.RuneSelf) && safeKeyCharset[c]
+}
+
+func validateValue(s string) bool {
+ for _, c := range s {
+ if !validateValueChar(c) {
+ return false
+ }
+ }
+
+ return true
+}
+
+var safeValueCharset = [utf8.RuneSelf]bool{
+ '!': true, // 0x21
+
+ // 0x23 to 0x2b
+ '#': true,
+ '$': true,
+ '%': true,
+ '&': true,
+ '\'': true,
+ '(': true,
+ ')': true,
+ '*': true,
+ '+': true,
+
+ // 0x2d to 0x3a
+ '-': true,
+ '.': true,
+ '/': true,
+ '0': true,
+ '1': true,
+ '2': true,
+ '3': true,
+ '4': true,
+ '5': true,
+ '6': true,
+ '7': true,
+ '8': true,
+ '9': true,
+ ':': true,
+
+ // 0x3c to 0x5b
+ '<': true, // 0x3C
+ '=': true, // 0x3D
+ '>': true, // 0x3E
+ '?': true, // 0x3F
+ '@': true, // 0x40
+ 'A': true, // 0x41
+ 'B': true, // 0x42
+ 'C': true, // 0x43
+ 'D': true, // 0x44
+ 'E': true, // 0x45
+ 'F': true, // 0x46
+ 'G': true, // 0x47
+ 'H': true, // 0x48
+ 'I': true, // 0x49
+ 'J': true, // 0x4A
+ 'K': true, // 0x4B
+ 'L': true, // 0x4C
+ 'M': true, // 0x4D
+ 'N': true, // 0x4E
+ 'O': true, // 0x4F
+ 'P': true, // 0x50
+ 'Q': true, // 0x51
+ 'R': true, // 0x52
+ 'S': true, // 0x53
+ 'T': true, // 0x54
+ 'U': true, // 0x55
+ 'V': true, // 0x56
+ 'W': true, // 0x57
+ 'X': true, // 0x58
+ 'Y': true, // 0x59
+ 'Z': true, // 0x5A
+ '[': true, // 0x5B
+
+ // 0x5d to 0x7e
+ ']': true, // 0x5D
+ '^': true, // 0x5E
+ '_': true, // 0x5F
+ '`': true, // 0x60
+ 'a': true, // 0x61
+ 'b': true, // 0x62
+ 'c': true, // 0x63
+ 'd': true, // 0x64
+ 'e': true, // 0x65
+ 'f': true, // 0x66
+ 'g': true, // 0x67
+ 'h': true, // 0x68
+ 'i': true, // 0x69
+ 'j': true, // 0x6A
+ 'k': true, // 0x6B
+ 'l': true, // 0x6C
+ 'm': true, // 0x6D
+ 'n': true, // 0x6E
+ 'o': true, // 0x6F
+ 'p': true, // 0x70
+ 'q': true, // 0x71
+ 'r': true, // 0x72
+ 's': true, // 0x73
+ 't': true, // 0x74
+ 'u': true, // 0x75
+ 'v': true, // 0x76
+ 'w': true, // 0x77
+ 'x': true, // 0x78
+ 'y': true, // 0x79
+ 'z': true, // 0x7A
+ '{': true, // 0x7B
+ '|': true, // 0x7C
+ '}': true, // 0x7D
+ '~': true, // 0x7E
+}
+
+func validateValueChar(c int32) bool {
+ return c >= 0 && c < int32(utf8.RuneSelf) && safeValueCharset[c]
+}
+
+// valueEscape escapes the string so it can be safely placed inside a baggage value,
+// replacing special characters with %XX sequences as needed.
+//
+// The implementation is based on:
+// https://github.com/golang/go/blob/f6509cf5cdbb5787061b784973782933c47f1782/src/net/url/url.go#L285.
+func valueEscape(s string) string {
+ hexCount := 0
+ for i := 0; i < len(s); i++ {
+ c := s[i]
+ if shouldEscape(c) {
+ hexCount++
+ }
+ }
+
+ if hexCount == 0 {
+ return s
+ }
+
+ var buf [64]byte
+ var t []byte
+
+ required := len(s) + 2*hexCount
+ if required <= len(buf) {
+ t = buf[:required]
+ } else {
+ t = make([]byte, required)
+ }
+
+ j := 0
+ for i := 0; i < len(s); i++ {
+ c := s[i]
+ if shouldEscape(s[i]) {
+ const upperhex = "0123456789ABCDEF"
+ t[j] = '%'
+ t[j+1] = upperhex[c>>4]
+ t[j+2] = upperhex[c&15]
+ j += 3
+ } else {
+ t[j] = c
+ j++
+ }
+ }
+
+ return string(t)
+}
+
+// shouldEscape returns true if the specified byte should be escaped when
+// appearing in a baggage value string.
+func shouldEscape(c byte) bool {
+ if c == '%' {
+ // The percent character must be encoded so that percent-encoding can work.
+ return true
+ }
+ return !validateValueChar(int32(c))
+}
diff --git a/vendor/go.opentelemetry.io/otel/baggage/context.go b/vendor/go.opentelemetry.io/otel/baggage/context.go
index 24b34b7564..a572461a05 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/context.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/baggage"
diff --git a/vendor/go.opentelemetry.io/otel/baggage/doc.go b/vendor/go.opentelemetry.io/otel/baggage/doc.go
index 4545100df6..b51d87cab7 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/doc.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package baggage provides functionality for storing and retrieving
diff --git a/vendor/go.opentelemetry.io/otel/codes/README.md b/vendor/go.opentelemetry.io/otel/codes/README.md
new file mode 100644
index 0000000000..24c52b387d
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/codes/README.md
@@ -0,0 +1,3 @@
+# Codes
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/codes)
diff --git a/vendor/go.opentelemetry.io/otel/codes/codes.go b/vendor/go.opentelemetry.io/otel/codes/codes.go
index 587ebae4e3..df29d96a6d 100644
--- a/vendor/go.opentelemetry.io/otel/codes/codes.go
+++ b/vendor/go.opentelemetry.io/otel/codes/codes.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package codes // import "go.opentelemetry.io/otel/codes"
diff --git a/vendor/go.opentelemetry.io/otel/codes/doc.go b/vendor/go.opentelemetry.io/otel/codes/doc.go
index 4e328fbb4b..ee8db448b8 100644
--- a/vendor/go.opentelemetry.io/otel/codes/doc.go
+++ b/vendor/go.opentelemetry.io/otel/codes/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package codes defines the canonical error codes used by OpenTelemetry.
diff --git a/vendor/go.opentelemetry.io/otel/doc.go b/vendor/go.opentelemetry.io/otel/doc.go
index daa36c89dc..441c595014 100644
--- a/vendor/go.opentelemetry.io/otel/doc.go
+++ b/vendor/go.opentelemetry.io/otel/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package otel provides global access to the OpenTelemetry API. The subpackages of
@@ -22,7 +11,7 @@ transmitted anywhere. An implementation of the OpenTelemetry SDK, like the
default SDK implementation (go.opentelemetry.io/otel/sdk), and associated
exporters are used to process and transport this data.
-To read the getting started guide, see https://opentelemetry.io/docs/go/getting-started/.
+To read the getting started guide, see https://opentelemetry.io/docs/languages/go/getting-started/.
To read more about tracing, see go.opentelemetry.io/otel/trace.
diff --git a/vendor/go.opentelemetry.io/otel/error_handler.go b/vendor/go.opentelemetry.io/otel/error_handler.go
index 72fad85412..67414c71e0 100644
--- a/vendor/go.opentelemetry.io/otel/error_handler.go
+++ b/vendor/go.opentelemetry.io/otel/error_handler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md
index 5029522318..50802d5aee 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md
@@ -1,51 +1,3 @@
-# OpenTelemetry-Go OTLP Span Exporter
+# OTLP Trace Exporter
-[](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace)
-
-[OpenTelemetry Protocol Exporter](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md) implementation.
-
-## Installation
-
-```
-go get -u go.opentelemetry.io/otel/exporters/otlp/otlptrace
-```
-
-## Examples
-
-- [HTTP Exporter setup and examples](./otlptracehttp/example_test.go)
-- [Full example of gRPC Exporter sending telemetry to a local collector](../../../example/otel-collector)
-
-## [`otlptrace`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace)
-
-The `otlptrace` package provides an exporter implementing the OTel span exporter interface.
-This exporter is configured using a client satisfying the `otlptrace.Client` interface.
-This client handles the transformation of data into wire format and the transmission of that data to the collector.
-
-## [`otlptracegrpc`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc)
-
-The `otlptracegrpc` package implements a client for the span exporter that sends trace telemetry data to the collector using gRPC with protobuf-encoded payloads.
-
-## [`otlptracehttp`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp)
-
-The `otlptracehttp` package implements a client for the span exporter that sends trace telemetry data to the collector using HTTP with protobuf-encoded payloads.
-
-## Configuration
-
-### Environment Variables
-
-The following environment variables can be used (instead of options objects) to
-override the default configuration. For more information about how each of
-these environment variables is interpreted, see [the OpenTelemetry
-specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md).
-
-| Environment variable | Option | Default value |
-| ------------------------------------------------------------------------ |------------------------------ | -------------------------------------------------------- |
-| `OTEL_EXPORTER_OTLP_ENDPOINT` `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | `WithEndpoint` `WithInsecure` | `https://localhost:4317` or `https://localhost:4318`[^1] |
-| `OTEL_EXPORTER_OTLP_CERTIFICATE` `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE` | `WithTLSClientConfig` | |
-| `OTEL_EXPORTER_OTLP_HEADERS` `OTEL_EXPORTER_OTLP_TRACES_HEADERS` | `WithHeaders` | |
-| `OTEL_EXPORTER_OTLP_COMPRESSION` `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` | `WithCompression` | |
-| `OTEL_EXPORTER_OTLP_TIMEOUT` `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT` | `WithTimeout` | `10s` |
-
-[^1]: The gRPC client defaults to `https://localhost:4317` and the HTTP client `https://localhost:4318`.
-
-Configuration using options have precedence over the environment variables.
+[](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace)
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go
index dbb40cf582..3c1a625c06 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go
new file mode 100644
index 0000000000..09ad5eadb6
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/doc.go
@@ -0,0 +1,10 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+/*
+Package otlptrace contains abstractions for OTLP span exporters.
+See the official OTLP span exporter implementations:
+ - [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc],
+ - [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp].
+*/
+package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go
index 0dbe15555b..3f0a518ae0 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
@@ -24,9 +13,7 @@ import (
tracesdk "go.opentelemetry.io/otel/sdk/trace"
)
-var (
- errAlreadyStarted = errors.New("already started")
-)
+var errAlreadyStarted = errors.New("already started")
// Exporter exports trace data in the OTLP wire format.
type Exporter struct {
@@ -55,7 +42,7 @@ func (e *Exporter) ExportSpans(ctx context.Context, ss []tracesdk.ReadOnlySpan)
// Start establishes a connection to the receiving endpoint.
func (e *Exporter) Start(ctx context.Context) error {
- var err = errAlreadyStarted
+ err := errAlreadyStarted
e.startOnce.Do(func() {
e.mu.Lock()
e.started = true
@@ -106,7 +93,7 @@ func NewUnstarted(client Client) *Exporter {
}
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Exporter.
func (e *Exporter) MarshalLog() interface{} {
return struct {
Type string
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go
index ec74f1aad7..4571a5ca39 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go
index 7aaec38d22..f6dd3decc9 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go
index 05a1f78adb..db7b698a56 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go
index b83cbd7247..c3c69c5a0d 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
@@ -121,6 +110,7 @@ func span(sd tracesdk.ReadOnlySpan) *tracepb.Span {
if psid := sd.Parent().SpanID(); psid.IsValid() {
s.ParentSpanId = psid[:]
}
+ s.Flags = buildSpanFlags(sd.Parent())
return s
}
@@ -157,16 +147,28 @@ func links(links []tracesdk.Link) []*tracepb.Span_Link {
tid := otLink.SpanContext.TraceID()
sid := otLink.SpanContext.SpanID()
+ flags := buildSpanFlags(otLink.SpanContext)
+
sl = append(sl, &tracepb.Span_Link{
TraceId: tid[:],
SpanId: sid[:],
Attributes: KeyValues(otLink.Attributes),
DroppedAttributesCount: uint32(otLink.DroppedAttributeCount),
+ Flags: flags,
})
}
return sl
}
+func buildSpanFlags(sc trace.SpanContext) uint32 {
+ flags := tracepb.SpanFlags_SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK
+ if sc.IsRemote() {
+ flags |= tracepb.SpanFlags_SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK
+ }
+
+ return uint32(flags)
+}
+
// spanEvents transforms span Events to an OTLP span events.
func spanEvents(es []tracesdk.Event) []*tracepb.Span_Event {
if len(es) == 0 {
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/README.md b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/README.md
new file mode 100644
index 0000000000..5309bb7cb1
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/README.md
@@ -0,0 +1,3 @@
+# OTLP Trace gRPC Exporter
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc)
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go
index 86fb61a0de..3993df927d 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
@@ -89,11 +78,11 @@ func newClient(opts ...Option) *client {
}
// Start establishes a gRPC connection to the collector.
-func (c *client) Start(ctx context.Context) error {
+func (c *client) Start(context.Context) error {
if c.conn == nil {
// If the caller did not provide a ClientConn when the client was
// created, create one using the configuration they did provide.
- conn, err := grpc.DialContext(ctx, c.endpoint, c.dialOpts...)
+ conn, err := grpc.NewClient(c.endpoint, c.dialOpts...)
if err != nil {
return err
}
@@ -260,30 +249,38 @@ func (c *client) exportContext(parent context.Context) (context.Context, context
// duration to wait for if an explicit throttle time is included in err.
func retryable(err error) (bool, time.Duration) {
s := status.Convert(err)
+ return retryableGRPCStatus(s)
+}
+
+func retryableGRPCStatus(s *status.Status) (bool, time.Duration) {
switch s.Code() {
case codes.Canceled,
codes.DeadlineExceeded,
- codes.ResourceExhausted,
codes.Aborted,
codes.OutOfRange,
codes.Unavailable,
codes.DataLoss:
- return true, throttleDelay(s)
+ // Additionally handle RetryInfo.
+ _, d := throttleDelay(s)
+ return true, d
+ case codes.ResourceExhausted:
+ // Retry only if the server signals that the recovery from resource exhaustion is possible.
+ return throttleDelay(s)
}
// Not a retry-able error.
return false, 0
}
-// throttleDelay returns a duration to wait for if an explicit throttle time
-// is included in the response status.
-func throttleDelay(s *status.Status) time.Duration {
+// throttleDelay returns of the status is RetryInfo
+// and the its duration to wait for if an explicit throttle time.
+func throttleDelay(s *status.Status) (bool, time.Duration) {
for _, detail := range s.Details() {
if t, ok := detail.(*errdetails.RetryInfo); ok {
- return t.RetryDelay.AsDuration()
+ return true, t.RetryDelay.AsDuration()
}
}
- return 0
+ return false, 0
}
// MarshalLog is the marshaling function used by the logging system to represent this Client.
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go
new file mode 100644
index 0000000000..e783b57ac4
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/doc.go
@@ -0,0 +1,66 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+/*
+Package otlptracegrpc provides an OTLP span exporter using gRPC.
+By default the telemetry is sent to https://localhost:4317.
+
+Exporter should be created using [New].
+
+The environment variables described below can be used for configuration.
+
+OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT (default: "https://localhost:4317") -
+target to which the exporter sends telemetry.
+The target syntax is defined in https://github.com/grpc/grpc/blob/master/doc/naming.md.
+The value must contain a host.
+The value may additionally a port, a scheme, and a path.
+The value accepts "http" and "https" scheme.
+The value should not contain a query string or fragment.
+OTEL_EXPORTER_OTLP_TRACES_ENDPOINT takes precedence over OTEL_EXPORTER_OTLP_ENDPOINT.
+The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WithInsecure], and [WithGRPCConn] options.
+
+OTEL_EXPORTER_OTLP_INSECURE, OTEL_EXPORTER_OTLP_TRACES_INSECURE (default: "false") -
+setting "true" disables client transport security for the exporter's gRPC connection.
+You can use this only when an endpoint is provided without the http or https scheme.
+OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT setting overrides
+the scheme defined via OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.
+OTEL_EXPORTER_OTLP_TRACES_INSECURE takes precedence over OTEL_EXPORTER_OTLP_INSECURE.
+The configuration can be overridden by [WithInsecure], [WithGRPCConn] options.
+
+OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_TRACES_HEADERS (default: none) -
+key-value pairs used as gRPC metadata associated with gRPC requests.
+The value is expected to be represented in a format matching the [W3C Baggage HTTP Header Content Format],
+except that additional semi-colon delimited metadata is not supported.
+Example value: "key1=value1,key2=value2".
+OTEL_EXPORTER_OTLP_TRACES_HEADERS takes precedence over OTEL_EXPORTER_OTLP_HEADERS.
+The configuration can be overridden by [WithHeaders] option.
+
+OTEL_EXPORTER_OTLP_TIMEOUT, OTEL_EXPORTER_OTLP_TRACES_TIMEOUT (default: "10000") -
+maximum time in milliseconds the OTLP exporter waits for each batch export.
+OTEL_EXPORTER_OTLP_TRACES_TIMEOUT takes precedence over OTEL_EXPORTER_OTLP_TIMEOUT.
+The configuration can be overridden by [WithTimeout] option.
+
+OTEL_EXPORTER_OTLP_COMPRESSION, OTEL_EXPORTER_OTLP_TRACES_COMPRESSION (default: none) -
+the gRPC compressor the exporter uses.
+Supported value: "gzip".
+OTEL_EXPORTER_OTLP_TRACES_COMPRESSION takes precedence over OTEL_EXPORTER_OTLP_COMPRESSION.
+The configuration can be overridden by [WithCompressor], [WithGRPCConn] options.
+
+OTEL_EXPORTER_OTLP_CERTIFICATE, OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE (default: none) -
+the filepath to the trusted certificate to use when verifying a server's TLS credentials.
+OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CERTIFICATE.
+The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options.
+
+OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE (default: none) -
+the filepath to the client certificate/chain trust for client's private key to use in mTLS communication in PEM format.
+OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE takes precedence over OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE.
+The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] options.
+
+OTEL_EXPORTER_OTLP_CLIENT_KEY, OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY (default: none) -
+the filepath to the client's private key to use in mTLS communication in PEM format.
+OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY takes precedence over OTEL_EXPORTER_OTLP_CLIENT_KEY.
+The configuration can be overridden by [WithTLSCredentials], [WithGRPCConn] option.
+
+[W3C Baggage HTTP Header Content Format]: https://www.w3.org/TR/baggage/#header-content
+*/
+package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go
index 89af41002f..b826b84247 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go
index becb1f0fbb..9513c0a57c 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/envconfig/envconfig.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig"
@@ -174,13 +163,13 @@ func stringToHeader(value string) map[string]string {
global.Error(errors.New("missing '="), "parse headers", "input", header)
continue
}
- name, err := url.QueryUnescape(n)
+ name, err := url.PathUnescape(n)
if err != nil {
global.Error(err, "escape header key", "key", n)
continue
}
trimmedName := strings.TrimSpace(name)
- value, err := url.QueryUnescape(v)
+ value, err := url.PathUnescape(v)
if err != nil {
global.Error(err, "escape header value", "value", v)
continue
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go
index 1fb2906189..97cd6c54f7 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go
index 32f6dddb4f..7bb189a94b 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go
index 19b8434d4d..8f84a79963 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go
@@ -2,24 +2,15 @@
// source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
import (
"crypto/tls"
"fmt"
+ "net/http"
+ "net/url"
"path"
"strings"
"time"
@@ -32,6 +23,7 @@ import (
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry"
+ "go.opentelemetry.io/otel/internal/global"
)
const (
@@ -44,6 +36,10 @@ const (
)
type (
+ // HTTPTransportProxyFunc is a function that resolves which URL to use as proxy for a given request.
+ // This type is compatible with `http.Transport.Proxy` and can be used to set a custom proxy function to the OTLP HTTP client.
+ HTTPTransportProxyFunc func(*http.Request) (*url.URL, error)
+
SignalConfig struct {
Endpoint string
Insecure bool
@@ -55,6 +51,8 @@ type (
// gRPC configurations
GRPCCredentials credentials.TransportCredentials
+
+ Proxy HTTPTransportProxyFunc
}
Config struct {
@@ -141,9 +139,6 @@ func NewGRPCConfig(opts ...GRPCOption) Config {
if cfg.Traces.Compression == GzipCompression {
cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name)))
}
- if len(cfg.DialOptions) != 0 {
- cfg.DialOptions = append(cfg.DialOptions, cfg.DialOptions...)
- }
if cfg.ReconnectionPeriod != 0 {
p := grpc.ConnectParams{
Backoff: backoff.DefaultConfig,
@@ -261,6 +256,9 @@ func NewGRPCOption(fn func(cfg Config) Config) GRPCOption {
// Generic Options
+// WithEndpoint configures the trace host and port only; endpoint should
+// resemble "example.com" or "localhost:4317". To configure the scheme and path,
+// use WithEndpointURL.
func WithEndpoint(endpoint string) GenericOption {
return newGenericOption(func(cfg Config) Config {
cfg.Traces.Endpoint = endpoint
@@ -268,6 +266,26 @@ func WithEndpoint(endpoint string) GenericOption {
})
}
+// WithEndpointURL configures the trace scheme, host, port, and path; the
+// provided value should resemble "https://example.com:4318/v1/traces".
+func WithEndpointURL(v string) GenericOption {
+ return newGenericOption(func(cfg Config) Config {
+ u, err := url.Parse(v)
+ if err != nil {
+ global.Error(err, "otlptrace: parse endpoint url", "url", v)
+ return cfg
+ }
+
+ cfg.Traces.Endpoint = u.Host
+ cfg.Traces.URLPath = u.Path
+ if u.Scheme != "https" {
+ cfg.Traces.Insecure = true
+ }
+
+ return cfg
+ })
+}
+
func WithCompression(compression Compression) GenericOption {
return newGenericOption(func(cfg Config) Config {
cfg.Traces.Compression = compression
@@ -326,3 +344,10 @@ func WithTimeout(duration time.Duration) GenericOption {
return cfg
})
}
+
+func WithProxy(pf HTTPTransportProxyFunc) GenericOption {
+ return newGenericOption(func(cfg Config) Config {
+ cfg.Traces.Proxy = pf
+ return cfg
+ })
+}
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go
index d9dcdc96e7..3d4f699d47 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go
index 19b6d4b21f..38b97a0131 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go
index 076905e54b..a12ea4c48e 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/partialsuccess.go
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal"
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go
index 3ce7d6632b..4f2113ae2c 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go
@@ -2,18 +2,7 @@
// source: internal/shared/otlp/retry/retry.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package retry provides request retry functionality that can perform
// configurable exponential backoff for transient errors and honor any
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go
index 78ce9ad8f0..bbad0e6d01 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptracegrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
@@ -64,14 +53,48 @@ func WithInsecure() Option {
return wrappedOption{otlpconfig.WithInsecure()}
}
-// WithEndpoint sets the target endpoint the exporter will connect to. If
-// unset, localhost:4317 will be used as a default.
+// WithEndpoint sets the target endpoint (host and port) the Exporter will
+// connect to. The provided endpoint should resemble "example.com:4317" (no
+// scheme or path).
+//
+// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
+// environment variable is set, and this option is not passed, that variable
+// value will be used. If both are set, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
+// will take precedence.
+//
+// If both this option and WithEndpointURL are used, the last used option will
+// take precedence.
+//
+// By default, if an environment variable is not set, and this option is not
+// passed, "localhost:4317" will be used.
//
// This option has no effect if WithGRPCConn is used.
func WithEndpoint(endpoint string) Option {
return wrappedOption{otlpconfig.WithEndpoint(endpoint)}
}
+// WithEndpointURL sets the target endpoint URL (scheme, host, port, path)
+// the Exporter will connect to. The provided endpoint URL should resemble
+// "https://example.com:4318/v1/traces".
+//
+// If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
+// environment variable is set, and this option is not passed, that variable
+// value will be used. If both are set, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
+// will take precedence.
+//
+// If both this option and WithEndpoint are used, the last used option will
+// take precedence.
+//
+// If an invalid URL is provided, the default value will be kept.
+//
+// By default, if an environment variable is not set, and this option is not
+// passed, "https://localhost:4317/v1/traces" will be used.
+//
+// This option has no effect if WithGRPCConn is used.
+func WithEndpointURL(u string) Option {
+ return wrappedOption{otlpconfig.WithEndpointURL(u)}
+}
+
// WithReconnectionPeriod set the minimum amount of time between connection
// attempts to the target endpoint.
//
@@ -93,13 +116,7 @@ func compressorToCompression(compressor string) otlpconfig.Compression {
}
// WithCompressor sets the compressor for the gRPC client to use when sending
-// requests. It is the responsibility of the caller to ensure that the
-// compressor set has been registered with google.golang.org/grpc/encoding.
-// This can be done by encoding.RegisterCompressor. Some compressors
-// auto-register on import, such as gzip, which can be registered by calling
-// `import _ "google.golang.org/grpc/encoding/gzip"`.
-//
-// This option has no effect if WithGRPCConn is used.
+// requests. Supported compressor values: "gzip".
func WithCompressor(compressor string) Option {
return wrappedOption{otlpconfig.WithCompression(compressorToCompression(compressor))}
}
@@ -137,6 +154,8 @@ func WithServiceConfig(serviceConfig string) Option {
// connection. The options here are appended to the internal grpc.DialOptions
// used so they will take precedence over any other internal grpc.DialOptions
// they might conflict with.
+// The [grpc.WithBlock], [grpc.WithTimeout], and [grpc.WithReturnConnectionError]
+// grpc.DialOptions are ignored.
//
// This option has no effect if WithGRPCConn is used.
func WithDialOption(opts ...grpc.DialOption) Option {
diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go
index 10ac73ee3b..14ad8c33b4 100644
--- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go
+++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
// Version is the current release version of the OpenTelemetry OTLP trace exporter in use.
func Version() string {
- return "1.19.0"
+ return "1.28.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
index 9a58fb1d37..93e80ea306 100644
--- a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
+++ b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
@@ -1,18 +1,7 @@
#!/usr/bin/env bash
# Copyright The OpenTelemetry Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
diff --git a/vendor/go.opentelemetry.io/otel/handler.go b/vendor/go.opentelemetry.io/otel/handler.go
index 4115fe3bbb..07623b6791 100644
--- a/vendor/go.opentelemetry.io/otel/handler.go
+++ b/vendor/go.opentelemetry.io/otel/handler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
@@ -18,12 +7,8 @@ import (
"go.opentelemetry.io/otel/internal/global"
)
-var (
- // Compile-time check global.ErrDelegator implements ErrorHandler.
- _ ErrorHandler = (*global.ErrDelegator)(nil)
- // Compile-time check global.ErrLogger implements ErrorHandler.
- _ ErrorHandler = (*global.ErrLogger)(nil)
-)
+// Compile-time check global.ErrDelegator implements ErrorHandler.
+var _ ErrorHandler = (*global.ErrDelegator)(nil)
// GetErrorHandler returns the global ErrorHandler instance.
//
@@ -44,5 +29,5 @@ func GetErrorHandler() ErrorHandler { return global.GetErrorHandler() }
// delegate errors to h.
func SetErrorHandler(h ErrorHandler) { global.SetErrorHandler(h) }
-// Handle is a convenience function for ErrorHandler().Handle(err).
-func Handle(err error) { global.Handle(err) }
+// Handle is a convenience function for GetErrorHandler().Handle(err).
+func Handle(err error) { global.GetErrorHandler().Handle(err) }
diff --git a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
index 622c3ee3f2..822d847947 100644
--- a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
+++ b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package attribute provide several helper functions for some commonly used
@@ -25,33 +14,33 @@ import (
// BoolSliceValue converts a bool slice into an array with same elements as slice.
func BoolSliceValue(v []bool) interface{} {
var zero bool
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]bool), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// Int64SliceValue converts an int64 slice into an array with same elements as slice.
func Int64SliceValue(v []int64) interface{} {
var zero int64
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]int64), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// Float64SliceValue converts a float64 slice into an array with same elements as slice.
func Float64SliceValue(v []float64) interface{} {
var zero float64
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]float64), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// StringSliceValue converts a string slice into an array with same elements as slice.
func StringSliceValue(v []string) interface{} {
var zero string
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]string), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// AsBoolSlice converts a bool array into a slice into with same elements as array.
diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
index b96e5408e6..b4f85f44a9 100644
--- a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package baggage provides base types and functionality to store and retrieve
diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
index 4469700d9c..3aea9c491f 100644
--- a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
+++ b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/internal/baggage"
diff --git a/vendor/go.opentelemetry.io/otel/internal/gen.go b/vendor/go.opentelemetry.io/otel/internal/gen.go
index f532f07e9e..4259f0320d 100644
--- a/vendor/go.opentelemetry.io/otel/internal/gen.go
+++ b/vendor/go.opentelemetry.io/otel/internal/gen.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/internal"
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/handler.go b/vendor/go.opentelemetry.io/otel/internal/global/handler.go
index 5e9b830479..c657ff8e75 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/handler.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/handler.go
@@ -1,38 +1,13 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
import (
"log"
- "os"
"sync/atomic"
)
-var (
- // GlobalErrorHandler provides an ErrorHandler that can be used
- // throughout an OpenTelemetry instrumented project. When a user
- // specified ErrorHandler is registered (`SetErrorHandler`) all calls to
- // `Handle` and will be delegated to the registered ErrorHandler.
- GlobalErrorHandler = defaultErrorHandler()
-
- // Compile-time check that delegator implements ErrorHandler.
- _ ErrorHandler = (*ErrDelegator)(nil)
- // Compile-time check that errLogger implements ErrorHandler.
- _ ErrorHandler = (*ErrLogger)(nil)
-)
-
// ErrorHandler handles irremediable events.
type ErrorHandler interface {
// Handle handles any error deemed irremediable by an OpenTelemetry
@@ -44,59 +19,18 @@ type ErrDelegator struct {
delegate atomic.Pointer[ErrorHandler]
}
-func (d *ErrDelegator) Handle(err error) {
- d.getDelegate().Handle(err)
-}
+// Compile-time check that delegator implements ErrorHandler.
+var _ ErrorHandler = (*ErrDelegator)(nil)
-func (d *ErrDelegator) getDelegate() ErrorHandler {
- return *d.delegate.Load()
+func (d *ErrDelegator) Handle(err error) {
+ if eh := d.delegate.Load(); eh != nil {
+ (*eh).Handle(err)
+ return
+ }
+ log.Print(err)
}
// setDelegate sets the ErrorHandler delegate.
func (d *ErrDelegator) setDelegate(eh ErrorHandler) {
d.delegate.Store(&eh)
}
-
-func defaultErrorHandler() *ErrDelegator {
- d := &ErrDelegator{}
- d.setDelegate(&ErrLogger{l: log.New(os.Stderr, "", log.LstdFlags)})
- return d
-}
-
-// ErrLogger logs errors if no delegate is set, otherwise they are delegated.
-type ErrLogger struct {
- l *log.Logger
-}
-
-// Handle logs err if no delegate is set, otherwise it is delegated.
-func (h *ErrLogger) Handle(err error) {
- h.l.Print(err)
-}
-
-// GetErrorHandler returns the global ErrorHandler instance.
-//
-// The default ErrorHandler instance returned will log all errors to STDERR
-// until an override ErrorHandler is set with SetErrorHandler. All
-// ErrorHandler returned prior to this will automatically forward errors to
-// the set instance instead of logging.
-//
-// Subsequent calls to SetErrorHandler after the first will not forward errors
-// to the new ErrorHandler for prior returned instances.
-func GetErrorHandler() ErrorHandler {
- return GlobalErrorHandler
-}
-
-// SetErrorHandler sets the global ErrorHandler to h.
-//
-// The first time this is called all ErrorHandler previously returned from
-// GetErrorHandler will send errors to h instead of the default logging
-// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not
-// delegate errors to h.
-func SetErrorHandler(h ErrorHandler) {
- GlobalErrorHandler.setDelegate(h)
-}
-
-// Handle is a convenience function for ErrorHandler().Handle(err).
-func Handle(err error) {
- GetErrorHandler().Handle(err)
-}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
index a33eded872..3a0cc42f6a 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -34,11 +23,13 @@ type afCounter struct {
name string
opts []metric.Float64ObservableCounterOption
- delegate atomic.Value //metric.Float64ObservableCounter
+ delegate atomic.Value // metric.Float64ObservableCounter
}
-var _ unwrapper = (*afCounter)(nil)
-var _ metric.Float64ObservableCounter = (*afCounter)(nil)
+var (
+ _ unwrapper = (*afCounter)(nil)
+ _ metric.Float64ObservableCounter = (*afCounter)(nil)
+)
func (i *afCounter) setDelegate(m metric.Meter) {
ctr, err := m.Float64ObservableCounter(i.name, i.opts...)
@@ -63,11 +54,13 @@ type afUpDownCounter struct {
name string
opts []metric.Float64ObservableUpDownCounterOption
- delegate atomic.Value //metric.Float64ObservableUpDownCounter
+ delegate atomic.Value // metric.Float64ObservableUpDownCounter
}
-var _ unwrapper = (*afUpDownCounter)(nil)
-var _ metric.Float64ObservableUpDownCounter = (*afUpDownCounter)(nil)
+var (
+ _ unwrapper = (*afUpDownCounter)(nil)
+ _ metric.Float64ObservableUpDownCounter = (*afUpDownCounter)(nil)
+)
func (i *afUpDownCounter) setDelegate(m metric.Meter) {
ctr, err := m.Float64ObservableUpDownCounter(i.name, i.opts...)
@@ -92,11 +85,13 @@ type afGauge struct {
name string
opts []metric.Float64ObservableGaugeOption
- delegate atomic.Value //metric.Float64ObservableGauge
+ delegate atomic.Value // metric.Float64ObservableGauge
}
-var _ unwrapper = (*afGauge)(nil)
-var _ metric.Float64ObservableGauge = (*afGauge)(nil)
+var (
+ _ unwrapper = (*afGauge)(nil)
+ _ metric.Float64ObservableGauge = (*afGauge)(nil)
+)
func (i *afGauge) setDelegate(m metric.Meter) {
ctr, err := m.Float64ObservableGauge(i.name, i.opts...)
@@ -121,11 +116,13 @@ type aiCounter struct {
name string
opts []metric.Int64ObservableCounterOption
- delegate atomic.Value //metric.Int64ObservableCounter
+ delegate atomic.Value // metric.Int64ObservableCounter
}
-var _ unwrapper = (*aiCounter)(nil)
-var _ metric.Int64ObservableCounter = (*aiCounter)(nil)
+var (
+ _ unwrapper = (*aiCounter)(nil)
+ _ metric.Int64ObservableCounter = (*aiCounter)(nil)
+)
func (i *aiCounter) setDelegate(m metric.Meter) {
ctr, err := m.Int64ObservableCounter(i.name, i.opts...)
@@ -150,11 +147,13 @@ type aiUpDownCounter struct {
name string
opts []metric.Int64ObservableUpDownCounterOption
- delegate atomic.Value //metric.Int64ObservableUpDownCounter
+ delegate atomic.Value // metric.Int64ObservableUpDownCounter
}
-var _ unwrapper = (*aiUpDownCounter)(nil)
-var _ metric.Int64ObservableUpDownCounter = (*aiUpDownCounter)(nil)
+var (
+ _ unwrapper = (*aiUpDownCounter)(nil)
+ _ metric.Int64ObservableUpDownCounter = (*aiUpDownCounter)(nil)
+)
func (i *aiUpDownCounter) setDelegate(m metric.Meter) {
ctr, err := m.Int64ObservableUpDownCounter(i.name, i.opts...)
@@ -179,11 +178,13 @@ type aiGauge struct {
name string
opts []metric.Int64ObservableGaugeOption
- delegate atomic.Value //metric.Int64ObservableGauge
+ delegate atomic.Value // metric.Int64ObservableGauge
}
-var _ unwrapper = (*aiGauge)(nil)
-var _ metric.Int64ObservableGauge = (*aiGauge)(nil)
+var (
+ _ unwrapper = (*aiGauge)(nil)
+ _ metric.Int64ObservableGauge = (*aiGauge)(nil)
+)
func (i *aiGauge) setDelegate(m metric.Meter) {
ctr, err := m.Int64ObservableGauge(i.name, i.opts...)
@@ -208,7 +209,7 @@ type sfCounter struct {
name string
opts []metric.Float64CounterOption
- delegate atomic.Value //metric.Float64Counter
+ delegate atomic.Value // metric.Float64Counter
}
var _ metric.Float64Counter = (*sfCounter)(nil)
@@ -234,7 +235,7 @@ type sfUpDownCounter struct {
name string
opts []metric.Float64UpDownCounterOption
- delegate atomic.Value //metric.Float64UpDownCounter
+ delegate atomic.Value // metric.Float64UpDownCounter
}
var _ metric.Float64UpDownCounter = (*sfUpDownCounter)(nil)
@@ -260,7 +261,7 @@ type sfHistogram struct {
name string
opts []metric.Float64HistogramOption
- delegate atomic.Value //metric.Float64Histogram
+ delegate atomic.Value // metric.Float64Histogram
}
var _ metric.Float64Histogram = (*sfHistogram)(nil)
@@ -280,13 +281,39 @@ func (i *sfHistogram) Record(ctx context.Context, x float64, opts ...metric.Reco
}
}
+type sfGauge struct {
+ embedded.Float64Gauge
+
+ name string
+ opts []metric.Float64GaugeOption
+
+ delegate atomic.Value // metric.Float64Gauge
+}
+
+var _ metric.Float64Gauge = (*sfGauge)(nil)
+
+func (i *sfGauge) setDelegate(m metric.Meter) {
+ ctr, err := m.Float64Gauge(i.name, i.opts...)
+ if err != nil {
+ GetErrorHandler().Handle(err)
+ return
+ }
+ i.delegate.Store(ctr)
+}
+
+func (i *sfGauge) Record(ctx context.Context, x float64, opts ...metric.RecordOption) {
+ if ctr := i.delegate.Load(); ctr != nil {
+ ctr.(metric.Float64Gauge).Record(ctx, x, opts...)
+ }
+}
+
type siCounter struct {
embedded.Int64Counter
name string
opts []metric.Int64CounterOption
- delegate atomic.Value //metric.Int64Counter
+ delegate atomic.Value // metric.Int64Counter
}
var _ metric.Int64Counter = (*siCounter)(nil)
@@ -312,7 +339,7 @@ type siUpDownCounter struct {
name string
opts []metric.Int64UpDownCounterOption
- delegate atomic.Value //metric.Int64UpDownCounter
+ delegate atomic.Value // metric.Int64UpDownCounter
}
var _ metric.Int64UpDownCounter = (*siUpDownCounter)(nil)
@@ -338,7 +365,7 @@ type siHistogram struct {
name string
opts []metric.Int64HistogramOption
- delegate atomic.Value //metric.Int64Histogram
+ delegate atomic.Value // metric.Int64Histogram
}
var _ metric.Int64Histogram = (*siHistogram)(nil)
@@ -357,3 +384,29 @@ func (i *siHistogram) Record(ctx context.Context, x int64, opts ...metric.Record
ctr.(metric.Int64Histogram).Record(ctx, x, opts...)
}
}
+
+type siGauge struct {
+ embedded.Int64Gauge
+
+ name string
+ opts []metric.Int64GaugeOption
+
+ delegate atomic.Value // metric.Int64Gauge
+}
+
+var _ metric.Int64Gauge = (*siGauge)(nil)
+
+func (i *siGauge) setDelegate(m metric.Meter) {
+ ctr, err := m.Int64Gauge(i.name, i.opts...)
+ if err != nil {
+ GetErrorHandler().Handle(err)
+ return
+ }
+ i.delegate.Store(ctr)
+}
+
+func (i *siGauge) Record(ctx context.Context, x int64, opts ...metric.RecordOption) {
+ if ctr := i.delegate.Load(); ctr != nil {
+ ctr.(metric.Int64Gauge).Record(ctx, x, opts...)
+ }
+}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
index c6f305a2b7..adbca7d347 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -23,17 +12,20 @@ import (
"github.com/go-logr/stdr"
)
-// globalLogger is the logging interface used within the otel api and sdk provide details of the internals.
+// globalLogger holds a reference to the [logr.Logger] used within
+// go.opentelemetry.io/otel.
//
// The default logger uses stdr which is backed by the standard `log.Logger`
// interface. This logger will only show messages at the Error Level.
-var globalLogger atomic.Pointer[logr.Logger]
+var globalLogger = func() *atomic.Pointer[logr.Logger] {
+ l := stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))
-func init() {
- SetLogger(stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile)))
-}
+ p := new(atomic.Pointer[logr.Logger])
+ p.Store(&l)
+ return p
+}()
-// SetLogger overrides the globalLogger with l.
+// SetLogger sets the global Logger to l.
//
// To see Warn messages use a logger with `l.V(1).Enabled() == true`
// To see Info messages use a logger with `l.V(4).Enabled() == true`
@@ -42,28 +34,29 @@ func SetLogger(l logr.Logger) {
globalLogger.Store(&l)
}
-func getLogger() logr.Logger {
+// GetLogger returns the global logger.
+func GetLogger() logr.Logger {
return *globalLogger.Load()
}
// Info prints messages about the general state of the API or SDK.
// This should usually be less than 5 messages a minute.
func Info(msg string, keysAndValues ...interface{}) {
- getLogger().V(4).Info(msg, keysAndValues...)
+ GetLogger().V(4).Info(msg, keysAndValues...)
}
// Error prints messages about exceptional states of the API or SDK.
func Error(err error, msg string, keysAndValues ...interface{}) {
- getLogger().Error(err, msg, keysAndValues...)
+ GetLogger().Error(err, msg, keysAndValues...)
}
// Debug prints messages about all internal changes in the API or SDK.
func Debug(msg string, keysAndValues ...interface{}) {
- getLogger().V(8).Info(msg, keysAndValues...)
+ GetLogger().V(8).Info(msg, keysAndValues...)
}
// Warn prints messages about warnings in the API or SDK.
// Not an error but is likely more important than an informational event.
func Warn(msg string, keysAndValues ...interface{}) {
- getLogger().V(1).Info(msg, keysAndValues...)
+ GetLogger().V(1).Info(msg, keysAndValues...)
}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/vendor/go.opentelemetry.io/otel/internal/global/meter.go
index 0097db478c..cfd1df9bfa 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/meter.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/meter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -76,6 +65,7 @@ func (p *meterProvider) Meter(name string, opts ...metric.MeterOption) metric.Me
key := il{
name: name,
version: c.InstrumentationVersion(),
+ schema: c.SchemaURL(),
}
if p.meters == nil {
@@ -130,9 +120,11 @@ func (m *meter) setDelegate(provider metric.MeterProvider) {
inst.setDelegate(meter)
}
- for e := m.registry.Front(); e != nil; e = e.Next() {
+ var n *list.Element
+ for e := m.registry.Front(); e != nil; e = n {
r := e.Value.(*registration)
r.setDelegate(meter)
+ n = e.Next()
m.registry.Remove(e)
}
@@ -173,6 +165,17 @@ func (m *meter) Int64Histogram(name string, options ...metric.Int64HistogramOpti
return i, nil
}
+func (m *meter) Int64Gauge(name string, options ...metric.Int64GaugeOption) (metric.Int64Gauge, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Int64Gauge(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &siGauge{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) {
if del, ok := m.delegate.Load().(metric.Meter); ok {
return del.Int64ObservableCounter(name, options...)
@@ -239,6 +242,17 @@ func (m *meter) Float64Histogram(name string, options ...metric.Float64Histogram
return i, nil
}
+func (m *meter) Float64Gauge(name string, options ...metric.Float64GaugeOption) (metric.Float64Gauge, error) {
+ if del, ok := m.delegate.Load().(metric.Meter); ok {
+ return del.Float64Gauge(name, options...)
+ }
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+ i := &sfGauge{name: name, opts: options}
+ m.instruments = append(m.instruments, i)
+ return i, nil
+}
+
func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) {
if del, ok := m.delegate.Load().(metric.Meter); ok {
return del.Float64ObservableCounter(name, options...)
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
index 06bac35c2f..38560ff991 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/state.go b/vendor/go.opentelemetry.io/otel/internal/global/state.go
index 7985005bcb..204ea142a5 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/state.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/state.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -25,6 +14,10 @@ import (
)
type (
+ errorHandlerHolder struct {
+ eh ErrorHandler
+ }
+
tracerProviderHolder struct {
tp trace.TracerProvider
}
@@ -39,15 +32,59 @@ type (
)
var (
+ globalErrorHandler = defaultErrorHandler()
globalTracer = defaultTracerValue()
globalPropagators = defaultPropagatorsValue()
globalMeterProvider = defaultMeterProvider()
+ delegateErrorHandlerOnce sync.Once
delegateTraceOnce sync.Once
delegateTextMapPropagatorOnce sync.Once
delegateMeterOnce sync.Once
)
+// GetErrorHandler returns the global ErrorHandler instance.
+//
+// The default ErrorHandler instance returned will log all errors to STDERR
+// until an override ErrorHandler is set with SetErrorHandler. All
+// ErrorHandler returned prior to this will automatically forward errors to
+// the set instance instead of logging.
+//
+// Subsequent calls to SetErrorHandler after the first will not forward errors
+// to the new ErrorHandler for prior returned instances.
+func GetErrorHandler() ErrorHandler {
+ return globalErrorHandler.Load().(errorHandlerHolder).eh
+}
+
+// SetErrorHandler sets the global ErrorHandler to h.
+//
+// The first time this is called all ErrorHandler previously returned from
+// GetErrorHandler will send errors to h instead of the default logging
+// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not
+// delegate errors to h.
+func SetErrorHandler(h ErrorHandler) {
+ current := GetErrorHandler()
+
+ if _, cOk := current.(*ErrDelegator); cOk {
+ if _, ehOk := h.(*ErrDelegator); ehOk && current == h {
+ // Do not assign to the delegate of the default ErrDelegator to be
+ // itself.
+ Error(
+ errors.New("no ErrorHandler delegate configured"),
+ "ErrorHandler remains its current value.",
+ )
+ return
+ }
+ }
+
+ delegateErrorHandlerOnce.Do(func() {
+ if def, ok := current.(*ErrDelegator); ok {
+ def.setDelegate(h)
+ }
+ })
+ globalErrorHandler.Store(errorHandlerHolder{eh: h})
+}
+
// TracerProvider is the internal implementation for global.TracerProvider.
func TracerProvider() trace.TracerProvider {
return globalTracer.Load().(tracerProviderHolder).tp
@@ -63,7 +100,7 @@ func SetTracerProvider(tp trace.TracerProvider) {
// to itself.
Error(
errors.New("no delegate configured in tracer provider"),
- "Setting tracer provider to it's current value. No delegate will be configured",
+ "Setting tracer provider to its current value. No delegate will be configured",
)
return
}
@@ -92,7 +129,7 @@ func SetTextMapPropagator(p propagation.TextMapPropagator) {
// delegate to itself.
Error(
errors.New("no delegate configured in text map propagator"),
- "Setting text map propagator to it's current value. No delegate will be configured",
+ "Setting text map propagator to its current value. No delegate will be configured",
)
return
}
@@ -123,7 +160,7 @@ func SetMeterProvider(mp metric.MeterProvider) {
// to itself.
Error(
errors.New("no delegate configured in meter provider"),
- "Setting meter provider to it's current value. No delegate will be configured",
+ "Setting meter provider to its current value. No delegate will be configured",
)
return
}
@@ -137,6 +174,12 @@ func SetMeterProvider(mp metric.MeterProvider) {
globalMeterProvider.Store(meterProviderHolder{mp: mp})
}
+func defaultErrorHandler() *atomic.Value {
+ v := &atomic.Value{}
+ v.Store(errorHandlerHolder{eh: &ErrDelegator{}})
+ return v
+}
+
func defaultTracerValue() *atomic.Value {
v := &atomic.Value{}
v.Store(tracerProviderHolder{tp: &tracerProvider{}})
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/vendor/go.opentelemetry.io/otel/internal/global/trace.go
index 5f008d0982..e31f442b48 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/trace.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -39,6 +28,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"
+ "go.opentelemetry.io/otel/trace/embedded"
)
// tracerProvider is a placeholder for a configured SDK TracerProvider.
@@ -46,6 +36,8 @@ import (
// All TracerProvider functionality is forwarded to a delegate once
// configured.
type tracerProvider struct {
+ embedded.TracerProvider
+
mtx sync.Mutex
tracers map[il]*tracer
delegate trace.TracerProvider
@@ -94,6 +86,7 @@ func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T
key := il{
name: name,
version: c.InstrumentationVersion(),
+ schema: c.SchemaURL(),
}
if p.tracers == nil {
@@ -109,16 +102,15 @@ func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T
return t
}
-type il struct {
- name string
- version string
-}
+type il struct{ name, version, schema string }
// tracer is a placeholder for a trace.Tracer.
//
// All Tracer functionality is forwarded to a delegate once configured.
// Otherwise, all functionality is forwarded to a NoopTracer.
type tracer struct {
+ embedded.Tracer
+
name string
opts []trace.TracerOption
provider *tracerProvider
@@ -156,6 +148,8 @@ func (t *tracer) Start(ctx context.Context, name string, opts ...trace.SpanStart
// SpanContext. It performs no operations other than to return the wrapped
// SpanContext.
type nonRecordingSpan struct {
+ embedded.Span
+
sc trace.SpanContext
tracer *tracer
}
@@ -186,6 +180,9 @@ func (nonRecordingSpan) RecordError(error, ...trace.EventOption) {}
// AddEvent does nothing.
func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) {}
+// AddLink does nothing.
+func (nonRecordingSpan) AddLink(trace.Link) {}
+
// SetName does nothing.
func (nonRecordingSpan) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
index e07e794000..3e7bb3b356 100644
--- a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
+++ b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/internal"
diff --git a/vendor/go.opentelemetry.io/otel/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal_logging.go
index c4f8acd5d8..6de7f2e4d8 100644
--- a/vendor/go.opentelemetry.io/otel/internal_logging.go
+++ b/vendor/go.opentelemetry.io/otel/internal_logging.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/metric.go b/vendor/go.opentelemetry.io/otel/metric.go
index f955171951..1e6473b32f 100644
--- a/vendor/go.opentelemetry.io/otel/metric.go
+++ b/vendor/go.opentelemetry.io/otel/metric.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/metric/README.md b/vendor/go.opentelemetry.io/otel/metric/README.md
new file mode 100644
index 0000000000..0cf902e01f
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/README.md
@@ -0,0 +1,3 @@
+# Metric API
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/metric)
diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
index 072baa8e8d..cf23db7780 100644
--- a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -50,7 +39,7 @@ type Float64ObservableCounter interface {
}
// Float64ObservableCounterConfig contains options for asynchronous counter
-// instruments that record int64 values.
+// instruments that record float64 values.
type Float64ObservableCounterConfig struct {
description string
unit string
@@ -108,7 +97,7 @@ type Float64ObservableUpDownCounter interface {
}
// Float64ObservableUpDownCounterConfig contains options for asynchronous
-// counter instruments that record int64 values.
+// counter instruments that record float64 values.
type Float64ObservableUpDownCounterConfig struct {
description string
unit string
@@ -165,7 +154,7 @@ type Float64ObservableGauge interface {
}
// Float64ObservableGaugeConfig contains options for asynchronous counter
-// instruments that record int64 values.
+// instruments that record float64 values.
type Float64ObservableGaugeConfig struct {
description string
unit string
diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
index 9bd6ebf020..c82ba5324e 100644
--- a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/config.go b/vendor/go.opentelemetry.io/otel/metric/config.go
index 778ad2d748..d9e3b13e4d 100644
--- a/vendor/go.opentelemetry.io/otel/metric/config.go
+++ b/vendor/go.opentelemetry.io/otel/metric/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/doc.go b/vendor/go.opentelemetry.io/otel/metric/doc.go
index ae24e448d9..f153745b00 100644
--- a/vendor/go.opentelemetry.io/otel/metric/doc.go
+++ b/vendor/go.opentelemetry.io/otel/metric/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package metric provides the OpenTelemetry API used to measure metrics about
@@ -68,6 +57,23 @@ asynchronous measurement, a Gauge ([Int64ObservableGauge] and
See the [OpenTelemetry documentation] for more information about instruments
and their intended use.
+# Instrument Name
+
+OpenTelemetry defines an [instrument name syntax] that restricts what
+instrument names are allowed.
+
+Instrument names should ...
+
+ - Not be empty.
+ - Have an alphabetic character as their first letter.
+ - Have any letter after the first be an alphanumeric character, ‘_’, ‘.’,
+ ‘-’, or ‘/’.
+ - Have a maximum length of 255 letters.
+
+To ensure compatibility with observability platforms, all instruments created
+need to conform to this syntax. Not all implementations of the API will validate
+these names, it is the callers responsibility to ensure compliance.
+
# Measurements
Measurements are made by recording values and information about the values with
@@ -149,7 +155,7 @@ of [go.opentelemetry.io/otel/metric].
Finally, an author can embed another implementation in theirs. The embedded
implementation will be used for methods not defined by the author. For example,
-an author who want to default to silently dropping the call can use
+an author who wants to default to silently dropping the call can use
[go.opentelemetry.io/otel/metric/noop]:
import "go.opentelemetry.io/otel/metric/noop"
@@ -164,6 +170,7 @@ It is strongly recommended that authors only embed
That implementation is the only one OpenTelemetry authors can guarantee will
fully implement all the API interfaces when a user updates their API.
+[instrument name syntax]: https://opentelemetry.io/docs/specs/otel/metrics/api/#instrument-name-syntax
[OpenTelemetry documentation]: https://opentelemetry.io/docs/concepts/signals/metrics/
[GetMeterProvider]: https://pkg.go.dev/go.opentelemetry.io/otel#GetMeterProvider
*/
diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/README.md b/vendor/go.opentelemetry.io/otel/metric/embedded/README.md
new file mode 100644
index 0000000000..1f6e0efa73
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/embedded/README.md
@@ -0,0 +1,3 @@
+# Metric Embedded
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/metric/embedded)
diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
index ae0bdbd2e6..1a9dc68093 100644
--- a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
+++ b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package embedded provides interfaces embedded within the [OpenTelemetry
// metric API].
@@ -113,6 +102,16 @@ type Float64Counter interface{ float64Counter() }
// the API package).
type Float64Histogram interface{ float64Histogram() }
+// Float64Gauge is embedded in [go.opentelemetry.io/otel/metric.Float64Gauge].
+//
+// Embed this interface in your implementation of the
+// [go.opentelemetry.io/otel/metric.Float64Gauge] if you want users to
+// experience a compilation error, signaling they need to update to your latest
+// implementation, when the [go.opentelemetry.io/otel/metric.Float64Gauge]
+// interface is extended (which is something that can happen without a major
+// version bump of the API package).
+type Float64Gauge interface{ float64Gauge() }
+
// Float64ObservableCounter is embedded in
// [go.opentelemetry.io/otel/metric.Float64ObservableCounter].
//
@@ -185,6 +184,16 @@ type Int64Counter interface{ int64Counter() }
// the API package).
type Int64Histogram interface{ int64Histogram() }
+// Int64Gauge is embedded in [go.opentelemetry.io/otel/metric.Int64Gauge].
+//
+// Embed this interface in your implementation of the
+// [go.opentelemetry.io/otel/metric.Int64Gauge] if you want users to experience
+// a compilation error, signaling they need to update to your latest
+// implementation, when the [go.opentelemetry.io/otel/metric.Int64Gauge]
+// interface is extended (which is something that can happen without a major
+// version bump of the API package).
+type Int64Gauge interface{ int64Gauge() }
+
// Int64ObservableCounter is embedded in
// [go.opentelemetry.io/otel/metric.Int64ObservableCounter].
//
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument.go b/vendor/go.opentelemetry.io/otel/metric/instrument.go
index cdca00058c..ea52e40233 100644
--- a/vendor/go.opentelemetry.io/otel/metric/instrument.go
+++ b/vendor/go.opentelemetry.io/otel/metric/instrument.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -27,6 +16,7 @@ type InstrumentOption interface {
Int64CounterOption
Int64UpDownCounterOption
Int64HistogramOption
+ Int64GaugeOption
Int64ObservableCounterOption
Int64ObservableUpDownCounterOption
Int64ObservableGaugeOption
@@ -34,11 +24,18 @@ type InstrumentOption interface {
Float64CounterOption
Float64UpDownCounterOption
Float64HistogramOption
+ Float64GaugeOption
Float64ObservableCounterOption
Float64ObservableUpDownCounterOption
Float64ObservableGaugeOption
}
+// HistogramOption applies options to histogram instruments.
+type HistogramOption interface {
+ Int64HistogramOption
+ Float64HistogramOption
+}
+
type descOpt string
func (o descOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig {
@@ -56,6 +53,11 @@ func (o descOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64Histogra
return c
}
+func (o descOpt) applyFloat64Gauge(c Float64GaugeConfig) Float64GaugeConfig {
+ c.description = string(o)
+ return c
+}
+
func (o descOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig {
c.description = string(o)
return c
@@ -86,6 +88,11 @@ func (o descOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfi
return c
}
+func (o descOpt) applyInt64Gauge(c Int64GaugeConfig) Int64GaugeConfig {
+ c.description = string(o)
+ return c
+}
+
func (o descOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig {
c.description = string(o)
return c
@@ -121,6 +128,11 @@ func (o unitOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64Histogra
return c
}
+func (o unitOpt) applyFloat64Gauge(c Float64GaugeConfig) Float64GaugeConfig {
+ c.unit = string(o)
+ return c
+}
+
func (o unitOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig {
c.unit = string(o)
return c
@@ -151,6 +163,11 @@ func (o unitOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfi
return c
}
+func (o unitOpt) applyInt64Gauge(c Int64GaugeConfig) Int64GaugeConfig {
+ c.unit = string(o)
+ return c
+}
+
func (o unitOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig {
c.unit = string(o)
return c
@@ -171,6 +188,23 @@ func (o unitOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64Ob
// The unit u should be defined using the appropriate [UCUM](https://ucum.org) case-sensitive code.
func WithUnit(u string) InstrumentOption { return unitOpt(u) }
+// WithExplicitBucketBoundaries sets the instrument explicit bucket boundaries.
+//
+// This option is considered "advisory", and may be ignored by API implementations.
+func WithExplicitBucketBoundaries(bounds ...float64) HistogramOption { return bucketOpt(bounds) }
+
+type bucketOpt []float64
+
+func (o bucketOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig {
+ c.explicitBucketBoundaries = o
+ return c
+}
+
+func (o bucketOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig {
+ c.explicitBucketBoundaries = o
+ return c
+}
+
// AddOption applies options to an addition measurement. See
// [MeasurementOption] for other options that can be used as an AddOption.
type AddOption interface {
diff --git a/vendor/go.opentelemetry.io/otel/metric/meter.go b/vendor/go.opentelemetry.io/otel/metric/meter.go
index 2520bc74af..6a7991e015 100644
--- a/vendor/go.opentelemetry.io/otel/metric/meter.go
+++ b/vendor/go.opentelemetry.io/otel/metric/meter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -58,17 +47,37 @@ type Meter interface {
// Int64Counter returns a new Int64Counter instrument identified by name
// and configured with options. The instrument is used to synchronously
// record increasing int64 measurements during a computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64Counter(name string, options ...Int64CounterOption) (Int64Counter, error)
// Int64UpDownCounter returns a new Int64UpDownCounter instrument
// identified by name and configured with options. The instrument is used
// to synchronously record int64 measurements during a computational
// operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64UpDownCounter(name string, options ...Int64UpDownCounterOption) (Int64UpDownCounter, error)
// Int64Histogram returns a new Int64Histogram instrument identified by
// name and configured with options. The instrument is used to
// synchronously record the distribution of int64 measurements during a
// computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64Histogram(name string, options ...Int64HistogramOption) (Int64Histogram, error)
+ // Int64Gauge returns a new Int64Gauge instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // instantaneous int64 measurements during a computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
+ Int64Gauge(name string, options ...Int64GaugeOption) (Int64Gauge, error)
// Int64ObservableCounter returns a new Int64ObservableCounter identified
// by name and configured with options. The instrument is used to
// asynchronously record increasing int64 measurements once per a
@@ -78,6 +87,10 @@ type Meter interface {
// the WithInt64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64ObservableCounter(name string, options ...Int64ObservableCounterOption) (Int64ObservableCounter, error)
// Int64ObservableUpDownCounter returns a new Int64ObservableUpDownCounter
// instrument identified by name and configured with options. The
@@ -88,6 +101,10 @@ type Meter interface {
// the WithInt64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64ObservableUpDownCounter(name string, options ...Int64ObservableUpDownCounterOption) (Int64ObservableUpDownCounter, error)
// Int64ObservableGauge returns a new Int64ObservableGauge instrument
// identified by name and configured with options. The instrument is used
@@ -98,23 +115,47 @@ type Meter interface {
// the WithInt64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64ObservableGauge(name string, options ...Int64ObservableGaugeOption) (Int64ObservableGauge, error)
// Float64Counter returns a new Float64Counter instrument identified by
// name and configured with options. The instrument is used to
// synchronously record increasing float64 measurements during a
// computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64Counter(name string, options ...Float64CounterOption) (Float64Counter, error)
// Float64UpDownCounter returns a new Float64UpDownCounter instrument
// identified by name and configured with options. The instrument is used
// to synchronously record float64 measurements during a computational
// operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64UpDownCounter(name string, options ...Float64UpDownCounterOption) (Float64UpDownCounter, error)
// Float64Histogram returns a new Float64Histogram instrument identified by
// name and configured with options. The instrument is used to
// synchronously record the distribution of float64 measurements during a
// computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64Histogram(name string, options ...Float64HistogramOption) (Float64Histogram, error)
+ // Float64Gauge returns a new Float64Gauge instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // instantaneous float64 measurements during a computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
+ Float64Gauge(name string, options ...Float64GaugeOption) (Float64Gauge, error)
// Float64ObservableCounter returns a new Float64ObservableCounter
// instrument identified by name and configured with options. The
// instrument is used to asynchronously record increasing float64
@@ -124,6 +165,10 @@ type Meter interface {
// the WithFloat64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64ObservableCounter(name string, options ...Float64ObservableCounterOption) (Float64ObservableCounter, error)
// Float64ObservableUpDownCounter returns a new
// Float64ObservableUpDownCounter instrument identified by name and
@@ -134,6 +179,10 @@ type Meter interface {
// the WithFloat64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64ObservableUpDownCounter(name string, options ...Float64ObservableUpDownCounterOption) (Float64ObservableUpDownCounter, error)
// Float64ObservableGauge returns a new Float64ObservableGauge instrument
// identified by name and configured with options. The instrument is used
@@ -144,6 +193,10 @@ type Meter interface {
// the WithFloat64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64ObservableGauge(name string, options ...Float64ObservableGaugeOption) (Float64ObservableGauge, error)
// RegisterCallback registers f to be called during the collection of a
diff --git a/vendor/go.opentelemetry.io/otel/metric/noop/README.md b/vendor/go.opentelemetry.io/otel/metric/noop/README.md
new file mode 100644
index 0000000000..bb89694356
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/noop/README.md
@@ -0,0 +1,3 @@
+# Metric Noop
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/metric/noop)
diff --git a/vendor/go.opentelemetry.io/otel/metric/noop/noop.go b/vendor/go.opentelemetry.io/otel/metric/noop/noop.go
new file mode 100644
index 0000000000..ca6fcbdc09
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/noop/noop.go
@@ -0,0 +1,281 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package noop provides an implementation of the OpenTelemetry metric API that
+// produces no telemetry and minimizes used computation resources.
+//
+// Using this package to implement the OpenTelemetry metric API will
+// effectively disable OpenTelemetry.
+//
+// This implementation can be embedded in other implementations of the
+// OpenTelemetry metric API. Doing so will mean the implementation defaults to
+// no operation for methods it does not implement.
+package noop // import "go.opentelemetry.io/otel/metric/noop"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/metric"
+ "go.opentelemetry.io/otel/metric/embedded"
+)
+
+var (
+ // Compile-time check this implements the OpenTelemetry API.
+
+ _ metric.MeterProvider = MeterProvider{}
+ _ metric.Meter = Meter{}
+ _ metric.Observer = Observer{}
+ _ metric.Registration = Registration{}
+ _ metric.Int64Counter = Int64Counter{}
+ _ metric.Float64Counter = Float64Counter{}
+ _ metric.Int64UpDownCounter = Int64UpDownCounter{}
+ _ metric.Float64UpDownCounter = Float64UpDownCounter{}
+ _ metric.Int64Histogram = Int64Histogram{}
+ _ metric.Float64Histogram = Float64Histogram{}
+ _ metric.Int64Gauge = Int64Gauge{}
+ _ metric.Float64Gauge = Float64Gauge{}
+ _ metric.Int64ObservableCounter = Int64ObservableCounter{}
+ _ metric.Float64ObservableCounter = Float64ObservableCounter{}
+ _ metric.Int64ObservableGauge = Int64ObservableGauge{}
+ _ metric.Float64ObservableGauge = Float64ObservableGauge{}
+ _ metric.Int64ObservableUpDownCounter = Int64ObservableUpDownCounter{}
+ _ metric.Float64ObservableUpDownCounter = Float64ObservableUpDownCounter{}
+ _ metric.Int64Observer = Int64Observer{}
+ _ metric.Float64Observer = Float64Observer{}
+)
+
+// MeterProvider is an OpenTelemetry No-Op MeterProvider.
+type MeterProvider struct{ embedded.MeterProvider }
+
+// NewMeterProvider returns a MeterProvider that does not record any telemetry.
+func NewMeterProvider() MeterProvider {
+ return MeterProvider{}
+}
+
+// Meter returns an OpenTelemetry Meter that does not record any telemetry.
+func (MeterProvider) Meter(string, ...metric.MeterOption) metric.Meter {
+ return Meter{}
+}
+
+// Meter is an OpenTelemetry No-Op Meter.
+type Meter struct{ embedded.Meter }
+
+// Int64Counter returns a Counter used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Int64Counter(string, ...metric.Int64CounterOption) (metric.Int64Counter, error) {
+ return Int64Counter{}, nil
+}
+
+// Int64UpDownCounter returns an UpDownCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Int64UpDownCounter(string, ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) {
+ return Int64UpDownCounter{}, nil
+}
+
+// Int64Histogram returns a Histogram used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Int64Histogram(string, ...metric.Int64HistogramOption) (metric.Int64Histogram, error) {
+ return Int64Histogram{}, nil
+}
+
+// Int64Gauge returns a Gauge used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Int64Gauge(string, ...metric.Int64GaugeOption) (metric.Int64Gauge, error) {
+ return Int64Gauge{}, nil
+}
+
+// Int64ObservableCounter returns an ObservableCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Int64ObservableCounter(string, ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) {
+ return Int64ObservableCounter{}, nil
+}
+
+// Int64ObservableUpDownCounter returns an ObservableUpDownCounter used to
+// record int64 measurements that produces no telemetry.
+func (Meter) Int64ObservableUpDownCounter(string, ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) {
+ return Int64ObservableUpDownCounter{}, nil
+}
+
+// Int64ObservableGauge returns an ObservableGauge used to record int64
+// measurements that produces no telemetry.
+func (Meter) Int64ObservableGauge(string, ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) {
+ return Int64ObservableGauge{}, nil
+}
+
+// Float64Counter returns a Counter used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Float64Counter(string, ...metric.Float64CounterOption) (metric.Float64Counter, error) {
+ return Float64Counter{}, nil
+}
+
+// Float64UpDownCounter returns an UpDownCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Float64UpDownCounter(string, ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) {
+ return Float64UpDownCounter{}, nil
+}
+
+// Float64Histogram returns a Histogram used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Float64Histogram(string, ...metric.Float64HistogramOption) (metric.Float64Histogram, error) {
+ return Float64Histogram{}, nil
+}
+
+// Float64Gauge returns a Gauge used to record float64 measurements that
+// produces no telemetry.
+func (Meter) Float64Gauge(string, ...metric.Float64GaugeOption) (metric.Float64Gauge, error) {
+ return Float64Gauge{}, nil
+}
+
+// Float64ObservableCounter returns an ObservableCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Float64ObservableCounter(string, ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) {
+ return Float64ObservableCounter{}, nil
+}
+
+// Float64ObservableUpDownCounter returns an ObservableUpDownCounter used to
+// record int64 measurements that produces no telemetry.
+func (Meter) Float64ObservableUpDownCounter(string, ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) {
+ return Float64ObservableUpDownCounter{}, nil
+}
+
+// Float64ObservableGauge returns an ObservableGauge used to record int64
+// measurements that produces no telemetry.
+func (Meter) Float64ObservableGauge(string, ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) {
+ return Float64ObservableGauge{}, nil
+}
+
+// RegisterCallback performs no operation.
+func (Meter) RegisterCallback(metric.Callback, ...metric.Observable) (metric.Registration, error) {
+ return Registration{}, nil
+}
+
+// Observer acts as a recorder of measurements for multiple instruments in a
+// Callback, it performing no operation.
+type Observer struct{ embedded.Observer }
+
+// ObserveFloat64 performs no operation.
+func (Observer) ObserveFloat64(metric.Float64Observable, float64, ...metric.ObserveOption) {
+}
+
+// ObserveInt64 performs no operation.
+func (Observer) ObserveInt64(metric.Int64Observable, int64, ...metric.ObserveOption) {
+}
+
+// Registration is the registration of a Callback with a No-Op Meter.
+type Registration struct{ embedded.Registration }
+
+// Unregister unregisters the Callback the Registration represents with the
+// No-Op Meter. This will always return nil because the No-Op Meter performs no
+// operation, including hold any record of registrations.
+func (Registration) Unregister() error { return nil }
+
+// Int64Counter is an OpenTelemetry Counter used to record int64 measurements.
+// It produces no telemetry.
+type Int64Counter struct{ embedded.Int64Counter }
+
+// Add performs no operation.
+func (Int64Counter) Add(context.Context, int64, ...metric.AddOption) {}
+
+// Float64Counter is an OpenTelemetry Counter used to record float64
+// measurements. It produces no telemetry.
+type Float64Counter struct{ embedded.Float64Counter }
+
+// Add performs no operation.
+func (Float64Counter) Add(context.Context, float64, ...metric.AddOption) {}
+
+// Int64UpDownCounter is an OpenTelemetry UpDownCounter used to record int64
+// measurements. It produces no telemetry.
+type Int64UpDownCounter struct{ embedded.Int64UpDownCounter }
+
+// Add performs no operation.
+func (Int64UpDownCounter) Add(context.Context, int64, ...metric.AddOption) {}
+
+// Float64UpDownCounter is an OpenTelemetry UpDownCounter used to record
+// float64 measurements. It produces no telemetry.
+type Float64UpDownCounter struct{ embedded.Float64UpDownCounter }
+
+// Add performs no operation.
+func (Float64UpDownCounter) Add(context.Context, float64, ...metric.AddOption) {}
+
+// Int64Histogram is an OpenTelemetry Histogram used to record int64
+// measurements. It produces no telemetry.
+type Int64Histogram struct{ embedded.Int64Histogram }
+
+// Record performs no operation.
+func (Int64Histogram) Record(context.Context, int64, ...metric.RecordOption) {}
+
+// Float64Histogram is an OpenTelemetry Histogram used to record float64
+// measurements. It produces no telemetry.
+type Float64Histogram struct{ embedded.Float64Histogram }
+
+// Record performs no operation.
+func (Float64Histogram) Record(context.Context, float64, ...metric.RecordOption) {}
+
+// Int64Gauge is an OpenTelemetry Gauge used to record instantaneous int64
+// measurements. It produces no telemetry.
+type Int64Gauge struct{ embedded.Int64Gauge }
+
+// Record performs no operation.
+func (Int64Gauge) Record(context.Context, int64, ...metric.RecordOption) {}
+
+// Float64Gauge is an OpenTelemetry Gauge used to record instantaneous float64
+// measurements. It produces no telemetry.
+type Float64Gauge struct{ embedded.Float64Gauge }
+
+// Record performs no operation.
+func (Float64Gauge) Record(context.Context, float64, ...metric.RecordOption) {}
+
+// Int64ObservableCounter is an OpenTelemetry ObservableCounter used to record
+// int64 measurements. It produces no telemetry.
+type Int64ObservableCounter struct {
+ metric.Int64Observable
+ embedded.Int64ObservableCounter
+}
+
+// Float64ObservableCounter is an OpenTelemetry ObservableCounter used to record
+// float64 measurements. It produces no telemetry.
+type Float64ObservableCounter struct {
+ metric.Float64Observable
+ embedded.Float64ObservableCounter
+}
+
+// Int64ObservableGauge is an OpenTelemetry ObservableGauge used to record
+// int64 measurements. It produces no telemetry.
+type Int64ObservableGauge struct {
+ metric.Int64Observable
+ embedded.Int64ObservableGauge
+}
+
+// Float64ObservableGauge is an OpenTelemetry ObservableGauge used to record
+// float64 measurements. It produces no telemetry.
+type Float64ObservableGauge struct {
+ metric.Float64Observable
+ embedded.Float64ObservableGauge
+}
+
+// Int64ObservableUpDownCounter is an OpenTelemetry ObservableUpDownCounter
+// used to record int64 measurements. It produces no telemetry.
+type Int64ObservableUpDownCounter struct {
+ metric.Int64Observable
+ embedded.Int64ObservableUpDownCounter
+}
+
+// Float64ObservableUpDownCounter is an OpenTelemetry ObservableUpDownCounter
+// used to record float64 measurements. It produces no telemetry.
+type Float64ObservableUpDownCounter struct {
+ metric.Float64Observable
+ embedded.Float64ObservableUpDownCounter
+}
+
+// Int64Observer is a recorder of int64 measurements that performs no operation.
+type Int64Observer struct{ embedded.Int64Observer }
+
+// Observe performs no operation.
+func (Int64Observer) Observe(int64, ...metric.ObserveOption) {}
+
+// Float64Observer is a recorder of float64 measurements that performs no
+// operation.
+type Float64Observer struct{ embedded.Float64Observer }
+
+// Observe performs no operation.
+func (Float64Observer) Observe(float64, ...metric.ObserveOption) {}
diff --git a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
index f0b063721d..8403a4bad2 100644
--- a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -39,7 +28,7 @@ type Float64Counter interface {
}
// Float64CounterConfig contains options for synchronous counter instruments that
-// record int64 values.
+// record float64 values.
type Float64CounterConfig struct {
description string
unit string
@@ -92,7 +81,7 @@ type Float64UpDownCounter interface {
}
// Float64UpDownCounterConfig contains options for synchronous counter
-// instruments that record int64 values.
+// instruments that record float64 values.
type Float64UpDownCounterConfig struct {
description string
unit string
@@ -144,11 +133,12 @@ type Float64Histogram interface {
Record(ctx context.Context, incr float64, options ...RecordOption)
}
-// Float64HistogramConfig contains options for synchronous counter instruments
-// that record int64 values.
+// Float64HistogramConfig contains options for synchronous histogram
+// instruments that record float64 values.
type Float64HistogramConfig struct {
- description string
- unit string
+ description string
+ unit string
+ explicitBucketBoundaries []float64
}
// NewFloat64HistogramConfig returns a new [Float64HistogramConfig] with all
@@ -171,9 +161,66 @@ func (c Float64HistogramConfig) Unit() string {
return c.unit
}
+// ExplicitBucketBoundaries returns the configured explicit bucket boundaries.
+func (c Float64HistogramConfig) ExplicitBucketBoundaries() []float64 {
+ return c.explicitBucketBoundaries
+}
+
// Float64HistogramOption applies options to a [Float64HistogramConfig]. See
// [InstrumentOption] for other options that can be used as a
// Float64HistogramOption.
type Float64HistogramOption interface {
applyFloat64Histogram(Float64HistogramConfig) Float64HistogramConfig
}
+
+// Float64Gauge is an instrument that records instantaneous float64 values.
+//
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
+type Float64Gauge interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.Float64Gauge
+
+ // Record records the instantaneous value.
+ //
+ // Use the WithAttributeSet (or, if performance is not a concern,
+ // the WithAttributes) option to include measurement attributes.
+ Record(ctx context.Context, value float64, options ...RecordOption)
+}
+
+// Float64GaugeConfig contains options for synchronous gauge instruments that
+// record float64 values.
+type Float64GaugeConfig struct {
+ description string
+ unit string
+}
+
+// NewFloat64GaugeConfig returns a new [Float64GaugeConfig] with all opts
+// applied.
+func NewFloat64GaugeConfig(opts ...Float64GaugeOption) Float64GaugeConfig {
+ var config Float64GaugeConfig
+ for _, o := range opts {
+ config = o.applyFloat64Gauge(config)
+ }
+ return config
+}
+
+// Description returns the configured description.
+func (c Float64GaugeConfig) Description() string {
+ return c.description
+}
+
+// Unit returns the configured unit.
+func (c Float64GaugeConfig) Unit() string {
+ return c.unit
+}
+
+// Float64GaugeOption applies options to a [Float64GaugeConfig]. See
+// [InstrumentOption] for other options that can be used as a
+// Float64GaugeOption.
+type Float64GaugeOption interface {
+ applyFloat64Gauge(Float64GaugeConfig) Float64GaugeConfig
+}
diff --git a/vendor/go.opentelemetry.io/otel/metric/syncint64.go b/vendor/go.opentelemetry.io/otel/metric/syncint64.go
index 6f508eb66d..783fdfba77 100644
--- a/vendor/go.opentelemetry.io/otel/metric/syncint64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/syncint64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -144,11 +133,12 @@ type Int64Histogram interface {
Record(ctx context.Context, incr int64, options ...RecordOption)
}
-// Int64HistogramConfig contains options for synchronous counter instruments
+// Int64HistogramConfig contains options for synchronous histogram instruments
// that record int64 values.
type Int64HistogramConfig struct {
- description string
- unit string
+ description string
+ unit string
+ explicitBucketBoundaries []float64
}
// NewInt64HistogramConfig returns a new [Int64HistogramConfig] with all opts
@@ -171,9 +161,66 @@ func (c Int64HistogramConfig) Unit() string {
return c.unit
}
+// ExplicitBucketBoundaries returns the configured explicit bucket boundaries.
+func (c Int64HistogramConfig) ExplicitBucketBoundaries() []float64 {
+ return c.explicitBucketBoundaries
+}
+
// Int64HistogramOption applies options to a [Int64HistogramConfig]. See
// [InstrumentOption] for other options that can be used as an
// Int64HistogramOption.
type Int64HistogramOption interface {
applyInt64Histogram(Int64HistogramConfig) Int64HistogramConfig
}
+
+// Int64Gauge is an instrument that records instantaneous int64 values.
+//
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
+type Int64Gauge interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.Int64Gauge
+
+ // Record records the instantaneous value.
+ //
+ // Use the WithAttributeSet (or, if performance is not a concern,
+ // the WithAttributes) option to include measurement attributes.
+ Record(ctx context.Context, value int64, options ...RecordOption)
+}
+
+// Int64GaugeConfig contains options for synchronous gauge instruments that
+// record int64 values.
+type Int64GaugeConfig struct {
+ description string
+ unit string
+}
+
+// NewInt64GaugeConfig returns a new [Int64GaugeConfig] with all opts
+// applied.
+func NewInt64GaugeConfig(opts ...Int64GaugeOption) Int64GaugeConfig {
+ var config Int64GaugeConfig
+ for _, o := range opts {
+ config = o.applyInt64Gauge(config)
+ }
+ return config
+}
+
+// Description returns the configured description.
+func (c Int64GaugeConfig) Description() string {
+ return c.description
+}
+
+// Unit returns the configured unit.
+func (c Int64GaugeConfig) Unit() string {
+ return c.unit
+}
+
+// Int64GaugeOption applies options to a [Int64GaugeConfig]. See
+// [InstrumentOption] for other options that can be used as a
+// Int64GaugeOption.
+type Int64GaugeOption interface {
+ applyInt64Gauge(Int64GaugeConfig) Int64GaugeConfig
+}
diff --git a/vendor/go.opentelemetry.io/otel/propagation.go b/vendor/go.opentelemetry.io/otel/propagation.go
index d29aaa32c0..2fd9497338 100644
--- a/vendor/go.opentelemetry.io/otel/propagation.go
+++ b/vendor/go.opentelemetry.io/otel/propagation.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/README.md b/vendor/go.opentelemetry.io/otel/propagation/README.md
new file mode 100644
index 0000000000..e2959ac747
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/propagation/README.md
@@ -0,0 +1,3 @@
+# Propagation
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/propagation)
diff --git a/vendor/go.opentelemetry.io/otel/propagation/baggage.go b/vendor/go.opentelemetry.io/otel/propagation/baggage.go
index 303cdf1cbf..552263ba73 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/doc.go b/vendor/go.opentelemetry.io/otel/propagation/doc.go
index c119eb2858..33a3baf15f 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/doc.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package propagation contains OpenTelemetry context propagators.
diff --git a/vendor/go.opentelemetry.io/otel/propagation/propagation.go b/vendor/go.opentelemetry.io/otel/propagation/propagation.go
index c94438f73a..8c8286aab4 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/propagation.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/propagation.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
index 902692da08..6870e316dc 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
@@ -18,7 +7,7 @@ import (
"context"
"encoding/hex"
"fmt"
- "regexp"
+ "strings"
"go.opentelemetry.io/otel/trace"
)
@@ -28,6 +17,7 @@ const (
maxVersion = 254
traceparentHeader = "traceparent"
tracestateHeader = "tracestate"
+ delimiter = "-"
)
// TraceContext is a propagator that supports the W3C Trace Context format
@@ -40,10 +30,12 @@ const (
// their proprietary information.
type TraceContext struct{}
-var _ TextMapPropagator = TraceContext{}
-var traceCtxRegExp = regexp.MustCompile("^(?P[0-9a-f]{2})-(?P[a-f0-9]{32})-(?P[a-f0-9]{16})-(?P[a-f0-9]{2})(?:-.*)?$")
+var (
+ _ TextMapPropagator = TraceContext{}
+ versionPart = fmt.Sprintf("%.2X", supportedVersion)
+)
-// Inject set tracecontext from the Context into the carrier.
+// Inject injects the trace context from ctx into carrier.
func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) {
sc := trace.SpanContextFromContext(ctx)
if !sc.IsValid() {
@@ -57,12 +49,19 @@ func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) {
// Clear all flags other than the trace-context supported sampling bit.
flags := sc.TraceFlags() & trace.FlagsSampled
- h := fmt.Sprintf("%.2x-%s-%s-%s",
- supportedVersion,
- sc.TraceID(),
- sc.SpanID(),
- flags)
- carrier.Set(traceparentHeader, h)
+ var sb strings.Builder
+ sb.Grow(2 + 32 + 16 + 2 + 3)
+ _, _ = sb.WriteString(versionPart)
+ traceID := sc.TraceID()
+ spanID := sc.SpanID()
+ flagByte := [1]byte{byte(flags)}
+ var buf [32]byte
+ for _, src := range [][]byte{traceID[:], spanID[:], flagByte[:]} {
+ _ = sb.WriteByte(delimiter[0])
+ n := hex.Encode(buf[:], src)
+ _, _ = sb.Write(buf[:n])
+ }
+ carrier.Set(traceparentHeader, sb.String())
}
// Extract reads tracecontext from the carrier into a returned Context.
@@ -84,21 +83,8 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
return trace.SpanContext{}
}
- matches := traceCtxRegExp.FindStringSubmatch(h)
-
- if len(matches) == 0 {
- return trace.SpanContext{}
- }
-
- if len(matches) < 5 { // four subgroups plus the overall match
- return trace.SpanContext{}
- }
-
- if len(matches[1]) != 2 {
- return trace.SpanContext{}
- }
- ver, err := hex.DecodeString(matches[1])
- if err != nil {
+ var ver [1]byte
+ if !extractPart(ver[:], &h, 2) {
return trace.SpanContext{}
}
version := int(ver[0])
@@ -106,36 +92,24 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
return trace.SpanContext{}
}
- if version == 0 && len(matches) != 5 { // four subgroups plus the overall match
- return trace.SpanContext{}
- }
-
- if len(matches[2]) != 32 {
- return trace.SpanContext{}
- }
-
var scc trace.SpanContextConfig
-
- scc.TraceID, err = trace.TraceIDFromHex(matches[2][:32])
- if err != nil {
+ if !extractPart(scc.TraceID[:], &h, 32) {
return trace.SpanContext{}
}
-
- if len(matches[3]) != 16 {
- return trace.SpanContext{}
- }
- scc.SpanID, err = trace.SpanIDFromHex(matches[3])
- if err != nil {
+ if !extractPart(scc.SpanID[:], &h, 16) {
return trace.SpanContext{}
}
- if len(matches[4]) != 2 {
+ var opts [1]byte
+ if !extractPart(opts[:], &h, 2) {
return trace.SpanContext{}
}
- opts, err := hex.DecodeString(matches[4])
- if err != nil || len(opts) < 1 || (version == 0 && opts[0] > 2) {
+ if version == 0 && (h != "" || opts[0] > 2) {
+ // version 0 not allow extra
+ // version 0 not allow other flag
return trace.SpanContext{}
}
+
// Clear all flags other than the trace-context supported sampling bit.
scc.TraceFlags = trace.TraceFlags(opts[0]) & trace.FlagsSampled
@@ -153,6 +127,29 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
return sc
}
+// upperHex detect hex is upper case Unicode characters.
+func upperHex(v string) bool {
+ for _, c := range v {
+ if c >= 'A' && c <= 'F' {
+ return true
+ }
+ }
+ return false
+}
+
+func extractPart(dst []byte, h *string, n int) bool {
+ part, left, _ := strings.Cut(*h, delimiter)
+ *h = left
+ // hex.Decode decodes unsupported upper-case characters, so exclude explicitly.
+ if len(part) != n || upperHex(part) {
+ return false
+ }
+ if p, err := hex.Decode(dst, []byte(part)); err != nil || p != n/2 {
+ return false
+ }
+ return true
+}
+
// Fields returns the keys who's values are set with Inject.
func (tc TraceContext) Fields() []string {
return []string{traceparentHeader, tracestateHeader}
diff --git a/vendor/go.opentelemetry.io/otel/renovate.json b/vendor/go.opentelemetry.io/otel/renovate.json
new file mode 100644
index 0000000000..8c5ac55ca9
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/renovate.json
@@ -0,0 +1,24 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+ "extends": [
+ "config:recommended"
+ ],
+ "ignorePaths": [],
+ "labels": ["Skip Changelog", "dependencies"],
+ "postUpdateOptions" : [
+ "gomodTidy"
+ ],
+ "packageRules": [
+ {
+ "matchManagers": ["gomod"],
+ "matchDepTypes": ["indirect"],
+ "enabled": true
+ },
+ {
+ "matchFileNames": ["internal/tools/**"],
+ "matchManagers": ["gomod"],
+ "matchDepTypes": ["indirect"],
+ "enabled": false
+ }
+ ]
+}
diff --git a/vendor/go.opentelemetry.io/otel/requirements.txt b/vendor/go.opentelemetry.io/otel/requirements.txt
index ddff454685..ab09daf9d5 100644
--- a/vendor/go.opentelemetry.io/otel/requirements.txt
+++ b/vendor/go.opentelemetry.io/otel/requirements.txt
@@ -1 +1 @@
-codespell==2.2.5
+codespell==2.3.0
diff --git a/vendor/go.opentelemetry.io/otel/sdk/README.md b/vendor/go.opentelemetry.io/otel/sdk/README.md
new file mode 100644
index 0000000000..f81b1576ad
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/README.md
@@ -0,0 +1,3 @@
+# SDK
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/sdk)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/README.md b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/README.md
new file mode 100644
index 0000000000..06e6d86854
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/README.md
@@ -0,0 +1,3 @@
+# SDK Instrumentation
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/instrumentation)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go
index 6e923acab4..a4faa6a03d 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package instrumentation provides types to represent the code libraries that
// provide OpenTelemetry instrumentation. These types are used in the
diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go
index 39f025a171..f4d1857c4f 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package instrumentation // import "go.opentelemetry.io/otel/sdk/instrumentation"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go
index 09c6d93f6d..728115045b 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package instrumentation // import "go.opentelemetry.io/otel/sdk/instrumentation"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go b/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go
index 59dcfab250..07923ed8d9 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package env // import "go.opentelemetry.io/otel/sdk/internal/env"
@@ -33,7 +22,7 @@ const (
BatchSpanProcessorMaxQueueSizeKey = "OTEL_BSP_MAX_QUEUE_SIZE"
// BatchSpanProcessorMaxExportBatchSizeKey is the maximum batch size (i.e.
// 512). Note: it must be less than or equal to
- // EnvBatchSpanProcessorMaxQueueSize.
+ // BatchSpanProcessorMaxQueueSize.
BatchSpanProcessorMaxExportBatchSizeKey = "OTEL_BSP_MAX_EXPORT_BATCH_SIZE"
// AttributeValueLengthKey is the maximum allowed attribute value size.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go b/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go
deleted file mode 100644
index bd84f624b4..0000000000
--- a/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package internal // import "go.opentelemetry.io/otel/sdk/internal"
-
-//go:generate gotmpl --body=../../internal/shared/matchers/expectation.go.tmpl "--data={}" --out=matchers/expectation.go
-//go:generate gotmpl --body=../../internal/shared/matchers/expecter.go.tmpl "--data={}" --out=matchers/expecter.go
-//go:generate gotmpl --body=../../internal/shared/matchers/temporal_matcher.go.tmpl "--data={}" --out=matchers/temporal_matcher.go
-
-//go:generate gotmpl --body=../../internal/shared/internaltest/alignment.go.tmpl "--data={}" --out=internaltest/alignment.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/env.go.tmpl "--data={}" --out=internaltest/env.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/env_test.go.tmpl "--data={}" --out=internaltest/env_test.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/errors.go.tmpl "--data={}" --out=internaltest/errors.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/harness.go.tmpl "--data={\"matchersImportPath\": \"go.opentelemetry.io/otel/sdk/internal/matchers\"}" --out=internaltest/harness.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_carrier.go.tmpl "--data={}" --out=internaltest/text_map_carrier.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_carrier_test.go.tmpl "--data={}" --out=internaltest/text_map_carrier_test.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_propagator.go.tmpl "--data={}" --out=internaltest/text_map_propagator.go
-//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_propagator_test.go.tmpl "--data={}" --out=internaltest/text_map_propagator_test.go
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/x/README.md b/vendor/go.opentelemetry.io/otel/sdk/internal/x/README.md
new file mode 100644
index 0000000000..fab61647c2
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/internal/x/README.md
@@ -0,0 +1,46 @@
+# Experimental Features
+
+The SDK contains features that have not yet stabilized in the OpenTelemetry specification.
+These features are added to the OpenTelemetry Go SDK prior to stabilization in the specification so that users can start experimenting with them and provide feedback.
+
+These feature may change in backwards incompatible ways as feedback is applied.
+See the [Compatibility and Stability](#compatibility-and-stability) section for more information.
+
+## Features
+
+- [Resource](#resource)
+
+### Resource
+
+[OpenTelemetry resource semantic conventions] include many attribute definitions that are defined as experimental.
+To have experimental semantic conventions be added by [resource detectors] set the `OTEL_GO_X_RESOURCE` environment variable.
+The value set must be the case-insensitive string of `"true"` to enable the feature.
+All other values are ignored.
+
+
+
+[OpenTelemetry resource semantic conventions]: https://opentelemetry.io/docs/specs/semconv/resource/
+[resource detectors]: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/resource#Detector
+
+#### Examples
+
+Enable experimental resource semantic conventions.
+
+```console
+export OTEL_GO_X_RESOURCE=true
+```
+
+Disable experimental resource semantic conventions.
+
+```console
+unset OTEL_GO_X_RESOURCE
+```
+
+## Compatibility and Stability
+
+Experimental features do not fall within the scope of the OpenTelemetry Go versioning and stability [policy](../../../VERSIONING.md).
+These features may be removed or modified in successive version releases, including patch versions.
+
+When an experimental feature is promoted to a stable feature, a migration path will be included in the changelog entry of the release.
+There is no guarantee that any environment variable feature flags that enabled the experimental feature will be supported by the stable version.
+If they are supported, they may be accompanied with a deprecation notice stating a timeline for the removal of that support.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go b/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go
new file mode 100644
index 0000000000..68d296cbed
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/internal/x/x.go
@@ -0,0 +1,66 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package x contains support for OTel SDK experimental features.
+//
+// This package should only be used for features defined in the specification.
+// It should not be used for experiments or new project ideas.
+package x // import "go.opentelemetry.io/otel/sdk/internal/x"
+
+import (
+ "os"
+ "strings"
+)
+
+// Resource is an experimental feature flag that defines if resource detectors
+// should be included experimental semantic conventions.
+//
+// To enable this feature set the OTEL_GO_X_RESOURCE environment variable
+// to the case-insensitive string value of "true" (i.e. "True" and "TRUE"
+// will also enable this).
+var Resource = newFeature("RESOURCE", func(v string) (string, bool) {
+ if strings.ToLower(v) == "true" {
+ return v, true
+ }
+ return "", false
+})
+
+// Feature is an experimental feature control flag. It provides a uniform way
+// to interact with these feature flags and parse their values.
+type Feature[T any] struct {
+ key string
+ parse func(v string) (T, bool)
+}
+
+func newFeature[T any](suffix string, parse func(string) (T, bool)) Feature[T] {
+ const envKeyRoot = "OTEL_GO_X_"
+ return Feature[T]{
+ key: envKeyRoot + suffix,
+ parse: parse,
+ }
+}
+
+// Key returns the environment variable key that needs to be set to enable the
+// feature.
+func (f Feature[T]) Key() string { return f.key }
+
+// Lookup returns the user configured value for the feature and true if the
+// user has enabled the feature. Otherwise, if the feature is not enabled, a
+// zero-value and false are returned.
+func (f Feature[T]) Lookup() (v T, ok bool) {
+ // https://github.com/open-telemetry/opentelemetry-specification/blob/62effed618589a0bec416a87e559c0a9d96289bb/specification/configuration/sdk-environment-variables.md#parsing-empty-value
+ //
+ // > The SDK MUST interpret an empty value of an environment variable the
+ // > same way as when the variable is unset.
+ vRaw := os.Getenv(f.key)
+ if vRaw == "" {
+ return v, ok
+ }
+ return f.parse(vRaw)
+}
+
+// Enabled returns if the feature is enabled.
+func (f Feature[T]) Enabled() bool {
+ _, ok := f.Lookup()
+ return ok
+}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/README.md b/vendor/go.opentelemetry.io/otel/sdk/resource/README.md
new file mode 100644
index 0000000000..4ad864d716
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/README.md
@@ -0,0 +1,3 @@
+# SDK Resource
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/resource)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go b/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go
index 324dd4baf2..95a61d61d4 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/auto.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -21,12 +10,10 @@ import (
"strings"
)
-var (
- // ErrPartialResource is returned by a detector when complete source
- // information for a Resource is unavailable or the source information
- // contains invalid values that are omitted from the returned Resource.
- ErrPartialResource = errors.New("partial resource")
-)
+// ErrPartialResource is returned by a detector when complete source
+// information for a Resource is unavailable or the source information
+// contains invalid values that are omitted from the returned Resource.
+var ErrPartialResource = errors.New("partial resource")
// Detector detects OpenTelemetry resource information.
type Detector interface {
@@ -43,8 +30,20 @@ type Detector interface {
// must never be done outside of a new major release.
}
-// Detect calls all input detectors sequentially and merges each result with the previous one.
-// It returns the merged error too.
+// Detect returns a new [Resource] merged from all the Resources each of the
+// detectors produces. Each of the detectors are called sequentially, in the
+// order they are passed, merging the produced resource into the previous.
+//
+// This may return a partial Resource along with an error containing
+// [ErrPartialResource] if that error is returned from a detector. It may also
+// return a merge-conflicting Resource along with an error containing
+// [ErrSchemaURLConflict] if merging Resources from different detectors results
+// in a schema URL conflict. It is up to the caller to determine if this
+// returned Resource should be used or not.
+//
+// If one of the detectors returns an error that is not [ErrPartialResource],
+// the resource produced by the detector will not be merged and the returned
+// error will wrap that detector's error.
func Detect(ctx context.Context, detectors ...Detector) (*Resource, error) {
r := new(Resource)
return r, detect(ctx, r, detectors)
@@ -52,6 +51,10 @@ func Detect(ctx context.Context, detectors ...Detector) (*Resource, error) {
// detect runs all detectors using ctx and merges the result into res. This
// assumes res is allocated and not nil, it will panic otherwise.
+//
+// If the detectors or merging resources produces any errors (i.e.
+// [ErrPartialResource] [ErrSchemaURLConflict]), a single error wrapping all of
+// these errors will be returned. Otherwise, nil is returned.
func detect(ctx context.Context, res *Resource, detectors []Detector) error {
var (
r *Resource
@@ -80,6 +83,11 @@ func detect(ctx context.Context, res *Resource, detectors []Detector) error {
if len(errs) == 0 {
return nil
}
+ if errors.Is(errs, ErrSchemaURLConflict) {
+ // If there has been a merge conflict, ensure the resource has no
+ // schema URL.
+ res.schemaURL = ""
+ }
return errs
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go b/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go
index c63a0dd1f8..6ac1cdbf7b 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -20,9 +9,11 @@ import (
"os"
"path/filepath"
+ "github.com/google/uuid"
+
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
type (
@@ -47,6 +38,8 @@ type (
}
defaultServiceNameDetector struct{}
+
+ defaultServiceInstanceIDDetector struct{}
)
var (
@@ -54,6 +47,7 @@ var (
_ Detector = host{}
_ Detector = stringDetector{}
_ Detector = defaultServiceNameDetector{}
+ _ Detector = defaultServiceInstanceIDDetector{}
)
// Detect returns a *Resource that describes the OpenTelemetry SDK used.
@@ -106,3 +100,19 @@ func (defaultServiceNameDetector) Detect(ctx context.Context) (*Resource, error)
},
).Detect(ctx)
}
+
+// Detect implements Detector.
+func (defaultServiceInstanceIDDetector) Detect(ctx context.Context) (*Resource, error) {
+ return StringDetector(
+ semconv.SchemaURL,
+ semconv.ServiceInstanceIDKey,
+ func() (string, error) {
+ version4Uuid, err := uuid.NewRandom()
+ if err != nil {
+ return "", err
+ }
+
+ return version4Uuid.String(), nil
+ },
+ ).Detect(ctx)
+}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/config.go b/vendor/go.opentelemetry.io/otel/sdk/resource/config.go
index f263919f6e..0d6e213d92 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/config.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/container.go b/vendor/go.opentelemetry.io/otel/sdk/resource/container.go
index 3d53622828..5ecd859a52 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/container.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/container.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -22,14 +11,14 @@ import (
"os"
"regexp"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
type containerIDProvider func() (string, error)
var (
containerID containerIDProvider = getContainerIDFromCGroup
- cgroupContainerIDRe = regexp.MustCompile(`^.*/(?:.*-)?([0-9a-f]+)(?:\.|\s*$)`)
+ cgroupContainerIDRe = regexp.MustCompile(`^.*/(?:.*[-:])?([0-9a-f]+)(?:\.|\s*$)`)
)
type cgroupContainerIDDetector struct{}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go b/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go
index d55a50b0dc..64939a2713 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package resource provides detecting and representing resources.
//
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/env.go b/vendor/go.opentelemetry.io/otel/sdk/resource/env.go
index a847c50622..813f056242 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/env.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/env.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -23,21 +12,19 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
const (
// resourceAttrKey is the environment variable name OpenTelemetry Resource information will be read from.
- resourceAttrKey = "OTEL_RESOURCE_ATTRIBUTES"
+ resourceAttrKey = "OTEL_RESOURCE_ATTRIBUTES" //nolint:gosec // False positive G101: Potential hardcoded credentials
// svcNameKey is the environment variable name that Service Name information will be read from.
svcNameKey = "OTEL_SERVICE_NAME"
)
-var (
- // errMissingValue is returned when a resource value is missing.
- errMissingValue = fmt.Errorf("%w: missing value", ErrPartialResource)
-)
+// errMissingValue is returned when a resource value is missing.
+var errMissingValue = fmt.Errorf("%w: missing value", ErrPartialResource)
// fromEnv is a Detector that implements the Detector and collects
// resources from environment. This Detector is included as a
@@ -91,7 +78,7 @@ func constructOTResources(s string) (*Resource, error) {
continue
}
key := strings.TrimSpace(k)
- val, err := url.QueryUnescape(strings.TrimSpace(v))
+ val, err := url.PathUnescape(strings.TrimSpace(v))
if err != nil {
// Retain original value if decoding fails, otherwise it will be
// an empty string.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go
index fb1ebf2cab..2d0f65498a 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -19,7 +8,7 @@ import (
"errors"
"strings"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
type hostIDProvider func() (string, error)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go
index 1778bbacf0..cc8b8938ed 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build dragonfly || freebsd || netbsd || openbsd || solaris
// +build dragonfly freebsd netbsd openbsd solaris
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go
index ba41409b23..b09fde3b73 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go
index 207acb0ed3..d9e5d1a8ff 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build darwin || dragonfly || freebsd || netbsd || openbsd || solaris
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go
index 410579b8fc..f84f173240 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build linux
// +build linux
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go
index 721e3ca6e7..6354b35602 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build linux || dragonfly || freebsd || netbsd || openbsd || solaris
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go
index 89df9d6882..df12c44c56 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go
@@ -1,25 +1,8 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
-// +build !darwin
-// +build !dragonfly
-// +build !freebsd
-// +build !linux
-// +build !netbsd
-// +build !openbsd
-// +build !solaris
-// +build !windows
+//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows
+// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go
index 5b431c6ee6..71386e2da4 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build windows
// +build windows
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os.go
index 84e1c58560..8a48ab4fa3 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -19,7 +8,7 @@ import (
"strings"
"go.opentelemetry.io/otel/attribute"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
type osDescriptionProvider func() (string, error)
@@ -36,8 +25,10 @@ func setOSDescriptionProvider(osDescriptionProvider osDescriptionProvider) {
osDescription = osDescriptionProvider
}
-type osTypeDetector struct{}
-type osDescriptionDetector struct{}
+type (
+ osTypeDetector struct{}
+ osDescriptionDetector struct{}
+)
// Detect returns a *Resource that describes the operating system type the
// service is running on.
@@ -56,7 +47,6 @@ func (osTypeDetector) Detect(ctx context.Context) (*Resource, error) {
// service is running on.
func (osDescriptionDetector) Detect(ctx context.Context) (*Resource, error) {
description, err := osDescription()
-
if err != nil {
return nil, err
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go
index 24ec85793d..ce455dc544 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go
index c771942dee..f537e5ca5c 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build aix || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
// +build aix dragonfly freebsd linux netbsd openbsd solaris zos
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go
index 1c84afc185..a6ff26a4d2 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go
index 3ebcb534f2..a77742b077 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go
@@ -1,27 +1,8 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
-// +build !aix
-// +build !darwin
-// +build !dragonfly
-// +build !freebsd
-// +build !linux
-// +build !netbsd
-// +build !openbsd
-// +build !solaris
-// +build !windows
-// +build !zos
+//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos
+// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go b/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go
index faad64d8da..5e3d199d78 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/process.go b/vendor/go.opentelemetry.io/otel/sdk/resource/process.go
index e67ff29e26..085fe68fd7 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/process.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/process.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
@@ -22,17 +11,19 @@ import (
"path/filepath"
"runtime"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)
-type pidProvider func() int
-type executablePathProvider func() (string, error)
-type commandArgsProvider func() []string
-type ownerProvider func() (*user.User, error)
-type runtimeNameProvider func() string
-type runtimeVersionProvider func() string
-type runtimeOSProvider func() string
-type runtimeArchProvider func() string
+type (
+ pidProvider func() int
+ executablePathProvider func() (string, error)
+ commandArgsProvider func() []string
+ ownerProvider func() (*user.User, error)
+ runtimeNameProvider func() string
+ runtimeVersionProvider func() string
+ runtimeOSProvider func() string
+ runtimeArchProvider func() string
+)
var (
defaultPidProvider pidProvider = os.Getpid
@@ -108,14 +99,16 @@ func setUserProviders(ownerProvider ownerProvider) {
owner = ownerProvider
}
-type processPIDDetector struct{}
-type processExecutableNameDetector struct{}
-type processExecutablePathDetector struct{}
-type processCommandArgsDetector struct{}
-type processOwnerDetector struct{}
-type processRuntimeNameDetector struct{}
-type processRuntimeVersionDetector struct{}
-type processRuntimeDescriptionDetector struct{}
+type (
+ processPIDDetector struct{}
+ processExecutableNameDetector struct{}
+ processExecutablePathDetector struct{}
+ processCommandArgsDetector struct{}
+ processOwnerDetector struct{}
+ processRuntimeNameDetector struct{}
+ processRuntimeVersionDetector struct{}
+ processRuntimeDescriptionDetector struct{}
+)
// Detect returns a *Resource that describes the process identifier (PID) of the
// executing process.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go b/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
index 176ff10666..ad4b50df40 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
@@ -1,26 +1,17 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package resource // import "go.opentelemetry.io/otel/sdk/resource"
import (
"context"
"errors"
+ "fmt"
"sync"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/sdk/internal/x"
)
// Resource describes an entity about which identifying information
@@ -40,9 +31,20 @@ var (
defaultResourceOnce sync.Once
)
-var errMergeConflictSchemaURL = errors.New("cannot merge resource due to conflicting Schema URL")
+// ErrSchemaURLConflict is an error returned when two Resources are merged
+// together that contain different, non-empty, schema URLs.
+var ErrSchemaURLConflict = errors.New("conflicting Schema URL")
-// New returns a Resource combined from the user-provided detectors.
+// New returns a [Resource] built using opts.
+//
+// This may return a partial Resource along with an error containing
+// [ErrPartialResource] if options that provide a [Detector] are used and that
+// error is returned from one or more of the Detectors. It may also return a
+// merge-conflict Resource along with an error containing
+// [ErrSchemaURLConflict] if merging Resources from the opts results in a
+// schema URL conflict (see [Resource.Merge] for more information). It is up to
+// the caller to determine if this returned Resource should be used or not
+// based on these errors.
func New(ctx context.Context, opts ...Option) (*Resource, error) {
cfg := config{}
for _, opt := range opts {
@@ -98,7 +100,7 @@ func (r *Resource) String() string {
return r.attrs.Encoded(attribute.DefaultEncoder())
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Resource.
func (r *Resource) MarshalLog() interface{} {
return struct {
Attributes attribute.Set
@@ -146,16 +148,29 @@ func (r *Resource) Equal(eq *Resource) bool {
return r.Equivalent() == eq.Equivalent()
}
-// Merge creates a new resource by combining resource a and b.
+// Merge creates a new [Resource] by merging a and b.
+//
+// If there are common keys between a and b, then the value from b will
+// overwrite the value from a, even if b's value is empty.
+//
+// The SchemaURL of the resources will be merged according to the
+// [OpenTelemetry specification rules]:
//
-// If there are common keys between resource a and b, then the value
-// from resource b will overwrite the value from resource a, even
-// if resource b's value is empty.
+// - If a's schema URL is empty then the returned Resource's schema URL will
+// be set to the schema URL of b,
+// - Else if b's schema URL is empty then the returned Resource's schema URL
+// will be set to the schema URL of a,
+// - Else if the schema URLs of a and b are the same then that will be the
+// schema URL of the returned Resource,
+// - Else this is a merging error. If the resources have different,
+// non-empty, schema URLs an error containing [ErrSchemaURLConflict] will
+// be returned with the merged Resource. The merged Resource will have an
+// empty schema URL. It may be the case that some unintended attributes
+// have been overwritten or old semantic conventions persisted in the
+// returned Resource. It is up to the caller to determine if this returned
+// Resource should be used or not.
//
-// The SchemaURL of the resources will be merged according to the spec rules:
-// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/resource/sdk.md#merge
-// If the resources have different non-empty schemaURL an empty resource and an error
-// will be returned.
+// [OpenTelemetry specification rules]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/resource/sdk.md#merge
func Merge(a, b *Resource) (*Resource, error) {
if a == nil && b == nil {
return Empty(), nil
@@ -167,19 +182,6 @@ func Merge(a, b *Resource) (*Resource, error) {
return a, nil
}
- // Merge the schema URL.
- var schemaURL string
- switch true {
- case a.schemaURL == "":
- schemaURL = b.schemaURL
- case b.schemaURL == "":
- schemaURL = a.schemaURL
- case a.schemaURL == b.schemaURL:
- schemaURL = a.schemaURL
- default:
- return Empty(), errMergeConflictSchemaURL
- }
-
// Note: 'b' attributes will overwrite 'a' with last-value-wins in attribute.Key()
// Meaning this is equivalent to: append(a.Attributes(), b.Attributes()...)
mi := attribute.NewMergeIterator(b.Set(), a.Set())
@@ -187,8 +189,23 @@ func Merge(a, b *Resource) (*Resource, error) {
for mi.Next() {
combine = append(combine, mi.Attribute())
}
- merged := NewWithAttributes(schemaURL, combine...)
- return merged, nil
+
+ switch {
+ case a.schemaURL == "":
+ return NewWithAttributes(b.schemaURL, combine...), nil
+ case b.schemaURL == "":
+ return NewWithAttributes(a.schemaURL, combine...), nil
+ case a.schemaURL == b.schemaURL:
+ return NewWithAttributes(a.schemaURL, combine...), nil
+ }
+ // Return the merged resource with an appropriate error. It is up to
+ // the user to decide if the returned resource can be used or not.
+ return NewSchemaless(combine...), fmt.Errorf(
+ "%w: %s and %s",
+ ErrSchemaURLConflict,
+ a.schemaURL,
+ b.schemaURL,
+ )
}
// Empty returns an instance of Resource with no attributes. It is
@@ -202,11 +219,17 @@ func Empty() *Resource {
func Default() *Resource {
defaultResourceOnce.Do(func() {
var err error
- defaultResource, err = Detect(
- context.Background(),
+ defaultDetectors := []Detector{
defaultServiceNameDetector{},
fromEnv{},
telemetrySDK{},
+ }
+ if x.Resource.Enabled() {
+ defaultDetectors = append([]Detector{defaultServiceInstanceIDDetector{}}, defaultDetectors...)
+ }
+ defaultResource, err = Detect(
+ context.Background(),
+ defaultDetectors...,
)
if err != nil {
otel.Handle(err)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/README.md b/vendor/go.opentelemetry.io/otel/sdk/trace/README.md
new file mode 100644
index 0000000000..f2936e1439
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/README.md
@@ -0,0 +1,3 @@
+# SDK Trace
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go
index c9c7effbf3..1d399a75db 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -392,7 +381,7 @@ func (bsp *batchSpanProcessor) enqueueBlockOnQueueFull(ctx context.Context, sd R
}
}
-func (bsp *batchSpanProcessor) enqueueDrop(ctx context.Context, sd ReadOnlySpan) bool {
+func (bsp *batchSpanProcessor) enqueueDrop(_ context.Context, sd ReadOnlySpan) bool {
if !sd.SpanContext().IsSampled() {
return false
}
@@ -406,7 +395,7 @@ func (bsp *batchSpanProcessor) enqueueDrop(ctx context.Context, sd ReadOnlySpan)
return false
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Span Processor.
func (bsp *batchSpanProcessor) MarshalLog() interface{} {
return struct {
Type string
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go b/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go
index 0285e99be0..1f60524e3e 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package trace contains support for OpenTelemetry distributed tracing.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/event.go b/vendor/go.opentelemetry.io/otel/sdk/trace/event.go
index 1e3b426757..60a7ed1349 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/event.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/event.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go b/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go
index d1c86e59b2..821c83faa1 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go
@@ -1,36 +1,45 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
+import (
+ "slices"
+ "sync"
+
+ "go.opentelemetry.io/otel/internal/global"
+)
+
// evictedQueue is a FIFO queue with a configurable capacity.
-type evictedQueue struct {
- queue []interface{}
+type evictedQueue[T any] struct {
+ queue []T
capacity int
droppedCount int
+ logDropped func()
}
-func newEvictedQueue(capacity int) evictedQueue {
+func newEvictedQueueEvent(capacity int) evictedQueue[Event] {
// Do not pre-allocate queue, do this lazily.
- return evictedQueue{capacity: capacity}
+ return evictedQueue[Event]{
+ capacity: capacity,
+ logDropped: sync.OnceFunc(func() { global.Warn("limit reached: dropping trace trace.Event") }),
+ }
+}
+
+func newEvictedQueueLink(capacity int) evictedQueue[Link] {
+ // Do not pre-allocate queue, do this lazily.
+ return evictedQueue[Link]{
+ capacity: capacity,
+ logDropped: sync.OnceFunc(func() { global.Warn("limit reached: dropping trace trace.Link") }),
+ }
}
// add adds value to the evictedQueue eq. If eq is at capacity, the oldest
// queued value will be discarded and the drop count incremented.
-func (eq *evictedQueue) add(value interface{}) {
+func (eq *evictedQueue[T]) add(value T) {
if eq.capacity == 0 {
eq.droppedCount++
+ eq.logDropped()
return
}
@@ -39,6 +48,12 @@ func (eq *evictedQueue) add(value interface{}) {
copy(eq.queue[:eq.capacity-1], eq.queue[1:])
eq.queue = eq.queue[:eq.capacity-1]
eq.droppedCount++
+ eq.logDropped()
}
eq.queue = append(eq.queue, value)
}
+
+// copy returns a copy of the evictedQueue.
+func (eq *evictedQueue[T]) copy() []T {
+ return slices.Clone(eq.queue)
+}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go b/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go
index bba246041a..925bcf9930 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -52,7 +41,12 @@ func (gen *randomIDGenerator) NewSpanID(ctx context.Context, traceID trace.Trace
gen.Lock()
defer gen.Unlock()
sid := trace.SpanID{}
- _, _ = gen.randSource.Read(sid[:])
+ for {
+ _, _ = gen.randSource.Read(sid[:])
+ if sid.IsValid() {
+ break
+ }
+ }
return sid
}
@@ -62,9 +56,19 @@ func (gen *randomIDGenerator) NewIDs(ctx context.Context) (trace.TraceID, trace.
gen.Lock()
defer gen.Unlock()
tid := trace.TraceID{}
- _, _ = gen.randSource.Read(tid[:])
sid := trace.SpanID{}
- _, _ = gen.randSource.Read(sid[:])
+ for {
+ _, _ = gen.randSource.Read(tid[:])
+ if tid.IsValid() {
+ break
+ }
+ }
+ for {
+ _, _ = gen.randSource.Read(sid[:])
+ if sid.IsValid() {
+ break
+ }
+ }
return tid, sid
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/link.go b/vendor/go.opentelemetry.io/otel/sdk/trace/link.go
index 19cfea4ba4..c03bdc90f6 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/link.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/link.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go b/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
index 0a018c14de..14c2e5bebd 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -25,6 +14,8 @@ import (
"go.opentelemetry.io/otel/sdk/instrumentation"
"go.opentelemetry.io/otel/sdk/resource"
"go.opentelemetry.io/otel/trace"
+ "go.opentelemetry.io/otel/trace/embedded"
+ "go.opentelemetry.io/otel/trace/noop"
)
const (
@@ -53,7 +44,7 @@ type tracerProviderConfig struct {
resource *resource.Resource
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Provider.
func (cfg tracerProviderConfig) MarshalLog() interface{} {
return struct {
SpanProcessors []SpanProcessor
@@ -73,6 +64,8 @@ func (cfg tracerProviderConfig) MarshalLog() interface{} {
// TracerProvider is an OpenTelemetry TracerProvider. It provides Tracers to
// instrumentation so it can trace operational flow through a system.
type TracerProvider struct {
+ embedded.TracerProvider
+
mu sync.Mutex
namedTracer map[instrumentation.Scope]*tracer
spanProcessors atomic.Pointer[spanProcessorStates]
@@ -139,7 +132,7 @@ func NewTracerProvider(opts ...TracerProviderOption) *TracerProvider {
func (p *TracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.Tracer {
// This check happens before the mutex is acquired to avoid deadlocking if Tracer() is called from within Shutdown().
if p.isShutdown.Load() {
- return trace.NewNoopTracerProvider().Tracer(name, opts...)
+ return noop.NewTracerProvider().Tracer(name, opts...)
}
c := trace.NewTracerConfig(opts...)
if name == "" {
@@ -157,7 +150,7 @@ func (p *TracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T
// Must check the flag after acquiring the mutex to avoid returning a valid tracer if Shutdown() ran
// after the first check above but before we acquired the mutex.
if p.isShutdown.Load() {
- return trace.NewNoopTracerProvider().Tracer(name, opts...), true
+ return noop.NewTracerProvider().Tracer(name, opts...), true
}
t, ok := p.namedTracer[is]
if !ok {
@@ -298,7 +291,7 @@ func (p *TracerProvider) Shutdown(ctx context.Context) error {
retErr = err
} else {
// Poor man's list of errors
- retErr = fmt.Errorf("%v; %v", retErr, err)
+ retErr = fmt.Errorf("%w; %w", retErr, err)
}
}
}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go b/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go
index 02053b318a..d2d1f72466 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go b/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go
index 5ee9715d27..ebb6df6c90 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -158,9 +147,9 @@ func NeverSample() Sampler {
return alwaysOffSampler{}
}
-// ParentBased returns a composite sampler which behaves differently,
+// ParentBased returns a sampler decorator which behaves differently,
// based on the parent of the span. If the span has no parent,
-// the root(Sampler) is used to make sampling decision. If the span has
+// the decorated sampler is used to make sampling decision. If the span has
// a parent, depending on whether the parent is remote and whether it
// is sampled, one of the following samplers will apply:
// - remoteParentSampled(Sampler) (default: AlwaysOn)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go
index f8770fff79..554111bb4a 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -36,10 +25,10 @@ var _ SpanProcessor = (*simpleSpanProcessor)(nil)
// send completed spans to the exporter immediately.
//
// This SpanProcessor is not recommended for production use. The synchronous
-// nature of this SpanProcessor make it good for testing, debugging, or
-// showing examples of other feature, but it will be slow and have a high
-// computation resource usage overhead. The BatchSpanProcessor is recommended
-// for production use instead.
+// nature of this SpanProcessor makes it good for testing, debugging, or showing
+// examples of other features, but it will be slow and have a high computation
+// resource usage overhead. The BatchSpanProcessor is recommended for production
+// use instead.
func NewSimpleSpanProcessor(exporter SpanExporter) SpanProcessor {
ssp := &simpleSpanProcessor{
exporter: exporter,
@@ -80,10 +69,10 @@ func (ssp *simpleSpanProcessor) Shutdown(ctx context.Context) error {
//
// A closure is used to keep reference to the exporter and then the
// field is zeroed. This ensures the simpleSpanProcessor is shut down
- // before the exporter. This order is important as it avoids a
- // potential deadlock. If the exporter shut down operation generates a
- // span, that span would need to be exported. Meaning, OnEnd would be
- // called and try acquiring the lock that is held here.
+ // before the exporter. This order is important as it avoids a potential
+ // deadlock. If the exporter shut down operation generates a span, that
+ // span would need to be exported. Meaning, OnEnd would be called and
+ // try acquiring the lock that is held here.
ssp.exporterMu.Lock()
done, shutdown := stopFunc(ssp.exporter)
ssp.exporter = nil
@@ -95,15 +84,15 @@ func (ssp *simpleSpanProcessor) Shutdown(ctx context.Context) error {
select {
case err = <-done:
case <-ctx.Done():
- // It is possible for the exporter to have immediately shut down
- // and the context to be done simultaneously. In that case this
- // outer select statement will randomly choose a case. This will
- // result in a different returned error for similar scenarios.
- // Instead, double check if the exporter shut down at the same
- // time and return that error if so. This will ensure consistency
- // as well as ensure the caller knows the exporter shut down
- // successfully (they can already determine if the deadline is
- // expired given they passed the context).
+ // It is possible for the exporter to have immediately shut down and
+ // the context to be done simultaneously. In that case this outer
+ // select statement will randomly choose a case. This will result in
+ // a different returned error for similar scenarios. Instead, double
+ // check if the exporter shut down at the same time and return that
+ // error if so. This will ensure consistency as well as ensure
+ // the caller knows the exporter shut down successfully (they can
+ // already determine if the deadline is expired given they passed
+ // the context).
select {
case err = <-done:
default:
@@ -119,7 +108,8 @@ func (ssp *simpleSpanProcessor) ForceFlush(context.Context) error {
return nil
}
-// MarshalLog is the marshaling function used by the logging system to represent this Span Processor.
+// MarshalLog is the marshaling function used by the logging system to represent
+// this Span Processor.
func (ssp *simpleSpanProcessor) MarshalLog() interface{} {
return struct {
Type string
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go b/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go
index 0349b2f198..32f862790c 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span.go
index 37cdd4a694..ac90f1a260 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/span.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -20,6 +9,7 @@ import (
"reflect"
"runtime"
rt "runtime/trace"
+ "slices"
"strings"
"sync"
"time"
@@ -27,11 +17,12 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/internal/global"
"go.opentelemetry.io/otel/sdk/instrumentation"
- "go.opentelemetry.io/otel/sdk/internal"
"go.opentelemetry.io/otel/sdk/resource"
- semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
"go.opentelemetry.io/otel/trace"
+ "go.opentelemetry.io/otel/trace/embedded"
)
// ReadOnlySpan allows reading information from the data structure underlying a
@@ -108,6 +99,8 @@ type ReadWriteSpan interface {
// recordingSpan is an implementation of the OpenTelemetry Span API
// representing the individual component of a trace that is sampled.
type recordingSpan struct {
+ embedded.Span
+
// mu protects the contents of this span.
mu sync.Mutex
@@ -144,12 +137,13 @@ type recordingSpan struct {
// ReadOnlySpan exported when the span ends.
attributes []attribute.KeyValue
droppedAttributes int
+ logDropAttrsOnce sync.Once
// events are stored in FIFO queue capped by configured limit.
- events evictedQueue
+ events evictedQueue[Event]
// links are stored in FIFO queue capped by configured limit.
- links evictedQueue
+ links evictedQueue[Link]
// executionTracerTaskEnd ends the execution tracer span.
executionTracerTaskEnd func()
@@ -158,8 +152,10 @@ type recordingSpan struct {
tracer *tracer
}
-var _ ReadWriteSpan = (*recordingSpan)(nil)
-var _ runtimeTracer = (*recordingSpan)(nil)
+var (
+ _ ReadWriteSpan = (*recordingSpan)(nil)
+ _ runtimeTracer = (*recordingSpan)(nil)
+)
// SpanContext returns the SpanContext of this span.
func (s *recordingSpan) SpanContext() trace.SpanContext {
@@ -224,7 +220,7 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) {
limit := s.tracer.provider.spanLimits.AttributeCountLimit
if limit == 0 {
// No attributes allowed.
- s.droppedAttributes += len(attributes)
+ s.addDroppedAttr(len(attributes))
return
}
@@ -237,10 +233,11 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) {
// Otherwise, add without deduplication. When attributes are read they
// will be deduplicated, optimizing the operation.
+ s.attributes = slices.Grow(s.attributes, len(s.attributes)+len(attributes))
for _, a := range attributes {
if !a.Valid() {
// Drop all invalid attributes.
- s.droppedAttributes++
+ s.addDroppedAttr(1)
continue
}
a = truncateAttr(s.tracer.provider.spanLimits.AttributeValueLengthLimit, a)
@@ -248,6 +245,22 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) {
}
}
+// Declared as a var so tests can override.
+var logDropAttrs = func() {
+ global.Warn("limit reached: dropping trace Span attributes")
+}
+
+// addDroppedAttr adds incr to the count of dropped attributes.
+//
+// The first, and only the first, time this method is called a warning will be
+// logged.
+//
+// This method assumes s.mu.Lock is held by the caller.
+func (s *recordingSpan) addDroppedAttr(incr int) {
+ s.droppedAttributes += incr
+ s.logDropAttrsOnce.Do(logDropAttrs)
+}
+
// addOverCapAttrs adds the attributes attrs to the span s while
// de-duplicating the attributes of s and attrs and dropping attributes that
// exceed the limit.
@@ -272,10 +285,12 @@ func (s *recordingSpan) addOverCapAttrs(limit int, attrs []attribute.KeyValue) {
// Now that s.attributes is deduplicated, adding unique attributes up to
// the capacity of s will not over allocate s.attributes.
+ sum := len(attrs) + len(s.attributes)
+ s.attributes = slices.Grow(s.attributes, min(sum, limit))
for _, a := range attrs {
if !a.Valid() {
// Drop all invalid attributes.
- s.droppedAttributes++
+ s.addDroppedAttr(1)
continue
}
@@ -288,7 +303,7 @@ func (s *recordingSpan) addOverCapAttrs(limit int, attrs []attribute.KeyValue) {
if len(s.attributes) >= limit {
// Do not just drop all of the remaining attributes, make sure
// updates are checked and performed.
- s.droppedAttributes++
+ s.addDroppedAttr(1)
} else {
a = truncateAttr(s.tracer.provider.spanLimits.AttributeValueLengthLimit, a)
s.attributes = append(s.attributes, a)
@@ -369,7 +384,7 @@ func (s *recordingSpan) End(options ...trace.SpanEndOption) {
// Store the end time as soon as possible to avoid artificially increasing
// the span's duration in case some operation below takes a while.
- et := internal.MonotonicEndTime(s.startTime)
+ et := monotonicEndTime(s.startTime)
// Do relative expensive check now that we have an end time and see if we
// need to do any more processing.
@@ -420,6 +435,16 @@ func (s *recordingSpan) End(options ...trace.SpanEndOption) {
}
}
+// monotonicEndTime returns the end time at present but offset from start,
+// monotonically.
+//
+// The monotonic clock is used in subtractions hence the duration since start
+// added back to start gives end as a monotonic time. See
+// https://golang.org/pkg/time/#hdr-Monotonic_Clocks
+func monotonicEndTime(start time.Time) time.Time {
+ return start.Add(time.Since(start))
+}
+
// RecordError will record err as a span event for this span. An additional call to
// SetStatus is required if the Status of the Span should be set to Error, this method
// does not change the Span status. If this span is not being recorded or err is nil
@@ -587,7 +612,7 @@ func (s *recordingSpan) Links() []Link {
if len(s.links.queue) == 0 {
return []Link{}
}
- return s.interfaceArrayToLinksArray()
+ return s.links.copy()
}
// Events returns the events of this span.
@@ -597,7 +622,7 @@ func (s *recordingSpan) Events() []Event {
if len(s.events.queue) == 0 {
return []Event{}
}
- return s.interfaceArrayToEventArray()
+ return s.events.copy()
}
// Status returns the status of this span.
@@ -631,8 +656,12 @@ func (s *recordingSpan) Resource() *resource.Resource {
return s.tracer.provider.resource
}
-func (s *recordingSpan) addLink(link trace.Link) {
- if !s.IsRecording() || !link.SpanContext.IsValid() {
+func (s *recordingSpan) AddLink(link trace.Link) {
+ if !s.IsRecording() {
+ return
+ }
+ if !link.SpanContext.IsValid() && len(link.Attributes) == 0 &&
+ link.SpanContext.TraceState().Len() == 0 {
return
}
@@ -715,32 +744,16 @@ func (s *recordingSpan) snapshot() ReadOnlySpan {
}
sd.droppedAttributeCount = s.droppedAttributes
if len(s.events.queue) > 0 {
- sd.events = s.interfaceArrayToEventArray()
+ sd.events = s.events.copy()
sd.droppedEventCount = s.events.droppedCount
}
if len(s.links.queue) > 0 {
- sd.links = s.interfaceArrayToLinksArray()
+ sd.links = s.links.copy()
sd.droppedLinkCount = s.links.droppedCount
}
return &sd
}
-func (s *recordingSpan) interfaceArrayToLinksArray() []Link {
- linkArr := make([]Link, 0)
- for _, value := range s.links.queue {
- linkArr = append(linkArr, value.(Link))
- }
- return linkArr
-}
-
-func (s *recordingSpan) interfaceArrayToEventArray() []Event {
- eventArr := make([]Event, 0)
- for _, value := range s.events.queue {
- eventArr = append(eventArr, value.(Event))
- }
- return eventArr
-}
-
func (s *recordingSpan) addChild() {
if !s.IsRecording() {
return
@@ -772,6 +785,8 @@ func (s *recordingSpan) runtimeTrace(ctx context.Context) context.Context {
// that wraps a SpanContext. It performs no operations other than to return
// the wrapped SpanContext or TracerProvider that created it.
type nonRecordingSpan struct {
+ embedded.Span
+
// tracer is the SDK tracer that created this span.
tracer *tracer
sc trace.SpanContext
@@ -803,6 +818,9 @@ func (nonRecordingSpan) RecordError(error, ...trace.EventOption) {}
// AddEvent does nothing.
func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) {}
+// AddLink does nothing.
+func (nonRecordingSpan) AddLink(trace.Link) {}
+
// SetName does nothing.
func (nonRecordingSpan) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go
index c9bd52f7ad..6bdda3d94a 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go
index aa4d4221db..bec5e20978 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go b/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go
index 9c53657a71..af7f9177fc 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go b/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
index 85a71227f3..43419d3b54 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
@@ -20,9 +9,12 @@ import (
"go.opentelemetry.io/otel/sdk/instrumentation"
"go.opentelemetry.io/otel/trace"
+ "go.opentelemetry.io/otel/trace/embedded"
)
type tracer struct {
+ embedded.Tracer
+
provider *TracerProvider
instrumentationScope instrumentation.Scope
}
@@ -140,13 +132,13 @@ func (tr *tracer) newRecordingSpan(psc, sc trace.SpanContext, name string, sr Sa
spanKind: trace.ValidateSpanKind(config.SpanKind()),
name: name,
startTime: startTime,
- events: newEvictedQueue(tr.provider.spanLimits.EventCountLimit),
- links: newEvictedQueue(tr.provider.spanLimits.LinkCountLimit),
+ events: newEvictedQueueEvent(tr.provider.spanLimits.EventCountLimit),
+ links: newEvictedQueueLink(tr.provider.spanLimits.LinkCountLimit),
tracer: tr,
}
for _, l := range config.Links() {
- s.addLink(l)
+ s.AddLink(l)
}
s.SetAttributes(sr.Attributes...)
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/version.go b/vendor/go.opentelemetry.io/otel/sdk/trace/version.go
index d3457ed135..b84dd2c5ee 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/version.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/trace/version.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
diff --git a/vendor/go.opentelemetry.io/otel/sdk/version.go b/vendor/go.opentelemetry.io/otel/sdk/version.go
index 72d2cb09f7..33d065a7cb 100644
--- a/vendor/go.opentelemetry.io/otel/sdk/version.go
+++ b/vendor/go.opentelemetry.io/otel/sdk/version.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package sdk // import "go.opentelemetry.io/otel/sdk"
// Version is the current release version of the OpenTelemetry SDK in use.
func Version() string {
- return "1.19.0"
+ return "1.28.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/internal/http.go b/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
index 19c394c69b..ada857995d 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/internal/http.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/semconv/internal"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/README.md
new file mode 100644
index 0000000000..6a273180fe
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.12.0
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.12.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go
index 181fcc9c52..fc255ef05d 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package semconv implements OpenTelemetry semantic conventions.
//
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go
index d689270943..f0e12957e3 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go
index 4b4f3cbaf0..4e19ca342c 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go
index b2155676f4..45951685a7 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go
index 2f2a019e43..f01d515bc2 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.12.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go
index 047d8e95cc..70c25dc210 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
@@ -1206,7 +1195,7 @@ const (
// Stability: stable
// Examples: 'Users', 'CatsTable'
AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
- // The the number of items in the `TableNames` response parameter.
+ // The number of items in the `TableNames` response parameter.
//
// Type: int
// Required: No
@@ -1267,7 +1256,7 @@ const (
// Stability: stable
// Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
- // The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates`
+ // The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates`
// request field.
//
// Type: string[]
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md
new file mode 100644
index 0000000000..87b842c5d1
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.17.0
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.17.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
index 71a1f7748d..e087c9c04d 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Package semconv implements OpenTelemetry semantic conventions.
//
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
index 679c40c4de..c7b804bbe2 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
index 9b8c559de4..137acc67de 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
index d5c4b5c136..d318221e59 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
index 39a2eab3a6..7e365e82ce 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
index 42fc525d16..634a1dce07 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
index 8c4a7299d2..21497bb6bc 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md
new file mode 100644
index 0000000000..82e1f46b4e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.20.0
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.20.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go
new file mode 100644
index 0000000000..6685c392b5
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go
@@ -0,0 +1,1198 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// Describes HTTP attributes.
+const (
+ // HTTPMethodKey is the attribute Key conforming to the "http.method"
+ // semantic conventions. It represents the hTTP request method.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'GET', 'POST', 'HEAD'
+ HTTPMethodKey = attribute.Key("http.method")
+
+ // HTTPStatusCodeKey is the attribute Key conforming to the
+ // "http.status_code" semantic conventions. It represents the [HTTP
+ // response status code](https://tools.ietf.org/html/rfc7231#section-6).
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If and only if one was
+ // received/sent.)
+ // Stability: stable
+ // Examples: 200
+ HTTPStatusCodeKey = attribute.Key("http.status_code")
+)
+
+// HTTPMethod returns an attribute KeyValue conforming to the "http.method"
+// semantic conventions. It represents the hTTP request method.
+func HTTPMethod(val string) attribute.KeyValue {
+ return HTTPMethodKey.String(val)
+}
+
+// HTTPStatusCode returns an attribute KeyValue conforming to the
+// "http.status_code" semantic conventions. It represents the [HTTP response
+// status code](https://tools.ietf.org/html/rfc7231#section-6).
+func HTTPStatusCode(val int) attribute.KeyValue {
+ return HTTPStatusCodeKey.Int(val)
+}
+
+// HTTP Server spans attributes
+const (
+ // HTTPSchemeKey is the attribute Key conforming to the "http.scheme"
+ // semantic conventions. It represents the URI scheme identifying the used
+ // protocol.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'http', 'https'
+ HTTPSchemeKey = attribute.Key("http.scheme")
+
+ // HTTPRouteKey is the attribute Key conforming to the "http.route"
+ // semantic conventions. It represents the matched route (path template in
+ // the format used by the respective server framework). See note below
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If and only if it's available)
+ // Stability: stable
+ // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
+ // Note: MUST NOT be populated when this is not supported by the HTTP
+ // server framework as the route attribute should have low-cardinality and
+ // the URI path can NOT substitute it.
+ // SHOULD include the [application
+ // root](/specification/trace/semantic_conventions/http.md#http-server-definitions)
+ // if there is one.
+ HTTPRouteKey = attribute.Key("http.route")
+)
+
+// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme"
+// semantic conventions. It represents the URI scheme identifying the used
+// protocol.
+func HTTPScheme(val string) attribute.KeyValue {
+ return HTTPSchemeKey.String(val)
+}
+
+// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
+// semantic conventions. It represents the matched route (path template in the
+// format used by the respective server framework). See note below
+func HTTPRoute(val string) attribute.KeyValue {
+ return HTTPRouteKey.String(val)
+}
+
+// Attributes for Events represented using Log Records.
+const (
+ // EventNameKey is the attribute Key conforming to the "event.name"
+ // semantic conventions. It represents the name identifies the event.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'click', 'exception'
+ EventNameKey = attribute.Key("event.name")
+
+ // EventDomainKey is the attribute Key conforming to the "event.domain"
+ // semantic conventions. It represents the domain identifies the business
+ // context for the events.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ // Note: Events across different domains may have same `event.name`, yet be
+ // unrelated events.
+ EventDomainKey = attribute.Key("event.domain")
+)
+
+var (
+ // Events from browser apps
+ EventDomainBrowser = EventDomainKey.String("browser")
+ // Events from mobile apps
+ EventDomainDevice = EventDomainKey.String("device")
+ // Events from Kubernetes
+ EventDomainK8S = EventDomainKey.String("k8s")
+)
+
+// EventName returns an attribute KeyValue conforming to the "event.name"
+// semantic conventions. It represents the name identifies the event.
+func EventName(val string) attribute.KeyValue {
+ return EventNameKey.String(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetTransportKey is the attribute Key conforming to the "net.transport"
+ // semantic conventions. It represents the transport protocol used. See
+ // note below.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ NetTransportKey = attribute.Key("net.transport")
+
+ // NetProtocolNameKey is the attribute Key conforming to the
+ // "net.protocol.name" semantic conventions. It represents the application
+ // layer protocol used. The value SHOULD be normalized to lowercase.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'amqp', 'http', 'mqtt'
+ NetProtocolNameKey = attribute.Key("net.protocol.name")
+
+ // NetProtocolVersionKey is the attribute Key conforming to the
+ // "net.protocol.version" semantic conventions. It represents the version
+ // of the application layer protocol used. See note below.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '3.1.1'
+ // Note: `net.protocol.version` refers to the version of the protocol used
+ // and might be different from the protocol client's version. If the HTTP
+ // client used has a version of `0.27.2`, but sends HTTP version `1.1`,
+ // this attribute should be set to `1.1`.
+ NetProtocolVersionKey = attribute.Key("net.protocol.version")
+
+ // NetSockPeerNameKey is the attribute Key conforming to the
+ // "net.sock.peer.name" semantic conventions. It represents the remote
+ // socket peer name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended (If available and different from
+ // `net.peer.name` and if `net.sock.peer.addr` is set.)
+ // Stability: stable
+ // Examples: 'proxy.example.com'
+ NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
+
+ // NetSockPeerAddrKey is the attribute Key conforming to the
+ // "net.sock.peer.addr" semantic conventions. It represents the remote
+ // socket peer address: IPv4 or IPv6 for internet protocols, path for local
+ // communication,
+ // [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '127.0.0.1', '/tmp/mysql.sock'
+ NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
+
+ // NetSockPeerPortKey is the attribute Key conforming to the
+ // "net.sock.peer.port" semantic conventions. It represents the remote
+ // socket peer port.
+ //
+ // Type: int
+ // RequirementLevel: Recommended (If defined for the address family and if
+ // different than `net.peer.port` and if `net.sock.peer.addr` is set.)
+ // Stability: stable
+ // Examples: 16456
+ NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
+
+ // NetSockFamilyKey is the attribute Key conforming to the
+ // "net.sock.family" semantic conventions. It represents the protocol
+ // [address
+ // family](https://man7.org/linux/man-pages/man7/address_families.7.html)
+ // which is used for communication.
+ //
+ // Type: Enum
+ // RequirementLevel: ConditionallyRequired (If different than `inet` and if
+ // any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers
+ // of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in
+ // `net.sock.peer.addr` if `net.sock.family` is not set. This is to support
+ // instrumentations that follow previous versions of this document.)
+ // Stability: stable
+ // Examples: 'inet6', 'bluetooth'
+ NetSockFamilyKey = attribute.Key("net.sock.family")
+
+ // NetPeerNameKey is the attribute Key conforming to the "net.peer.name"
+ // semantic conventions. It represents the logical remote hostname, see
+ // note below.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'example.com'
+ // Note: `net.peer.name` SHOULD NOT be set if capturing it would require an
+ // extra DNS lookup.
+ NetPeerNameKey = attribute.Key("net.peer.name")
+
+ // NetPeerPortKey is the attribute Key conforming to the "net.peer.port"
+ // semantic conventions. It represents the logical remote port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 80, 8080, 443
+ NetPeerPortKey = attribute.Key("net.peer.port")
+
+ // NetHostNameKey is the attribute Key conforming to the "net.host.name"
+ // semantic conventions. It represents the logical local hostname or
+ // similar, see note below.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'localhost'
+ NetHostNameKey = attribute.Key("net.host.name")
+
+ // NetHostPortKey is the attribute Key conforming to the "net.host.port"
+ // semantic conventions. It represents the logical local port number,
+ // preferably the one that the peer used to connect
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 8080
+ NetHostPortKey = attribute.Key("net.host.port")
+
+ // NetSockHostAddrKey is the attribute Key conforming to the
+ // "net.sock.host.addr" semantic conventions. It represents the local
+ // socket address. Useful in case of a multi-IP host.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '192.168.0.1'
+ NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
+
+ // NetSockHostPortKey is the attribute Key conforming to the
+ // "net.sock.host.port" semantic conventions. It represents the local
+ // socket port number.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If defined for the address
+ // family and if different than `net.host.port` and if `net.sock.host.addr`
+ // is set. In other cases, it is still recommended to set this.)
+ // Stability: stable
+ // Examples: 35555
+ NetSockHostPortKey = attribute.Key("net.sock.host.port")
+)
+
+var (
+ // ip_tcp
+ NetTransportTCP = NetTransportKey.String("ip_tcp")
+ // ip_udp
+ NetTransportUDP = NetTransportKey.String("ip_udp")
+ // Named or anonymous pipe. See note below
+ NetTransportPipe = NetTransportKey.String("pipe")
+ // In-process communication
+ NetTransportInProc = NetTransportKey.String("inproc")
+ // Something else (non IP-based)
+ NetTransportOther = NetTransportKey.String("other")
+)
+
+var (
+ // IPv4 address
+ NetSockFamilyInet = NetSockFamilyKey.String("inet")
+ // IPv6 address
+ NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
+ // Unix domain socket path
+ NetSockFamilyUnix = NetSockFamilyKey.String("unix")
+)
+
+// NetProtocolName returns an attribute KeyValue conforming to the
+// "net.protocol.name" semantic conventions. It represents the application
+// layer protocol used. The value SHOULD be normalized to lowercase.
+func NetProtocolName(val string) attribute.KeyValue {
+ return NetProtocolNameKey.String(val)
+}
+
+// NetProtocolVersion returns an attribute KeyValue conforming to the
+// "net.protocol.version" semantic conventions. It represents the version of
+// the application layer protocol used. See note below.
+func NetProtocolVersion(val string) attribute.KeyValue {
+ return NetProtocolVersionKey.String(val)
+}
+
+// NetSockPeerName returns an attribute KeyValue conforming to the
+// "net.sock.peer.name" semantic conventions. It represents the remote socket
+// peer name.
+func NetSockPeerName(val string) attribute.KeyValue {
+ return NetSockPeerNameKey.String(val)
+}
+
+// NetSockPeerAddr returns an attribute KeyValue conforming to the
+// "net.sock.peer.addr" semantic conventions. It represents the remote socket
+// peer address: IPv4 or IPv6 for internet protocols, path for local
+// communication,
+// [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
+func NetSockPeerAddr(val string) attribute.KeyValue {
+ return NetSockPeerAddrKey.String(val)
+}
+
+// NetSockPeerPort returns an attribute KeyValue conforming to the
+// "net.sock.peer.port" semantic conventions. It represents the remote socket
+// peer port.
+func NetSockPeerPort(val int) attribute.KeyValue {
+ return NetSockPeerPortKey.Int(val)
+}
+
+// NetPeerName returns an attribute KeyValue conforming to the
+// "net.peer.name" semantic conventions. It represents the logical remote
+// hostname, see note below.
+func NetPeerName(val string) attribute.KeyValue {
+ return NetPeerNameKey.String(val)
+}
+
+// NetPeerPort returns an attribute KeyValue conforming to the
+// "net.peer.port" semantic conventions. It represents the logical remote port
+// number
+func NetPeerPort(val int) attribute.KeyValue {
+ return NetPeerPortKey.Int(val)
+}
+
+// NetHostName returns an attribute KeyValue conforming to the
+// "net.host.name" semantic conventions. It represents the logical local
+// hostname or similar, see note below.
+func NetHostName(val string) attribute.KeyValue {
+ return NetHostNameKey.String(val)
+}
+
+// NetHostPort returns an attribute KeyValue conforming to the
+// "net.host.port" semantic conventions. It represents the logical local port
+// number, preferably the one that the peer used to connect
+func NetHostPort(val int) attribute.KeyValue {
+ return NetHostPortKey.Int(val)
+}
+
+// NetSockHostAddr returns an attribute KeyValue conforming to the
+// "net.sock.host.addr" semantic conventions. It represents the local socket
+// address. Useful in case of a multi-IP host.
+func NetSockHostAddr(val string) attribute.KeyValue {
+ return NetSockHostAddrKey.String(val)
+}
+
+// NetSockHostPort returns an attribute KeyValue conforming to the
+// "net.sock.host.port" semantic conventions. It represents the local socket
+// port number.
+func NetSockHostPort(val int) attribute.KeyValue {
+ return NetSockHostPortKey.Int(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetHostConnectionTypeKey is the attribute Key conforming to the
+ // "net.host.connection.type" semantic conventions. It represents the
+ // internet connection type currently being used by the host.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'wifi'
+ NetHostConnectionTypeKey = attribute.Key("net.host.connection.type")
+
+ // NetHostConnectionSubtypeKey is the attribute Key conforming to the
+ // "net.host.connection.subtype" semantic conventions. It represents the
+ // this describes more details regarding the connection.type. It may be the
+ // type of cell technology connection, but it could be used for describing
+ // details about a wifi connection.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'LTE'
+ NetHostConnectionSubtypeKey = attribute.Key("net.host.connection.subtype")
+
+ // NetHostCarrierNameKey is the attribute Key conforming to the
+ // "net.host.carrier.name" semantic conventions. It represents the name of
+ // the mobile carrier.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'sprint'
+ NetHostCarrierNameKey = attribute.Key("net.host.carrier.name")
+
+ // NetHostCarrierMccKey is the attribute Key conforming to the
+ // "net.host.carrier.mcc" semantic conventions. It represents the mobile
+ // carrier country code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '310'
+ NetHostCarrierMccKey = attribute.Key("net.host.carrier.mcc")
+
+ // NetHostCarrierMncKey is the attribute Key conforming to the
+ // "net.host.carrier.mnc" semantic conventions. It represents the mobile
+ // carrier network code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '001'
+ NetHostCarrierMncKey = attribute.Key("net.host.carrier.mnc")
+
+ // NetHostCarrierIccKey is the attribute Key conforming to the
+ // "net.host.carrier.icc" semantic conventions. It represents the ISO
+ // 3166-1 alpha-2 2-character country code associated with the mobile
+ // carrier network.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'DE'
+ NetHostCarrierIccKey = attribute.Key("net.host.carrier.icc")
+)
+
+var (
+ // wifi
+ NetHostConnectionTypeWifi = NetHostConnectionTypeKey.String("wifi")
+ // wired
+ NetHostConnectionTypeWired = NetHostConnectionTypeKey.String("wired")
+ // cell
+ NetHostConnectionTypeCell = NetHostConnectionTypeKey.String("cell")
+ // unavailable
+ NetHostConnectionTypeUnavailable = NetHostConnectionTypeKey.String("unavailable")
+ // unknown
+ NetHostConnectionTypeUnknown = NetHostConnectionTypeKey.String("unknown")
+)
+
+var (
+ // GPRS
+ NetHostConnectionSubtypeGprs = NetHostConnectionSubtypeKey.String("gprs")
+ // EDGE
+ NetHostConnectionSubtypeEdge = NetHostConnectionSubtypeKey.String("edge")
+ // UMTS
+ NetHostConnectionSubtypeUmts = NetHostConnectionSubtypeKey.String("umts")
+ // CDMA
+ NetHostConnectionSubtypeCdma = NetHostConnectionSubtypeKey.String("cdma")
+ // EVDO Rel. 0
+ NetHostConnectionSubtypeEvdo0 = NetHostConnectionSubtypeKey.String("evdo_0")
+ // EVDO Rev. A
+ NetHostConnectionSubtypeEvdoA = NetHostConnectionSubtypeKey.String("evdo_a")
+ // CDMA2000 1XRTT
+ NetHostConnectionSubtypeCdma20001xrtt = NetHostConnectionSubtypeKey.String("cdma2000_1xrtt")
+ // HSDPA
+ NetHostConnectionSubtypeHsdpa = NetHostConnectionSubtypeKey.String("hsdpa")
+ // HSUPA
+ NetHostConnectionSubtypeHsupa = NetHostConnectionSubtypeKey.String("hsupa")
+ // HSPA
+ NetHostConnectionSubtypeHspa = NetHostConnectionSubtypeKey.String("hspa")
+ // IDEN
+ NetHostConnectionSubtypeIden = NetHostConnectionSubtypeKey.String("iden")
+ // EVDO Rev. B
+ NetHostConnectionSubtypeEvdoB = NetHostConnectionSubtypeKey.String("evdo_b")
+ // LTE
+ NetHostConnectionSubtypeLte = NetHostConnectionSubtypeKey.String("lte")
+ // EHRPD
+ NetHostConnectionSubtypeEhrpd = NetHostConnectionSubtypeKey.String("ehrpd")
+ // HSPAP
+ NetHostConnectionSubtypeHspap = NetHostConnectionSubtypeKey.String("hspap")
+ // GSM
+ NetHostConnectionSubtypeGsm = NetHostConnectionSubtypeKey.String("gsm")
+ // TD-SCDMA
+ NetHostConnectionSubtypeTdScdma = NetHostConnectionSubtypeKey.String("td_scdma")
+ // IWLAN
+ NetHostConnectionSubtypeIwlan = NetHostConnectionSubtypeKey.String("iwlan")
+ // 5G NR (New Radio)
+ NetHostConnectionSubtypeNr = NetHostConnectionSubtypeKey.String("nr")
+ // 5G NRNSA (New Radio Non-Standalone)
+ NetHostConnectionSubtypeNrnsa = NetHostConnectionSubtypeKey.String("nrnsa")
+ // LTE CA
+ NetHostConnectionSubtypeLteCa = NetHostConnectionSubtypeKey.String("lte_ca")
+)
+
+// NetHostCarrierName returns an attribute KeyValue conforming to the
+// "net.host.carrier.name" semantic conventions. It represents the name of the
+// mobile carrier.
+func NetHostCarrierName(val string) attribute.KeyValue {
+ return NetHostCarrierNameKey.String(val)
+}
+
+// NetHostCarrierMcc returns an attribute KeyValue conforming to the
+// "net.host.carrier.mcc" semantic conventions. It represents the mobile
+// carrier country code.
+func NetHostCarrierMcc(val string) attribute.KeyValue {
+ return NetHostCarrierMccKey.String(val)
+}
+
+// NetHostCarrierMnc returns an attribute KeyValue conforming to the
+// "net.host.carrier.mnc" semantic conventions. It represents the mobile
+// carrier network code.
+func NetHostCarrierMnc(val string) attribute.KeyValue {
+ return NetHostCarrierMncKey.String(val)
+}
+
+// NetHostCarrierIcc returns an attribute KeyValue conforming to the
+// "net.host.carrier.icc" semantic conventions. It represents the ISO 3166-1
+// alpha-2 2-character country code associated with the mobile carrier network.
+func NetHostCarrierIcc(val string) attribute.KeyValue {
+ return NetHostCarrierIccKey.String(val)
+}
+
+// Semantic conventions for HTTP client and server Spans.
+const (
+ // HTTPRequestContentLengthKey is the attribute Key conforming to the
+ // "http.request_content_length" semantic conventions. It represents the
+ // size of the request payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3495
+ HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
+
+ // HTTPResponseContentLengthKey is the attribute Key conforming to the
+ // "http.response_content_length" semantic conventions. It represents the
+ // size of the response payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3495
+ HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
+)
+
+// HTTPRequestContentLength returns an attribute KeyValue conforming to the
+// "http.request_content_length" semantic conventions. It represents the size
+// of the request payload body in bytes. This is the number of bytes
+// transferred excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPRequestContentLength(val int) attribute.KeyValue {
+ return HTTPRequestContentLengthKey.Int(val)
+}
+
+// HTTPResponseContentLength returns an attribute KeyValue conforming to the
+// "http.response_content_length" semantic conventions. It represents the size
+// of the response payload body in bytes. This is the number of bytes
+// transferred excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPResponseContentLength(val int) attribute.KeyValue {
+ return HTTPResponseContentLengthKey.Int(val)
+}
+
+// Semantic convention describing per-message attributes populated on messaging
+// spans or links.
+const (
+ // MessagingMessageIDKey is the attribute Key conforming to the
+ // "messaging.message.id" semantic conventions. It represents a value used
+ // by the messaging system as an identifier for the message, represented as
+ // a string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
+ MessagingMessageIDKey = attribute.Key("messaging.message.id")
+
+ // MessagingMessageConversationIDKey is the attribute Key conforming to the
+ // "messaging.message.conversation_id" semantic conventions. It represents
+ // the [conversation ID](#conversations) identifying the conversation to
+ // which the message belongs, represented as a string. Sometimes called
+ // "Correlation ID".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'MyConversationID'
+ MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
+
+ // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to
+ // the "messaging.message.payload_size_bytes" semantic conventions. It
+ // represents the (uncompressed) size of the message payload in bytes. Also
+ // use this attribute if it is unknown whether the compressed or
+ // uncompressed payload size is reported.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2738
+ MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes")
+
+ // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key
+ // conforming to the "messaging.message.payload_compressed_size_bytes"
+ // semantic conventions. It represents the compressed size of the message
+ // payload in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2048
+ MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes")
+)
+
+// MessagingMessageID returns an attribute KeyValue conforming to the
+// "messaging.message.id" semantic conventions. It represents a value used by
+// the messaging system as an identifier for the message, represented as a
+// string.
+func MessagingMessageID(val string) attribute.KeyValue {
+ return MessagingMessageIDKey.String(val)
+}
+
+// MessagingMessageConversationID returns an attribute KeyValue conforming
+// to the "messaging.message.conversation_id" semantic conventions. It
+// represents the [conversation ID](#conversations) identifying the
+// conversation to which the message belongs, represented as a string.
+// Sometimes called "Correlation ID".
+func MessagingMessageConversationID(val string) attribute.KeyValue {
+ return MessagingMessageConversationIDKey.String(val)
+}
+
+// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming
+// to the "messaging.message.payload_size_bytes" semantic conventions. It
+// represents the (uncompressed) size of the message payload in bytes. Also use
+// this attribute if it is unknown whether the compressed or uncompressed
+// payload size is reported.
+func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue {
+ return MessagingMessagePayloadSizeBytesKey.Int(val)
+}
+
+// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue
+// conforming to the "messaging.message.payload_compressed_size_bytes" semantic
+// conventions. It represents the compressed size of the message payload in
+// bytes.
+func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue {
+ return MessagingMessagePayloadCompressedSizeBytesKey.Int(val)
+}
+
+// Semantic convention for attributes that describe messaging destination on
+// broker
+const (
+ // MessagingDestinationNameKey is the attribute Key conforming to the
+ // "messaging.destination.name" semantic conventions. It represents the
+ // message destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Destination name SHOULD uniquely identify a specific queue, topic
+ // or other entity within the broker. If
+ // the broker does not have such notion, the destination name SHOULD
+ // uniquely identify the broker.
+ MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
+
+ // MessagingDestinationTemplateKey is the attribute Key conforming to the
+ // "messaging.destination.template" semantic conventions. It represents the
+ // low cardinality representation of the messaging destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/customers/{customerID}'
+ // Note: Destination names could be constructed from templates. An example
+ // would be a destination name involving a user name or product id.
+ // Although the destination name in this case is of high cardinality, the
+ // underlying template is of low cardinality and can be effectively used
+ // for grouping and aggregation.
+ MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
+
+ // MessagingDestinationTemporaryKey is the attribute Key conforming to the
+ // "messaging.destination.temporary" semantic conventions. It represents a
+ // boolean that is true if the message destination is temporary and might
+ // not exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
+
+ // MessagingDestinationAnonymousKey is the attribute Key conforming to the
+ // "messaging.destination.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message destination is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
+)
+
+// MessagingDestinationName returns an attribute KeyValue conforming to the
+// "messaging.destination.name" semantic conventions. It represents the message
+// destination name
+func MessagingDestinationName(val string) attribute.KeyValue {
+ return MessagingDestinationNameKey.String(val)
+}
+
+// MessagingDestinationTemplate returns an attribute KeyValue conforming to
+// the "messaging.destination.template" semantic conventions. It represents the
+// low cardinality representation of the messaging destination name
+func MessagingDestinationTemplate(val string) attribute.KeyValue {
+ return MessagingDestinationTemplateKey.String(val)
+}
+
+// MessagingDestinationTemporary returns an attribute KeyValue conforming to
+// the "messaging.destination.temporary" semantic conventions. It represents a
+// boolean that is true if the message destination is temporary and might not
+// exist anymore after messages are processed.
+func MessagingDestinationTemporary(val bool) attribute.KeyValue {
+ return MessagingDestinationTemporaryKey.Bool(val)
+}
+
+// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
+// the "messaging.destination.anonymous" semantic conventions. It represents a
+// boolean that is true if the message destination is anonymous (could be
+// unnamed or have auto-generated name).
+func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationAnonymousKey.Bool(val)
+}
+
+// Semantic convention for attributes that describe messaging source on broker
+const (
+ // MessagingSourceNameKey is the attribute Key conforming to the
+ // "messaging.source.name" semantic conventions. It represents the message
+ // source name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Source name SHOULD uniquely identify a specific queue, topic, or
+ // other entity within the broker. If
+ // the broker does not have such notion, the source name SHOULD uniquely
+ // identify the broker.
+ MessagingSourceNameKey = attribute.Key("messaging.source.name")
+
+ // MessagingSourceTemplateKey is the attribute Key conforming to the
+ // "messaging.source.template" semantic conventions. It represents the low
+ // cardinality representation of the messaging source name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/customers/{customerID}'
+ // Note: Source names could be constructed from templates. An example would
+ // be a source name involving a user name or product id. Although the
+ // source name in this case is of high cardinality, the underlying template
+ // is of low cardinality and can be effectively used for grouping and
+ // aggregation.
+ MessagingSourceTemplateKey = attribute.Key("messaging.source.template")
+
+ // MessagingSourceTemporaryKey is the attribute Key conforming to the
+ // "messaging.source.temporary" semantic conventions. It represents a
+ // boolean that is true if the message source is temporary and might not
+ // exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingSourceTemporaryKey = attribute.Key("messaging.source.temporary")
+
+ // MessagingSourceAnonymousKey is the attribute Key conforming to the
+ // "messaging.source.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message source is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingSourceAnonymousKey = attribute.Key("messaging.source.anonymous")
+)
+
+// MessagingSourceName returns an attribute KeyValue conforming to the
+// "messaging.source.name" semantic conventions. It represents the message
+// source name
+func MessagingSourceName(val string) attribute.KeyValue {
+ return MessagingSourceNameKey.String(val)
+}
+
+// MessagingSourceTemplate returns an attribute KeyValue conforming to the
+// "messaging.source.template" semantic conventions. It represents the low
+// cardinality representation of the messaging source name
+func MessagingSourceTemplate(val string) attribute.KeyValue {
+ return MessagingSourceTemplateKey.String(val)
+}
+
+// MessagingSourceTemporary returns an attribute KeyValue conforming to the
+// "messaging.source.temporary" semantic conventions. It represents a boolean
+// that is true if the message source is temporary and might not exist anymore
+// after messages are processed.
+func MessagingSourceTemporary(val bool) attribute.KeyValue {
+ return MessagingSourceTemporaryKey.Bool(val)
+}
+
+// MessagingSourceAnonymous returns an attribute KeyValue conforming to the
+// "messaging.source.anonymous" semantic conventions. It represents a boolean
+// that is true if the message source is anonymous (could be unnamed or have
+// auto-generated name).
+func MessagingSourceAnonymous(val bool) attribute.KeyValue {
+ return MessagingSourceAnonymousKey.Bool(val)
+}
+
+// Attributes for RabbitMQ
+const (
+ // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
+ // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+ // conventions. It represents the rabbitMQ message routing key.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If not empty.)
+ // Stability: stable
+ // Examples: 'myKey'
+ MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
+)
+
+// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+// conventions. It represents the rabbitMQ message routing key.
+func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
+ return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
+}
+
+// Attributes for Apache Kafka
+const (
+ // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
+ // "messaging.kafka.message.key" semantic conventions. It represents the
+ // message keys in Kafka are used for grouping alike messages to ensure
+ // they're processed on the same partition. They differ from
+ // `messaging.message.id` in that they're not unique. If the key is `null`,
+ // the attribute MUST NOT be set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'myKey'
+ // Note: If the key type is not string, it's string representation has to
+ // be supplied for the attribute. If the key has no unambiguous, canonical
+ // string form, don't include its value.
+ MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
+
+ // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
+ // "messaging.kafka.consumer.group" semantic conventions. It represents the
+ // name of the Kafka Consumer Group that is handling the message. Only
+ // applies to consumers, not producers.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'my-group'
+ MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
+
+ // MessagingKafkaClientIDKey is the attribute Key conforming to the
+ // "messaging.kafka.client_id" semantic conventions. It represents the
+ // client ID for the Consumer or Producer that is handling the message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'client-5'
+ MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id")
+
+ // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to
+ // the "messaging.kafka.destination.partition" semantic conventions. It
+ // represents the partition the message is sent to.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2
+ MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
+
+ // MessagingKafkaSourcePartitionKey is the attribute Key conforming to the
+ // "messaging.kafka.source.partition" semantic conventions. It represents
+ // the partition the message is received from.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2
+ MessagingKafkaSourcePartitionKey = attribute.Key("messaging.kafka.source.partition")
+
+ // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
+ // "messaging.kafka.message.offset" semantic conventions. It represents the
+ // offset of a record in the corresponding Kafka partition.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 42
+ MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
+
+ // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
+ // "messaging.kafka.message.tombstone" semantic conventions. It represents
+ // a boolean that is true if the message is a tombstone.
+ //
+ // Type: boolean
+ // RequirementLevel: ConditionallyRequired (If value is `true`. When
+ // missing, the value is assumed to be `false`.)
+ // Stability: stable
+ MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
+)
+
+// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
+// "messaging.kafka.message.key" semantic conventions. It represents the
+// message keys in Kafka are used for grouping alike messages to ensure they're
+// processed on the same partition. They differ from `messaging.message.id` in
+// that they're not unique. If the key is `null`, the attribute MUST NOT be
+// set.
+func MessagingKafkaMessageKey(val string) attribute.KeyValue {
+ return MessagingKafkaMessageKeyKey.String(val)
+}
+
+// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
+// the "messaging.kafka.consumer.group" semantic conventions. It represents the
+// name of the Kafka Consumer Group that is handling the message. Only applies
+// to consumers, not producers.
+func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
+ return MessagingKafkaConsumerGroupKey.String(val)
+}
+
+// MessagingKafkaClientID returns an attribute KeyValue conforming to the
+// "messaging.kafka.client_id" semantic conventions. It represents the client
+// ID for the Consumer or Producer that is handling the message.
+func MessagingKafkaClientID(val string) attribute.KeyValue {
+ return MessagingKafkaClientIDKey.String(val)
+}
+
+// MessagingKafkaDestinationPartition returns an attribute KeyValue
+// conforming to the "messaging.kafka.destination.partition" semantic
+// conventions. It represents the partition the message is sent to.
+func MessagingKafkaDestinationPartition(val int) attribute.KeyValue {
+ return MessagingKafkaDestinationPartitionKey.Int(val)
+}
+
+// MessagingKafkaSourcePartition returns an attribute KeyValue conforming to
+// the "messaging.kafka.source.partition" semantic conventions. It represents
+// the partition the message is received from.
+func MessagingKafkaSourcePartition(val int) attribute.KeyValue {
+ return MessagingKafkaSourcePartitionKey.Int(val)
+}
+
+// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
+// the "messaging.kafka.message.offset" semantic conventions. It represents the
+// offset of a record in the corresponding Kafka partition.
+func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
+ return MessagingKafkaMessageOffsetKey.Int(val)
+}
+
+// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
+// to the "messaging.kafka.message.tombstone" semantic conventions. It
+// represents a boolean that is true if the message is a tombstone.
+func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
+ return MessagingKafkaMessageTombstoneKey.Bool(val)
+}
+
+// Attributes for Apache RocketMQ
+const (
+ // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
+ // "messaging.rocketmq.namespace" semantic conventions. It represents the
+ // namespace of RocketMQ resources, resources in different namespaces are
+ // individual.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'myNamespace'
+ MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
+
+ // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_group" semantic conventions. It represents
+ // the name of the RocketMQ producer/consumer group that is handling the
+ // message. The client type is identified by the SpanKind.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'myConsumerGroup'
+ MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
+
+ // MessagingRocketmqClientIDKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_id" semantic conventions. It represents the
+ // unique identifier for each client.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'myhost@8742@s8083jm'
+ MessagingRocketmqClientIDKey = attribute.Key("messaging.rocketmq.client_id")
+
+ // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delivery_timestamp"
+ // semantic conventions. It represents the timestamp in milliseconds that
+ // the delay message is expected to be delivered to consumer.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If the message type is delay
+ // and delay time level is not specified.)
+ // Stability: stable
+ // Examples: 1665987217045
+ MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
+
+ // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+ // conventions. It represents the delay time level for delay message, which
+ // determines the message delay time.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If the message type is delay
+ // and delivery timestamp is not specified.)
+ // Stability: stable
+ // Examples: 3
+ MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
+
+ // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.group" semantic conventions. It represents
+ // the it is essential for FIFO message. Messages that belong to the same
+ // message group are always processed one by one within the same consumer
+ // group.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If the message type is FIFO.)
+ // Stability: stable
+ // Examples: 'myMessageGroup'
+ MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
+
+ // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.type" semantic conventions. It represents
+ // the type of message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
+
+ // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.tag" semantic conventions. It represents the
+ // secondary classifier of message besides topic.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'tagA'
+ MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
+
+ // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.keys" semantic conventions. It represents
+ // the key(s) of message, another way to mark message besides message id.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'keyA', 'keyB'
+ MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
+
+ // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
+ // the "messaging.rocketmq.consumption_model" semantic conventions. It
+ // represents the model of message consumption. This only applies to
+ // consumer spans.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
+)
+
+var (
+ // Normal message
+ MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
+ // FIFO message
+ MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
+ // Delay message
+ MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
+ // Transaction message
+ MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
+)
+
+var (
+ // Clustering consumption model
+ MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
+ // Broadcasting consumption model
+ MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
+)
+
+// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.namespace" semantic conventions. It represents the
+// namespace of RocketMQ resources, resources in different namespaces are
+// individual.
+func MessagingRocketmqNamespace(val string) attribute.KeyValue {
+ return MessagingRocketmqNamespaceKey.String(val)
+}
+
+// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.client_group" semantic conventions. It represents
+// the name of the RocketMQ producer/consumer group that is handling the
+// message. The client type is identified by the SpanKind.
+func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqClientGroupKey.String(val)
+}
+
+// MessagingRocketmqClientID returns an attribute KeyValue conforming to the
+// "messaging.rocketmq.client_id" semantic conventions. It represents the
+// unique identifier for each client.
+func MessagingRocketmqClientID(val string) attribute.KeyValue {
+ return MessagingRocketmqClientIDKey.String(val)
+}
+
+// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
+// conventions. It represents the timestamp in milliseconds that the delay
+// message is expected to be delivered to consumer.
+func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
+}
+
+// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+// conventions. It represents the delay time level for delay message, which
+// determines the message delay time.
+func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
+}
+
+// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.group" semantic conventions. It represents
+// the it is essential for FIFO message. Messages that belong to the same
+// message group are always processed one by one within the same consumer
+// group.
+func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
+// secondary classifier of message besides topic.
+func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageTagKey.String(val)
+}
+
+// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.keys" semantic conventions. It represents
+// the key(s) of message, another way to mark message besides message id.
+func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
+ return MessagingRocketmqMessageKeysKey.StringSlice(val)
+}
+
+// Describes user-agent attributes.
+const (
+ // UserAgentOriginalKey is the attribute Key conforming to the
+ // "user_agent.original" semantic conventions. It represents the value of
+ // the [HTTP
+ // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+ // header sent by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
+ UserAgentOriginalKey = attribute.Key("user_agent.original")
+)
+
+// UserAgentOriginal returns an attribute KeyValue conforming to the
+// "user_agent.original" semantic conventions. It represents the value of the
+// [HTTP
+// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+// header sent by the client.
+func UserAgentOriginal(val string) attribute.KeyValue {
+ return UserAgentOriginalKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go
new file mode 100644
index 0000000000..0d1f55a8fe
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package semconv implements OpenTelemetry semantic conventions.
+//
+// OpenTelemetry semantic conventions are agreed standardized naming
+// patterns for OpenTelemetry things. This package represents the conventions
+// as of the v1.20.0 version of the OpenTelemetry specification.
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
similarity index 92%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
index 30ae34fe47..6377639321 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go
new file mode 100644
index 0000000000..f40c97825a
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+const (
+ // ExceptionEventName is the name of the Span event representing an exception.
+ ExceptionEventName = "exception"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go
new file mode 100644
index 0000000000..9c1840631b
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go
@@ -0,0 +1,10 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+// HTTP scheme attributes.
+var (
+ HTTPSchemeHTTP = HTTPSchemeKey.String("http")
+ HTTPSchemeHTTPS = HTTPSchemeKey.String("https")
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
similarity index 86%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
index b6d8935cf9..3d44dae275 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
@@ -273,8 +262,6 @@ var (
CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service")
// Azure Red Hat OpenShift
CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift")
- // Google Bare Metal Solution (BMS)
- CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution")
// Google Cloud Compute Engine (GCE)
CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine")
// Google Cloud Run
@@ -547,103 +534,6 @@ func AWSLogStreamARNs(val ...string) attribute.KeyValue {
return AWSLogStreamARNsKey.StringSlice(val)
}
-// Resource used by Google Cloud Run.
-const (
- // GCPCloudRunJobExecutionKey is the attribute Key conforming to the
- // "gcp.cloud_run.job.execution" semantic conventions. It represents the
- // name of the Cloud Run
- // [execution](https://cloud.google.com/run/docs/managing/job-executions)
- // being run for the Job, as set by the
- // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
- // environment variable.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'job-name-xxxx', 'sample-job-mdw84'
- GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution")
-
- // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the
- // "gcp.cloud_run.job.task_index" semantic conventions. It represents the
- // index for a task within an execution as provided by the
- // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
- // environment variable.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 0, 1
- GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index")
-)
-
-// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the
-// "gcp.cloud_run.job.execution" semantic conventions. It represents the name
-// of the Cloud Run
-// [execution](https://cloud.google.com/run/docs/managing/job-executions) being
-// run for the Job, as set by the
-// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
-// environment variable.
-func GCPCloudRunJobExecution(val string) attribute.KeyValue {
- return GCPCloudRunJobExecutionKey.String(val)
-}
-
-// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the
-// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index
-// for a task within an execution as provided by the
-// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
-// environment variable.
-func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue {
- return GCPCloudRunJobTaskIndexKey.Int(val)
-}
-
-// Resources used by Google Compute Engine (GCE).
-const (
- // GCPGceInstanceNameKey is the attribute Key conforming to the
- // "gcp.gce.instance.name" semantic conventions. It represents the instance
- // name of a GCE instance. This is the value provided by `host.name`, the
- // visible name of the instance in the Cloud Console UI, and the prefix for
- // the default hostname of the instance as defined by the [default internal
- // DNS
- // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'instance-1', 'my-vm-name'
- GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name")
-
- // GCPGceInstanceHostnameKey is the attribute Key conforming to the
- // "gcp.gce.instance.hostname" semantic conventions. It represents the
- // hostname of a GCE instance. This is the full value of the default or
- // [custom
- // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'my-host1234.example.com',
- // 'sample-vm.us-west1-b.c.my-project.internal'
- GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname")
-)
-
-// GCPGceInstanceName returns an attribute KeyValue conforming to the
-// "gcp.gce.instance.name" semantic conventions. It represents the instance
-// name of a GCE instance. This is the value provided by `host.name`, the
-// visible name of the instance in the Cloud Console UI, and the prefix for the
-// default hostname of the instance as defined by the [default internal DNS
-// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
-func GCPGceInstanceName(val string) attribute.KeyValue {
- return GCPGceInstanceNameKey.String(val)
-}
-
-// GCPGceInstanceHostname returns an attribute KeyValue conforming to the
-// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname
-// of a GCE instance. This is the full value of the default or [custom
-// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
-func GCPGceInstanceHostname(val string) attribute.KeyValue {
- return GCPGceInstanceHostnameKey.String(val)
-}
-
// Heroku dyno metadata
const (
// HerokuReleaseCreationTimestampKey is the attribute Key conforming to the
@@ -751,59 +641,6 @@ const (
// Stability: stable
// Examples: '0.1'
ContainerImageTagKey = attribute.Key("container.image.tag")
-
- // ContainerImageIDKey is the attribute Key conforming to the
- // "container.image.id" semantic conventions. It represents the runtime
- // specific image identifier. Usually a hash algorithm followed by a UUID.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples:
- // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f'
- // Note: Docker defines a sha256 of the image id; `container.image.id`
- // corresponds to the `Image` field from the Docker container inspect
- // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect)
- // endpoint.
- // K8S defines a link to the container registry repository with digest
- // `"imageID": "registry.azurecr.io
- // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
- // OCI defines a digest of manifest.
- ContainerImageIDKey = attribute.Key("container.image.id")
-
- // ContainerCommandKey is the attribute Key conforming to the
- // "container.command" semantic conventions. It represents the command used
- // to run the container (i.e. the command name).
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'otelcontribcol'
- // Note: If using embedded credentials or sensitive data, it is recommended
- // to remove them to prevent potential leakage.
- ContainerCommandKey = attribute.Key("container.command")
-
- // ContainerCommandLineKey is the attribute Key conforming to the
- // "container.command_line" semantic conventions. It represents the full
- // command run by the container as a single string representing the full
- // command. [2]
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'otelcontribcol --config config.yaml'
- ContainerCommandLineKey = attribute.Key("container.command_line")
-
- // ContainerCommandArgsKey is the attribute Key conforming to the
- // "container.command_args" semantic conventions. It represents the all the
- // command arguments (including the command/executable itself) run by the
- // container. [2]
- //
- // Type: string[]
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'otelcontribcol, --config, config.yaml'
- ContainerCommandArgsKey = attribute.Key("container.command_args")
)
// ContainerName returns an attribute KeyValue conforming to the
@@ -843,36 +680,6 @@ func ContainerImageTag(val string) attribute.KeyValue {
return ContainerImageTagKey.String(val)
}
-// ContainerImageID returns an attribute KeyValue conforming to the
-// "container.image.id" semantic conventions. It represents the runtime
-// specific image identifier. Usually a hash algorithm followed by a UUID.
-func ContainerImageID(val string) attribute.KeyValue {
- return ContainerImageIDKey.String(val)
-}
-
-// ContainerCommand returns an attribute KeyValue conforming to the
-// "container.command" semantic conventions. It represents the command used to
-// run the container (i.e. the command name).
-func ContainerCommand(val string) attribute.KeyValue {
- return ContainerCommandKey.String(val)
-}
-
-// ContainerCommandLine returns an attribute KeyValue conforming to the
-// "container.command_line" semantic conventions. It represents the full
-// command run by the container as a single string representing the full
-// command. [2]
-func ContainerCommandLine(val string) attribute.KeyValue {
- return ContainerCommandLineKey.String(val)
-}
-
-// ContainerCommandArgs returns an attribute KeyValue conforming to the
-// "container.command_args" semantic conventions. It represents the all the
-// command arguments (including the command/executable itself) run by the
-// container. [2]
-func ContainerCommandArgs(val ...string) attribute.KeyValue {
- return ContainerCommandArgsKey.StringSlice(val)
-}
-
// The software deployment.
const (
// DeploymentEnvironmentKey is the attribute Key conforming to the
@@ -1002,7 +809,7 @@ const (
// FaaS
// platform and is usually different from the name of the callback
// function (which may be stored in the
- // [`code.namespace`/`code.function`](/docs/general/general-attributes.md#source-code-attributes)
+ // [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes)
// span attributes).
//
// For some cloud providers, the above definition is ambiguous. The
@@ -1032,7 +839,7 @@ const (
// * **AWS Lambda:** The [function
// version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
// (an integer represented as a decimal string).
- // * **Google Cloud Run (Services):** The
+ // * **Google Cloud Run:** The
// [revision](https://cloud.google.com/run/docs/managing/revisions)
// (i.e., the function name plus the revision suffix).
// * **Google Cloud Functions:** The value of the
@@ -1098,8 +905,7 @@ func FaaSMaxMemory(val int) attribute.KeyValue {
return FaaSMaxMemoryKey.Int(val)
}
-// A host is defined as a computing instance. For example, physical servers,
-// virtual machines, switches or disk array.
+// A host is defined as a general computing instance.
const (
// HostIDKey is the attribute Key conforming to the "host.id" semantic
// conventions. It represents the unique host ID. For Cloud, this must be
@@ -1154,8 +960,8 @@ const (
HostImageNameKey = attribute.Key("host.image.name")
// HostImageIDKey is the attribute Key conforming to the "host.image.id"
- // semantic conventions. It represents the vM image ID or host OS image ID.
- // For Cloud, this value is from the provider.
+ // semantic conventions. It represents the vM image ID. For Cloud, this
+ // value is from the provider.
//
// Type: string
// RequirementLevel: Optional
@@ -1165,7 +971,7 @@ const (
// HostImageVersionKey is the attribute Key conforming to the
// "host.image.version" semantic conventions. It represents the version
- // string of the VM image or host OS as defined in [Version
+ // string of the VM image as defined in [Version
// Attributes](README.md#version-attributes).
//
// Type: string
@@ -1226,15 +1032,15 @@ func HostImageName(val string) attribute.KeyValue {
}
// HostImageID returns an attribute KeyValue conforming to the
-// "host.image.id" semantic conventions. It represents the vM image ID or host
-// OS image ID. For Cloud, this value is from the provider.
+// "host.image.id" semantic conventions. It represents the vM image ID. For
+// Cloud, this value is from the provider.
func HostImageID(val string) attribute.KeyValue {
return HostImageIDKey.String(val)
}
// HostImageVersion returns an attribute KeyValue conforming to the
// "host.image.version" semantic conventions. It represents the version string
-// of the VM image or host OS as defined in [Version
+// of the VM image as defined in [Version
// Attributes](README.md#version-attributes).
func HostImageVersion(val string) attribute.KeyValue {
return HostImageVersionKey.String(val)
@@ -1251,40 +1057,6 @@ const (
// Stability: stable
// Examples: 'opentelemetry-cluster'
K8SClusterNameKey = attribute.Key("k8s.cluster.name")
-
- // K8SClusterUIDKey is the attribute Key conforming to the
- // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for
- // the cluster, set to the UID of the `kube-system` namespace.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d'
- // Note: K8S does not have support for obtaining a cluster ID. If this is
- // ever
- // added, we will recommend collecting the `k8s.cluster.uid` through the
- // official APIs. In the meantime, we are able to use the `uid` of the
- // `kube-system` namespace as a proxy for cluster ID. Read on for the
- // rationale.
- //
- // Every object created in a K8S cluster is assigned a distinct UID. The
- // `kube-system` namespace is used by Kubernetes itself and will exist
- // for the lifetime of the cluster. Using the `uid` of the `kube-system`
- // namespace is a reasonable proxy for the K8S ClusterID as it will only
- // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are
- // UUIDs as standardized by
- // [ISO/IEC 9834-8 and ITU-T
- // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html).
- // Which states:
- //
- // > If generated according to one of the mechanisms defined in Rec.
- // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be
- // different from all other UUIDs generated before 3603 A.D., or is
- // extremely likely to be different (depending on the mechanism chosen).
- //
- // Therefore, UIDs between clusters should be extremely unlikely to
- // conflict.
- K8SClusterUIDKey = attribute.Key("k8s.cluster.uid")
)
// K8SClusterName returns an attribute KeyValue conforming to the
@@ -1294,13 +1066,6 @@ func K8SClusterName(val string) attribute.KeyValue {
return K8SClusterNameKey.String(val)
}
-// K8SClusterUID returns an attribute KeyValue conforming to the
-// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the
-// cluster, set to the UID of the `kube-system` namespace.
-func K8SClusterUID(val string) attribute.KeyValue {
- return K8SClusterUIDKey.String(val)
-}
-
// A Kubernetes Node object.
const (
// K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name"
@@ -1683,7 +1448,7 @@ const (
// OSVersionKey is the attribute Key conforming to the "os.version"
// semantic conventions. It represents the version string of the operating
// system as defined in [Version
- // Attributes](/docs/resource/README.md#version-attributes).
+ // Attributes](../../resource/semantic_conventions/README.md#version-attributes).
//
// Type: string
// RequirementLevel: Optional
@@ -1734,7 +1499,7 @@ func OSName(val string) attribute.KeyValue {
// OSVersion returns an attribute KeyValue conforming to the "os.version"
// semantic conventions. It represents the version string of the operating
// system as defined in [Version
-// Attributes](/docs/resource/README.md#version-attributes).
+// Attributes](../../resource/semantic_conventions/README.md#version-attributes).
func OSVersion(val string) attribute.KeyValue {
return OSVersionKey.String(val)
}
@@ -1983,17 +1748,6 @@ const (
// `unknown_service:bash`. If `process.executable.name` is not available,
// the value MUST be set to `unknown_service`.
ServiceNameKey = attribute.Key("service.name")
-
- // ServiceVersionKey is the attribute Key conforming to the
- // "service.version" semantic conventions. It represents the version string
- // of the service API or implementation. The format is not defined by these
- // conventions.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '2.0.0', 'a01dbef8a'
- ServiceVersionKey = attribute.Key("service.version")
)
// ServiceName returns an attribute KeyValue conforming to the
@@ -2003,14 +1757,6 @@ func ServiceName(val string) attribute.KeyValue {
return ServiceNameKey.String(val)
}
-// ServiceVersion returns an attribute KeyValue conforming to the
-// "service.version" semantic conventions. It represents the version string of
-// the service API or implementation. The format is not defined by these
-// conventions.
-func ServiceVersion(val string) attribute.KeyValue {
- return ServiceVersionKey.String(val)
-}
-
// A service instance.
const (
// ServiceNamespaceKey is the attribute Key conforming to the
@@ -2054,6 +1800,16 @@ const (
// RFC 4122 UUID (services aiming for reproducible UUIDs may also use
// Version 5, see RFC 4122 for more recommendations).
ServiceInstanceIDKey = attribute.Key("service.instance.id")
+
+ // ServiceVersionKey is the attribute Key conforming to the
+ // "service.version" semantic conventions. It represents the version string
+ // of the service API or implementation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '2.0.0'
+ ServiceVersionKey = attribute.Key("service.version")
)
// ServiceNamespace returns an attribute KeyValue conforming to the
@@ -2070,6 +1826,13 @@ func ServiceInstanceID(val string) attribute.KeyValue {
return ServiceInstanceIDKey.String(val)
}
+// ServiceVersion returns an attribute KeyValue conforming to the
+// "service.version" semantic conventions. It represents the version string of
+// the service API or implementation.
+func ServiceVersion(val string) attribute.KeyValue {
+ return ServiceVersionKey.String(val)
+}
+
// The telemetry SDK used to capture data recorded by the instrumentation
// libraries.
const (
@@ -2081,17 +1844,6 @@ const (
// RequirementLevel: Required
// Stability: stable
// Examples: 'opentelemetry'
- // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute
- // to `opentelemetry`.
- // If another SDK, like a fork or a vendor-provided implementation, is
- // used, this SDK MUST set the
- // `telemetry.sdk.name` attribute to the fully-qualified class or module
- // name of this SDK's main entry point
- // or another suitable identifier depending on the language.
- // The identifier `opentelemetry` is reserved and MUST NOT be used in this
- // case.
- // All custom identifiers SHOULD be stable across different versions of an
- // implementation.
TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
// TelemetrySDKLanguageKey is the attribute Key conforming to the
@@ -2133,12 +1885,10 @@ var (
TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python")
// ruby
TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby")
- // rust
- TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust")
- // swift
- TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift")
// webjs
TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs")
+ // swift
+ TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift")
)
// TelemetrySDKName returns an attribute KeyValue conforming to the
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go
new file mode 100644
index 0000000000..95d0210e38
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+// SchemaURL is the schema URL that matches the version of the semantic conventions
+// that this package defines. Semconv packages starting from v1.4.0 must declare
+// non-empty schema URL in the form https://opentelemetry.io/schemas/
+const SchemaURL = "https://opentelemetry.io/schemas/1.20.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
similarity index 94%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
index b5a91450d4..90b1b0452c 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
@@ -84,6 +73,33 @@ func ExceptionStacktrace(val string) attribute.KeyValue {
return ExceptionStacktraceKey.String(val)
}
+// The attributes described in this section are rather generic. They may be
+// used in any Log Record they apply to.
+const (
+ // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
+ // semantic conventions. It represents a unique identifier for the Log
+ // Record.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
+ // Note: If an id is provided, other log records with the same id will be
+ // considered duplicates and can be removed safely. This means, that two
+ // distinguishable log records MUST have different values.
+ // The id MAY be an [Universally Unique Lexicographically Sortable
+ // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
+ // (e.g. UUID) may be used as needed.
+ LogRecordUIDKey = attribute.Key("log.record.uid")
+)
+
+// LogRecordUID returns an attribute KeyValue conforming to the
+// "log.record.uid" semantic conventions. It represents a unique identifier for
+// the Log Record.
+func LogRecordUID(val string) attribute.KeyValue {
+ return LogRecordUIDKey.String(val)
+}
+
// Span attributes used by AWS Lambda (in addition to general `faas`
// attributes).
const (
@@ -498,8 +514,8 @@ const (
// RequirementLevel: Optional
// Stability: stable
// Examples: 'MSSQLSERVER'
- // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer
- // required (but still recommended if non-standard).
+ // Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no
+ // longer required (but still recommended if non-standard).
DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name")
)
@@ -1208,9 +1224,9 @@ func FaaSInvokedRegion(val string) attribute.KeyValue {
const (
// PeerServiceKey is the attribute Key conforming to the "peer.service"
// semantic conventions. It represents the
- // [`service.name`](/docs/resource/README.md#service) of the remote
- // service. SHOULD be equal to the actual `service.name` resource attribute
- // of the remote service if any.
+ // [`service.name`](../../resource/semantic_conventions/README.md#service)
+ // of the remote service. SHOULD be equal to the actual `service.name`
+ // resource attribute of the remote service if any.
//
// Type: string
// RequirementLevel: Optional
@@ -1221,9 +1237,9 @@ const (
// PeerService returns an attribute KeyValue conforming to the
// "peer.service" semantic conventions. It represents the
-// [`service.name`](/docs/resource/README.md#service) of the remote service.
-// SHOULD be equal to the actual `service.name` resource attribute of the
-// remote service if any.
+// [`service.name`](../../resource/semantic_conventions/README.md#service) of
+// the remote service. SHOULD be equal to the actual `service.name` resource
+// attribute of the remote service if any.
func PeerService(val string) attribute.KeyValue {
return PeerServiceKey.String(val)
}
@@ -1436,6 +1452,21 @@ func CodeColumn(val int) attribute.KeyValue {
// Semantic Convention for HTTP Client
const (
+ // HTTPURLKey is the attribute Key conforming to the "http.url" semantic
+ // conventions. It represents the full HTTP request URL in the form
+ // `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is
+ // not transmitted over HTTP, but if it is known, it should be included
+ // nevertheless.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
+ // Note: `http.url` MUST NOT contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case the
+ // attribute's value should be `https://www.example.com/`.
+ HTTPURLKey = attribute.Key("http.url")
+
// HTTPResendCountKey is the attribute Key conforming to the
// "http.resend_count" semantic conventions. It represents the ordinal
// number of request resending attempt (for any reason, including
@@ -1452,6 +1483,15 @@ const (
HTTPResendCountKey = attribute.Key("http.resend_count")
)
+// HTTPURL returns an attribute KeyValue conforming to the "http.url"
+// semantic conventions. It represents the full HTTP request URL in the form
+// `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not
+// transmitted over HTTP, but if it is known, it should be included
+// nevertheless.
+func HTTPURL(val string) attribute.KeyValue {
+ return HTTPURLKey.String(val)
+}
+
// HTTPResendCount returns an attribute KeyValue conforming to the
// "http.resend_count" semantic conventions. It represents the ordinal number
// of request resending attempt (for any reason, including redirects).
@@ -1459,6 +1499,58 @@ func HTTPResendCount(val int) attribute.KeyValue {
return HTTPResendCountKey.Int(val)
}
+// Semantic Convention for HTTP Server
+const (
+ // HTTPTargetKey is the attribute Key conforming to the "http.target"
+ // semantic conventions. It represents the full request target as passed in
+ // a HTTP request line or equivalent.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: '/users/12314/?q=ddds'
+ HTTPTargetKey = attribute.Key("http.target")
+
+ // HTTPClientIPKey is the attribute Key conforming to the "http.client_ip"
+ // semantic conventions. It represents the IP address of the original
+ // client behind all proxies, if known (e.g. from
+ // [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '83.164.160.102'
+ // Note: This is not necessarily the same as `net.sock.peer.addr`, which
+ // would
+ // identify the network-level peer, which may be a proxy.
+ //
+ // This attribute should be set when a source of information different
+ // from the one used for `net.sock.peer.addr`, is available even if that
+ // other
+ // source just confirms the same value as `net.sock.peer.addr`.
+ // Rationale: For `net.sock.peer.addr`, one typically does not know if it
+ // comes from a proxy, reverse proxy, or the actual client. Setting
+ // `http.client_ip` when it's the same as `net.sock.peer.addr` means that
+ // one is at least somewhat confident that the address is not that of
+ // the closest proxy.
+ HTTPClientIPKey = attribute.Key("http.client_ip")
+)
+
+// HTTPTarget returns an attribute KeyValue conforming to the "http.target"
+// semantic conventions. It represents the full request target as passed in a
+// HTTP request line or equivalent.
+func HTTPTarget(val string) attribute.KeyValue {
+ return HTTPTargetKey.String(val)
+}
+
+// HTTPClientIP returns an attribute KeyValue conforming to the
+// "http.client_ip" semantic conventions. It represents the IP address of the
+// original client behind all proxies, if known (e.g. from
+// [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).
+func HTTPClientIP(val string) attribute.KeyValue {
+ return HTTPClientIPKey.String(val)
+}
+
// The `aws` conventions apply to operations using the AWS SDK. They map
// request or response parameters in AWS SDK API calls to attributes on a Span.
// The conventions have been collected over time based on feedback from AWS
@@ -2201,16 +2293,6 @@ const (
// operation, instrumentations SHOULD use `messaging.batch.message_count`
// for batching APIs and SHOULD NOT use it for single-message APIs.
MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
-
- // MessagingClientIDKey is the attribute Key conforming to the
- // "messaging.client_id" semantic conventions. It represents a unique
- // identifier for the client that consumes or produces a message.
- //
- // Type: string
- // RequirementLevel: Recommended (If a client id is available)
- // Stability: stable
- // Examples: 'client-5', 'myhost@8742@s8083jm'
- MessagingClientIDKey = attribute.Key("messaging.client_id")
)
var (
@@ -2237,11 +2319,33 @@ func MessagingBatchMessageCount(val int) attribute.KeyValue {
return MessagingBatchMessageCountKey.Int(val)
}
-// MessagingClientID returns an attribute KeyValue conforming to the
-// "messaging.client_id" semantic conventions. It represents a unique
-// identifier for the client that consumes or produces a message.
-func MessagingClientID(val string) attribute.KeyValue {
- return MessagingClientIDKey.String(val)
+// Semantic convention for a consumer of messages received from a messaging
+// system
+const (
+ // MessagingConsumerIDKey is the attribute Key conforming to the
+ // "messaging.consumer.id" semantic conventions. It represents the
+ // identifier for the consumer receiving a message. For Kafka, set it to
+ // `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if
+ // both are present, or only `messaging.kafka.consumer.group`. For brokers,
+ // such as RabbitMQ and Artemis, set it to the `client_id` of the client
+ // consuming the message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'mygroup - client-6'
+ MessagingConsumerIDKey = attribute.Key("messaging.consumer.id")
+)
+
+// MessagingConsumerID returns an attribute KeyValue conforming to the
+// "messaging.consumer.id" semantic conventions. It represents the identifier
+// for the consumer receiving a message. For Kafka, set it to
+// `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both
+// are present, or only `messaging.kafka.consumer.group`. For brokers, such as
+// RabbitMQ and Artemis, set it to the `client_id` of the client consuming the
+// message.
+func MessagingConsumerID(val string) attribute.KeyValue {
+ return MessagingConsumerIDKey.String(val)
}
// Semantic conventions for remote procedure calls.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go
deleted file mode 100644
index e6cf895105..0000000000
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go
+++ /dev/null
@@ -1,1877 +0,0 @@
-// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Code generated from semantic convention specification. DO NOT EDIT.
-
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
-
-import "go.opentelemetry.io/otel/attribute"
-
-// These attributes may be used to describe the client in a connection-based
-// network interaction where there is one side that initiates the connection
-// (the client is the side that initiates the connection). This covers all TCP
-// network interactions since TCP is connection-based and one side initiates
-// the connection (an exception is made for peer-to-peer communication over TCP
-// where the "user-facing" surface of the protocol / API does not expose a
-// clear notion of client and server). This also covers UDP network
-// interactions where one side initiates the interaction, e.g. QUIC (HTTP/3)
-// and DNS.
-const (
- // ClientAddressKey is the attribute Key conforming to the "client.address"
- // semantic conventions. It represents the client address - unix domain
- // socket name, IPv4 or IPv6 address.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/tmp/my.sock', '10.1.2.80'
- // Note: When observed from the server side, and when communicating through
- // an intermediary, `client.address` SHOULD represent client address behind
- // any intermediaries (e.g. proxies) if it's available.
- ClientAddressKey = attribute.Key("client.address")
-
- // ClientPortKey is the attribute Key conforming to the "client.port"
- // semantic conventions. It represents the client port number
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 65123
- // Note: When observed from the server side, and when communicating through
- // an intermediary, `client.port` SHOULD represent client port behind any
- // intermediaries (e.g. proxies) if it's available.
- ClientPortKey = attribute.Key("client.port")
-
- // ClientSocketAddressKey is the attribute Key conforming to the
- // "client.socket.address" semantic conventions. It represents the
- // immediate client peer address - unix domain socket name, IPv4 or IPv6
- // address.
- //
- // Type: string
- // RequirementLevel: Recommended (If different than `client.address`.)
- // Stability: stable
- // Examples: '/tmp/my.sock', '127.0.0.1'
- ClientSocketAddressKey = attribute.Key("client.socket.address")
-
- // ClientSocketPortKey is the attribute Key conforming to the
- // "client.socket.port" semantic conventions. It represents the immediate
- // client peer port number
- //
- // Type: int
- // RequirementLevel: Recommended (If different than `client.port`.)
- // Stability: stable
- // Examples: 35555
- ClientSocketPortKey = attribute.Key("client.socket.port")
-)
-
-// ClientAddress returns an attribute KeyValue conforming to the
-// "client.address" semantic conventions. It represents the client address -
-// unix domain socket name, IPv4 or IPv6 address.
-func ClientAddress(val string) attribute.KeyValue {
- return ClientAddressKey.String(val)
-}
-
-// ClientPort returns an attribute KeyValue conforming to the "client.port"
-// semantic conventions. It represents the client port number
-func ClientPort(val int) attribute.KeyValue {
- return ClientPortKey.Int(val)
-}
-
-// ClientSocketAddress returns an attribute KeyValue conforming to the
-// "client.socket.address" semantic conventions. It represents the immediate
-// client peer address - unix domain socket name, IPv4 or IPv6 address.
-func ClientSocketAddress(val string) attribute.KeyValue {
- return ClientSocketAddressKey.String(val)
-}
-
-// ClientSocketPort returns an attribute KeyValue conforming to the
-// "client.socket.port" semantic conventions. It represents the immediate
-// client peer port number
-func ClientSocketPort(val int) attribute.KeyValue {
- return ClientSocketPortKey.Int(val)
-}
-
-// Describes deprecated HTTP attributes.
-const (
- // HTTPMethodKey is the attribute Key conforming to the "http.method"
- // semantic conventions. It represents the deprecated, use
- // `http.request.method` instead.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'GET', 'POST', 'HEAD'
- HTTPMethodKey = attribute.Key("http.method")
-
- // HTTPStatusCodeKey is the attribute Key conforming to the
- // "http.status_code" semantic conventions. It represents the deprecated,
- // use `http.response.status_code` instead.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 200
- HTTPStatusCodeKey = attribute.Key("http.status_code")
-
- // HTTPSchemeKey is the attribute Key conforming to the "http.scheme"
- // semantic conventions. It represents the deprecated, use `url.scheme`
- // instead.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'http', 'https'
- HTTPSchemeKey = attribute.Key("http.scheme")
-
- // HTTPURLKey is the attribute Key conforming to the "http.url" semantic
- // conventions. It represents the deprecated, use `url.full` instead.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
- HTTPURLKey = attribute.Key("http.url")
-
- // HTTPTargetKey is the attribute Key conforming to the "http.target"
- // semantic conventions. It represents the deprecated, use `url.path` and
- // `url.query` instead.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: '/search?q=OpenTelemetry#SemConv'
- HTTPTargetKey = attribute.Key("http.target")
-
- // HTTPRequestContentLengthKey is the attribute Key conforming to the
- // "http.request_content_length" semantic conventions. It represents the
- // deprecated, use `http.request.body.size` instead.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 3495
- HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
-
- // HTTPResponseContentLengthKey is the attribute Key conforming to the
- // "http.response_content_length" semantic conventions. It represents the
- // deprecated, use `http.response.body.size` instead.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 3495
- HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
-)
-
-// HTTPMethod returns an attribute KeyValue conforming to the "http.method"
-// semantic conventions. It represents the deprecated, use
-// `http.request.method` instead.
-func HTTPMethod(val string) attribute.KeyValue {
- return HTTPMethodKey.String(val)
-}
-
-// HTTPStatusCode returns an attribute KeyValue conforming to the
-// "http.status_code" semantic conventions. It represents the deprecated, use
-// `http.response.status_code` instead.
-func HTTPStatusCode(val int) attribute.KeyValue {
- return HTTPStatusCodeKey.Int(val)
-}
-
-// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme"
-// semantic conventions. It represents the deprecated, use `url.scheme`
-// instead.
-func HTTPScheme(val string) attribute.KeyValue {
- return HTTPSchemeKey.String(val)
-}
-
-// HTTPURL returns an attribute KeyValue conforming to the "http.url"
-// semantic conventions. It represents the deprecated, use `url.full` instead.
-func HTTPURL(val string) attribute.KeyValue {
- return HTTPURLKey.String(val)
-}
-
-// HTTPTarget returns an attribute KeyValue conforming to the "http.target"
-// semantic conventions. It represents the deprecated, use `url.path` and
-// `url.query` instead.
-func HTTPTarget(val string) attribute.KeyValue {
- return HTTPTargetKey.String(val)
-}
-
-// HTTPRequestContentLength returns an attribute KeyValue conforming to the
-// "http.request_content_length" semantic conventions. It represents the
-// deprecated, use `http.request.body.size` instead.
-func HTTPRequestContentLength(val int) attribute.KeyValue {
- return HTTPRequestContentLengthKey.Int(val)
-}
-
-// HTTPResponseContentLength returns an attribute KeyValue conforming to the
-// "http.response_content_length" semantic conventions. It represents the
-// deprecated, use `http.response.body.size` instead.
-func HTTPResponseContentLength(val int) attribute.KeyValue {
- return HTTPResponseContentLengthKey.Int(val)
-}
-
-// These attributes may be used for any network related operation.
-const (
- // NetSockPeerNameKey is the attribute Key conforming to the
- // "net.sock.peer.name" semantic conventions. It represents the deprecated,
- // use `server.socket.domain` on client spans.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: '/var/my.sock'
- NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
-
- // NetSockPeerAddrKey is the attribute Key conforming to the
- // "net.sock.peer.addr" semantic conventions. It represents the deprecated,
- // use `server.socket.address` on client spans and `client.socket.address`
- // on server spans.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: '192.168.0.1'
- NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
-
- // NetSockPeerPortKey is the attribute Key conforming to the
- // "net.sock.peer.port" semantic conventions. It represents the deprecated,
- // use `server.socket.port` on client spans and `client.socket.port` on
- // server spans.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 65531
- NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
-
- // NetPeerNameKey is the attribute Key conforming to the "net.peer.name"
- // semantic conventions. It represents the deprecated, use `server.address`
- // on client spans and `client.address` on server spans.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'example.com'
- NetPeerNameKey = attribute.Key("net.peer.name")
-
- // NetPeerPortKey is the attribute Key conforming to the "net.peer.port"
- // semantic conventions. It represents the deprecated, use `server.port` on
- // client spans and `client.port` on server spans.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 8080
- NetPeerPortKey = attribute.Key("net.peer.port")
-
- // NetHostNameKey is the attribute Key conforming to the "net.host.name"
- // semantic conventions. It represents the deprecated, use
- // `server.address`.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'example.com'
- NetHostNameKey = attribute.Key("net.host.name")
-
- // NetHostPortKey is the attribute Key conforming to the "net.host.port"
- // semantic conventions. It represents the deprecated, use `server.port`.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 8080
- NetHostPortKey = attribute.Key("net.host.port")
-
- // NetSockHostAddrKey is the attribute Key conforming to the
- // "net.sock.host.addr" semantic conventions. It represents the deprecated,
- // use `server.socket.address`.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: '/var/my.sock'
- NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
-
- // NetSockHostPortKey is the attribute Key conforming to the
- // "net.sock.host.port" semantic conventions. It represents the deprecated,
- // use `server.socket.port`.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 8080
- NetSockHostPortKey = attribute.Key("net.sock.host.port")
-
- // NetTransportKey is the attribute Key conforming to the "net.transport"
- // semantic conventions. It represents the deprecated, use
- // `network.transport`.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: deprecated
- NetTransportKey = attribute.Key("net.transport")
-
- // NetProtocolNameKey is the attribute Key conforming to the
- // "net.protocol.name" semantic conventions. It represents the deprecated,
- // use `network.protocol.name`.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: 'amqp', 'http', 'mqtt'
- NetProtocolNameKey = attribute.Key("net.protocol.name")
-
- // NetProtocolVersionKey is the attribute Key conforming to the
- // "net.protocol.version" semantic conventions. It represents the
- // deprecated, use `network.protocol.version`.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: deprecated
- // Examples: '3.1.1'
- NetProtocolVersionKey = attribute.Key("net.protocol.version")
-
- // NetSockFamilyKey is the attribute Key conforming to the
- // "net.sock.family" semantic conventions. It represents the deprecated,
- // use `network.transport` and `network.type`.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: deprecated
- NetSockFamilyKey = attribute.Key("net.sock.family")
-)
-
-var (
- // ip_tcp
- NetTransportTCP = NetTransportKey.String("ip_tcp")
- // ip_udp
- NetTransportUDP = NetTransportKey.String("ip_udp")
- // Named or anonymous pipe
- NetTransportPipe = NetTransportKey.String("pipe")
- // In-process communication
- NetTransportInProc = NetTransportKey.String("inproc")
- // Something else (non IP-based)
- NetTransportOther = NetTransportKey.String("other")
-)
-
-var (
- // IPv4 address
- NetSockFamilyInet = NetSockFamilyKey.String("inet")
- // IPv6 address
- NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
- // Unix domain socket path
- NetSockFamilyUnix = NetSockFamilyKey.String("unix")
-)
-
-// NetSockPeerName returns an attribute KeyValue conforming to the
-// "net.sock.peer.name" semantic conventions. It represents the deprecated, use
-// `server.socket.domain` on client spans.
-func NetSockPeerName(val string) attribute.KeyValue {
- return NetSockPeerNameKey.String(val)
-}
-
-// NetSockPeerAddr returns an attribute KeyValue conforming to the
-// "net.sock.peer.addr" semantic conventions. It represents the deprecated, use
-// `server.socket.address` on client spans and `client.socket.address` on
-// server spans.
-func NetSockPeerAddr(val string) attribute.KeyValue {
- return NetSockPeerAddrKey.String(val)
-}
-
-// NetSockPeerPort returns an attribute KeyValue conforming to the
-// "net.sock.peer.port" semantic conventions. It represents the deprecated, use
-// `server.socket.port` on client spans and `client.socket.port` on server
-// spans.
-func NetSockPeerPort(val int) attribute.KeyValue {
- return NetSockPeerPortKey.Int(val)
-}
-
-// NetPeerName returns an attribute KeyValue conforming to the
-// "net.peer.name" semantic conventions. It represents the deprecated, use
-// `server.address` on client spans and `client.address` on server spans.
-func NetPeerName(val string) attribute.KeyValue {
- return NetPeerNameKey.String(val)
-}
-
-// NetPeerPort returns an attribute KeyValue conforming to the
-// "net.peer.port" semantic conventions. It represents the deprecated, use
-// `server.port` on client spans and `client.port` on server spans.
-func NetPeerPort(val int) attribute.KeyValue {
- return NetPeerPortKey.Int(val)
-}
-
-// NetHostName returns an attribute KeyValue conforming to the
-// "net.host.name" semantic conventions. It represents the deprecated, use
-// `server.address`.
-func NetHostName(val string) attribute.KeyValue {
- return NetHostNameKey.String(val)
-}
-
-// NetHostPort returns an attribute KeyValue conforming to the
-// "net.host.port" semantic conventions. It represents the deprecated, use
-// `server.port`.
-func NetHostPort(val int) attribute.KeyValue {
- return NetHostPortKey.Int(val)
-}
-
-// NetSockHostAddr returns an attribute KeyValue conforming to the
-// "net.sock.host.addr" semantic conventions. It represents the deprecated, use
-// `server.socket.address`.
-func NetSockHostAddr(val string) attribute.KeyValue {
- return NetSockHostAddrKey.String(val)
-}
-
-// NetSockHostPort returns an attribute KeyValue conforming to the
-// "net.sock.host.port" semantic conventions. It represents the deprecated, use
-// `server.socket.port`.
-func NetSockHostPort(val int) attribute.KeyValue {
- return NetSockHostPortKey.Int(val)
-}
-
-// NetProtocolName returns an attribute KeyValue conforming to the
-// "net.protocol.name" semantic conventions. It represents the deprecated, use
-// `network.protocol.name`.
-func NetProtocolName(val string) attribute.KeyValue {
- return NetProtocolNameKey.String(val)
-}
-
-// NetProtocolVersion returns an attribute KeyValue conforming to the
-// "net.protocol.version" semantic conventions. It represents the deprecated,
-// use `network.protocol.version`.
-func NetProtocolVersion(val string) attribute.KeyValue {
- return NetProtocolVersionKey.String(val)
-}
-
-// These attributes may be used to describe the receiver of a network
-// exchange/packet. These should be used when there is no client/server
-// relationship between the two sides, or when that relationship is unknown.
-// This covers low-level network interactions (e.g. packet tracing) where you
-// don't know if there was a connection or which side initiated it. This also
-// covers unidirectional UDP flows and peer-to-peer communication where the
-// "user-facing" surface of the protocol / API does not expose a clear notion
-// of client and server.
-const (
- // DestinationDomainKey is the attribute Key conforming to the
- // "destination.domain" semantic conventions. It represents the domain name
- // of the destination system.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'foo.example.com'
- // Note: This value may be a host name, a fully qualified domain name, or
- // another host naming format.
- DestinationDomainKey = attribute.Key("destination.domain")
-
- // DestinationAddressKey is the attribute Key conforming to the
- // "destination.address" semantic conventions. It represents the peer
- // address, for example IP address or UNIX socket name.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '10.5.3.2'
- DestinationAddressKey = attribute.Key("destination.address")
-
- // DestinationPortKey is the attribute Key conforming to the
- // "destination.port" semantic conventions. It represents the peer port
- // number
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 3389, 2888
- DestinationPortKey = attribute.Key("destination.port")
-)
-
-// DestinationDomain returns an attribute KeyValue conforming to the
-// "destination.domain" semantic conventions. It represents the domain name of
-// the destination system.
-func DestinationDomain(val string) attribute.KeyValue {
- return DestinationDomainKey.String(val)
-}
-
-// DestinationAddress returns an attribute KeyValue conforming to the
-// "destination.address" semantic conventions. It represents the peer address,
-// for example IP address or UNIX socket name.
-func DestinationAddress(val string) attribute.KeyValue {
- return DestinationAddressKey.String(val)
-}
-
-// DestinationPort returns an attribute KeyValue conforming to the
-// "destination.port" semantic conventions. It represents the peer port number
-func DestinationPort(val int) attribute.KeyValue {
- return DestinationPortKey.Int(val)
-}
-
-// Describes HTTP attributes.
-const (
- // HTTPRequestMethodKey is the attribute Key conforming to the
- // "http.request.method" semantic conventions. It represents the hTTP
- // request method.
- //
- // Type: Enum
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'GET', 'POST', 'HEAD'
- // Note: HTTP request method value SHOULD be "known" to the
- // instrumentation.
- // By default, this convention defines "known" methods as the ones listed
- // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
- // and the PATCH method defined in
- // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
- //
- // If the HTTP request method is not known to instrumentation, it MUST set
- // the `http.request.method` attribute to `_OTHER` and, except if reporting
- // a metric, MUST
- // set the exact method received in the request line as value of the
- // `http.request.method_original` attribute.
- //
- // If the HTTP instrumentation could end up converting valid HTTP request
- // methods to `_OTHER`, then it MUST provide a way to override
- // the list of known HTTP methods. If this override is done via environment
- // variable, then the environment variable MUST be named
- // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated
- // list of case-sensitive known HTTP methods
- // (this list MUST be a full override of the default known method, it is
- // not a list of known methods in addition to the defaults).
- //
- // HTTP method names are case-sensitive and `http.request.method` attribute
- // value MUST match a known HTTP method name exactly.
- // Instrumentations for specific web frameworks that consider HTTP methods
- // to be case insensitive, SHOULD populate a canonical equivalent.
- // Tracing instrumentations that do so, MUST also set
- // `http.request.method_original` to the original value.
- HTTPRequestMethodKey = attribute.Key("http.request.method")
-
- // HTTPResponseStatusCodeKey is the attribute Key conforming to the
- // "http.response.status_code" semantic conventions. It represents the
- // [HTTP response status
- // code](https://tools.ietf.org/html/rfc7231#section-6).
- //
- // Type: int
- // RequirementLevel: ConditionallyRequired (If and only if one was
- // received/sent.)
- // Stability: stable
- // Examples: 200
- HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code")
-)
-
-var (
- // CONNECT method
- HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT")
- // DELETE method
- HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE")
- // GET method
- HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET")
- // HEAD method
- HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD")
- // OPTIONS method
- HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS")
- // PATCH method
- HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH")
- // POST method
- HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST")
- // PUT method
- HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT")
- // TRACE method
- HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE")
- // Any HTTP method that the instrumentation has no prior knowledge of
- HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER")
-)
-
-// HTTPResponseStatusCode returns an attribute KeyValue conforming to the
-// "http.response.status_code" semantic conventions. It represents the [HTTP
-// response status code](https://tools.ietf.org/html/rfc7231#section-6).
-func HTTPResponseStatusCode(val int) attribute.KeyValue {
- return HTTPResponseStatusCodeKey.Int(val)
-}
-
-// HTTP Server attributes
-const (
- // HTTPRouteKey is the attribute Key conforming to the "http.route"
- // semantic conventions. It represents the matched route (path template in
- // the format used by the respective server framework). See note below
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If and only if it's available)
- // Stability: stable
- // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
- // Note: MUST NOT be populated when this is not supported by the HTTP
- // server framework as the route attribute should have low-cardinality and
- // the URI path can NOT substitute it.
- // SHOULD include the [application
- // root](/docs/http/http-spans.md#http-server-definitions) if there is one.
- HTTPRouteKey = attribute.Key("http.route")
-)
-
-// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
-// semantic conventions. It represents the matched route (path template in the
-// format used by the respective server framework). See note below
-func HTTPRoute(val string) attribute.KeyValue {
- return HTTPRouteKey.String(val)
-}
-
-// Attributes for Events represented using Log Records.
-const (
- // EventNameKey is the attribute Key conforming to the "event.name"
- // semantic conventions. It represents the name identifies the event.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'click', 'exception'
- EventNameKey = attribute.Key("event.name")
-
- // EventDomainKey is the attribute Key conforming to the "event.domain"
- // semantic conventions. It represents the domain identifies the business
- // context for the events.
- //
- // Type: Enum
- // RequirementLevel: Required
- // Stability: stable
- // Note: Events across different domains may have same `event.name`, yet be
- // unrelated events.
- EventDomainKey = attribute.Key("event.domain")
-)
-
-var (
- // Events from browser apps
- EventDomainBrowser = EventDomainKey.String("browser")
- // Events from mobile apps
- EventDomainDevice = EventDomainKey.String("device")
- // Events from Kubernetes
- EventDomainK8S = EventDomainKey.String("k8s")
-)
-
-// EventName returns an attribute KeyValue conforming to the "event.name"
-// semantic conventions. It represents the name identifies the event.
-func EventName(val string) attribute.KeyValue {
- return EventNameKey.String(val)
-}
-
-// The attributes described in this section are rather generic. They may be
-// used in any Log Record they apply to.
-const (
- // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
- // semantic conventions. It represents a unique identifier for the Log
- // Record.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
- // Note: If an id is provided, other log records with the same id will be
- // considered duplicates and can be removed safely. This means, that two
- // distinguishable log records MUST have different values.
- // The id MAY be an [Universally Unique Lexicographically Sortable
- // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
- // (e.g. UUID) may be used as needed.
- LogRecordUIDKey = attribute.Key("log.record.uid")
-)
-
-// LogRecordUID returns an attribute KeyValue conforming to the
-// "log.record.uid" semantic conventions. It represents a unique identifier for
-// the Log Record.
-func LogRecordUID(val string) attribute.KeyValue {
- return LogRecordUIDKey.String(val)
-}
-
-// Describes Log attributes
-const (
- // LogIostreamKey is the attribute Key conforming to the "log.iostream"
- // semantic conventions. It represents the stream associated with the log.
- // See below for a list of well-known values.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- LogIostreamKey = attribute.Key("log.iostream")
-)
-
-var (
- // Logs from stdout stream
- LogIostreamStdout = LogIostreamKey.String("stdout")
- // Events from stderr stream
- LogIostreamStderr = LogIostreamKey.String("stderr")
-)
-
-// A file to which log was emitted.
-const (
- // LogFileNameKey is the attribute Key conforming to the "log.file.name"
- // semantic conventions. It represents the basename of the file.
- //
- // Type: string
- // RequirementLevel: Recommended
- // Stability: stable
- // Examples: 'audit.log'
- LogFileNameKey = attribute.Key("log.file.name")
-
- // LogFilePathKey is the attribute Key conforming to the "log.file.path"
- // semantic conventions. It represents the full path to the file.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/var/log/mysql/audit.log'
- LogFilePathKey = attribute.Key("log.file.path")
-
- // LogFileNameResolvedKey is the attribute Key conforming to the
- // "log.file.name_resolved" semantic conventions. It represents the
- // basename of the file, with symlinks resolved.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'uuid.log'
- LogFileNameResolvedKey = attribute.Key("log.file.name_resolved")
-
- // LogFilePathResolvedKey is the attribute Key conforming to the
- // "log.file.path_resolved" semantic conventions. It represents the full
- // path to the file, with symlinks resolved.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/var/lib/docker/uuid.log'
- LogFilePathResolvedKey = attribute.Key("log.file.path_resolved")
-)
-
-// LogFileName returns an attribute KeyValue conforming to the
-// "log.file.name" semantic conventions. It represents the basename of the
-// file.
-func LogFileName(val string) attribute.KeyValue {
- return LogFileNameKey.String(val)
-}
-
-// LogFilePath returns an attribute KeyValue conforming to the
-// "log.file.path" semantic conventions. It represents the full path to the
-// file.
-func LogFilePath(val string) attribute.KeyValue {
- return LogFilePathKey.String(val)
-}
-
-// LogFileNameResolved returns an attribute KeyValue conforming to the
-// "log.file.name_resolved" semantic conventions. It represents the basename of
-// the file, with symlinks resolved.
-func LogFileNameResolved(val string) attribute.KeyValue {
- return LogFileNameResolvedKey.String(val)
-}
-
-// LogFilePathResolved returns an attribute KeyValue conforming to the
-// "log.file.path_resolved" semantic conventions. It represents the full path
-// to the file, with symlinks resolved.
-func LogFilePathResolved(val string) attribute.KeyValue {
- return LogFilePathResolvedKey.String(val)
-}
-
-// Describes JVM memory metric attributes.
-const (
- // TypeKey is the attribute Key conforming to the "type" semantic
- // conventions. It represents the type of memory.
- //
- // Type: Enum
- // RequirementLevel: Recommended
- // Stability: stable
- // Examples: 'heap', 'non_heap'
- TypeKey = attribute.Key("type")
-
- // PoolKey is the attribute Key conforming to the "pool" semantic
- // conventions. It represents the name of the memory pool.
- //
- // Type: string
- // RequirementLevel: Recommended
- // Stability: stable
- // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space'
- // Note: Pool names are generally obtained via
- // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).
- PoolKey = attribute.Key("pool")
-)
-
-var (
- // Heap memory
- TypeHeap = TypeKey.String("heap")
- // Non-heap memory
- TypeNonHeap = TypeKey.String("non_heap")
-)
-
-// Pool returns an attribute KeyValue conforming to the "pool" semantic
-// conventions. It represents the name of the memory pool.
-func Pool(val string) attribute.KeyValue {
- return PoolKey.String(val)
-}
-
-// These attributes may be used to describe the server in a connection-based
-// network interaction where there is one side that initiates the connection
-// (the client is the side that initiates the connection). This covers all TCP
-// network interactions since TCP is connection-based and one side initiates
-// the connection (an exception is made for peer-to-peer communication over TCP
-// where the "user-facing" surface of the protocol / API does not expose a
-// clear notion of client and server). This also covers UDP network
-// interactions where one side initiates the interaction, e.g. QUIC (HTTP/3)
-// and DNS.
-const (
- // ServerAddressKey is the attribute Key conforming to the "server.address"
- // semantic conventions. It represents the logical server hostname, matches
- // server FQDN if available, and IP or socket address if FQDN is not known.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'example.com'
- ServerAddressKey = attribute.Key("server.address")
-
- // ServerPortKey is the attribute Key conforming to the "server.port"
- // semantic conventions. It represents the logical server port number
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 80, 8080, 443
- ServerPortKey = attribute.Key("server.port")
-
- // ServerSocketDomainKey is the attribute Key conforming to the
- // "server.socket.domain" semantic conventions. It represents the domain
- // name of an immediate peer.
- //
- // Type: string
- // RequirementLevel: Recommended (If different than `server.address`.)
- // Stability: stable
- // Examples: 'proxy.example.com'
- // Note: Typically observed from the client side, and represents a proxy or
- // other intermediary domain name.
- ServerSocketDomainKey = attribute.Key("server.socket.domain")
-
- // ServerSocketAddressKey is the attribute Key conforming to the
- // "server.socket.address" semantic conventions. It represents the physical
- // server IP address or Unix socket address. If set from the client, should
- // simply use the socket's peer address, and not attempt to find any actual
- // server IP (i.e., if set from client, this may represent some proxy
- // server instead of the logical server).
- //
- // Type: string
- // RequirementLevel: Recommended (If different than `server.address`.)
- // Stability: stable
- // Examples: '10.5.3.2'
- ServerSocketAddressKey = attribute.Key("server.socket.address")
-
- // ServerSocketPortKey is the attribute Key conforming to the
- // "server.socket.port" semantic conventions. It represents the physical
- // server port.
- //
- // Type: int
- // RequirementLevel: Recommended (If different than `server.port`.)
- // Stability: stable
- // Examples: 16456
- ServerSocketPortKey = attribute.Key("server.socket.port")
-)
-
-// ServerAddress returns an attribute KeyValue conforming to the
-// "server.address" semantic conventions. It represents the logical server
-// hostname, matches server FQDN if available, and IP or socket address if FQDN
-// is not known.
-func ServerAddress(val string) attribute.KeyValue {
- return ServerAddressKey.String(val)
-}
-
-// ServerPort returns an attribute KeyValue conforming to the "server.port"
-// semantic conventions. It represents the logical server port number
-func ServerPort(val int) attribute.KeyValue {
- return ServerPortKey.Int(val)
-}
-
-// ServerSocketDomain returns an attribute KeyValue conforming to the
-// "server.socket.domain" semantic conventions. It represents the domain name
-// of an immediate peer.
-func ServerSocketDomain(val string) attribute.KeyValue {
- return ServerSocketDomainKey.String(val)
-}
-
-// ServerSocketAddress returns an attribute KeyValue conforming to the
-// "server.socket.address" semantic conventions. It represents the physical
-// server IP address or Unix socket address. If set from the client, should
-// simply use the socket's peer address, and not attempt to find any actual
-// server IP (i.e., if set from client, this may represent some proxy server
-// instead of the logical server).
-func ServerSocketAddress(val string) attribute.KeyValue {
- return ServerSocketAddressKey.String(val)
-}
-
-// ServerSocketPort returns an attribute KeyValue conforming to the
-// "server.socket.port" semantic conventions. It represents the physical server
-// port.
-func ServerSocketPort(val int) attribute.KeyValue {
- return ServerSocketPortKey.Int(val)
-}
-
-// These attributes may be used to describe the sender of a network
-// exchange/packet. These should be used when there is no client/server
-// relationship between the two sides, or when that relationship is unknown.
-// This covers low-level network interactions (e.g. packet tracing) where you
-// don't know if there was a connection or which side initiated it. This also
-// covers unidirectional UDP flows and peer-to-peer communication where the
-// "user-facing" surface of the protocol / API does not expose a clear notion
-// of client and server.
-const (
- // SourceDomainKey is the attribute Key conforming to the "source.domain"
- // semantic conventions. It represents the domain name of the source
- // system.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'foo.example.com'
- // Note: This value may be a host name, a fully qualified domain name, or
- // another host naming format.
- SourceDomainKey = attribute.Key("source.domain")
-
- // SourceAddressKey is the attribute Key conforming to the "source.address"
- // semantic conventions. It represents the source address, for example IP
- // address or Unix socket name.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '10.5.3.2'
- SourceAddressKey = attribute.Key("source.address")
-
- // SourcePortKey is the attribute Key conforming to the "source.port"
- // semantic conventions. It represents the source port number
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 3389, 2888
- SourcePortKey = attribute.Key("source.port")
-)
-
-// SourceDomain returns an attribute KeyValue conforming to the
-// "source.domain" semantic conventions. It represents the domain name of the
-// source system.
-func SourceDomain(val string) attribute.KeyValue {
- return SourceDomainKey.String(val)
-}
-
-// SourceAddress returns an attribute KeyValue conforming to the
-// "source.address" semantic conventions. It represents the source address, for
-// example IP address or Unix socket name.
-func SourceAddress(val string) attribute.KeyValue {
- return SourceAddressKey.String(val)
-}
-
-// SourcePort returns an attribute KeyValue conforming to the "source.port"
-// semantic conventions. It represents the source port number
-func SourcePort(val int) attribute.KeyValue {
- return SourcePortKey.Int(val)
-}
-
-// These attributes may be used for any network related operation.
-const (
- // NetworkTransportKey is the attribute Key conforming to the
- // "network.transport" semantic conventions. It represents the [OSI
- // Transport Layer](https://osi-model.com/transport-layer/) or
- // [Inter-process Communication
- // method](https://en.wikipedia.org/wiki/Inter-process_communication). The
- // value SHOULD be normalized to lowercase.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'tcp', 'udp'
- NetworkTransportKey = attribute.Key("network.transport")
-
- // NetworkTypeKey is the attribute Key conforming to the "network.type"
- // semantic conventions. It represents the [OSI Network
- // Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The
- // value SHOULD be normalized to lowercase.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'ipv4', 'ipv6'
- NetworkTypeKey = attribute.Key("network.type")
-
- // NetworkProtocolNameKey is the attribute Key conforming to the
- // "network.protocol.name" semantic conventions. It represents the [OSI
- // Application Layer](https://osi-model.com/application-layer/) or non-OSI
- // equivalent. The value SHOULD be normalized to lowercase.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'amqp', 'http', 'mqtt'
- NetworkProtocolNameKey = attribute.Key("network.protocol.name")
-
- // NetworkProtocolVersionKey is the attribute Key conforming to the
- // "network.protocol.version" semantic conventions. It represents the
- // version of the application layer protocol used. See note below.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '3.1.1'
- // Note: `network.protocol.version` refers to the version of the protocol
- // used and might be different from the protocol client's version. If the
- // HTTP client used has a version of `0.27.2`, but sends HTTP version
- // `1.1`, this attribute should be set to `1.1`.
- NetworkProtocolVersionKey = attribute.Key("network.protocol.version")
-)
-
-var (
- // TCP
- NetworkTransportTCP = NetworkTransportKey.String("tcp")
- // UDP
- NetworkTransportUDP = NetworkTransportKey.String("udp")
- // Named or anonymous pipe. See note below
- NetworkTransportPipe = NetworkTransportKey.String("pipe")
- // Unix domain socket
- NetworkTransportUnix = NetworkTransportKey.String("unix")
-)
-
-var (
- // IPv4
- NetworkTypeIpv4 = NetworkTypeKey.String("ipv4")
- // IPv6
- NetworkTypeIpv6 = NetworkTypeKey.String("ipv6")
-)
-
-// NetworkProtocolName returns an attribute KeyValue conforming to the
-// "network.protocol.name" semantic conventions. It represents the [OSI
-// Application Layer](https://osi-model.com/application-layer/) or non-OSI
-// equivalent. The value SHOULD be normalized to lowercase.
-func NetworkProtocolName(val string) attribute.KeyValue {
- return NetworkProtocolNameKey.String(val)
-}
-
-// NetworkProtocolVersion returns an attribute KeyValue conforming to the
-// "network.protocol.version" semantic conventions. It represents the version
-// of the application layer protocol used. See note below.
-func NetworkProtocolVersion(val string) attribute.KeyValue {
- return NetworkProtocolVersionKey.String(val)
-}
-
-// These attributes may be used for any network related operation.
-const (
- // NetworkConnectionTypeKey is the attribute Key conforming to the
- // "network.connection.type" semantic conventions. It represents the
- // internet connection type.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'wifi'
- NetworkConnectionTypeKey = attribute.Key("network.connection.type")
-
- // NetworkConnectionSubtypeKey is the attribute Key conforming to the
- // "network.connection.subtype" semantic conventions. It represents the
- // this describes more details regarding the connection.type. It may be the
- // type of cell technology connection, but it could be used for describing
- // details about a wifi connection.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'LTE'
- NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype")
-
- // NetworkCarrierNameKey is the attribute Key conforming to the
- // "network.carrier.name" semantic conventions. It represents the name of
- // the mobile carrier.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'sprint'
- NetworkCarrierNameKey = attribute.Key("network.carrier.name")
-
- // NetworkCarrierMccKey is the attribute Key conforming to the
- // "network.carrier.mcc" semantic conventions. It represents the mobile
- // carrier country code.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '310'
- NetworkCarrierMccKey = attribute.Key("network.carrier.mcc")
-
- // NetworkCarrierMncKey is the attribute Key conforming to the
- // "network.carrier.mnc" semantic conventions. It represents the mobile
- // carrier network code.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '001'
- NetworkCarrierMncKey = attribute.Key("network.carrier.mnc")
-
- // NetworkCarrierIccKey is the attribute Key conforming to the
- // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
- // alpha-2 2-character country code associated with the mobile carrier
- // network.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'DE'
- NetworkCarrierIccKey = attribute.Key("network.carrier.icc")
-)
-
-var (
- // wifi
- NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi")
- // wired
- NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired")
- // cell
- NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell")
- // unavailable
- NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable")
- // unknown
- NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown")
-)
-
-var (
- // GPRS
- NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs")
- // EDGE
- NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge")
- // UMTS
- NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts")
- // CDMA
- NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma")
- // EVDO Rel. 0
- NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0")
- // EVDO Rev. A
- NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a")
- // CDMA2000 1XRTT
- NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt")
- // HSDPA
- NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa")
- // HSUPA
- NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa")
- // HSPA
- NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa")
- // IDEN
- NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden")
- // EVDO Rev. B
- NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b")
- // LTE
- NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte")
- // EHRPD
- NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd")
- // HSPAP
- NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap")
- // GSM
- NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm")
- // TD-SCDMA
- NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma")
- // IWLAN
- NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan")
- // 5G NR (New Radio)
- NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr")
- // 5G NRNSA (New Radio Non-Standalone)
- NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa")
- // LTE CA
- NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca")
-)
-
-// NetworkCarrierName returns an attribute KeyValue conforming to the
-// "network.carrier.name" semantic conventions. It represents the name of the
-// mobile carrier.
-func NetworkCarrierName(val string) attribute.KeyValue {
- return NetworkCarrierNameKey.String(val)
-}
-
-// NetworkCarrierMcc returns an attribute KeyValue conforming to the
-// "network.carrier.mcc" semantic conventions. It represents the mobile carrier
-// country code.
-func NetworkCarrierMcc(val string) attribute.KeyValue {
- return NetworkCarrierMccKey.String(val)
-}
-
-// NetworkCarrierMnc returns an attribute KeyValue conforming to the
-// "network.carrier.mnc" semantic conventions. It represents the mobile carrier
-// network code.
-func NetworkCarrierMnc(val string) attribute.KeyValue {
- return NetworkCarrierMncKey.String(val)
-}
-
-// NetworkCarrierIcc returns an attribute KeyValue conforming to the
-// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
-// alpha-2 2-character country code associated with the mobile carrier network.
-func NetworkCarrierIcc(val string) attribute.KeyValue {
- return NetworkCarrierIccKey.String(val)
-}
-
-// Semantic conventions for HTTP client and server Spans.
-const (
- // HTTPRequestMethodOriginalKey is the attribute Key conforming to the
- // "http.request.method_original" semantic conventions. It represents the
- // original HTTP method sent by the client in the request line.
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If and only if it's different
- // than `http.request.method`.)
- // Stability: stable
- // Examples: 'GeT', 'ACL', 'foo'
- HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original")
-
- // HTTPRequestBodySizeKey is the attribute Key conforming to the
- // "http.request.body.size" semantic conventions. It represents the size of
- // the request payload body in bytes. This is the number of bytes
- // transferred excluding headers and is often, but not always, present as
- // the
- // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
- // header. For requests using transport encoding, this should be the
- // compressed size.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 3495
- HTTPRequestBodySizeKey = attribute.Key("http.request.body.size")
-
- // HTTPResponseBodySizeKey is the attribute Key conforming to the
- // "http.response.body.size" semantic conventions. It represents the size
- // of the response payload body in bytes. This is the number of bytes
- // transferred excluding headers and is often, but not always, present as
- // the
- // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
- // header. For requests using transport encoding, this should be the
- // compressed size.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 3495
- HTTPResponseBodySizeKey = attribute.Key("http.response.body.size")
-)
-
-// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the
-// "http.request.method_original" semantic conventions. It represents the
-// original HTTP method sent by the client in the request line.
-func HTTPRequestMethodOriginal(val string) attribute.KeyValue {
- return HTTPRequestMethodOriginalKey.String(val)
-}
-
-// HTTPRequestBodySize returns an attribute KeyValue conforming to the
-// "http.request.body.size" semantic conventions. It represents the size of the
-// request payload body in bytes. This is the number of bytes transferred
-// excluding headers and is often, but not always, present as the
-// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
-// header. For requests using transport encoding, this should be the compressed
-// size.
-func HTTPRequestBodySize(val int) attribute.KeyValue {
- return HTTPRequestBodySizeKey.Int(val)
-}
-
-// HTTPResponseBodySize returns an attribute KeyValue conforming to the
-// "http.response.body.size" semantic conventions. It represents the size of
-// the response payload body in bytes. This is the number of bytes transferred
-// excluding headers and is often, but not always, present as the
-// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
-// header. For requests using transport encoding, this should be the compressed
-// size.
-func HTTPResponseBodySize(val int) attribute.KeyValue {
- return HTTPResponseBodySizeKey.Int(val)
-}
-
-// Semantic convention describing per-message attributes populated on messaging
-// spans or links.
-const (
- // MessagingMessageIDKey is the attribute Key conforming to the
- // "messaging.message.id" semantic conventions. It represents a value used
- // by the messaging system as an identifier for the message, represented as
- // a string.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
- MessagingMessageIDKey = attribute.Key("messaging.message.id")
-
- // MessagingMessageConversationIDKey is the attribute Key conforming to the
- // "messaging.message.conversation_id" semantic conventions. It represents
- // the [conversation ID](#conversations) identifying the conversation to
- // which the message belongs, represented as a string. Sometimes called
- // "Correlation ID".
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'MyConversationID'
- MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
-
- // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to
- // the "messaging.message.payload_size_bytes" semantic conventions. It
- // represents the (uncompressed) size of the message payload in bytes. Also
- // use this attribute if it is unknown whether the compressed or
- // uncompressed payload size is reported.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 2738
- MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes")
-
- // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key
- // conforming to the "messaging.message.payload_compressed_size_bytes"
- // semantic conventions. It represents the compressed size of the message
- // payload in bytes.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 2048
- MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes")
-)
-
-// MessagingMessageID returns an attribute KeyValue conforming to the
-// "messaging.message.id" semantic conventions. It represents a value used by
-// the messaging system as an identifier for the message, represented as a
-// string.
-func MessagingMessageID(val string) attribute.KeyValue {
- return MessagingMessageIDKey.String(val)
-}
-
-// MessagingMessageConversationID returns an attribute KeyValue conforming
-// to the "messaging.message.conversation_id" semantic conventions. It
-// represents the [conversation ID](#conversations) identifying the
-// conversation to which the message belongs, represented as a string.
-// Sometimes called "Correlation ID".
-func MessagingMessageConversationID(val string) attribute.KeyValue {
- return MessagingMessageConversationIDKey.String(val)
-}
-
-// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming
-// to the "messaging.message.payload_size_bytes" semantic conventions. It
-// represents the (uncompressed) size of the message payload in bytes. Also use
-// this attribute if it is unknown whether the compressed or uncompressed
-// payload size is reported.
-func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue {
- return MessagingMessagePayloadSizeBytesKey.Int(val)
-}
-
-// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue
-// conforming to the "messaging.message.payload_compressed_size_bytes" semantic
-// conventions. It represents the compressed size of the message payload in
-// bytes.
-func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue {
- return MessagingMessagePayloadCompressedSizeBytesKey.Int(val)
-}
-
-// Semantic convention for attributes that describe messaging destination on
-// broker
-const (
- // MessagingDestinationNameKey is the attribute Key conforming to the
- // "messaging.destination.name" semantic conventions. It represents the
- // message destination name
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'MyQueue', 'MyTopic'
- // Note: Destination name SHOULD uniquely identify a specific queue, topic
- // or other entity within the broker. If
- // the broker does not have such notion, the destination name SHOULD
- // uniquely identify the broker.
- MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
-
- // MessagingDestinationTemplateKey is the attribute Key conforming to the
- // "messaging.destination.template" semantic conventions. It represents the
- // low cardinality representation of the messaging destination name
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/customers/{customerID}'
- // Note: Destination names could be constructed from templates. An example
- // would be a destination name involving a user name or product id.
- // Although the destination name in this case is of high cardinality, the
- // underlying template is of low cardinality and can be effectively used
- // for grouping and aggregation.
- MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
-
- // MessagingDestinationTemporaryKey is the attribute Key conforming to the
- // "messaging.destination.temporary" semantic conventions. It represents a
- // boolean that is true if the message destination is temporary and might
- // not exist anymore after messages are processed.
- //
- // Type: boolean
- // RequirementLevel: Optional
- // Stability: stable
- MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
-
- // MessagingDestinationAnonymousKey is the attribute Key conforming to the
- // "messaging.destination.anonymous" semantic conventions. It represents a
- // boolean that is true if the message destination is anonymous (could be
- // unnamed or have auto-generated name).
- //
- // Type: boolean
- // RequirementLevel: Optional
- // Stability: stable
- MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
-)
-
-// MessagingDestinationName returns an attribute KeyValue conforming to the
-// "messaging.destination.name" semantic conventions. It represents the message
-// destination name
-func MessagingDestinationName(val string) attribute.KeyValue {
- return MessagingDestinationNameKey.String(val)
-}
-
-// MessagingDestinationTemplate returns an attribute KeyValue conforming to
-// the "messaging.destination.template" semantic conventions. It represents the
-// low cardinality representation of the messaging destination name
-func MessagingDestinationTemplate(val string) attribute.KeyValue {
- return MessagingDestinationTemplateKey.String(val)
-}
-
-// MessagingDestinationTemporary returns an attribute KeyValue conforming to
-// the "messaging.destination.temporary" semantic conventions. It represents a
-// boolean that is true if the message destination is temporary and might not
-// exist anymore after messages are processed.
-func MessagingDestinationTemporary(val bool) attribute.KeyValue {
- return MessagingDestinationTemporaryKey.Bool(val)
-}
-
-// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
-// the "messaging.destination.anonymous" semantic conventions. It represents a
-// boolean that is true if the message destination is anonymous (could be
-// unnamed or have auto-generated name).
-func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
- return MessagingDestinationAnonymousKey.Bool(val)
-}
-
-// Attributes for RabbitMQ
-const (
- // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
- // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
- // conventions. It represents the rabbitMQ message routing key.
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If not empty.)
- // Stability: stable
- // Examples: 'myKey'
- MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
-)
-
-// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
-// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
-// conventions. It represents the rabbitMQ message routing key.
-func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
- return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
-}
-
-// Attributes for Apache Kafka
-const (
- // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
- // "messaging.kafka.message.key" semantic conventions. It represents the
- // message keys in Kafka are used for grouping alike messages to ensure
- // they're processed on the same partition. They differ from
- // `messaging.message.id` in that they're not unique. If the key is `null`,
- // the attribute MUST NOT be set.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'myKey'
- // Note: If the key type is not string, it's string representation has to
- // be supplied for the attribute. If the key has no unambiguous, canonical
- // string form, don't include its value.
- MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
-
- // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
- // "messaging.kafka.consumer.group" semantic conventions. It represents the
- // name of the Kafka Consumer Group that is handling the message. Only
- // applies to consumers, not producers.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'my-group'
- MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
-
- // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to
- // the "messaging.kafka.destination.partition" semantic conventions. It
- // represents the partition the message is sent to.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 2
- MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
-
- // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
- // "messaging.kafka.message.offset" semantic conventions. It represents the
- // offset of a record in the corresponding Kafka partition.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 42
- MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
-
- // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
- // "messaging.kafka.message.tombstone" semantic conventions. It represents
- // a boolean that is true if the message is a tombstone.
- //
- // Type: boolean
- // RequirementLevel: ConditionallyRequired (If value is `true`. When
- // missing, the value is assumed to be `false`.)
- // Stability: stable
- MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
-)
-
-// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
-// "messaging.kafka.message.key" semantic conventions. It represents the
-// message keys in Kafka are used for grouping alike messages to ensure they're
-// processed on the same partition. They differ from `messaging.message.id` in
-// that they're not unique. If the key is `null`, the attribute MUST NOT be
-// set.
-func MessagingKafkaMessageKey(val string) attribute.KeyValue {
- return MessagingKafkaMessageKeyKey.String(val)
-}
-
-// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
-// the "messaging.kafka.consumer.group" semantic conventions. It represents the
-// name of the Kafka Consumer Group that is handling the message. Only applies
-// to consumers, not producers.
-func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
- return MessagingKafkaConsumerGroupKey.String(val)
-}
-
-// MessagingKafkaDestinationPartition returns an attribute KeyValue
-// conforming to the "messaging.kafka.destination.partition" semantic
-// conventions. It represents the partition the message is sent to.
-func MessagingKafkaDestinationPartition(val int) attribute.KeyValue {
- return MessagingKafkaDestinationPartitionKey.Int(val)
-}
-
-// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
-// the "messaging.kafka.message.offset" semantic conventions. It represents the
-// offset of a record in the corresponding Kafka partition.
-func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
- return MessagingKafkaMessageOffsetKey.Int(val)
-}
-
-// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
-// to the "messaging.kafka.message.tombstone" semantic conventions. It
-// represents a boolean that is true if the message is a tombstone.
-func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
- return MessagingKafkaMessageTombstoneKey.Bool(val)
-}
-
-// Attributes for Apache RocketMQ
-const (
- // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
- // "messaging.rocketmq.namespace" semantic conventions. It represents the
- // namespace of RocketMQ resources, resources in different namespaces are
- // individual.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'myNamespace'
- MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
-
- // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
- // "messaging.rocketmq.client_group" semantic conventions. It represents
- // the name of the RocketMQ producer/consumer group that is handling the
- // message. The client type is identified by the SpanKind.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'myConsumerGroup'
- MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
-
- // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
- // conforming to the "messaging.rocketmq.message.delivery_timestamp"
- // semantic conventions. It represents the timestamp in milliseconds that
- // the delay message is expected to be delivered to consumer.
- //
- // Type: int
- // RequirementLevel: ConditionallyRequired (If the message type is delay
- // and delay time level is not specified.)
- // Stability: stable
- // Examples: 1665987217045
- MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
-
- // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
- // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
- // conventions. It represents the delay time level for delay message, which
- // determines the message delay time.
- //
- // Type: int
- // RequirementLevel: ConditionallyRequired (If the message type is delay
- // and delivery timestamp is not specified.)
- // Stability: stable
- // Examples: 3
- MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
-
- // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.group" semantic conventions. It represents
- // the it is essential for FIFO message. Messages that belong to the same
- // message group are always processed one by one within the same consumer
- // group.
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If the message type is FIFO.)
- // Stability: stable
- // Examples: 'myMessageGroup'
- MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
-
- // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.type" semantic conventions. It represents
- // the type of message.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
-
- // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.tag" semantic conventions. It represents the
- // secondary classifier of message besides topic.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'tagA'
- MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
-
- // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.keys" semantic conventions. It represents
- // the key(s) of message, another way to mark message besides message id.
- //
- // Type: string[]
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'keyA', 'keyB'
- MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
-
- // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
- // the "messaging.rocketmq.consumption_model" semantic conventions. It
- // represents the model of message consumption. This only applies to
- // consumer spans.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
-)
-
-var (
- // Normal message
- MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
- // FIFO message
- MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
- // Delay message
- MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
- // Transaction message
- MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
-)
-
-var (
- // Clustering consumption model
- MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
- // Broadcasting consumption model
- MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
-)
-
-// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.namespace" semantic conventions. It represents the
-// namespace of RocketMQ resources, resources in different namespaces are
-// individual.
-func MessagingRocketmqNamespace(val string) attribute.KeyValue {
- return MessagingRocketmqNamespaceKey.String(val)
-}
-
-// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.client_group" semantic conventions. It represents
-// the name of the RocketMQ producer/consumer group that is handling the
-// message. The client type is identified by the SpanKind.
-func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
- return MessagingRocketmqClientGroupKey.String(val)
-}
-
-// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
-// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
-// conventions. It represents the timestamp in milliseconds that the delay
-// message is expected to be delivered to consumer.
-func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
- return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
-}
-
-// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
-// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
-// conventions. It represents the delay time level for delay message, which
-// determines the message delay time.
-func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
- return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
-}
-
-// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.message.group" semantic conventions. It represents
-// the it is essential for FIFO message. Messages that belong to the same
-// message group are always processed one by one within the same consumer
-// group.
-func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
- return MessagingRocketmqMessageGroupKey.String(val)
-}
-
-// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
-// secondary classifier of message besides topic.
-func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
- return MessagingRocketmqMessageTagKey.String(val)
-}
-
-// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.message.keys" semantic conventions. It represents
-// the key(s) of message, another way to mark message besides message id.
-func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
- return MessagingRocketmqMessageKeysKey.StringSlice(val)
-}
-
-// Attributes describing URL.
-const (
- // URLSchemeKey is the attribute Key conforming to the "url.scheme"
- // semantic conventions. It represents the [URI
- // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
- // identifying the used protocol.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'https', 'ftp', 'telnet'
- URLSchemeKey = attribute.Key("url.scheme")
-
- // URLFullKey is the attribute Key conforming to the "url.full" semantic
- // conventions. It represents the absolute URL describing a network
- // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
- // '//localhost'
- // Note: For network calls, URL usually has
- // `scheme://host[:port][path][?query][#fragment]` format, where the
- // fragment is not transmitted over HTTP, but if it is known, it should be
- // included nevertheless.
- // `url.full` MUST NOT contain credentials passed via URL in form of
- // `https://username:password@www.example.com/`. In such case username and
- // password should be redacted and attribute's value should be
- // `https://REDACTED:REDACTED@www.example.com/`.
- // `url.full` SHOULD capture the absolute URL when it is available (or can
- // be reconstructed) and SHOULD NOT be validated or modified except for
- // sanitizing purposes.
- URLFullKey = attribute.Key("url.full")
-
- // URLPathKey is the attribute Key conforming to the "url.path" semantic
- // conventions. It represents the [URI
- // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/search'
- // Note: When missing, the value is assumed to be `/`
- URLPathKey = attribute.Key("url.path")
-
- // URLQueryKey is the attribute Key conforming to the "url.query" semantic
- // conventions. It represents the [URI
- // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'q=OpenTelemetry'
- // Note: Sensitive content provided in query string SHOULD be scrubbed when
- // instrumentations can identify it.
- URLQueryKey = attribute.Key("url.query")
-
- // URLFragmentKey is the attribute Key conforming to the "url.fragment"
- // semantic conventions. It represents the [URI
- // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'SemConv'
- URLFragmentKey = attribute.Key("url.fragment")
-)
-
-// URLScheme returns an attribute KeyValue conforming to the "url.scheme"
-// semantic conventions. It represents the [URI
-// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
-// identifying the used protocol.
-func URLScheme(val string) attribute.KeyValue {
- return URLSchemeKey.String(val)
-}
-
-// URLFull returns an attribute KeyValue conforming to the "url.full"
-// semantic conventions. It represents the absolute URL describing a network
-// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
-func URLFull(val string) attribute.KeyValue {
- return URLFullKey.String(val)
-}
-
-// URLPath returns an attribute KeyValue conforming to the "url.path"
-// semantic conventions. It represents the [URI
-// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
-func URLPath(val string) attribute.KeyValue {
- return URLPathKey.String(val)
-}
-
-// URLQuery returns an attribute KeyValue conforming to the "url.query"
-// semantic conventions. It represents the [URI
-// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
-func URLQuery(val string) attribute.KeyValue {
- return URLQueryKey.String(val)
-}
-
-// URLFragment returns an attribute KeyValue conforming to the
-// "url.fragment" semantic conventions. It represents the [URI
-// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
-func URLFragment(val string) attribute.KeyValue {
- return URLFragmentKey.String(val)
-}
-
-// Describes user-agent attributes.
-const (
- // UserAgentOriginalKey is the attribute Key conforming to the
- // "user_agent.original" semantic conventions. It represents the value of
- // the [HTTP
- // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
- // header sent by the client.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
- UserAgentOriginalKey = attribute.Key("user_agent.original")
-)
-
-// UserAgentOriginal returns an attribute KeyValue conforming to the
-// "user_agent.original" semantic conventions. It represents the value of the
-// [HTTP
-// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
-// header sent by the client.
-func UserAgentOriginal(val string) attribute.KeyValue {
- return UserAgentOriginalKey.String(val)
-}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/README.md
new file mode 100644
index 0000000000..0b6cbe960c
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.24.0
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.24.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go
new file mode 100644
index 0000000000..6e688345cb
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go
@@ -0,0 +1,4387 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// Describes FaaS attributes.
+const (
+ // FaaSInvokedNameKey is the attribute Key conforming to the
+ // "faas.invoked_name" semantic conventions. It represents the name of the
+ // invoked function.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'my-function'
+ // Note: SHOULD be equal to the `faas.name` resource attribute of the
+ // invoked function.
+ FaaSInvokedNameKey = attribute.Key("faas.invoked_name")
+
+ // FaaSInvokedProviderKey is the attribute Key conforming to the
+ // "faas.invoked_provider" semantic conventions. It represents the cloud
+ // provider of the invoked function.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Note: SHOULD be equal to the `cloud.provider` resource attribute of the
+ // invoked function.
+ FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider")
+
+ // FaaSInvokedRegionKey is the attribute Key conforming to the
+ // "faas.invoked_region" semantic conventions. It represents the cloud
+ // region of the invoked function.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (For some cloud providers, like
+ // AWS or GCP, the region in which a function is hosted is essential to
+ // uniquely identify the function and also part of its endpoint. Since it's
+ // part of the endpoint being called, the region is always known to
+ // clients. In these cases, `faas.invoked_region` MUST be set accordingly.
+ // If the region is unknown to the client or not required for identifying
+ // the invoked function, setting `faas.invoked_region` is optional.)
+ // Stability: experimental
+ // Examples: 'eu-central-1'
+ // Note: SHOULD be equal to the `cloud.region` resource attribute of the
+ // invoked function.
+ FaaSInvokedRegionKey = attribute.Key("faas.invoked_region")
+
+ // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger"
+ // semantic conventions. It represents the type of the trigger which caused
+ // this function invocation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSTriggerKey = attribute.Key("faas.trigger")
+)
+
+var (
+ // Alibaba Cloud
+ FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws")
+ // Microsoft Azure
+ FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure")
+ // Google Cloud Platform
+ FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp")
+ // Tencent Cloud
+ FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud")
+)
+
+var (
+ // A response to some data source operation such as a database or filesystem read/write
+ FaaSTriggerDatasource = FaaSTriggerKey.String("datasource")
+ // To provide an answer to an inbound HTTP request
+ FaaSTriggerHTTP = FaaSTriggerKey.String("http")
+ // A function is set to be executed when messages are sent to a messaging system
+ FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub")
+ // A function is scheduled to be executed regularly
+ FaaSTriggerTimer = FaaSTriggerKey.String("timer")
+ // If none of the others apply
+ FaaSTriggerOther = FaaSTriggerKey.String("other")
+)
+
+// FaaSInvokedName returns an attribute KeyValue conforming to the
+// "faas.invoked_name" semantic conventions. It represents the name of the
+// invoked function.
+func FaaSInvokedName(val string) attribute.KeyValue {
+ return FaaSInvokedNameKey.String(val)
+}
+
+// FaaSInvokedRegion returns an attribute KeyValue conforming to the
+// "faas.invoked_region" semantic conventions. It represents the cloud region
+// of the invoked function.
+func FaaSInvokedRegion(val string) attribute.KeyValue {
+ return FaaSInvokedRegionKey.String(val)
+}
+
+// Attributes for Events represented using Log Records.
+const (
+ // EventNameKey is the attribute Key conforming to the "event.name"
+ // semantic conventions. It represents the identifies the class / type of
+ // event.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'browser.mouse.click', 'device.app.lifecycle'
+ // Note: Event names are subject to the same rules as [attribute
+ // names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/common/attribute-naming.md).
+ // Notably, event names are namespaced to avoid collisions and provide a
+ // clean separation of semantics for events in separate domains like
+ // browser, mobile, and kubernetes.
+ EventNameKey = attribute.Key("event.name")
+)
+
+// EventName returns an attribute KeyValue conforming to the "event.name"
+// semantic conventions. It represents the identifies the class / type of
+// event.
+func EventName(val string) attribute.KeyValue {
+ return EventNameKey.String(val)
+}
+
+// The attributes described in this section are rather generic. They may be
+// used in any Log Record they apply to.
+const (
+ // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
+ // semantic conventions. It represents a unique identifier for the Log
+ // Record.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
+ // Note: If an id is provided, other log records with the same id will be
+ // considered duplicates and can be removed safely. This means, that two
+ // distinguishable log records MUST have different values.
+ // The id MAY be an [Universally Unique Lexicographically Sortable
+ // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
+ // (e.g. UUID) may be used as needed.
+ LogRecordUIDKey = attribute.Key("log.record.uid")
+)
+
+// LogRecordUID returns an attribute KeyValue conforming to the
+// "log.record.uid" semantic conventions. It represents a unique identifier for
+// the Log Record.
+func LogRecordUID(val string) attribute.KeyValue {
+ return LogRecordUIDKey.String(val)
+}
+
+// Describes Log attributes
+const (
+ // LogIostreamKey is the attribute Key conforming to the "log.iostream"
+ // semantic conventions. It represents the stream associated with the log.
+ // See below for a list of well-known values.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ LogIostreamKey = attribute.Key("log.iostream")
+)
+
+var (
+ // Logs from stdout stream
+ LogIostreamStdout = LogIostreamKey.String("stdout")
+ // Events from stderr stream
+ LogIostreamStderr = LogIostreamKey.String("stderr")
+)
+
+// A file to which log was emitted.
+const (
+ // LogFileNameKey is the attribute Key conforming to the "log.file.name"
+ // semantic conventions. It represents the basename of the file.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: experimental
+ // Examples: 'audit.log'
+ LogFileNameKey = attribute.Key("log.file.name")
+
+ // LogFileNameResolvedKey is the attribute Key conforming to the
+ // "log.file.name_resolved" semantic conventions. It represents the
+ // basename of the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'uuid.log'
+ LogFileNameResolvedKey = attribute.Key("log.file.name_resolved")
+
+ // LogFilePathKey is the attribute Key conforming to the "log.file.path"
+ // semantic conventions. It represents the full path to the file.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/var/log/mysql/audit.log'
+ LogFilePathKey = attribute.Key("log.file.path")
+
+ // LogFilePathResolvedKey is the attribute Key conforming to the
+ // "log.file.path_resolved" semantic conventions. It represents the full
+ // path to the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/var/lib/docker/uuid.log'
+ LogFilePathResolvedKey = attribute.Key("log.file.path_resolved")
+)
+
+// LogFileName returns an attribute KeyValue conforming to the
+// "log.file.name" semantic conventions. It represents the basename of the
+// file.
+func LogFileName(val string) attribute.KeyValue {
+ return LogFileNameKey.String(val)
+}
+
+// LogFileNameResolved returns an attribute KeyValue conforming to the
+// "log.file.name_resolved" semantic conventions. It represents the basename of
+// the file, with symlinks resolved.
+func LogFileNameResolved(val string) attribute.KeyValue {
+ return LogFileNameResolvedKey.String(val)
+}
+
+// LogFilePath returns an attribute KeyValue conforming to the
+// "log.file.path" semantic conventions. It represents the full path to the
+// file.
+func LogFilePath(val string) attribute.KeyValue {
+ return LogFilePathKey.String(val)
+}
+
+// LogFilePathResolved returns an attribute KeyValue conforming to the
+// "log.file.path_resolved" semantic conventions. It represents the full path
+// to the file, with symlinks resolved.
+func LogFilePathResolved(val string) attribute.KeyValue {
+ return LogFilePathResolvedKey.String(val)
+}
+
+// Describes Database attributes
+const (
+ // PoolNameKey is the attribute Key conforming to the "pool.name" semantic
+ // conventions. It represents the name of the connection pool; unique
+ // within the instrumented application. In case the connection pool
+ // implementation doesn't provide a name, then the
+ // [db.connection_string](/docs/database/database-spans.md#connection-level-attributes)
+ // should be used
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'myDataSource'
+ PoolNameKey = attribute.Key("pool.name")
+
+ // StateKey is the attribute Key conforming to the "state" semantic
+ // conventions. It represents the state of a connection in the pool
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'idle'
+ StateKey = attribute.Key("state")
+)
+
+var (
+ // idle
+ StateIdle = StateKey.String("idle")
+ // used
+ StateUsed = StateKey.String("used")
+)
+
+// PoolName returns an attribute KeyValue conforming to the "pool.name"
+// semantic conventions. It represents the name of the connection pool; unique
+// within the instrumented application. In case the connection pool
+// implementation doesn't provide a name, then the
+// [db.connection_string](/docs/database/database-spans.md#connection-level-attributes)
+// should be used
+func PoolName(val string) attribute.KeyValue {
+ return PoolNameKey.String(val)
+}
+
+// ASP.NET Core attributes
+const (
+ // AspnetcoreDiagnosticsHandlerTypeKey is the attribute Key conforming to
+ // the "aspnetcore.diagnostics.handler.type" semantic conventions. It
+ // represents the full type name of the
+ // [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
+ // implementation that handled the exception.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (if and only if the exception
+ // was handled by this handler.)
+ // Stability: experimental
+ // Examples: 'Contoso.MyHandler'
+ AspnetcoreDiagnosticsHandlerTypeKey = attribute.Key("aspnetcore.diagnostics.handler.type")
+
+ // AspnetcoreRateLimitingPolicyKey is the attribute Key conforming to the
+ // "aspnetcore.rate_limiting.policy" semantic conventions. It represents
+ // the rate limiting policy name.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (if the matched endpoint for the
+ // request had a rate-limiting policy.)
+ // Stability: experimental
+ // Examples: 'fixed', 'sliding', 'token'
+ AspnetcoreRateLimitingPolicyKey = attribute.Key("aspnetcore.rate_limiting.policy")
+
+ // AspnetcoreRateLimitingResultKey is the attribute Key conforming to the
+ // "aspnetcore.rate_limiting.result" semantic conventions. It represents
+ // the rate-limiting result, shows whether the lease was acquired or
+ // contains a rejection reason
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'acquired', 'request_canceled'
+ AspnetcoreRateLimitingResultKey = attribute.Key("aspnetcore.rate_limiting.result")
+
+ // AspnetcoreRequestIsUnhandledKey is the attribute Key conforming to the
+ // "aspnetcore.request.is_unhandled" semantic conventions. It represents
+ // the flag indicating if request was handled by the application pipeline.
+ //
+ // Type: boolean
+ // RequirementLevel: ConditionallyRequired (if and only if the request was
+ // not handled.)
+ // Stability: experimental
+ // Examples: True
+ AspnetcoreRequestIsUnhandledKey = attribute.Key("aspnetcore.request.is_unhandled")
+
+ // AspnetcoreRoutingIsFallbackKey is the attribute Key conforming to the
+ // "aspnetcore.routing.is_fallback" semantic conventions. It represents a
+ // value that indicates whether the matched route is a fallback route.
+ //
+ // Type: boolean
+ // RequirementLevel: ConditionallyRequired (If and only if a route was
+ // successfully matched.)
+ // Stability: experimental
+ // Examples: True
+ AspnetcoreRoutingIsFallbackKey = attribute.Key("aspnetcore.routing.is_fallback")
+)
+
+var (
+ // Lease was acquired
+ AspnetcoreRateLimitingResultAcquired = AspnetcoreRateLimitingResultKey.String("acquired")
+ // Lease request was rejected by the endpoint limiter
+ AspnetcoreRateLimitingResultEndpointLimiter = AspnetcoreRateLimitingResultKey.String("endpoint_limiter")
+ // Lease request was rejected by the global limiter
+ AspnetcoreRateLimitingResultGlobalLimiter = AspnetcoreRateLimitingResultKey.String("global_limiter")
+ // Lease request was canceled
+ AspnetcoreRateLimitingResultRequestCanceled = AspnetcoreRateLimitingResultKey.String("request_canceled")
+)
+
+// AspnetcoreDiagnosticsHandlerType returns an attribute KeyValue conforming
+// to the "aspnetcore.diagnostics.handler.type" semantic conventions. It
+// represents the full type name of the
+// [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
+// implementation that handled the exception.
+func AspnetcoreDiagnosticsHandlerType(val string) attribute.KeyValue {
+ return AspnetcoreDiagnosticsHandlerTypeKey.String(val)
+}
+
+// AspnetcoreRateLimitingPolicy returns an attribute KeyValue conforming to
+// the "aspnetcore.rate_limiting.policy" semantic conventions. It represents
+// the rate limiting policy name.
+func AspnetcoreRateLimitingPolicy(val string) attribute.KeyValue {
+ return AspnetcoreRateLimitingPolicyKey.String(val)
+}
+
+// AspnetcoreRequestIsUnhandled returns an attribute KeyValue conforming to
+// the "aspnetcore.request.is_unhandled" semantic conventions. It represents
+// the flag indicating if request was handled by the application pipeline.
+func AspnetcoreRequestIsUnhandled(val bool) attribute.KeyValue {
+ return AspnetcoreRequestIsUnhandledKey.Bool(val)
+}
+
+// AspnetcoreRoutingIsFallback returns an attribute KeyValue conforming to
+// the "aspnetcore.routing.is_fallback" semantic conventions. It represents a
+// value that indicates whether the matched route is a fallback route.
+func AspnetcoreRoutingIsFallback(val bool) attribute.KeyValue {
+ return AspnetcoreRoutingIsFallbackKey.Bool(val)
+}
+
+// SignalR attributes
+const (
+ // SignalrConnectionStatusKey is the attribute Key conforming to the
+ // "signalr.connection.status" semantic conventions. It represents the
+ // signalR HTTP connection closure status.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'app_shutdown', 'timeout'
+ SignalrConnectionStatusKey = attribute.Key("signalr.connection.status")
+
+ // SignalrTransportKey is the attribute Key conforming to the
+ // "signalr.transport" semantic conventions. It represents the [SignalR
+ // transport
+ // type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'web_sockets', 'long_polling'
+ SignalrTransportKey = attribute.Key("signalr.transport")
+)
+
+var (
+ // The connection was closed normally
+ SignalrConnectionStatusNormalClosure = SignalrConnectionStatusKey.String("normal_closure")
+ // The connection was closed due to a timeout
+ SignalrConnectionStatusTimeout = SignalrConnectionStatusKey.String("timeout")
+ // The connection was closed because the app is shutting down
+ SignalrConnectionStatusAppShutdown = SignalrConnectionStatusKey.String("app_shutdown")
+)
+
+var (
+ // ServerSentEvents protocol
+ SignalrTransportServerSentEvents = SignalrTransportKey.String("server_sent_events")
+ // LongPolling protocol
+ SignalrTransportLongPolling = SignalrTransportKey.String("long_polling")
+ // WebSockets protocol
+ SignalrTransportWebSockets = SignalrTransportKey.String("web_sockets")
+)
+
+// Describes JVM buffer metric attributes.
+const (
+ // JvmBufferPoolNameKey is the attribute Key conforming to the
+ // "jvm.buffer.pool.name" semantic conventions. It represents the name of
+ // the buffer pool.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: experimental
+ // Examples: 'mapped', 'direct'
+ // Note: Pool names are generally obtained via
+ // [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()).
+ JvmBufferPoolNameKey = attribute.Key("jvm.buffer.pool.name")
+)
+
+// JvmBufferPoolName returns an attribute KeyValue conforming to the
+// "jvm.buffer.pool.name" semantic conventions. It represents the name of the
+// buffer pool.
+func JvmBufferPoolName(val string) attribute.KeyValue {
+ return JvmBufferPoolNameKey.String(val)
+}
+
+// Describes JVM memory metric attributes.
+const (
+ // JvmMemoryPoolNameKey is the attribute Key conforming to the
+ // "jvm.memory.pool.name" semantic conventions. It represents the name of
+ // the memory pool.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: stable
+ // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space'
+ // Note: Pool names are generally obtained via
+ // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).
+ JvmMemoryPoolNameKey = attribute.Key("jvm.memory.pool.name")
+
+ // JvmMemoryTypeKey is the attribute Key conforming to the
+ // "jvm.memory.type" semantic conventions. It represents the type of
+ // memory.
+ //
+ // Type: Enum
+ // RequirementLevel: Recommended
+ // Stability: stable
+ // Examples: 'heap', 'non_heap'
+ JvmMemoryTypeKey = attribute.Key("jvm.memory.type")
+)
+
+var (
+ // Heap memory
+ JvmMemoryTypeHeap = JvmMemoryTypeKey.String("heap")
+ // Non-heap memory
+ JvmMemoryTypeNonHeap = JvmMemoryTypeKey.String("non_heap")
+)
+
+// JvmMemoryPoolName returns an attribute KeyValue conforming to the
+// "jvm.memory.pool.name" semantic conventions. It represents the name of the
+// memory pool.
+func JvmMemoryPoolName(val string) attribute.KeyValue {
+ return JvmMemoryPoolNameKey.String(val)
+}
+
+// Describes System metric attributes
+const (
+ // SystemDeviceKey is the attribute Key conforming to the "system.device"
+ // semantic conventions. It represents the device identifier
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '(identifier)'
+ SystemDeviceKey = attribute.Key("system.device")
+)
+
+// SystemDevice returns an attribute KeyValue conforming to the
+// "system.device" semantic conventions. It represents the device identifier
+func SystemDevice(val string) attribute.KeyValue {
+ return SystemDeviceKey.String(val)
+}
+
+// Describes System CPU metric attributes
+const (
+ // SystemCPULogicalNumberKey is the attribute Key conforming to the
+ // "system.cpu.logical_number" semantic conventions. It represents the
+ // logical CPU number [0..n-1]
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1
+ SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number")
+
+ // SystemCPUStateKey is the attribute Key conforming to the
+ // "system.cpu.state" semantic conventions. It represents the state of the
+ // CPU
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'idle', 'interrupt'
+ SystemCPUStateKey = attribute.Key("system.cpu.state")
+)
+
+var (
+ // user
+ SystemCPUStateUser = SystemCPUStateKey.String("user")
+ // system
+ SystemCPUStateSystem = SystemCPUStateKey.String("system")
+ // nice
+ SystemCPUStateNice = SystemCPUStateKey.String("nice")
+ // idle
+ SystemCPUStateIdle = SystemCPUStateKey.String("idle")
+ // iowait
+ SystemCPUStateIowait = SystemCPUStateKey.String("iowait")
+ // interrupt
+ SystemCPUStateInterrupt = SystemCPUStateKey.String("interrupt")
+ // steal
+ SystemCPUStateSteal = SystemCPUStateKey.String("steal")
+)
+
+// SystemCPULogicalNumber returns an attribute KeyValue conforming to the
+// "system.cpu.logical_number" semantic conventions. It represents the logical
+// CPU number [0..n-1]
+func SystemCPULogicalNumber(val int) attribute.KeyValue {
+ return SystemCPULogicalNumberKey.Int(val)
+}
+
+// Describes System Memory metric attributes
+const (
+ // SystemMemoryStateKey is the attribute Key conforming to the
+ // "system.memory.state" semantic conventions. It represents the memory
+ // state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'free', 'cached'
+ SystemMemoryStateKey = attribute.Key("system.memory.state")
+)
+
+var (
+ // used
+ SystemMemoryStateUsed = SystemMemoryStateKey.String("used")
+ // free
+ SystemMemoryStateFree = SystemMemoryStateKey.String("free")
+ // shared
+ SystemMemoryStateShared = SystemMemoryStateKey.String("shared")
+ // buffers
+ SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers")
+ // cached
+ SystemMemoryStateCached = SystemMemoryStateKey.String("cached")
+)
+
+// Describes System Memory Paging metric attributes
+const (
+ // SystemPagingDirectionKey is the attribute Key conforming to the
+ // "system.paging.direction" semantic conventions. It represents the paging
+ // access direction
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'in'
+ SystemPagingDirectionKey = attribute.Key("system.paging.direction")
+
+ // SystemPagingStateKey is the attribute Key conforming to the
+ // "system.paging.state" semantic conventions. It represents the memory
+ // paging state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'free'
+ SystemPagingStateKey = attribute.Key("system.paging.state")
+
+ // SystemPagingTypeKey is the attribute Key conforming to the
+ // "system.paging.type" semantic conventions. It represents the memory
+ // paging type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'minor'
+ SystemPagingTypeKey = attribute.Key("system.paging.type")
+)
+
+var (
+ // in
+ SystemPagingDirectionIn = SystemPagingDirectionKey.String("in")
+ // out
+ SystemPagingDirectionOut = SystemPagingDirectionKey.String("out")
+)
+
+var (
+ // used
+ SystemPagingStateUsed = SystemPagingStateKey.String("used")
+ // free
+ SystemPagingStateFree = SystemPagingStateKey.String("free")
+)
+
+var (
+ // major
+ SystemPagingTypeMajor = SystemPagingTypeKey.String("major")
+ // minor
+ SystemPagingTypeMinor = SystemPagingTypeKey.String("minor")
+)
+
+// Describes Filesystem metric attributes
+const (
+ // SystemFilesystemModeKey is the attribute Key conforming to the
+ // "system.filesystem.mode" semantic conventions. It represents the
+ // filesystem mode
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'rw, ro'
+ SystemFilesystemModeKey = attribute.Key("system.filesystem.mode")
+
+ // SystemFilesystemMountpointKey is the attribute Key conforming to the
+ // "system.filesystem.mountpoint" semantic conventions. It represents the
+ // filesystem mount path
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/mnt/data'
+ SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint")
+
+ // SystemFilesystemStateKey is the attribute Key conforming to the
+ // "system.filesystem.state" semantic conventions. It represents the
+ // filesystem state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'used'
+ SystemFilesystemStateKey = attribute.Key("system.filesystem.state")
+
+ // SystemFilesystemTypeKey is the attribute Key conforming to the
+ // "system.filesystem.type" semantic conventions. It represents the
+ // filesystem type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ext4'
+ SystemFilesystemTypeKey = attribute.Key("system.filesystem.type")
+)
+
+var (
+ // used
+ SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used")
+ // free
+ SystemFilesystemStateFree = SystemFilesystemStateKey.String("free")
+ // reserved
+ SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved")
+)
+
+var (
+ // fat32
+ SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32")
+ // exfat
+ SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat")
+ // ntfs
+ SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs")
+ // refs
+ SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs")
+ // hfsplus
+ SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus")
+ // ext4
+ SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4")
+)
+
+// SystemFilesystemMode returns an attribute KeyValue conforming to the
+// "system.filesystem.mode" semantic conventions. It represents the filesystem
+// mode
+func SystemFilesystemMode(val string) attribute.KeyValue {
+ return SystemFilesystemModeKey.String(val)
+}
+
+// SystemFilesystemMountpoint returns an attribute KeyValue conforming to
+// the "system.filesystem.mountpoint" semantic conventions. It represents the
+// filesystem mount path
+func SystemFilesystemMountpoint(val string) attribute.KeyValue {
+ return SystemFilesystemMountpointKey.String(val)
+}
+
+// Describes Network metric attributes
+const (
+ // SystemNetworkStateKey is the attribute Key conforming to the
+ // "system.network.state" semantic conventions. It represents a stateless
+ // protocol MUST NOT set this attribute
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'close_wait'
+ SystemNetworkStateKey = attribute.Key("system.network.state")
+)
+
+var (
+ // close
+ SystemNetworkStateClose = SystemNetworkStateKey.String("close")
+ // close_wait
+ SystemNetworkStateCloseWait = SystemNetworkStateKey.String("close_wait")
+ // closing
+ SystemNetworkStateClosing = SystemNetworkStateKey.String("closing")
+ // delete
+ SystemNetworkStateDelete = SystemNetworkStateKey.String("delete")
+ // established
+ SystemNetworkStateEstablished = SystemNetworkStateKey.String("established")
+ // fin_wait_1
+ SystemNetworkStateFinWait1 = SystemNetworkStateKey.String("fin_wait_1")
+ // fin_wait_2
+ SystemNetworkStateFinWait2 = SystemNetworkStateKey.String("fin_wait_2")
+ // last_ack
+ SystemNetworkStateLastAck = SystemNetworkStateKey.String("last_ack")
+ // listen
+ SystemNetworkStateListen = SystemNetworkStateKey.String("listen")
+ // syn_recv
+ SystemNetworkStateSynRecv = SystemNetworkStateKey.String("syn_recv")
+ // syn_sent
+ SystemNetworkStateSynSent = SystemNetworkStateKey.String("syn_sent")
+ // time_wait
+ SystemNetworkStateTimeWait = SystemNetworkStateKey.String("time_wait")
+)
+
+// Describes System Process metric attributes
+const (
+ // SystemProcessesStatusKey is the attribute Key conforming to the
+ // "system.processes.status" semantic conventions. It represents the
+ // process state, e.g., [Linux Process State
+ // Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'running'
+ SystemProcessesStatusKey = attribute.Key("system.processes.status")
+)
+
+var (
+ // running
+ SystemProcessesStatusRunning = SystemProcessesStatusKey.String("running")
+ // sleeping
+ SystemProcessesStatusSleeping = SystemProcessesStatusKey.String("sleeping")
+ // stopped
+ SystemProcessesStatusStopped = SystemProcessesStatusKey.String("stopped")
+ // defunct
+ SystemProcessesStatusDefunct = SystemProcessesStatusKey.String("defunct")
+)
+
+// These attributes may be used to describe the client in a connection-based
+// network interaction where there is one side that initiates the connection
+// (the client is the side that initiates the connection). This covers all TCP
+// network interactions since TCP is connection-based and one side initiates
+// the connection (an exception is made for peer-to-peer communication over TCP
+// where the "user-facing" surface of the protocol / API doesn't expose a clear
+// notion of client and server). This also covers UDP network interactions
+// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
+const (
+ // ClientAddressKey is the attribute Key conforming to the "client.address"
+ // semantic conventions. It represents the client address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix
+ // domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'client.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the server side, and when communicating through
+ // an intermediary, `client.address` SHOULD represent the client address
+ // behind any intermediaries, for example proxies, if it's available.
+ ClientAddressKey = attribute.Key("client.address")
+
+ // ClientPortKey is the attribute Key conforming to the "client.port"
+ // semantic conventions. It represents the client port number.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ // Note: When observed from the server side, and when communicating through
+ // an intermediary, `client.port` SHOULD represent the client port behind
+ // any intermediaries, for example proxies, if it's available.
+ ClientPortKey = attribute.Key("client.port")
+)
+
+// ClientAddress returns an attribute KeyValue conforming to the
+// "client.address" semantic conventions. It represents the client address -
+// domain name if available without reverse DNS lookup; otherwise, IP address
+// or Unix domain socket name.
+func ClientAddress(val string) attribute.KeyValue {
+ return ClientAddressKey.String(val)
+}
+
+// ClientPort returns an attribute KeyValue conforming to the "client.port"
+// semantic conventions. It represents the client port number.
+func ClientPort(val int) attribute.KeyValue {
+ return ClientPortKey.Int(val)
+}
+
+// The attributes used to describe telemetry in the context of databases.
+const (
+ // DBCassandraConsistencyLevelKey is the attribute Key conforming to the
+ // "db.cassandra.consistency_level" semantic conventions. It represents the
+ // consistency level of the query. Based on consistency values from
+ // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level")
+
+ // DBCassandraCoordinatorDCKey is the attribute Key conforming to the
+ // "db.cassandra.coordinator.dc" semantic conventions. It represents the
+ // data center of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-west-2'
+ DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc")
+
+ // DBCassandraCoordinatorIDKey is the attribute Key conforming to the
+ // "db.cassandra.coordinator.id" semantic conventions. It represents the ID
+ // of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
+ DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id")
+
+ // DBCassandraIdempotenceKey is the attribute Key conforming to the
+ // "db.cassandra.idempotence" semantic conventions. It represents the
+ // whether or not the query is idempotent.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence")
+
+ // DBCassandraPageSizeKey is the attribute Key conforming to the
+ // "db.cassandra.page_size" semantic conventions. It represents the fetch
+ // size used for paging, i.e. how many rows will be returned at once.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 5000
+ DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size")
+
+ // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming
+ // to the "db.cassandra.speculative_execution_count" semantic conventions.
+ // It represents the number of times a query was speculatively executed.
+ // Not set or `0` if the query was not executed speculatively.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 2
+ DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count")
+
+ // DBCassandraTableKey is the attribute Key conforming to the
+ // "db.cassandra.table" semantic conventions. It represents the name of the
+ // primary Cassandra table that the operation is acting upon, including the
+ // keyspace name (if applicable).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mytable'
+ // Note: This mirrors the db.sql.table attribute but references cassandra
+ // rather than sql. It is not recommended to attempt any client-side
+ // parsing of `db.statement` just to get this property, but it should be
+ // set if it is provided by the library being instrumented. If the
+ // operation is acting upon an anonymous table, or more than one table,
+ // this value MUST NOT be set.
+ DBCassandraTableKey = attribute.Key("db.cassandra.table")
+
+ // DBConnectionStringKey is the attribute Key conforming to the
+ // "db.connection_string" semantic conventions. It represents the
+ // connection string used to connect to the database. It is recommended to
+ // remove embedded credentials.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;'
+ DBConnectionStringKey = attribute.Key("db.connection_string")
+
+ // DBCosmosDBClientIDKey is the attribute Key conforming to the
+ // "db.cosmosdb.client_id" semantic conventions. It represents the unique
+ // Cosmos client instance id.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d'
+ DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id")
+
+ // DBCosmosDBConnectionModeKey is the attribute Key conforming to the
+ // "db.cosmosdb.connection_mode" semantic conventions. It represents the
+ // cosmos client connection mode.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode")
+
+ // DBCosmosDBContainerKey is the attribute Key conforming to the
+ // "db.cosmosdb.container" semantic conventions. It represents the cosmos
+ // DB container name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'anystring'
+ DBCosmosDBContainerKey = attribute.Key("db.cosmosdb.container")
+
+ // DBCosmosDBOperationTypeKey is the attribute Key conforming to the
+ // "db.cosmosdb.operation_type" semantic conventions. It represents the
+ // cosmosDB Operation Type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type")
+
+ // DBCosmosDBRequestChargeKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+ // consumed for that operation
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 46.18, 1.0
+ DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge")
+
+ // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_content_length" semantic conventions. It represents
+ // the request payload size in bytes
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length")
+
+ // DBCosmosDBStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos
+ // DB status code.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 200, 201
+ DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code")
+
+ // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.sub_status_code" semantic conventions. It represents the
+ // cosmos DB sub status code.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1000, 1002
+ DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code")
+
+ // DBElasticsearchClusterNameKey is the attribute Key conforming to the
+ // "db.elasticsearch.cluster.name" semantic conventions. It represents the
+ // represents the identifier of an Elasticsearch cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'e9106fc68e3044f0b1475b04bf4ffd5f'
+ DBElasticsearchClusterNameKey = attribute.Key("db.elasticsearch.cluster.name")
+
+ // DBElasticsearchNodeNameKey is the attribute Key conforming to the
+ // "db.elasticsearch.node.name" semantic conventions. It represents the
+ // represents the human-readable identifier of the node/instance to which a
+ // request was routed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'instance-0000000001'
+ DBElasticsearchNodeNameKey = attribute.Key("db.elasticsearch.node.name")
+
+ // DBInstanceIDKey is the attribute Key conforming to the "db.instance.id"
+ // semantic conventions. It represents an identifier (address, unique name,
+ // or any other identifier) of the database instance that is executing
+ // queries or mutations on the current connection. This is useful in cases
+ // where the database is running in a clustered environment and the
+ // instrumentation is able to record the node executing the query. The
+ // client may obtain this value in databases like MySQL using queries like
+ // `select @@hostname`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mysql-e26b99z.example.com'
+ DBInstanceIDKey = attribute.Key("db.instance.id")
+
+ // DBJDBCDriverClassnameKey is the attribute Key conforming to the
+ // "db.jdbc.driver_classname" semantic conventions. It represents the
+ // fully-qualified class name of the [Java Database Connectivity
+ // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/)
+ // driver used to connect.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'org.postgresql.Driver',
+ // 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
+ DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname")
+
+ // DBMongoDBCollectionKey is the attribute Key conforming to the
+ // "db.mongodb.collection" semantic conventions. It represents the MongoDB
+ // collection being accessed within the database stated in `db.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'customers', 'products'
+ DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection")
+
+ // DBMSSQLInstanceNameKey is the attribute Key conforming to the
+ // "db.mssql.instance_name" semantic conventions. It represents the
+ // Microsoft SQL Server [instance
+ // name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
+ // connecting to. This name is used to determine the port of a named
+ // instance.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MSSQLSERVER'
+ // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer
+ // required (but still recommended if non-standard).
+ DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name")
+
+ // DBNameKey is the attribute Key conforming to the "db.name" semantic
+ // conventions. It represents the this attribute is used to report the name
+ // of the database being accessed. For commands that switch the database,
+ // this should be set to the target database (even if the command fails).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'customers', 'main'
+ // Note: In some SQL databases, the database name to be used is called
+ // "schema name". In case there are multiple layers that could be
+ // considered for database name (e.g. Oracle instance name and schema
+ // name), the database name to be used is the more specific layer (e.g.
+ // Oracle schema name).
+ DBNameKey = attribute.Key("db.name")
+
+ // DBOperationKey is the attribute Key conforming to the "db.operation"
+ // semantic conventions. It represents the name of the operation being
+ // executed, e.g. the [MongoDB command
+ // name](https://docs.mongodb.com/manual/reference/command/#database-operations)
+ // such as `findAndModify`, or the SQL keyword.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'findAndModify', 'HMSET', 'SELECT'
+ // Note: When setting this to an SQL keyword, it is not recommended to
+ // attempt any client-side parsing of `db.statement` just to get this
+ // property, but it should be set if the operation name is provided by the
+ // library being instrumented. If the SQL statement has an ambiguous
+ // operation, or performs more than one operation, this value may be
+ // omitted.
+ DBOperationKey = attribute.Key("db.operation")
+
+ // DBRedisDBIndexKey is the attribute Key conforming to the
+ // "db.redis.database_index" semantic conventions. It represents the index
+ // of the database being accessed as used in the [`SELECT`
+ // command](https://redis.io/commands/select), provided as an integer. To
+ // be used instead of the generic `db.name` attribute.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1, 15
+ DBRedisDBIndexKey = attribute.Key("db.redis.database_index")
+
+ // DBSQLTableKey is the attribute Key conforming to the "db.sql.table"
+ // semantic conventions. It represents the name of the primary table that
+ // the operation is acting upon, including the database name (if
+ // applicable).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'public.users', 'customers'
+ // Note: It is not recommended to attempt any client-side parsing of
+ // `db.statement` just to get this property, but it should be set if it is
+ // provided by the library being instrumented. If the operation is acting
+ // upon an anonymous table, or more than one table, this value MUST NOT be
+ // set.
+ DBSQLTableKey = attribute.Key("db.sql.table")
+
+ // DBStatementKey is the attribute Key conforming to the "db.statement"
+ // semantic conventions. It represents the database statement being
+ // executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"'
+ DBStatementKey = attribute.Key("db.statement")
+
+ // DBSystemKey is the attribute Key conforming to the "db.system" semantic
+ // conventions. It represents an identifier for the database management
+ // system (DBMS) product being used. See below for a list of well-known
+ // identifiers.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBSystemKey = attribute.Key("db.system")
+
+ // DBUserKey is the attribute Key conforming to the "db.user" semantic
+ // conventions. It represents the username for accessing the database.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'readonly_user', 'reporting_user'
+ DBUserKey = attribute.Key("db.user")
+)
+
+var (
+ // all
+ DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all")
+ // each_quorum
+ DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum")
+ // quorum
+ DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum")
+ // local_quorum
+ DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum")
+ // one
+ DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one")
+ // two
+ DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two")
+ // three
+ DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three")
+ // local_one
+ DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one")
+ // any
+ DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any")
+ // serial
+ DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial")
+ // local_serial
+ DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial")
+)
+
+var (
+ // Gateway (HTTP) connections mode
+ DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway")
+ // Direct connection
+ DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct")
+)
+
+var (
+ // invalid
+ DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid")
+ // create
+ DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create")
+ // patch
+ DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch")
+ // read
+ DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read")
+ // read_feed
+ DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed")
+ // delete
+ DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete")
+ // replace
+ DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace")
+ // execute
+ DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute")
+ // query
+ DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query")
+ // head
+ DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head")
+ // head_feed
+ DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed")
+ // upsert
+ DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert")
+ // batch
+ DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch")
+ // query_plan
+ DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan")
+ // execute_javascript
+ DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript")
+)
+
+var (
+ // Some other SQL database. Fallback only. See notes
+ DBSystemOtherSQL = DBSystemKey.String("other_sql")
+ // Microsoft SQL Server
+ DBSystemMSSQL = DBSystemKey.String("mssql")
+ // Microsoft SQL Server Compact
+ DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact")
+ // MySQL
+ DBSystemMySQL = DBSystemKey.String("mysql")
+ // Oracle Database
+ DBSystemOracle = DBSystemKey.String("oracle")
+ // IBM DB2
+ DBSystemDB2 = DBSystemKey.String("db2")
+ // PostgreSQL
+ DBSystemPostgreSQL = DBSystemKey.String("postgresql")
+ // Amazon Redshift
+ DBSystemRedshift = DBSystemKey.String("redshift")
+ // Apache Hive
+ DBSystemHive = DBSystemKey.String("hive")
+ // Cloudscape
+ DBSystemCloudscape = DBSystemKey.String("cloudscape")
+ // HyperSQL DataBase
+ DBSystemHSQLDB = DBSystemKey.String("hsqldb")
+ // Progress Database
+ DBSystemProgress = DBSystemKey.String("progress")
+ // SAP MaxDB
+ DBSystemMaxDB = DBSystemKey.String("maxdb")
+ // SAP HANA
+ DBSystemHanaDB = DBSystemKey.String("hanadb")
+ // Ingres
+ DBSystemIngres = DBSystemKey.String("ingres")
+ // FirstSQL
+ DBSystemFirstSQL = DBSystemKey.String("firstsql")
+ // EnterpriseDB
+ DBSystemEDB = DBSystemKey.String("edb")
+ // InterSystems Caché
+ DBSystemCache = DBSystemKey.String("cache")
+ // Adabas (Adaptable Database System)
+ DBSystemAdabas = DBSystemKey.String("adabas")
+ // Firebird
+ DBSystemFirebird = DBSystemKey.String("firebird")
+ // Apache Derby
+ DBSystemDerby = DBSystemKey.String("derby")
+ // FileMaker
+ DBSystemFilemaker = DBSystemKey.String("filemaker")
+ // Informix
+ DBSystemInformix = DBSystemKey.String("informix")
+ // InstantDB
+ DBSystemInstantDB = DBSystemKey.String("instantdb")
+ // InterBase
+ DBSystemInterbase = DBSystemKey.String("interbase")
+ // MariaDB
+ DBSystemMariaDB = DBSystemKey.String("mariadb")
+ // Netezza
+ DBSystemNetezza = DBSystemKey.String("netezza")
+ // Pervasive PSQL
+ DBSystemPervasive = DBSystemKey.String("pervasive")
+ // PointBase
+ DBSystemPointbase = DBSystemKey.String("pointbase")
+ // SQLite
+ DBSystemSqlite = DBSystemKey.String("sqlite")
+ // Sybase
+ DBSystemSybase = DBSystemKey.String("sybase")
+ // Teradata
+ DBSystemTeradata = DBSystemKey.String("teradata")
+ // Vertica
+ DBSystemVertica = DBSystemKey.String("vertica")
+ // H2
+ DBSystemH2 = DBSystemKey.String("h2")
+ // ColdFusion IMQ
+ DBSystemColdfusion = DBSystemKey.String("coldfusion")
+ // Apache Cassandra
+ DBSystemCassandra = DBSystemKey.String("cassandra")
+ // Apache HBase
+ DBSystemHBase = DBSystemKey.String("hbase")
+ // MongoDB
+ DBSystemMongoDB = DBSystemKey.String("mongodb")
+ // Redis
+ DBSystemRedis = DBSystemKey.String("redis")
+ // Couchbase
+ DBSystemCouchbase = DBSystemKey.String("couchbase")
+ // CouchDB
+ DBSystemCouchDB = DBSystemKey.String("couchdb")
+ // Microsoft Azure Cosmos DB
+ DBSystemCosmosDB = DBSystemKey.String("cosmosdb")
+ // Amazon DynamoDB
+ DBSystemDynamoDB = DBSystemKey.String("dynamodb")
+ // Neo4j
+ DBSystemNeo4j = DBSystemKey.String("neo4j")
+ // Apache Geode
+ DBSystemGeode = DBSystemKey.String("geode")
+ // Elasticsearch
+ DBSystemElasticsearch = DBSystemKey.String("elasticsearch")
+ // Memcached
+ DBSystemMemcached = DBSystemKey.String("memcached")
+ // CockroachDB
+ DBSystemCockroachdb = DBSystemKey.String("cockroachdb")
+ // OpenSearch
+ DBSystemOpensearch = DBSystemKey.String("opensearch")
+ // ClickHouse
+ DBSystemClickhouse = DBSystemKey.String("clickhouse")
+ // Cloud Spanner
+ DBSystemSpanner = DBSystemKey.String("spanner")
+ // Trino
+ DBSystemTrino = DBSystemKey.String("trino")
+)
+
+// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the
+// "db.cassandra.coordinator.dc" semantic conventions. It represents the data
+// center of the coordinating node for a query.
+func DBCassandraCoordinatorDC(val string) attribute.KeyValue {
+ return DBCassandraCoordinatorDCKey.String(val)
+}
+
+// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the
+// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of
+// the coordinating node for a query.
+func DBCassandraCoordinatorID(val string) attribute.KeyValue {
+ return DBCassandraCoordinatorIDKey.String(val)
+}
+
+// DBCassandraIdempotence returns an attribute KeyValue conforming to the
+// "db.cassandra.idempotence" semantic conventions. It represents the whether
+// or not the query is idempotent.
+func DBCassandraIdempotence(val bool) attribute.KeyValue {
+ return DBCassandraIdempotenceKey.Bool(val)
+}
+
+// DBCassandraPageSize returns an attribute KeyValue conforming to the
+// "db.cassandra.page_size" semantic conventions. It represents the fetch size
+// used for paging, i.e. how many rows will be returned at once.
+func DBCassandraPageSize(val int) attribute.KeyValue {
+ return DBCassandraPageSizeKey.Int(val)
+}
+
+// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue
+// conforming to the "db.cassandra.speculative_execution_count" semantic
+// conventions. It represents the number of times a query was speculatively
+// executed. Not set or `0` if the query was not executed speculatively.
+func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue {
+ return DBCassandraSpeculativeExecutionCountKey.Int(val)
+}
+
+// DBCassandraTable returns an attribute KeyValue conforming to the
+// "db.cassandra.table" semantic conventions. It represents the name of the
+// primary Cassandra table that the operation is acting upon, including the
+// keyspace name (if applicable).
+func DBCassandraTable(val string) attribute.KeyValue {
+ return DBCassandraTableKey.String(val)
+}
+
+// DBConnectionString returns an attribute KeyValue conforming to the
+// "db.connection_string" semantic conventions. It represents the connection
+// string used to connect to the database. It is recommended to remove embedded
+// credentials.
+func DBConnectionString(val string) attribute.KeyValue {
+ return DBConnectionStringKey.String(val)
+}
+
+// DBCosmosDBClientID returns an attribute KeyValue conforming to the
+// "db.cosmosdb.client_id" semantic conventions. It represents the unique
+// Cosmos client instance id.
+func DBCosmosDBClientID(val string) attribute.KeyValue {
+ return DBCosmosDBClientIDKey.String(val)
+}
+
+// DBCosmosDBContainer returns an attribute KeyValue conforming to the
+// "db.cosmosdb.container" semantic conventions. It represents the cosmos DB
+// container name.
+func DBCosmosDBContainer(val string) attribute.KeyValue {
+ return DBCosmosDBContainerKey.String(val)
+}
+
+// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the
+// "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+// consumed for that operation
+func DBCosmosDBRequestCharge(val float64) attribute.KeyValue {
+ return DBCosmosDBRequestChargeKey.Float64(val)
+}
+
+// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming
+// to the "db.cosmosdb.request_content_length" semantic conventions. It
+// represents the request payload size in bytes
+func DBCosmosDBRequestContentLength(val int) attribute.KeyValue {
+ return DBCosmosDBRequestContentLengthKey.Int(val)
+}
+
+// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB
+// status code.
+func DBCosmosDBStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBStatusCodeKey.Int(val)
+}
+
+// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos
+// DB sub status code.
+func DBCosmosDBSubStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBSubStatusCodeKey.Int(val)
+}
+
+// DBElasticsearchClusterName returns an attribute KeyValue conforming to
+// the "db.elasticsearch.cluster.name" semantic conventions. It represents the
+// represents the identifier of an Elasticsearch cluster.
+func DBElasticsearchClusterName(val string) attribute.KeyValue {
+ return DBElasticsearchClusterNameKey.String(val)
+}
+
+// DBElasticsearchNodeName returns an attribute KeyValue conforming to the
+// "db.elasticsearch.node.name" semantic conventions. It represents the
+// represents the human-readable identifier of the node/instance to which a
+// request was routed.
+func DBElasticsearchNodeName(val string) attribute.KeyValue {
+ return DBElasticsearchNodeNameKey.String(val)
+}
+
+// DBInstanceID returns an attribute KeyValue conforming to the
+// "db.instance.id" semantic conventions. It represents an identifier (address,
+// unique name, or any other identifier) of the database instance that is
+// executing queries or mutations on the current connection. This is useful in
+// cases where the database is running in a clustered environment and the
+// instrumentation is able to record the node executing the query. The client
+// may obtain this value in databases like MySQL using queries like `select
+// @@hostname`.
+func DBInstanceID(val string) attribute.KeyValue {
+ return DBInstanceIDKey.String(val)
+}
+
+// DBJDBCDriverClassname returns an attribute KeyValue conforming to the
+// "db.jdbc.driver_classname" semantic conventions. It represents the
+// fully-qualified class name of the [Java Database Connectivity
+// (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver
+// used to connect.
+func DBJDBCDriverClassname(val string) attribute.KeyValue {
+ return DBJDBCDriverClassnameKey.String(val)
+}
+
+// DBMongoDBCollection returns an attribute KeyValue conforming to the
+// "db.mongodb.collection" semantic conventions. It represents the MongoDB
+// collection being accessed within the database stated in `db.name`.
+func DBMongoDBCollection(val string) attribute.KeyValue {
+ return DBMongoDBCollectionKey.String(val)
+}
+
+// DBMSSQLInstanceName returns an attribute KeyValue conforming to the
+// "db.mssql.instance_name" semantic conventions. It represents the Microsoft
+// SQL Server [instance
+// name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
+// connecting to. This name is used to determine the port of a named instance.
+func DBMSSQLInstanceName(val string) attribute.KeyValue {
+ return DBMSSQLInstanceNameKey.String(val)
+}
+
+// DBName returns an attribute KeyValue conforming to the "db.name" semantic
+// conventions. It represents the this attribute is used to report the name of
+// the database being accessed. For commands that switch the database, this
+// should be set to the target database (even if the command fails).
+func DBName(val string) attribute.KeyValue {
+ return DBNameKey.String(val)
+}
+
+// DBOperation returns an attribute KeyValue conforming to the
+// "db.operation" semantic conventions. It represents the name of the operation
+// being executed, e.g. the [MongoDB command
+// name](https://docs.mongodb.com/manual/reference/command/#database-operations)
+// such as `findAndModify`, or the SQL keyword.
+func DBOperation(val string) attribute.KeyValue {
+ return DBOperationKey.String(val)
+}
+
+// DBRedisDBIndex returns an attribute KeyValue conforming to the
+// "db.redis.database_index" semantic conventions. It represents the index of
+// the database being accessed as used in the [`SELECT`
+// command](https://redis.io/commands/select), provided as an integer. To be
+// used instead of the generic `db.name` attribute.
+func DBRedisDBIndex(val int) attribute.KeyValue {
+ return DBRedisDBIndexKey.Int(val)
+}
+
+// DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table"
+// semantic conventions. It represents the name of the primary table that the
+// operation is acting upon, including the database name (if applicable).
+func DBSQLTable(val string) attribute.KeyValue {
+ return DBSQLTableKey.String(val)
+}
+
+// DBStatement returns an attribute KeyValue conforming to the
+// "db.statement" semantic conventions. It represents the database statement
+// being executed.
+func DBStatement(val string) attribute.KeyValue {
+ return DBStatementKey.String(val)
+}
+
+// DBUser returns an attribute KeyValue conforming to the "db.user" semantic
+// conventions. It represents the username for accessing the database.
+func DBUser(val string) attribute.KeyValue {
+ return DBUserKey.String(val)
+}
+
+// Describes deprecated HTTP attributes.
+const (
+ // HTTPFlavorKey is the attribute Key conforming to the "http.flavor"
+ // semantic conventions.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorKey = attribute.Key("http.flavor")
+
+ // HTTPMethodKey is the attribute Key conforming to the "http.method"
+ // semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'GET', 'POST', 'HEAD'
+ // Deprecated: use `http.request.method` instead.
+ HTTPMethodKey = attribute.Key("http.method")
+
+ // HTTPRequestContentLengthKey is the attribute Key conforming to the
+ // "http.request_content_length" semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 3495
+ // Deprecated: use `http.request.header.content-length` instead.
+ HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
+
+ // HTTPResponseContentLengthKey is the attribute Key conforming to the
+ // "http.response_content_length" semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 3495
+ // Deprecated: use `http.response.header.content-length` instead.
+ HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
+
+ // HTTPSchemeKey is the attribute Key conforming to the "http.scheme"
+ // semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'http', 'https'
+ // Deprecated: use `url.scheme` instead.
+ HTTPSchemeKey = attribute.Key("http.scheme")
+
+ // HTTPStatusCodeKey is the attribute Key conforming to the
+ // "http.status_code" semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 200
+ // Deprecated: use `http.response.status_code` instead.
+ HTTPStatusCodeKey = attribute.Key("http.status_code")
+
+ // HTTPTargetKey is the attribute Key conforming to the "http.target"
+ // semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '/search?q=OpenTelemetry#SemConv'
+ // Deprecated: use `url.path` and `url.query` instead.
+ HTTPTargetKey = attribute.Key("http.target")
+
+ // HTTPURLKey is the attribute Key conforming to the "http.url" semantic
+ // conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
+ // Deprecated: use `url.full` instead.
+ HTTPURLKey = attribute.Key("http.url")
+
+ // HTTPUserAgentKey is the attribute Key conforming to the
+ // "http.user_agent" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU
+ // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)
+ // Version/14.1.2 Mobile/15E148 Safari/604.1'
+ // Deprecated: use `user_agent.original` instead.
+ HTTPUserAgentKey = attribute.Key("http.user_agent")
+)
+
+var (
+ // HTTP/1.0
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorHTTP10 = HTTPFlavorKey.String("1.0")
+ // HTTP/1.1
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorHTTP11 = HTTPFlavorKey.String("1.1")
+ // HTTP/2
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorHTTP20 = HTTPFlavorKey.String("2.0")
+ // HTTP/3
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorHTTP30 = HTTPFlavorKey.String("3.0")
+ // SPDY protocol
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY")
+ // QUIC protocol
+ //
+ // Deprecated: use `network.protocol.name` instead.
+ HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC")
+)
+
+// HTTPMethod returns an attribute KeyValue conforming to the "http.method"
+// semantic conventions.
+//
+// Deprecated: use `http.request.method` instead.
+func HTTPMethod(val string) attribute.KeyValue {
+ return HTTPMethodKey.String(val)
+}
+
+// HTTPRequestContentLength returns an attribute KeyValue conforming to the
+// "http.request_content_length" semantic conventions.
+//
+// Deprecated: use `http.request.header.content-length` instead.
+func HTTPRequestContentLength(val int) attribute.KeyValue {
+ return HTTPRequestContentLengthKey.Int(val)
+}
+
+// HTTPResponseContentLength returns an attribute KeyValue conforming to the
+// "http.response_content_length" semantic conventions.
+//
+// Deprecated: use `http.response.header.content-length` instead.
+func HTTPResponseContentLength(val int) attribute.KeyValue {
+ return HTTPResponseContentLengthKey.Int(val)
+}
+
+// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme"
+// semantic conventions.
+//
+// Deprecated: use `url.scheme` instead.
+func HTTPScheme(val string) attribute.KeyValue {
+ return HTTPSchemeKey.String(val)
+}
+
+// HTTPStatusCode returns an attribute KeyValue conforming to the
+// "http.status_code" semantic conventions.
+//
+// Deprecated: use `http.response.status_code` instead.
+func HTTPStatusCode(val int) attribute.KeyValue {
+ return HTTPStatusCodeKey.Int(val)
+}
+
+// HTTPTarget returns an attribute KeyValue conforming to the "http.target"
+// semantic conventions.
+//
+// Deprecated: use `url.path` and `url.query` instead.
+func HTTPTarget(val string) attribute.KeyValue {
+ return HTTPTargetKey.String(val)
+}
+
+// HTTPURL returns an attribute KeyValue conforming to the "http.url"
+// semantic conventions.
+//
+// Deprecated: use `url.full` instead.
+func HTTPURL(val string) attribute.KeyValue {
+ return HTTPURLKey.String(val)
+}
+
+// HTTPUserAgent returns an attribute KeyValue conforming to the
+// "http.user_agent" semantic conventions.
+//
+// Deprecated: use `user_agent.original` instead.
+func HTTPUserAgent(val string) attribute.KeyValue {
+ return HTTPUserAgentKey.String(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetHostNameKey is the attribute Key conforming to the "net.host.name"
+ // semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'example.com'
+ // Deprecated: use `server.address`.
+ NetHostNameKey = attribute.Key("net.host.name")
+
+ // NetHostPortKey is the attribute Key conforming to the "net.host.port"
+ // semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 8080
+ // Deprecated: use `server.port`.
+ NetHostPortKey = attribute.Key("net.host.port")
+
+ // NetPeerNameKey is the attribute Key conforming to the "net.peer.name"
+ // semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'example.com'
+ // Deprecated: use `server.address` on client spans and `client.address` on
+ // server spans.
+ NetPeerNameKey = attribute.Key("net.peer.name")
+
+ // NetPeerPortKey is the attribute Key conforming to the "net.peer.port"
+ // semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 8080
+ // Deprecated: use `server.port` on client spans and `client.port` on
+ // server spans.
+ NetPeerPortKey = attribute.Key("net.peer.port")
+
+ // NetProtocolNameKey is the attribute Key conforming to the
+ // "net.protocol.name" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'amqp', 'http', 'mqtt'
+ // Deprecated: use `network.protocol.name`.
+ NetProtocolNameKey = attribute.Key("net.protocol.name")
+
+ // NetProtocolVersionKey is the attribute Key conforming to the
+ // "net.protocol.version" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '3.1.1'
+ // Deprecated: use `network.protocol.version`.
+ NetProtocolVersionKey = attribute.Key("net.protocol.version")
+
+ // NetSockFamilyKey is the attribute Key conforming to the
+ // "net.sock.family" semantic conventions.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Deprecated: use `network.transport` and `network.type`.
+ NetSockFamilyKey = attribute.Key("net.sock.family")
+
+ // NetSockHostAddrKey is the attribute Key conforming to the
+ // "net.sock.host.addr" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '/var/my.sock'
+ // Deprecated: use `network.local.address`.
+ NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
+
+ // NetSockHostPortKey is the attribute Key conforming to the
+ // "net.sock.host.port" semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 8080
+ // Deprecated: use `network.local.port`.
+ NetSockHostPortKey = attribute.Key("net.sock.host.port")
+
+ // NetSockPeerAddrKey is the attribute Key conforming to the
+ // "net.sock.peer.addr" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '192.168.0.1'
+ // Deprecated: use `network.peer.address`.
+ NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
+
+ // NetSockPeerNameKey is the attribute Key conforming to the
+ // "net.sock.peer.name" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '/var/my.sock'
+ // Deprecated: no replacement at this time.
+ NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
+
+ // NetSockPeerPortKey is the attribute Key conforming to the
+ // "net.sock.peer.port" semantic conventions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 65531
+ // Deprecated: use `network.peer.port`.
+ NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
+
+ // NetTransportKey is the attribute Key conforming to the "net.transport"
+ // semantic conventions.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Deprecated: use `network.transport`.
+ NetTransportKey = attribute.Key("net.transport")
+)
+
+var (
+ // IPv4 address
+ //
+ // Deprecated: use `network.transport` and `network.type`.
+ NetSockFamilyInet = NetSockFamilyKey.String("inet")
+ // IPv6 address
+ //
+ // Deprecated: use `network.transport` and `network.type`.
+ NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
+ // Unix domain socket path
+ //
+ // Deprecated: use `network.transport` and `network.type`.
+ NetSockFamilyUnix = NetSockFamilyKey.String("unix")
+)
+
+var (
+ // ip_tcp
+ //
+ // Deprecated: use `network.transport`.
+ NetTransportTCP = NetTransportKey.String("ip_tcp")
+ // ip_udp
+ //
+ // Deprecated: use `network.transport`.
+ NetTransportUDP = NetTransportKey.String("ip_udp")
+ // Named or anonymous pipe
+ //
+ // Deprecated: use `network.transport`.
+ NetTransportPipe = NetTransportKey.String("pipe")
+ // In-process communication
+ //
+ // Deprecated: use `network.transport`.
+ NetTransportInProc = NetTransportKey.String("inproc")
+ // Something else (non IP-based)
+ //
+ // Deprecated: use `network.transport`.
+ NetTransportOther = NetTransportKey.String("other")
+)
+
+// NetHostName returns an attribute KeyValue conforming to the
+// "net.host.name" semantic conventions.
+//
+// Deprecated: use `server.address`.
+func NetHostName(val string) attribute.KeyValue {
+ return NetHostNameKey.String(val)
+}
+
+// NetHostPort returns an attribute KeyValue conforming to the
+// "net.host.port" semantic conventions.
+//
+// Deprecated: use `server.port`.
+func NetHostPort(val int) attribute.KeyValue {
+ return NetHostPortKey.Int(val)
+}
+
+// NetPeerName returns an attribute KeyValue conforming to the
+// "net.peer.name" semantic conventions.
+//
+// Deprecated: use `server.address` on client spans and `client.address` on
+// server spans.
+func NetPeerName(val string) attribute.KeyValue {
+ return NetPeerNameKey.String(val)
+}
+
+// NetPeerPort returns an attribute KeyValue conforming to the
+// "net.peer.port" semantic conventions.
+//
+// Deprecated: use `server.port` on client spans and `client.port` on server
+// spans.
+func NetPeerPort(val int) attribute.KeyValue {
+ return NetPeerPortKey.Int(val)
+}
+
+// NetProtocolName returns an attribute KeyValue conforming to the
+// "net.protocol.name" semantic conventions.
+//
+// Deprecated: use `network.protocol.name`.
+func NetProtocolName(val string) attribute.KeyValue {
+ return NetProtocolNameKey.String(val)
+}
+
+// NetProtocolVersion returns an attribute KeyValue conforming to the
+// "net.protocol.version" semantic conventions.
+//
+// Deprecated: use `network.protocol.version`.
+func NetProtocolVersion(val string) attribute.KeyValue {
+ return NetProtocolVersionKey.String(val)
+}
+
+// NetSockHostAddr returns an attribute KeyValue conforming to the
+// "net.sock.host.addr" semantic conventions.
+//
+// Deprecated: use `network.local.address`.
+func NetSockHostAddr(val string) attribute.KeyValue {
+ return NetSockHostAddrKey.String(val)
+}
+
+// NetSockHostPort returns an attribute KeyValue conforming to the
+// "net.sock.host.port" semantic conventions.
+//
+// Deprecated: use `network.local.port`.
+func NetSockHostPort(val int) attribute.KeyValue {
+ return NetSockHostPortKey.Int(val)
+}
+
+// NetSockPeerAddr returns an attribute KeyValue conforming to the
+// "net.sock.peer.addr" semantic conventions.
+//
+// Deprecated: use `network.peer.address`.
+func NetSockPeerAddr(val string) attribute.KeyValue {
+ return NetSockPeerAddrKey.String(val)
+}
+
+// NetSockPeerName returns an attribute KeyValue conforming to the
+// "net.sock.peer.name" semantic conventions.
+//
+// Deprecated: no replacement at this time.
+func NetSockPeerName(val string) attribute.KeyValue {
+ return NetSockPeerNameKey.String(val)
+}
+
+// NetSockPeerPort returns an attribute KeyValue conforming to the
+// "net.sock.peer.port" semantic conventions.
+//
+// Deprecated: use `network.peer.port`.
+func NetSockPeerPort(val int) attribute.KeyValue {
+ return NetSockPeerPortKey.Int(val)
+}
+
+// These attributes may be used to describe the receiver of a network
+// exchange/packet. These should be used when there is no client/server
+// relationship between the two sides, or when that relationship is unknown.
+// This covers low-level network interactions (e.g. packet tracing) where you
+// don't know if there was a connection or which side initiated it. This also
+// covers unidirectional UDP flows and peer-to-peer communication where the
+// "user-facing" surface of the protocol / API doesn't expose a clear notion of
+// client and server.
+const (
+ // DestinationAddressKey is the attribute Key conforming to the
+ // "destination.address" semantic conventions. It represents the
+ // destination address - domain name if available without reverse DNS
+ // lookup; otherwise, IP address or Unix domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'destination.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the source side, and when communicating through
+ // an intermediary, `destination.address` SHOULD represent the destination
+ // address behind any intermediaries, for example proxies, if it's
+ // available.
+ DestinationAddressKey = attribute.Key("destination.address")
+
+ // DestinationPortKey is the attribute Key conforming to the
+ // "destination.port" semantic conventions. It represents the destination
+ // port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3389, 2888
+ DestinationPortKey = attribute.Key("destination.port")
+)
+
+// DestinationAddress returns an attribute KeyValue conforming to the
+// "destination.address" semantic conventions. It represents the destination
+// address - domain name if available without reverse DNS lookup; otherwise, IP
+// address or Unix domain socket name.
+func DestinationAddress(val string) attribute.KeyValue {
+ return DestinationAddressKey.String(val)
+}
+
+// DestinationPort returns an attribute KeyValue conforming to the
+// "destination.port" semantic conventions. It represents the destination port
+// number
+func DestinationPort(val int) attribute.KeyValue {
+ return DestinationPortKey.Int(val)
+}
+
+// These attributes may be used for any disk related operation.
+const (
+ // DiskIoDirectionKey is the attribute Key conforming to the
+ // "disk.io.direction" semantic conventions. It represents the disk IO
+ // operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'read'
+ DiskIoDirectionKey = attribute.Key("disk.io.direction")
+)
+
+var (
+ // read
+ DiskIoDirectionRead = DiskIoDirectionKey.String("read")
+ // write
+ DiskIoDirectionWrite = DiskIoDirectionKey.String("write")
+)
+
+// The shared attributes used to report an error.
+const (
+ // ErrorTypeKey is the attribute Key conforming to the "error.type"
+ // semantic conventions. It represents the describes a class of error the
+ // operation ended with.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'timeout', 'java.net.UnknownHostException',
+ // 'server_certificate_invalid', '500'
+ // Note: The `error.type` SHOULD be predictable and SHOULD have low
+ // cardinality.
+ // Instrumentations SHOULD document the list of errors they report.
+ //
+ // The cardinality of `error.type` within one instrumentation library
+ // SHOULD be low.
+ // Telemetry consumers that aggregate data from multiple instrumentation
+ // libraries and applications
+ // should be prepared for `error.type` to have high cardinality at query
+ // time when no
+ // additional filters are applied.
+ //
+ // If the operation has completed successfully, instrumentations SHOULD NOT
+ // set `error.type`.
+ //
+ // If a specific domain defines its own set of error identifiers (such as
+ // HTTP or gRPC status codes),
+ // it's RECOMMENDED to:
+ //
+ // * Use a domain-specific attribute
+ // * Set `error.type` to capture all errors, regardless of whether they are
+ // defined within the domain-specific set or not.
+ ErrorTypeKey = attribute.Key("error.type")
+)
+
+var (
+ // A fallback error value to be used when the instrumentation doesn't define a custom value
+ ErrorTypeOther = ErrorTypeKey.String("_OTHER")
+)
+
+// The shared attributes used to report a single exception associated with a
+// span or log.
+const (
+ // ExceptionEscapedKey is the attribute Key conforming to the
+ // "exception.escaped" semantic conventions. It represents the sHOULD be
+ // set to true if the exception event is recorded at a point where it is
+ // known that the exception is escaping the scope of the span.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: An exception is considered to have escaped (or left) the scope of
+ // a span,
+ // if that span is ended while the exception is still logically "in
+ // flight".
+ // This may be actually "in flight" in some languages (e.g. if the
+ // exception
+ // is passed to a Context manager's `__exit__` method in Python) but will
+ // usually be caught at the point of recording the exception in most
+ // languages.
+ //
+ // It is usually not possible to determine at the point where an exception
+ // is thrown
+ // whether it will escape the scope of a span.
+ // However, it is trivial to know that an exception
+ // will escape, if one checks for an active exception just before ending
+ // the span,
+ // as done in the [example for recording span
+ // exceptions](#recording-an-exception).
+ //
+ // It follows that an exception may still escape the scope of the span
+ // even if the `exception.escaped` attribute was not set or set to false,
+ // since the event might have been recorded at a time where it was not
+ // clear whether the exception will escape.
+ ExceptionEscapedKey = attribute.Key("exception.escaped")
+
+ // ExceptionMessageKey is the attribute Key conforming to the
+ // "exception.message" semantic conventions. It represents the exception
+ // message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Division by zero', "Can't convert 'int' object to str
+ // implicitly"
+ ExceptionMessageKey = attribute.Key("exception.message")
+
+ // ExceptionStacktraceKey is the attribute Key conforming to the
+ // "exception.stacktrace" semantic conventions. It represents a stacktrace
+ // as a string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test
+ // exception\\n at '
+ // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
+
+ // ExceptionTypeKey is the attribute Key conforming to the "exception.type"
+ // semantic conventions. It represents the type of the exception (its
+ // fully-qualified class name, if applicable). The dynamic type of the
+ // exception should be preferred over the static type in languages that
+ // support it.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'java.net.ConnectException', 'OSError'
+ ExceptionTypeKey = attribute.Key("exception.type")
+)
+
+// ExceptionEscaped returns an attribute KeyValue conforming to the
+// "exception.escaped" semantic conventions. It represents the sHOULD be set to
+// true if the exception event is recorded at a point where it is known that
+// the exception is escaping the scope of the span.
+func ExceptionEscaped(val bool) attribute.KeyValue {
+ return ExceptionEscapedKey.Bool(val)
+}
+
+// ExceptionMessage returns an attribute KeyValue conforming to the
+// "exception.message" semantic conventions. It represents the exception
+// message.
+func ExceptionMessage(val string) attribute.KeyValue {
+ return ExceptionMessageKey.String(val)
+}
+
+// ExceptionStacktrace returns an attribute KeyValue conforming to the
+// "exception.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func ExceptionStacktrace(val string) attribute.KeyValue {
+ return ExceptionStacktraceKey.String(val)
+}
+
+// ExceptionType returns an attribute KeyValue conforming to the
+// "exception.type" semantic conventions. It represents the type of the
+// exception (its fully-qualified class name, if applicable). The dynamic type
+// of the exception should be preferred over the static type in languages that
+// support it.
+func ExceptionType(val string) attribute.KeyValue {
+ return ExceptionTypeKey.String(val)
+}
+
+// Semantic convention attributes in the HTTP namespace.
+const (
+ // HTTPRequestBodySizeKey is the attribute Key conforming to the
+ // "http.request.body.size" semantic conventions. It represents the size of
+ // the request payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3495
+ HTTPRequestBodySizeKey = attribute.Key("http.request.body.size")
+
+ // HTTPRequestMethodKey is the attribute Key conforming to the
+ // "http.request.method" semantic conventions. It represents the hTTP
+ // request method.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'GET', 'POST', 'HEAD'
+ // Note: HTTP request method value SHOULD be "known" to the
+ // instrumentation.
+ // By default, this convention defines "known" methods as the ones listed
+ // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
+ // and the PATCH method defined in
+ // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
+ //
+ // If the HTTP request method is not known to instrumentation, it MUST set
+ // the `http.request.method` attribute to `_OTHER`.
+ //
+ // If the HTTP instrumentation could end up converting valid HTTP request
+ // methods to `_OTHER`, then it MUST provide a way to override
+ // the list of known HTTP methods. If this override is done via environment
+ // variable, then the environment variable MUST be named
+ // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated
+ // list of case-sensitive known HTTP methods
+ // (this list MUST be a full override of the default known method, it is
+ // not a list of known methods in addition to the defaults).
+ //
+ // HTTP method names are case-sensitive and `http.request.method` attribute
+ // value MUST match a known HTTP method name exactly.
+ // Instrumentations for specific web frameworks that consider HTTP methods
+ // to be case insensitive, SHOULD populate a canonical equivalent.
+ // Tracing instrumentations that do so, MUST also set
+ // `http.request.method_original` to the original value.
+ HTTPRequestMethodKey = attribute.Key("http.request.method")
+
+ // HTTPRequestMethodOriginalKey is the attribute Key conforming to the
+ // "http.request.method_original" semantic conventions. It represents the
+ // original HTTP method sent by the client in the request line.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'GeT', 'ACL', 'foo'
+ HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original")
+
+ // HTTPRequestResendCountKey is the attribute Key conforming to the
+ // "http.request.resend_count" semantic conventions. It represents the
+ // ordinal number of request resending attempt (for any reason, including
+ // redirects).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3
+ // Note: The resend count SHOULD be updated each time an HTTP request gets
+ // resent by the client, regardless of what was the cause of the resending
+ // (e.g. redirection, authorization failure, 503 Server Unavailable,
+ // network issues, or any other).
+ HTTPRequestResendCountKey = attribute.Key("http.request.resend_count")
+
+ // HTTPResponseBodySizeKey is the attribute Key conforming to the
+ // "http.response.body.size" semantic conventions. It represents the size
+ // of the response payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3495
+ HTTPResponseBodySizeKey = attribute.Key("http.response.body.size")
+
+ // HTTPResponseStatusCodeKey is the attribute Key conforming to the
+ // "http.response.status_code" semantic conventions. It represents the
+ // [HTTP response status
+ // code](https://tools.ietf.org/html/rfc7231#section-6).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 200
+ HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code")
+
+ // HTTPRouteKey is the attribute Key conforming to the "http.route"
+ // semantic conventions. It represents the matched route, that is, the path
+ // template in the format used by the respective server framework.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
+ // Note: MUST NOT be populated when this is not supported by the HTTP
+ // server framework as the route attribute should have low-cardinality and
+ // the URI path can NOT substitute it.
+ // SHOULD include the [application
+ // root](/docs/http/http-spans.md#http-server-definitions) if there is one.
+ HTTPRouteKey = attribute.Key("http.route")
+)
+
+var (
+ // CONNECT method
+ HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT")
+ // DELETE method
+ HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE")
+ // GET method
+ HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET")
+ // HEAD method
+ HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD")
+ // OPTIONS method
+ HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS")
+ // PATCH method
+ HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH")
+ // POST method
+ HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST")
+ // PUT method
+ HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT")
+ // TRACE method
+ HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE")
+ // Any HTTP method that the instrumentation has no prior knowledge of
+ HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER")
+)
+
+// HTTPRequestBodySize returns an attribute KeyValue conforming to the
+// "http.request.body.size" semantic conventions. It represents the size of the
+// request payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPRequestBodySize(val int) attribute.KeyValue {
+ return HTTPRequestBodySizeKey.Int(val)
+}
+
+// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the
+// "http.request.method_original" semantic conventions. It represents the
+// original HTTP method sent by the client in the request line.
+func HTTPRequestMethodOriginal(val string) attribute.KeyValue {
+ return HTTPRequestMethodOriginalKey.String(val)
+}
+
+// HTTPRequestResendCount returns an attribute KeyValue conforming to the
+// "http.request.resend_count" semantic conventions. It represents the ordinal
+// number of request resending attempt (for any reason, including redirects).
+func HTTPRequestResendCount(val int) attribute.KeyValue {
+ return HTTPRequestResendCountKey.Int(val)
+}
+
+// HTTPResponseBodySize returns an attribute KeyValue conforming to the
+// "http.response.body.size" semantic conventions. It represents the size of
+// the response payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPResponseBodySize(val int) attribute.KeyValue {
+ return HTTPResponseBodySizeKey.Int(val)
+}
+
+// HTTPResponseStatusCode returns an attribute KeyValue conforming to the
+// "http.response.status_code" semantic conventions. It represents the [HTTP
+// response status code](https://tools.ietf.org/html/rfc7231#section-6).
+func HTTPResponseStatusCode(val int) attribute.KeyValue {
+ return HTTPResponseStatusCodeKey.Int(val)
+}
+
+// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
+// semantic conventions. It represents the matched route, that is, the path
+// template in the format used by the respective server framework.
+func HTTPRoute(val string) attribute.KeyValue {
+ return HTTPRouteKey.String(val)
+}
+
+// Attributes describing telemetry around messaging systems and messaging
+// activities.
+const (
+ // MessagingBatchMessageCountKey is the attribute Key conforming to the
+ // "messaging.batch.message_count" semantic conventions. It represents the
+ // number of messages sent, received, or processed in the scope of the
+ // batching operation.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1, 2
+ // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on
+ // spans that operate with a single message. When a messaging client
+ // library supports both batch and single-message API for the same
+ // operation, instrumentations SHOULD use `messaging.batch.message_count`
+ // for batching APIs and SHOULD NOT use it for single-message APIs.
+ MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
+
+ // MessagingClientIDKey is the attribute Key conforming to the
+ // "messaging.client_id" semantic conventions. It represents a unique
+ // identifier for the client that consumes or produces a message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'client-5', 'myhost@8742@s8083jm'
+ MessagingClientIDKey = attribute.Key("messaging.client_id")
+
+ // MessagingDestinationAnonymousKey is the attribute Key conforming to the
+ // "messaging.destination.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message destination is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
+
+ // MessagingDestinationNameKey is the attribute Key conforming to the
+ // "messaging.destination.name" semantic conventions. It represents the
+ // message destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Destination name SHOULD uniquely identify a specific queue, topic
+ // or other entity within the broker. If
+ // the broker doesn't have such notion, the destination name SHOULD
+ // uniquely identify the broker.
+ MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
+
+ // MessagingDestinationTemplateKey is the attribute Key conforming to the
+ // "messaging.destination.template" semantic conventions. It represents the
+ // low cardinality representation of the messaging destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/customers/{customerID}'
+ // Note: Destination names could be constructed from templates. An example
+ // would be a destination name involving a user name or product id.
+ // Although the destination name in this case is of high cardinality, the
+ // underlying template is of low cardinality and can be effectively used
+ // for grouping and aggregation.
+ MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
+
+ // MessagingDestinationTemporaryKey is the attribute Key conforming to the
+ // "messaging.destination.temporary" semantic conventions. It represents a
+ // boolean that is true if the message destination is temporary and might
+ // not exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
+
+ // MessagingDestinationPublishAnonymousKey is the attribute Key conforming
+ // to the "messaging.destination_publish.anonymous" semantic conventions.
+ // It represents a boolean that is true if the publish message destination
+ // is anonymous (could be unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationPublishAnonymousKey = attribute.Key("messaging.destination_publish.anonymous")
+
+ // MessagingDestinationPublishNameKey is the attribute Key conforming to
+ // the "messaging.destination_publish.name" semantic conventions. It
+ // represents the name of the original destination the message was
+ // published to
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: The name SHOULD uniquely identify a specific queue, topic, or
+ // other entity within the broker. If
+ // the broker doesn't have such notion, the original destination name
+ // SHOULD uniquely identify the broker.
+ MessagingDestinationPublishNameKey = attribute.Key("messaging.destination_publish.name")
+
+ // MessagingGCPPubsubMessageOrderingKeyKey is the attribute Key conforming
+ // to the "messaging.gcp_pubsub.message.ordering_key" semantic conventions.
+ // It represents the ordering key for a given message. If the attribute is
+ // not present, the message does not have an ordering key.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ordering_key'
+ MessagingGCPPubsubMessageOrderingKeyKey = attribute.Key("messaging.gcp_pubsub.message.ordering_key")
+
+ // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
+ // "messaging.kafka.consumer.group" semantic conventions. It represents the
+ // name of the Kafka Consumer Group that is handling the message. Only
+ // applies to consumers, not producers.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-group'
+ MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
+
+ // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to
+ // the "messaging.kafka.destination.partition" semantic conventions. It
+ // represents the partition the message is sent to.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2
+ MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
+
+ // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
+ // "messaging.kafka.message.key" semantic conventions. It represents the
+ // message keys in Kafka are used for grouping alike messages to ensure
+ // they're processed on the same partition. They differ from
+ // `messaging.message.id` in that they're not unique. If the key is `null`,
+ // the attribute MUST NOT be set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myKey'
+ // Note: If the key type is not string, it's string representation has to
+ // be supplied for the attribute. If the key has no unambiguous, canonical
+ // string form, don't include its value.
+ MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
+
+ // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
+ // "messaging.kafka.message.offset" semantic conventions. It represents the
+ // offset of a record in the corresponding Kafka partition.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
+
+ // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
+ // "messaging.kafka.message.tombstone" semantic conventions. It represents
+ // a boolean that is true if the message is a tombstone.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
+
+ // MessagingMessageBodySizeKey is the attribute Key conforming to the
+ // "messaging.message.body.size" semantic conventions. It represents the
+ // size of the message body in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1439
+ // Note: This can refer to both the compressed or uncompressed body size.
+ // If both sizes are known, the uncompressed
+ // body size should be used.
+ MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size")
+
+ // MessagingMessageConversationIDKey is the attribute Key conforming to the
+ // "messaging.message.conversation_id" semantic conventions. It represents
+ // the conversation ID identifying the conversation to which the message
+ // belongs, represented as a string. Sometimes called "Correlation ID".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyConversationID'
+ MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
+
+ // MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the
+ // "messaging.message.envelope.size" semantic conventions. It represents
+ // the size of the message body and metadata in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2738
+ // Note: This can refer to both the compressed or uncompressed size. If
+ // both sizes are known, the uncompressed
+ // size should be used.
+ MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size")
+
+ // MessagingMessageIDKey is the attribute Key conforming to the
+ // "messaging.message.id" semantic conventions. It represents a value used
+ // by the messaging system as an identifier for the message, represented as
+ // a string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
+ MessagingMessageIDKey = attribute.Key("messaging.message.id")
+
+ // MessagingOperationKey is the attribute Key conforming to the
+ // "messaging.operation" semantic conventions. It represents a string
+ // identifying the kind of messaging operation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: If a custom value is used, it MUST be of low cardinality.
+ MessagingOperationKey = attribute.Key("messaging.operation")
+
+ // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
+ // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+ // conventions. It represents the rabbitMQ message routing key.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myKey'
+ MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
+
+ // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_group" semantic conventions. It represents
+ // the name of the RocketMQ producer/consumer group that is handling the
+ // message. The client type is identified by the SpanKind.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myConsumerGroup'
+ MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
+
+ // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
+ // the "messaging.rocketmq.consumption_model" semantic conventions. It
+ // represents the model of message consumption. This only applies to
+ // consumer spans.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
+
+ // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+ // conventions. It represents the delay time level for delay message, which
+ // determines the message delay time.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3
+ MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
+
+ // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delivery_timestamp"
+ // semantic conventions. It represents the timestamp in milliseconds that
+ // the delay message is expected to be delivered to consumer.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1665987217045
+ MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
+
+ // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.group" semantic conventions. It represents
+ // the it is essential for FIFO message. Messages that belong to the same
+ // message group are always processed one by one within the same consumer
+ // group.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myMessageGroup'
+ MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
+
+ // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.keys" semantic conventions. It represents
+ // the key(s) of message, another way to mark message besides message id.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'keyA', 'keyB'
+ MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
+
+ // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.tag" semantic conventions. It represents the
+ // secondary classifier of message besides topic.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'tagA'
+ MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
+
+ // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.type" semantic conventions. It represents
+ // the type of message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
+
+ // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
+ // "messaging.rocketmq.namespace" semantic conventions. It represents the
+ // namespace of RocketMQ resources, resources in different namespaces are
+ // individual.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myNamespace'
+ MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
+
+ // MessagingSystemKey is the attribute Key conforming to the
+ // "messaging.system" semantic conventions. It represents an identifier for
+ // the messaging system being used. See below for a list of well-known
+ // identifiers.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingSystemKey = attribute.Key("messaging.system")
+)
+
+var (
+ // One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created
+ MessagingOperationPublish = MessagingOperationKey.String("publish")
+ // A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios
+ MessagingOperationCreate = MessagingOperationKey.String("create")
+ // One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages
+ MessagingOperationReceive = MessagingOperationKey.String("receive")
+ // One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs
+ MessagingOperationDeliver = MessagingOperationKey.String("deliver")
+)
+
+var (
+ // Clustering consumption model
+ MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
+ // Broadcasting consumption model
+ MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
+)
+
+var (
+ // Normal message
+ MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
+ // FIFO message
+ MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
+ // Delay message
+ MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
+ // Transaction message
+ MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
+)
+
+var (
+ // Apache ActiveMQ
+ MessagingSystemActivemq = MessagingSystemKey.String("activemq")
+ // Amazon Simple Queue Service (SQS)
+ MessagingSystemAWSSqs = MessagingSystemKey.String("aws_sqs")
+ // Azure Event Grid
+ MessagingSystemAzureEventgrid = MessagingSystemKey.String("azure_eventgrid")
+ // Azure Event Hubs
+ MessagingSystemAzureEventhubs = MessagingSystemKey.String("azure_eventhubs")
+ // Azure Service Bus
+ MessagingSystemAzureServicebus = MessagingSystemKey.String("azure_servicebus")
+ // Google Cloud Pub/Sub
+ MessagingSystemGCPPubsub = MessagingSystemKey.String("gcp_pubsub")
+ // Java Message Service
+ MessagingSystemJms = MessagingSystemKey.String("jms")
+ // Apache Kafka
+ MessagingSystemKafka = MessagingSystemKey.String("kafka")
+ // RabbitMQ
+ MessagingSystemRabbitmq = MessagingSystemKey.String("rabbitmq")
+ // Apache RocketMQ
+ MessagingSystemRocketmq = MessagingSystemKey.String("rocketmq")
+)
+
+// MessagingBatchMessageCount returns an attribute KeyValue conforming to
+// the "messaging.batch.message_count" semantic conventions. It represents the
+// number of messages sent, received, or processed in the scope of the batching
+// operation.
+func MessagingBatchMessageCount(val int) attribute.KeyValue {
+ return MessagingBatchMessageCountKey.Int(val)
+}
+
+// MessagingClientID returns an attribute KeyValue conforming to the
+// "messaging.client_id" semantic conventions. It represents a unique
+// identifier for the client that consumes or produces a message.
+func MessagingClientID(val string) attribute.KeyValue {
+ return MessagingClientIDKey.String(val)
+}
+
+// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
+// the "messaging.destination.anonymous" semantic conventions. It represents a
+// boolean that is true if the message destination is anonymous (could be
+// unnamed or have auto-generated name).
+func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationName returns an attribute KeyValue conforming to the
+// "messaging.destination.name" semantic conventions. It represents the message
+// destination name
+func MessagingDestinationName(val string) attribute.KeyValue {
+ return MessagingDestinationNameKey.String(val)
+}
+
+// MessagingDestinationTemplate returns an attribute KeyValue conforming to
+// the "messaging.destination.template" semantic conventions. It represents the
+// low cardinality representation of the messaging destination name
+func MessagingDestinationTemplate(val string) attribute.KeyValue {
+ return MessagingDestinationTemplateKey.String(val)
+}
+
+// MessagingDestinationTemporary returns an attribute KeyValue conforming to
+// the "messaging.destination.temporary" semantic conventions. It represents a
+// boolean that is true if the message destination is temporary and might not
+// exist anymore after messages are processed.
+func MessagingDestinationTemporary(val bool) attribute.KeyValue {
+ return MessagingDestinationTemporaryKey.Bool(val)
+}
+
+// MessagingDestinationPublishAnonymous returns an attribute KeyValue
+// conforming to the "messaging.destination_publish.anonymous" semantic
+// conventions. It represents a boolean that is true if the publish message
+// destination is anonymous (could be unnamed or have auto-generated name).
+func MessagingDestinationPublishAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationPublishAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationPublishName returns an attribute KeyValue conforming
+// to the "messaging.destination_publish.name" semantic conventions. It
+// represents the name of the original destination the message was published to
+func MessagingDestinationPublishName(val string) attribute.KeyValue {
+ return MessagingDestinationPublishNameKey.String(val)
+}
+
+// MessagingGCPPubsubMessageOrderingKey returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.ordering_key" semantic
+// conventions. It represents the ordering key for a given message. If the
+// attribute is not present, the message does not have an ordering key.
+func MessagingGCPPubsubMessageOrderingKey(val string) attribute.KeyValue {
+ return MessagingGCPPubsubMessageOrderingKeyKey.String(val)
+}
+
+// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
+// the "messaging.kafka.consumer.group" semantic conventions. It represents the
+// name of the Kafka Consumer Group that is handling the message. Only applies
+// to consumers, not producers.
+func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
+ return MessagingKafkaConsumerGroupKey.String(val)
+}
+
+// MessagingKafkaDestinationPartition returns an attribute KeyValue
+// conforming to the "messaging.kafka.destination.partition" semantic
+// conventions. It represents the partition the message is sent to.
+func MessagingKafkaDestinationPartition(val int) attribute.KeyValue {
+ return MessagingKafkaDestinationPartitionKey.Int(val)
+}
+
+// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
+// "messaging.kafka.message.key" semantic conventions. It represents the
+// message keys in Kafka are used for grouping alike messages to ensure they're
+// processed on the same partition. They differ from `messaging.message.id` in
+// that they're not unique. If the key is `null`, the attribute MUST NOT be
+// set.
+func MessagingKafkaMessageKey(val string) attribute.KeyValue {
+ return MessagingKafkaMessageKeyKey.String(val)
+}
+
+// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
+// the "messaging.kafka.message.offset" semantic conventions. It represents the
+// offset of a record in the corresponding Kafka partition.
+func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
+ return MessagingKafkaMessageOffsetKey.Int(val)
+}
+
+// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
+// to the "messaging.kafka.message.tombstone" semantic conventions. It
+// represents a boolean that is true if the message is a tombstone.
+func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
+ return MessagingKafkaMessageTombstoneKey.Bool(val)
+}
+
+// MessagingMessageBodySize returns an attribute KeyValue conforming to the
+// "messaging.message.body.size" semantic conventions. It represents the size
+// of the message body in bytes.
+func MessagingMessageBodySize(val int) attribute.KeyValue {
+ return MessagingMessageBodySizeKey.Int(val)
+}
+
+// MessagingMessageConversationID returns an attribute KeyValue conforming
+// to the "messaging.message.conversation_id" semantic conventions. It
+// represents the conversation ID identifying the conversation to which the
+// message belongs, represented as a string. Sometimes called "Correlation ID".
+func MessagingMessageConversationID(val string) attribute.KeyValue {
+ return MessagingMessageConversationIDKey.String(val)
+}
+
+// MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to
+// the "messaging.message.envelope.size" semantic conventions. It represents
+// the size of the message body and metadata in bytes.
+func MessagingMessageEnvelopeSize(val int) attribute.KeyValue {
+ return MessagingMessageEnvelopeSizeKey.Int(val)
+}
+
+// MessagingMessageID returns an attribute KeyValue conforming to the
+// "messaging.message.id" semantic conventions. It represents a value used by
+// the messaging system as an identifier for the message, represented as a
+// string.
+func MessagingMessageID(val string) attribute.KeyValue {
+ return MessagingMessageIDKey.String(val)
+}
+
+// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+// conventions. It represents the rabbitMQ message routing key.
+func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
+ return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
+}
+
+// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.client_group" semantic conventions. It represents
+// the name of the RocketMQ producer/consumer group that is handling the
+// message. The client type is identified by the SpanKind.
+func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqClientGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+// conventions. It represents the delay time level for delay message, which
+// determines the message delay time.
+func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
+}
+
+// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
+// conventions. It represents the timestamp in milliseconds that the delay
+// message is expected to be delivered to consumer.
+func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
+}
+
+// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.group" semantic conventions. It represents
+// the it is essential for FIFO message. Messages that belong to the same
+// message group are always processed one by one within the same consumer
+// group.
+func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.keys" semantic conventions. It represents
+// the key(s) of message, another way to mark message besides message id.
+func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
+ return MessagingRocketmqMessageKeysKey.StringSlice(val)
+}
+
+// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
+// secondary classifier of message besides topic.
+func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageTagKey.String(val)
+}
+
+// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.namespace" semantic conventions. It represents the
+// namespace of RocketMQ resources, resources in different namespaces are
+// individual.
+func MessagingRocketmqNamespace(val string) attribute.KeyValue {
+ return MessagingRocketmqNamespaceKey.String(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetworkCarrierIccKey is the attribute Key conforming to the
+ // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+ // alpha-2 2-character country code associated with the mobile carrier
+ // network.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'DE'
+ NetworkCarrierIccKey = attribute.Key("network.carrier.icc")
+
+ // NetworkCarrierMccKey is the attribute Key conforming to the
+ // "network.carrier.mcc" semantic conventions. It represents the mobile
+ // carrier country code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '310'
+ NetworkCarrierMccKey = attribute.Key("network.carrier.mcc")
+
+ // NetworkCarrierMncKey is the attribute Key conforming to the
+ // "network.carrier.mnc" semantic conventions. It represents the mobile
+ // carrier network code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '001'
+ NetworkCarrierMncKey = attribute.Key("network.carrier.mnc")
+
+ // NetworkCarrierNameKey is the attribute Key conforming to the
+ // "network.carrier.name" semantic conventions. It represents the name of
+ // the mobile carrier.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'sprint'
+ NetworkCarrierNameKey = attribute.Key("network.carrier.name")
+
+ // NetworkConnectionSubtypeKey is the attribute Key conforming to the
+ // "network.connection.subtype" semantic conventions. It represents the
+ // this describes more details regarding the connection.type. It may be the
+ // type of cell technology connection, but it could be used for describing
+ // details about a wifi connection.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'LTE'
+ NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype")
+
+ // NetworkConnectionTypeKey is the attribute Key conforming to the
+ // "network.connection.type" semantic conventions. It represents the
+ // internet connection type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'wifi'
+ NetworkConnectionTypeKey = attribute.Key("network.connection.type")
+
+ // NetworkIoDirectionKey is the attribute Key conforming to the
+ // "network.io.direction" semantic conventions. It represents the network
+ // IO operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'transmit'
+ NetworkIoDirectionKey = attribute.Key("network.io.direction")
+
+ // NetworkLocalAddressKey is the attribute Key conforming to the
+ // "network.local.address" semantic conventions. It represents the local
+ // address of the network connection - IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '10.1.2.80', '/tmp/my.sock'
+ NetworkLocalAddressKey = attribute.Key("network.local.address")
+
+ // NetworkLocalPortKey is the attribute Key conforming to the
+ // "network.local.port" semantic conventions. It represents the local port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ NetworkLocalPortKey = attribute.Key("network.local.port")
+
+ // NetworkPeerAddressKey is the attribute Key conforming to the
+ // "network.peer.address" semantic conventions. It represents the peer
+ // address of the network connection - IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '10.1.2.80', '/tmp/my.sock'
+ NetworkPeerAddressKey = attribute.Key("network.peer.address")
+
+ // NetworkPeerPortKey is the attribute Key conforming to the
+ // "network.peer.port" semantic conventions. It represents the peer port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ NetworkPeerPortKey = attribute.Key("network.peer.port")
+
+ // NetworkProtocolNameKey is the attribute Key conforming to the
+ // "network.protocol.name" semantic conventions. It represents the [OSI
+ // application layer](https://osi-model.com/application-layer/) or non-OSI
+ // equivalent.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'amqp', 'http', 'mqtt'
+ // Note: The value SHOULD be normalized to lowercase.
+ NetworkProtocolNameKey = attribute.Key("network.protocol.name")
+
+ // NetworkProtocolVersionKey is the attribute Key conforming to the
+ // "network.protocol.version" semantic conventions. It represents the
+ // version of the protocol specified in `network.protocol.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '3.1.1'
+ // Note: `network.protocol.version` refers to the version of the protocol
+ // used and might be different from the protocol client's version. If the
+ // HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`,
+ // this attribute should be set to `1.1`.
+ NetworkProtocolVersionKey = attribute.Key("network.protocol.version")
+
+ // NetworkTransportKey is the attribute Key conforming to the
+ // "network.transport" semantic conventions. It represents the [OSI
+ // transport layer](https://osi-model.com/transport-layer/) or
+ // [inter-process communication
+ // method](https://wikipedia.org/wiki/Inter-process_communication).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'tcp', 'udp'
+ // Note: The value SHOULD be normalized to lowercase.
+ //
+ // Consider always setting the transport when setting a port number, since
+ // a port number is ambiguous without knowing the transport. For example
+ // different processes could be listening on TCP port 12345 and UDP port
+ // 12345.
+ NetworkTransportKey = attribute.Key("network.transport")
+
+ // NetworkTypeKey is the attribute Key conforming to the "network.type"
+ // semantic conventions. It represents the [OSI network
+ // layer](https://osi-model.com/network-layer/) or non-OSI equivalent.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'ipv4', 'ipv6'
+ // Note: The value SHOULD be normalized to lowercase.
+ NetworkTypeKey = attribute.Key("network.type")
+)
+
+var (
+ // GPRS
+ NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs")
+ // EDGE
+ NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge")
+ // UMTS
+ NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts")
+ // CDMA
+ NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma")
+ // EVDO Rel. 0
+ NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0")
+ // EVDO Rev. A
+ NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a")
+ // CDMA2000 1XRTT
+ NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt")
+ // HSDPA
+ NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa")
+ // HSUPA
+ NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa")
+ // HSPA
+ NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa")
+ // IDEN
+ NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden")
+ // EVDO Rev. B
+ NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b")
+ // LTE
+ NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte")
+ // EHRPD
+ NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd")
+ // HSPAP
+ NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap")
+ // GSM
+ NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm")
+ // TD-SCDMA
+ NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma")
+ // IWLAN
+ NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan")
+ // 5G NR (New Radio)
+ NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr")
+ // 5G NRNSA (New Radio Non-Standalone)
+ NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa")
+ // LTE CA
+ NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca")
+)
+
+var (
+ // wifi
+ NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi")
+ // wired
+ NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired")
+ // cell
+ NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell")
+ // unavailable
+ NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable")
+ // unknown
+ NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown")
+)
+
+var (
+ // transmit
+ NetworkIoDirectionTransmit = NetworkIoDirectionKey.String("transmit")
+ // receive
+ NetworkIoDirectionReceive = NetworkIoDirectionKey.String("receive")
+)
+
+var (
+ // TCP
+ NetworkTransportTCP = NetworkTransportKey.String("tcp")
+ // UDP
+ NetworkTransportUDP = NetworkTransportKey.String("udp")
+ // Named or anonymous pipe
+ NetworkTransportPipe = NetworkTransportKey.String("pipe")
+ // Unix domain socket
+ NetworkTransportUnix = NetworkTransportKey.String("unix")
+)
+
+var (
+ // IPv4
+ NetworkTypeIpv4 = NetworkTypeKey.String("ipv4")
+ // IPv6
+ NetworkTypeIpv6 = NetworkTypeKey.String("ipv6")
+)
+
+// NetworkCarrierIcc returns an attribute KeyValue conforming to the
+// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+// alpha-2 2-character country code associated with the mobile carrier network.
+func NetworkCarrierIcc(val string) attribute.KeyValue {
+ return NetworkCarrierIccKey.String(val)
+}
+
+// NetworkCarrierMcc returns an attribute KeyValue conforming to the
+// "network.carrier.mcc" semantic conventions. It represents the mobile carrier
+// country code.
+func NetworkCarrierMcc(val string) attribute.KeyValue {
+ return NetworkCarrierMccKey.String(val)
+}
+
+// NetworkCarrierMnc returns an attribute KeyValue conforming to the
+// "network.carrier.mnc" semantic conventions. It represents the mobile carrier
+// network code.
+func NetworkCarrierMnc(val string) attribute.KeyValue {
+ return NetworkCarrierMncKey.String(val)
+}
+
+// NetworkCarrierName returns an attribute KeyValue conforming to the
+// "network.carrier.name" semantic conventions. It represents the name of the
+// mobile carrier.
+func NetworkCarrierName(val string) attribute.KeyValue {
+ return NetworkCarrierNameKey.String(val)
+}
+
+// NetworkLocalAddress returns an attribute KeyValue conforming to the
+// "network.local.address" semantic conventions. It represents the local
+// address of the network connection - IP address or Unix domain socket name.
+func NetworkLocalAddress(val string) attribute.KeyValue {
+ return NetworkLocalAddressKey.String(val)
+}
+
+// NetworkLocalPort returns an attribute KeyValue conforming to the
+// "network.local.port" semantic conventions. It represents the local port
+// number of the network connection.
+func NetworkLocalPort(val int) attribute.KeyValue {
+ return NetworkLocalPortKey.Int(val)
+}
+
+// NetworkPeerAddress returns an attribute KeyValue conforming to the
+// "network.peer.address" semantic conventions. It represents the peer address
+// of the network connection - IP address or Unix domain socket name.
+func NetworkPeerAddress(val string) attribute.KeyValue {
+ return NetworkPeerAddressKey.String(val)
+}
+
+// NetworkPeerPort returns an attribute KeyValue conforming to the
+// "network.peer.port" semantic conventions. It represents the peer port number
+// of the network connection.
+func NetworkPeerPort(val int) attribute.KeyValue {
+ return NetworkPeerPortKey.Int(val)
+}
+
+// NetworkProtocolName returns an attribute KeyValue conforming to the
+// "network.protocol.name" semantic conventions. It represents the [OSI
+// application layer](https://osi-model.com/application-layer/) or non-OSI
+// equivalent.
+func NetworkProtocolName(val string) attribute.KeyValue {
+ return NetworkProtocolNameKey.String(val)
+}
+
+// NetworkProtocolVersion returns an attribute KeyValue conforming to the
+// "network.protocol.version" semantic conventions. It represents the version
+// of the protocol specified in `network.protocol.name`.
+func NetworkProtocolVersion(val string) attribute.KeyValue {
+ return NetworkProtocolVersionKey.String(val)
+}
+
+// Attributes for remote procedure calls.
+const (
+ // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the
+ // "rpc.connect_rpc.error_code" semantic conventions. It represents the
+ // [error codes](https://connect.build/docs/protocol/#error-codes) of the
+ // Connect request. Error codes are always string values.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code")
+
+ // RPCGRPCStatusCodeKey is the attribute Key conforming to the
+ // "rpc.grpc.status_code" semantic conventions. It represents the [numeric
+ // status
+ // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of
+ // the gRPC request.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
+
+ // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_code" semantic conventions. It represents the
+ // `error.code` property of response if it is an error response.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: -32700, 100
+ RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
+
+ // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_message" semantic conventions. It represents the
+ // `error.message` property of response if it is an error response.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Parse error', 'User already exists'
+ RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
+
+ // RPCJsonrpcRequestIDKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+ // property of request or response. Since protocol allows id to be int,
+ // string, `null` or missing (for notifications), value is expected to be
+ // cast to string for simplicity. Use empty string in case of `null` value.
+ // Omit entirely if this is a notification.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '10', 'request-7', ''
+ RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
+
+ // RPCJsonrpcVersionKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+ // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+ // doesn't specify this, the value can be omitted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2.0', '1.0'
+ RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version")
+
+ // RPCMethodKey is the attribute Key conforming to the "rpc.method"
+ // semantic conventions. It represents the name of the (logical) method
+ // being called, must be equal to the $method part in the span name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'exampleMethod'
+ // Note: This is the logical name of the method from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // method/function. The `code.function` attribute may be used to store the
+ // latter (e.g., method actually executing the call on the server side, RPC
+ // client stub method on the client side).
+ RPCMethodKey = attribute.Key("rpc.method")
+
+ // RPCServiceKey is the attribute Key conforming to the "rpc.service"
+ // semantic conventions. It represents the full (logical) name of the
+ // service being called, including its package name, if applicable.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myservice.EchoService'
+ // Note: This is the logical name of the service from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // class. The `code.namespace` attribute may be used to store the latter
+ // (despite the attribute name, it may include a class name; e.g., class
+ // with method actually executing the call on the server side, RPC client
+ // stub class on the client side).
+ RPCServiceKey = attribute.Key("rpc.service")
+
+ // RPCSystemKey is the attribute Key conforming to the "rpc.system"
+ // semantic conventions. It represents a string identifying the remoting
+ // system. See below for a list of well-known identifiers.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCSystemKey = attribute.Key("rpc.system")
+)
+
+var (
+ // cancelled
+ RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled")
+ // unknown
+ RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown")
+ // invalid_argument
+ RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument")
+ // deadline_exceeded
+ RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded")
+ // not_found
+ RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found")
+ // already_exists
+ RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists")
+ // permission_denied
+ RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied")
+ // resource_exhausted
+ RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted")
+ // failed_precondition
+ RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition")
+ // aborted
+ RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted")
+ // out_of_range
+ RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range")
+ // unimplemented
+ RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented")
+ // internal
+ RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal")
+ // unavailable
+ RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable")
+ // data_loss
+ RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss")
+ // unauthenticated
+ RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated")
+)
+
+var (
+ // OK
+ RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0)
+ // CANCELLED
+ RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1)
+ // UNKNOWN
+ RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2)
+ // INVALID_ARGUMENT
+ RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3)
+ // DEADLINE_EXCEEDED
+ RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4)
+ // NOT_FOUND
+ RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5)
+ // ALREADY_EXISTS
+ RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6)
+ // PERMISSION_DENIED
+ RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7)
+ // RESOURCE_EXHAUSTED
+ RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8)
+ // FAILED_PRECONDITION
+ RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9)
+ // ABORTED
+ RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10)
+ // OUT_OF_RANGE
+ RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11)
+ // UNIMPLEMENTED
+ RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12)
+ // INTERNAL
+ RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13)
+ // UNAVAILABLE
+ RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14)
+ // DATA_LOSS
+ RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15)
+ // UNAUTHENTICATED
+ RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16)
+)
+
+var (
+ // gRPC
+ RPCSystemGRPC = RPCSystemKey.String("grpc")
+ // Java RMI
+ RPCSystemJavaRmi = RPCSystemKey.String("java_rmi")
+ // .NET WCF
+ RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf")
+ // Apache Dubbo
+ RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo")
+ // Connect RPC
+ RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc")
+)
+
+// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_code" semantic conventions. It represents the
+// `error.code` property of response if it is an error response.
+func RPCJsonrpcErrorCode(val int) attribute.KeyValue {
+ return RPCJsonrpcErrorCodeKey.Int(val)
+}
+
+// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_message" semantic conventions. It represents the
+// `error.message` property of response if it is an error response.
+func RPCJsonrpcErrorMessage(val string) attribute.KeyValue {
+ return RPCJsonrpcErrorMessageKey.String(val)
+}
+
+// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+// property of request or response. Since protocol allows id to be int, string,
+// `null` or missing (for notifications), value is expected to be cast to
+// string for simplicity. Use empty string in case of `null` value. Omit
+// entirely if this is a notification.
+func RPCJsonrpcRequestID(val string) attribute.KeyValue {
+ return RPCJsonrpcRequestIDKey.String(val)
+}
+
+// RPCJsonrpcVersion returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+// doesn't specify this, the value can be omitted.
+func RPCJsonrpcVersion(val string) attribute.KeyValue {
+ return RPCJsonrpcVersionKey.String(val)
+}
+
+// RPCMethod returns an attribute KeyValue conforming to the "rpc.method"
+// semantic conventions. It represents the name of the (logical) method being
+// called, must be equal to the $method part in the span name.
+func RPCMethod(val string) attribute.KeyValue {
+ return RPCMethodKey.String(val)
+}
+
+// RPCService returns an attribute KeyValue conforming to the "rpc.service"
+// semantic conventions. It represents the full (logical) name of the service
+// being called, including its package name, if applicable.
+func RPCService(val string) attribute.KeyValue {
+ return RPCServiceKey.String(val)
+}
+
+// These attributes may be used to describe the server in a connection-based
+// network interaction where there is one side that initiates the connection
+// (the client is the side that initiates the connection). This covers all TCP
+// network interactions since TCP is connection-based and one side initiates
+// the connection (an exception is made for peer-to-peer communication over TCP
+// where the "user-facing" surface of the protocol / API doesn't expose a clear
+// notion of client and server). This also covers UDP network interactions
+// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
+const (
+ // ServerAddressKey is the attribute Key conforming to the "server.address"
+ // semantic conventions. It represents the server domain name if available
+ // without reverse DNS lookup; otherwise, IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the client side, and when communicating through
+ // an intermediary, `server.address` SHOULD represent the server address
+ // behind any intermediaries, for example proxies, if it's available.
+ ServerAddressKey = attribute.Key("server.address")
+
+ // ServerPortKey is the attribute Key conforming to the "server.port"
+ // semantic conventions. It represents the server port number.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 80, 8080, 443
+ // Note: When observed from the client side, and when communicating through
+ // an intermediary, `server.port` SHOULD represent the server port behind
+ // any intermediaries, for example proxies, if it's available.
+ ServerPortKey = attribute.Key("server.port")
+)
+
+// ServerAddress returns an attribute KeyValue conforming to the
+// "server.address" semantic conventions. It represents the server domain name
+// if available without reverse DNS lookup; otherwise, IP address or Unix
+// domain socket name.
+func ServerAddress(val string) attribute.KeyValue {
+ return ServerAddressKey.String(val)
+}
+
+// ServerPort returns an attribute KeyValue conforming to the "server.port"
+// semantic conventions. It represents the server port number.
+func ServerPort(val int) attribute.KeyValue {
+ return ServerPortKey.Int(val)
+}
+
+// These attributes may be used to describe the sender of a network
+// exchange/packet. These should be used when there is no client/server
+// relationship between the two sides, or when that relationship is unknown.
+// This covers low-level network interactions (e.g. packet tracing) where you
+// don't know if there was a connection or which side initiated it. This also
+// covers unidirectional UDP flows and peer-to-peer communication where the
+// "user-facing" surface of the protocol / API doesn't expose a clear notion of
+// client and server.
+const (
+ // SourceAddressKey is the attribute Key conforming to the "source.address"
+ // semantic conventions. It represents the source address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix
+ // domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'source.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the destination side, and when communicating
+ // through an intermediary, `source.address` SHOULD represent the source
+ // address behind any intermediaries, for example proxies, if it's
+ // available.
+ SourceAddressKey = attribute.Key("source.address")
+
+ // SourcePortKey is the attribute Key conforming to the "source.port"
+ // semantic conventions. It represents the source port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3389, 2888
+ SourcePortKey = attribute.Key("source.port")
+)
+
+// SourceAddress returns an attribute KeyValue conforming to the
+// "source.address" semantic conventions. It represents the source address -
+// domain name if available without reverse DNS lookup; otherwise, IP address
+// or Unix domain socket name.
+func SourceAddress(val string) attribute.KeyValue {
+ return SourceAddressKey.String(val)
+}
+
+// SourcePort returns an attribute KeyValue conforming to the "source.port"
+// semantic conventions. It represents the source port number
+func SourcePort(val int) attribute.KeyValue {
+ return SourcePortKey.Int(val)
+}
+
+// Semantic convention attributes in the TLS namespace.
+const (
+ // TLSCipherKey is the attribute Key conforming to the "tls.cipher"
+ // semantic conventions. It represents the string indicating the
+ // [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5)
+ // used during the current connection.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'TLS_RSA_WITH_3DES_EDE_CBC_SHA',
+ // 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256'
+ // Note: The values allowed for `tls.cipher` MUST be one of the
+ // `Descriptions` of the [registered TLS Cipher
+ // Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4).
+ TLSCipherKey = attribute.Key("tls.cipher")
+
+ // TLSClientCertificateKey is the attribute Key conforming to the
+ // "tls.client.certificate" semantic conventions. It represents the
+ // pEM-encoded stand-alone certificate offered by the client. This is
+ // usually mutually-exclusive of `client.certificate_chain` since this
+ // value also exists in that list.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...'
+ TLSClientCertificateKey = attribute.Key("tls.client.certificate")
+
+ // TLSClientCertificateChainKey is the attribute Key conforming to the
+ // "tls.client.certificate_chain" semantic conventions. It represents the
+ // array of PEM-encoded certificates that make up the certificate chain
+ // offered by the client. This is usually mutually-exclusive of
+ // `client.certificate` since that value should be the first certificate in
+ // the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...', 'MI...'
+ TLSClientCertificateChainKey = attribute.Key("tls.client.certificate_chain")
+
+ // TLSClientHashMd5Key is the attribute Key conforming to the
+ // "tls.client.hash.md5" semantic conventions. It represents the
+ // certificate fingerprint using the MD5 digest of DER-encoded version of
+ // certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC'
+ TLSClientHashMd5Key = attribute.Key("tls.client.hash.md5")
+
+ // TLSClientHashSha1Key is the attribute Key conforming to the
+ // "tls.client.hash.sha1" semantic conventions. It represents the
+ // certificate fingerprint using the SHA1 digest of DER-encoded version of
+ // certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A'
+ TLSClientHashSha1Key = attribute.Key("tls.client.hash.sha1")
+
+ // TLSClientHashSha256Key is the attribute Key conforming to the
+ // "tls.client.hash.sha256" semantic conventions. It represents the
+ // certificate fingerprint using the SHA256 digest of DER-encoded version
+ // of certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0'
+ TLSClientHashSha256Key = attribute.Key("tls.client.hash.sha256")
+
+ // TLSClientIssuerKey is the attribute Key conforming to the
+ // "tls.client.issuer" semantic conventions. It represents the
+ // distinguished name of
+ // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6)
+ // of the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example,
+ // DC=com'
+ TLSClientIssuerKey = attribute.Key("tls.client.issuer")
+
+ // TLSClientJa3Key is the attribute Key conforming to the "tls.client.ja3"
+ // semantic conventions. It represents a hash that identifies clients based
+ // on how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'd4e5b18d6b55c71272893221c96ba240'
+ TLSClientJa3Key = attribute.Key("tls.client.ja3")
+
+ // TLSClientNotAfterKey is the attribute Key conforming to the
+ // "tls.client.not_after" semantic conventions. It represents the date/Time
+ // indicating when client certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021-01-01T00:00:00.000Z'
+ TLSClientNotAfterKey = attribute.Key("tls.client.not_after")
+
+ // TLSClientNotBeforeKey is the attribute Key conforming to the
+ // "tls.client.not_before" semantic conventions. It represents the
+ // date/Time indicating when client certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1970-01-01T00:00:00.000Z'
+ TLSClientNotBeforeKey = attribute.Key("tls.client.not_before")
+
+ // TLSClientServerNameKey is the attribute Key conforming to the
+ // "tls.client.server_name" semantic conventions. It represents the also
+ // called an SNI, this tells the server which hostname to which the client
+ // is attempting to connect to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry.io'
+ TLSClientServerNameKey = attribute.Key("tls.client.server_name")
+
+ // TLSClientSubjectKey is the attribute Key conforming to the
+ // "tls.client.subject" semantic conventions. It represents the
+ // distinguished name of subject of the x.509 certificate presented by the
+ // client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=myclient, OU=Documentation Team, DC=example, DC=com'
+ TLSClientSubjectKey = attribute.Key("tls.client.subject")
+
+ // TLSClientSupportedCiphersKey is the attribute Key conforming to the
+ // "tls.client.supported_ciphers" semantic conventions. It represents the
+ // array of ciphers offered by the client during the client hello.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
+ // "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "..."'
+ TLSClientSupportedCiphersKey = attribute.Key("tls.client.supported_ciphers")
+
+ // TLSCurveKey is the attribute Key conforming to the "tls.curve" semantic
+ // conventions. It represents the string indicating the curve used for the
+ // given cipher, when applicable
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'secp256r1'
+ TLSCurveKey = attribute.Key("tls.curve")
+
+ // TLSEstablishedKey is the attribute Key conforming to the
+ // "tls.established" semantic conventions. It represents the boolean flag
+ // indicating if the TLS negotiation was successful and transitioned to an
+ // encrypted tunnel.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: True
+ TLSEstablishedKey = attribute.Key("tls.established")
+
+ // TLSNextProtocolKey is the attribute Key conforming to the
+ // "tls.next_protocol" semantic conventions. It represents the string
+ // indicating the protocol being tunneled. Per the values in the [IANA
+ // registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids),
+ // this string should be lower case.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'http/1.1'
+ TLSNextProtocolKey = attribute.Key("tls.next_protocol")
+
+ // TLSProtocolNameKey is the attribute Key conforming to the
+ // "tls.protocol.name" semantic conventions. It represents the normalized
+ // lowercase protocol name parsed from original string of the negotiated
+ // [SSL/TLS protocol
+ // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ TLSProtocolNameKey = attribute.Key("tls.protocol.name")
+
+ // TLSProtocolVersionKey is the attribute Key conforming to the
+ // "tls.protocol.version" semantic conventions. It represents the numeric
+ // part of the version parsed from the original string of the negotiated
+ // [SSL/TLS protocol
+ // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.2', '3'
+ TLSProtocolVersionKey = attribute.Key("tls.protocol.version")
+
+ // TLSResumedKey is the attribute Key conforming to the "tls.resumed"
+ // semantic conventions. It represents the boolean flag indicating if this
+ // TLS connection was resumed from an existing TLS negotiation.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: True
+ TLSResumedKey = attribute.Key("tls.resumed")
+
+ // TLSServerCertificateKey is the attribute Key conforming to the
+ // "tls.server.certificate" semantic conventions. It represents the
+ // pEM-encoded stand-alone certificate offered by the server. This is
+ // usually mutually-exclusive of `server.certificate_chain` since this
+ // value also exists in that list.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...'
+ TLSServerCertificateKey = attribute.Key("tls.server.certificate")
+
+ // TLSServerCertificateChainKey is the attribute Key conforming to the
+ // "tls.server.certificate_chain" semantic conventions. It represents the
+ // array of PEM-encoded certificates that make up the certificate chain
+ // offered by the server. This is usually mutually-exclusive of
+ // `server.certificate` since that value should be the first certificate in
+ // the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...', 'MI...'
+ TLSServerCertificateChainKey = attribute.Key("tls.server.certificate_chain")
+
+ // TLSServerHashMd5Key is the attribute Key conforming to the
+ // "tls.server.hash.md5" semantic conventions. It represents the
+ // certificate fingerprint using the MD5 digest of DER-encoded version of
+ // certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC'
+ TLSServerHashMd5Key = attribute.Key("tls.server.hash.md5")
+
+ // TLSServerHashSha1Key is the attribute Key conforming to the
+ // "tls.server.hash.sha1" semantic conventions. It represents the
+ // certificate fingerprint using the SHA1 digest of DER-encoded version of
+ // certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A'
+ TLSServerHashSha1Key = attribute.Key("tls.server.hash.sha1")
+
+ // TLSServerHashSha256Key is the attribute Key conforming to the
+ // "tls.server.hash.sha256" semantic conventions. It represents the
+ // certificate fingerprint using the SHA256 digest of DER-encoded version
+ // of certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0'
+ TLSServerHashSha256Key = attribute.Key("tls.server.hash.sha256")
+
+ // TLSServerIssuerKey is the attribute Key conforming to the
+ // "tls.server.issuer" semantic conventions. It represents the
+ // distinguished name of
+ // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6)
+ // of the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example,
+ // DC=com'
+ TLSServerIssuerKey = attribute.Key("tls.server.issuer")
+
+ // TLSServerJa3sKey is the attribute Key conforming to the
+ // "tls.server.ja3s" semantic conventions. It represents a hash that
+ // identifies servers based on how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'd4e5b18d6b55c71272893221c96ba240'
+ TLSServerJa3sKey = attribute.Key("tls.server.ja3s")
+
+ // TLSServerNotAfterKey is the attribute Key conforming to the
+ // "tls.server.not_after" semantic conventions. It represents the date/Time
+ // indicating when server certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021-01-01T00:00:00.000Z'
+ TLSServerNotAfterKey = attribute.Key("tls.server.not_after")
+
+ // TLSServerNotBeforeKey is the attribute Key conforming to the
+ // "tls.server.not_before" semantic conventions. It represents the
+ // date/Time indicating when server certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1970-01-01T00:00:00.000Z'
+ TLSServerNotBeforeKey = attribute.Key("tls.server.not_before")
+
+ // TLSServerSubjectKey is the attribute Key conforming to the
+ // "tls.server.subject" semantic conventions. It represents the
+ // distinguished name of subject of the x.509 certificate presented by the
+ // server.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=myserver, OU=Documentation Team, DC=example, DC=com'
+ TLSServerSubjectKey = attribute.Key("tls.server.subject")
+)
+
+var (
+ // ssl
+ TLSProtocolNameSsl = TLSProtocolNameKey.String("ssl")
+ // tls
+ TLSProtocolNameTLS = TLSProtocolNameKey.String("tls")
+)
+
+// TLSCipher returns an attribute KeyValue conforming to the "tls.cipher"
+// semantic conventions. It represents the string indicating the
+// [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used
+// during the current connection.
+func TLSCipher(val string) attribute.KeyValue {
+ return TLSCipherKey.String(val)
+}
+
+// TLSClientCertificate returns an attribute KeyValue conforming to the
+// "tls.client.certificate" semantic conventions. It represents the pEM-encoded
+// stand-alone certificate offered by the client. This is usually
+// mutually-exclusive of `client.certificate_chain` since this value also
+// exists in that list.
+func TLSClientCertificate(val string) attribute.KeyValue {
+ return TLSClientCertificateKey.String(val)
+}
+
+// TLSClientCertificateChain returns an attribute KeyValue conforming to the
+// "tls.client.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by
+// the client. This is usually mutually-exclusive of `client.certificate` since
+// that value should be the first certificate in the chain.
+func TLSClientCertificateChain(val ...string) attribute.KeyValue {
+ return TLSClientCertificateChainKey.StringSlice(val)
+}
+
+// TLSClientHashMd5 returns an attribute KeyValue conforming to the
+// "tls.client.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashMd5(val string) attribute.KeyValue {
+ return TLSClientHashMd5Key.String(val)
+}
+
+// TLSClientHashSha1 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha1(val string) attribute.KeyValue {
+ return TLSClientHashSha1Key.String(val)
+}
+
+// TLSClientHashSha256 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha256(val string) attribute.KeyValue {
+ return TLSClientHashSha256Key.String(val)
+}
+
+// TLSClientIssuer returns an attribute KeyValue conforming to the
+// "tls.client.issuer" semantic conventions. It represents the distinguished
+// name of
+// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of
+// the issuer of the x.509 certificate presented by the client.
+func TLSClientIssuer(val string) attribute.KeyValue {
+ return TLSClientIssuerKey.String(val)
+}
+
+// TLSClientJa3 returns an attribute KeyValue conforming to the
+// "tls.client.ja3" semantic conventions. It represents a hash that identifies
+// clients based on how they perform an SSL/TLS handshake.
+func TLSClientJa3(val string) attribute.KeyValue {
+ return TLSClientJa3Key.String(val)
+}
+
+// TLSClientNotAfter returns an attribute KeyValue conforming to the
+// "tls.client.not_after" semantic conventions. It represents the date/Time
+// indicating when client certificate is no longer considered valid.
+func TLSClientNotAfter(val string) attribute.KeyValue {
+ return TLSClientNotAfterKey.String(val)
+}
+
+// TLSClientNotBefore returns an attribute KeyValue conforming to the
+// "tls.client.not_before" semantic conventions. It represents the date/Time
+// indicating when client certificate is first considered valid.
+func TLSClientNotBefore(val string) attribute.KeyValue {
+ return TLSClientNotBeforeKey.String(val)
+}
+
+// TLSClientServerName returns an attribute KeyValue conforming to the
+// "tls.client.server_name" semantic conventions. It represents the also called
+// an SNI, this tells the server which hostname to which the client is
+// attempting to connect to.
+func TLSClientServerName(val string) attribute.KeyValue {
+ return TLSClientServerNameKey.String(val)
+}
+
+// TLSClientSubject returns an attribute KeyValue conforming to the
+// "tls.client.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the client.
+func TLSClientSubject(val string) attribute.KeyValue {
+ return TLSClientSubjectKey.String(val)
+}
+
+// TLSClientSupportedCiphers returns an attribute KeyValue conforming to the
+// "tls.client.supported_ciphers" semantic conventions. It represents the array
+// of ciphers offered by the client during the client hello.
+func TLSClientSupportedCiphers(val ...string) attribute.KeyValue {
+ return TLSClientSupportedCiphersKey.StringSlice(val)
+}
+
+// TLSCurve returns an attribute KeyValue conforming to the "tls.curve"
+// semantic conventions. It represents the string indicating the curve used for
+// the given cipher, when applicable
+func TLSCurve(val string) attribute.KeyValue {
+ return TLSCurveKey.String(val)
+}
+
+// TLSEstablished returns an attribute KeyValue conforming to the
+// "tls.established" semantic conventions. It represents the boolean flag
+// indicating if the TLS negotiation was successful and transitioned to an
+// encrypted tunnel.
+func TLSEstablished(val bool) attribute.KeyValue {
+ return TLSEstablishedKey.Bool(val)
+}
+
+// TLSNextProtocol returns an attribute KeyValue conforming to the
+// "tls.next_protocol" semantic conventions. It represents the string
+// indicating the protocol being tunneled. Per the values in the [IANA
+// registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids),
+// this string should be lower case.
+func TLSNextProtocol(val string) attribute.KeyValue {
+ return TLSNextProtocolKey.String(val)
+}
+
+// TLSProtocolVersion returns an attribute KeyValue conforming to the
+// "tls.protocol.version" semantic conventions. It represents the numeric part
+// of the version parsed from the original string of the negotiated [SSL/TLS
+// protocol
+// version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+func TLSProtocolVersion(val string) attribute.KeyValue {
+ return TLSProtocolVersionKey.String(val)
+}
+
+// TLSResumed returns an attribute KeyValue conforming to the "tls.resumed"
+// semantic conventions. It represents the boolean flag indicating if this TLS
+// connection was resumed from an existing TLS negotiation.
+func TLSResumed(val bool) attribute.KeyValue {
+ return TLSResumedKey.Bool(val)
+}
+
+// TLSServerCertificate returns an attribute KeyValue conforming to the
+// "tls.server.certificate" semantic conventions. It represents the pEM-encoded
+// stand-alone certificate offered by the server. This is usually
+// mutually-exclusive of `server.certificate_chain` since this value also
+// exists in that list.
+func TLSServerCertificate(val string) attribute.KeyValue {
+ return TLSServerCertificateKey.String(val)
+}
+
+// TLSServerCertificateChain returns an attribute KeyValue conforming to the
+// "tls.server.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by
+// the server. This is usually mutually-exclusive of `server.certificate` since
+// that value should be the first certificate in the chain.
+func TLSServerCertificateChain(val ...string) attribute.KeyValue {
+ return TLSServerCertificateChainKey.StringSlice(val)
+}
+
+// TLSServerHashMd5 returns an attribute KeyValue conforming to the
+// "tls.server.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashMd5(val string) attribute.KeyValue {
+ return TLSServerHashMd5Key.String(val)
+}
+
+// TLSServerHashSha1 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha1(val string) attribute.KeyValue {
+ return TLSServerHashSha1Key.String(val)
+}
+
+// TLSServerHashSha256 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha256(val string) attribute.KeyValue {
+ return TLSServerHashSha256Key.String(val)
+}
+
+// TLSServerIssuer returns an attribute KeyValue conforming to the
+// "tls.server.issuer" semantic conventions. It represents the distinguished
+// name of
+// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of
+// the issuer of the x.509 certificate presented by the client.
+func TLSServerIssuer(val string) attribute.KeyValue {
+ return TLSServerIssuerKey.String(val)
+}
+
+// TLSServerJa3s returns an attribute KeyValue conforming to the
+// "tls.server.ja3s" semantic conventions. It represents a hash that identifies
+// servers based on how they perform an SSL/TLS handshake.
+func TLSServerJa3s(val string) attribute.KeyValue {
+ return TLSServerJa3sKey.String(val)
+}
+
+// TLSServerNotAfter returns an attribute KeyValue conforming to the
+// "tls.server.not_after" semantic conventions. It represents the date/Time
+// indicating when server certificate is no longer considered valid.
+func TLSServerNotAfter(val string) attribute.KeyValue {
+ return TLSServerNotAfterKey.String(val)
+}
+
+// TLSServerNotBefore returns an attribute KeyValue conforming to the
+// "tls.server.not_before" semantic conventions. It represents the date/Time
+// indicating when server certificate is first considered valid.
+func TLSServerNotBefore(val string) attribute.KeyValue {
+ return TLSServerNotBeforeKey.String(val)
+}
+
+// TLSServerSubject returns an attribute KeyValue conforming to the
+// "tls.server.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the server.
+func TLSServerSubject(val string) attribute.KeyValue {
+ return TLSServerSubjectKey.String(val)
+}
+
+// Attributes describing URL.
+const (
+ // URLFragmentKey is the attribute Key conforming to the "url.fragment"
+ // semantic conventions. It represents the [URI
+ // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'SemConv'
+ URLFragmentKey = attribute.Key("url.fragment")
+
+ // URLFullKey is the attribute Key conforming to the "url.full" semantic
+ // conventions. It represents the absolute URL describing a network
+ // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
+ // '//localhost'
+ // Note: For network calls, URL usually has
+ // `scheme://host[:port][path][?query][#fragment]` format, where the
+ // fragment is not transmitted over HTTP, but if it is known, it SHOULD be
+ // included nevertheless.
+ // `url.full` MUST NOT contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case username and
+ // password SHOULD be redacted and attribute's value SHOULD be
+ // `https://REDACTED:REDACTED@www.example.com/`.
+ // `url.full` SHOULD capture the absolute URL when it is available (or can
+ // be reconstructed) and SHOULD NOT be validated or modified except for
+ // sanitizing purposes.
+ URLFullKey = attribute.Key("url.full")
+
+ // URLPathKey is the attribute Key conforming to the "url.path" semantic
+ // conventions. It represents the [URI
+ // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/search'
+ URLPathKey = attribute.Key("url.path")
+
+ // URLQueryKey is the attribute Key conforming to the "url.query" semantic
+ // conventions. It represents the [URI
+ // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'q=OpenTelemetry'
+ // Note: Sensitive content provided in query string SHOULD be scrubbed when
+ // instrumentations can identify it.
+ URLQueryKey = attribute.Key("url.query")
+
+ // URLSchemeKey is the attribute Key conforming to the "url.scheme"
+ // semantic conventions. It represents the [URI
+ // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
+ // identifying the used protocol.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'https', 'ftp', 'telnet'
+ URLSchemeKey = attribute.Key("url.scheme")
+)
+
+// URLFragment returns an attribute KeyValue conforming to the
+// "url.fragment" semantic conventions. It represents the [URI
+// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
+func URLFragment(val string) attribute.KeyValue {
+ return URLFragmentKey.String(val)
+}
+
+// URLFull returns an attribute KeyValue conforming to the "url.full"
+// semantic conventions. It represents the absolute URL describing a network
+// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
+func URLFull(val string) attribute.KeyValue {
+ return URLFullKey.String(val)
+}
+
+// URLPath returns an attribute KeyValue conforming to the "url.path"
+// semantic conventions. It represents the [URI
+// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
+func URLPath(val string) attribute.KeyValue {
+ return URLPathKey.String(val)
+}
+
+// URLQuery returns an attribute KeyValue conforming to the "url.query"
+// semantic conventions. It represents the [URI
+// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
+func URLQuery(val string) attribute.KeyValue {
+ return URLQueryKey.String(val)
+}
+
+// URLScheme returns an attribute KeyValue conforming to the "url.scheme"
+// semantic conventions. It represents the [URI
+// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
+// identifying the used protocol.
+func URLScheme(val string) attribute.KeyValue {
+ return URLSchemeKey.String(val)
+}
+
+// Describes user-agent attributes.
+const (
+ // UserAgentOriginalKey is the attribute Key conforming to the
+ // "user_agent.original" semantic conventions. It represents the value of
+ // the [HTTP
+ // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+ // header sent by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU
+ // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)
+ // Version/14.1.2 Mobile/15E148 Safari/604.1'
+ UserAgentOriginalKey = attribute.Key("user_agent.original")
+)
+
+// UserAgentOriginal returns an attribute KeyValue conforming to the
+// "user_agent.original" semantic conventions. It represents the value of the
+// [HTTP
+// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+// header sent by the client.
+func UserAgentOriginal(val string) attribute.KeyValue {
+ return UserAgentOriginalKey.String(val)
+}
+
+// Session is defined as the period of time encompassing all activities
+// performed by the application and the actions executed by the end user.
+// Consequently, a Session is represented as a collection of Logs, Events, and
+// Spans emitted by the Client Application throughout the Session's duration.
+// Each Session is assigned a unique identifier, which is included as an
+// attribute in the Logs, Events, and Spans generated during the Session's
+// lifecycle.
+// When a session reaches end of life, typically due to user inactivity or
+// session timeout, a new session identifier will be assigned. The previous
+// session identifier may be provided by the instrumentation so that telemetry
+// backends can link the two sessions.
+const (
+ // SessionIDKey is the attribute Key conforming to the "session.id"
+ // semantic conventions. It represents a unique id to identify a session.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '00112233-4455-6677-8899-aabbccddeeff'
+ SessionIDKey = attribute.Key("session.id")
+
+ // SessionPreviousIDKey is the attribute Key conforming to the
+ // "session.previous_id" semantic conventions. It represents the previous
+ // `session.id` for this user, when known.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '00112233-4455-6677-8899-aabbccddeeff'
+ SessionPreviousIDKey = attribute.Key("session.previous_id")
+)
+
+// SessionID returns an attribute KeyValue conforming to the "session.id"
+// semantic conventions. It represents a unique id to identify a session.
+func SessionID(val string) attribute.KeyValue {
+ return SessionIDKey.String(val)
+}
+
+// SessionPreviousID returns an attribute KeyValue conforming to the
+// "session.previous_id" semantic conventions. It represents the previous
+// `session.id` for this user, when known.
+func SessionPreviousID(val string) attribute.KeyValue {
+ return SessionPreviousIDKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go
new file mode 100644
index 0000000000..d27e8a8f8b
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package semconv implements OpenTelemetry semantic conventions.
+//
+// OpenTelemetry semantic conventions are agreed standardized naming
+// patterns for OpenTelemetry things. This package represents the v1.24.0
+// version of the OpenTelemetry semantic conventions.
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go
new file mode 100644
index 0000000000..6c019aafc3
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go
@@ -0,0 +1,200 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// This event represents an occurrence of a lifecycle transition on the iOS
+// platform.
+const (
+ // IosStateKey is the attribute Key conforming to the "ios.state" semantic
+ // conventions. It represents the this attribute represents the state the
+ // application has transitioned into at the occurrence of the event.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Note: The iOS lifecycle states are defined in the [UIApplicationDelegate
+ // documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902),
+ // and from which the `OS terminology` column values are derived.
+ IosStateKey = attribute.Key("ios.state")
+)
+
+var (
+ // The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive`
+ IosStateActive = IosStateKey.String("active")
+ // The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive`
+ IosStateInactive = IosStateKey.String("inactive")
+ // The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground`
+ IosStateBackground = IosStateKey.String("background")
+ // The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground`
+ IosStateForeground = IosStateKey.String("foreground")
+ // The app is about to terminate. Associated with UIKit notification `applicationWillTerminate`
+ IosStateTerminate = IosStateKey.String("terminate")
+)
+
+// This event represents an occurrence of a lifecycle transition on the Android
+// platform.
+const (
+ // AndroidStateKey is the attribute Key conforming to the "android.state"
+ // semantic conventions. It represents the this attribute represents the
+ // state the application has transitioned into at the occurrence of the
+ // event.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Note: The Android lifecycle states are defined in [Activity lifecycle
+ // callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc),
+ // and from which the `OS identifiers` are derived.
+ AndroidStateKey = attribute.Key("android.state")
+)
+
+var (
+ // Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time
+ AndroidStateCreated = AndroidStateKey.String("created")
+ // Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state
+ AndroidStateBackground = AndroidStateKey.String("background")
+ // Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states
+ AndroidStateForeground = AndroidStateKey.String("foreground")
+)
+
+// This semantic convention defines the attributes used to represent a feature
+// flag evaluation as an event.
+const (
+ // FeatureFlagKeyKey is the attribute Key conforming to the
+ // "feature_flag.key" semantic conventions. It represents the unique
+ // identifier of the feature flag.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'logo-color'
+ FeatureFlagKeyKey = attribute.Key("feature_flag.key")
+
+ // FeatureFlagProviderNameKey is the attribute Key conforming to the
+ // "feature_flag.provider_name" semantic conventions. It represents the
+ // name of the service provider that performs the flag evaluation.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: experimental
+ // Examples: 'Flag Manager'
+ FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name")
+
+ // FeatureFlagVariantKey is the attribute Key conforming to the
+ // "feature_flag.variant" semantic conventions. It represents the sHOULD be
+ // a semantic identifier for a value. If one is unavailable, a stringified
+ // version of the value can be used.
+ //
+ // Type: string
+ // RequirementLevel: Recommended
+ // Stability: experimental
+ // Examples: 'red', 'true', 'on'
+ // Note: A semantic identifier, commonly referred to as a variant, provides
+ // a means
+ // for referring to a value without including the value itself. This can
+ // provide additional context for understanding the meaning behind a value.
+ // For example, the variant `red` maybe be used for the value `#c05543`.
+ //
+ // A stringified version of the value can be used in situations where a
+ // semantic identifier is unavailable. String representation of the value
+ // should be determined by the implementer.
+ FeatureFlagVariantKey = attribute.Key("feature_flag.variant")
+)
+
+// FeatureFlagKey returns an attribute KeyValue conforming to the
+// "feature_flag.key" semantic conventions. It represents the unique identifier
+// of the feature flag.
+func FeatureFlagKey(val string) attribute.KeyValue {
+ return FeatureFlagKeyKey.String(val)
+}
+
+// FeatureFlagProviderName returns an attribute KeyValue conforming to the
+// "feature_flag.provider_name" semantic conventions. It represents the name of
+// the service provider that performs the flag evaluation.
+func FeatureFlagProviderName(val string) attribute.KeyValue {
+ return FeatureFlagProviderNameKey.String(val)
+}
+
+// FeatureFlagVariant returns an attribute KeyValue conforming to the
+// "feature_flag.variant" semantic conventions. It represents the sHOULD be a
+// semantic identifier for a value. If one is unavailable, a stringified
+// version of the value can be used.
+func FeatureFlagVariant(val string) attribute.KeyValue {
+ return FeatureFlagVariantKey.String(val)
+}
+
+// RPC received/sent message.
+const (
+ // MessageCompressedSizeKey is the attribute Key conforming to the
+ // "message.compressed_size" semantic conventions. It represents the
+ // compressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessageCompressedSizeKey = attribute.Key("message.compressed_size")
+
+ // MessageIDKey is the attribute Key conforming to the "message.id"
+ // semantic conventions. It represents the mUST be calculated as two
+ // different counters starting from `1` one for sent messages and one for
+ // received message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: This way we guarantee that the values will be consistent between
+ // different implementations.
+ MessageIDKey = attribute.Key("message.id")
+
+ // MessageTypeKey is the attribute Key conforming to the "message.type"
+ // semantic conventions. It represents the whether this is a received or
+ // sent message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessageTypeKey = attribute.Key("message.type")
+
+ // MessageUncompressedSizeKey is the attribute Key conforming to the
+ // "message.uncompressed_size" semantic conventions. It represents the
+ // uncompressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size")
+)
+
+var (
+ // sent
+ MessageTypeSent = MessageTypeKey.String("SENT")
+ // received
+ MessageTypeReceived = MessageTypeKey.String("RECEIVED")
+)
+
+// MessageCompressedSize returns an attribute KeyValue conforming to the
+// "message.compressed_size" semantic conventions. It represents the compressed
+// size of the message in bytes.
+func MessageCompressedSize(val int) attribute.KeyValue {
+ return MessageCompressedSizeKey.Int(val)
+}
+
+// MessageID returns an attribute KeyValue conforming to the "message.id"
+// semantic conventions. It represents the mUST be calculated as two different
+// counters starting from `1` one for sent messages and one for received
+// message.
+func MessageID(val int) attribute.KeyValue {
+ return MessageIDKey.Int(val)
+}
+
+// MessageUncompressedSize returns an attribute KeyValue conforming to the
+// "message.uncompressed_size" semantic conventions. It represents the
+// uncompressed size of the message in bytes.
+func MessageUncompressedSize(val int) attribute.KeyValue {
+ return MessageUncompressedSizeKey.Int(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go
new file mode 100644
index 0000000000..7235bb51d9
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+const (
+ // ExceptionEventName is the name of the Span event representing an exception.
+ ExceptionEventName = "exception"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go
new file mode 100644
index 0000000000..a6b953f625
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go
@@ -0,0 +1,1071 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+const (
+
+ // DBClientConnectionsUsage is the metric conforming to the
+ // "db.client.connections.usage" semantic conventions. It represents the number
+ // of connections that are currently in state described by the `state`
+ // attribute.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsUsageName = "db.client.connections.usage"
+ DBClientConnectionsUsageUnit = "{connection}"
+ DBClientConnectionsUsageDescription = "The number of connections that are currently in state described by the `state` attribute"
+
+ // DBClientConnectionsIdleMax is the metric conforming to the
+ // "db.client.connections.idle.max" semantic conventions. It represents the
+ // maximum number of idle open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsIdleMaxName = "db.client.connections.idle.max"
+ DBClientConnectionsIdleMaxUnit = "{connection}"
+ DBClientConnectionsIdleMaxDescription = "The maximum number of idle open connections allowed"
+
+ // DBClientConnectionsIdleMin is the metric conforming to the
+ // "db.client.connections.idle.min" semantic conventions. It represents the
+ // minimum number of idle open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsIdleMinName = "db.client.connections.idle.min"
+ DBClientConnectionsIdleMinUnit = "{connection}"
+ DBClientConnectionsIdleMinDescription = "The minimum number of idle open connections allowed"
+
+ // DBClientConnectionsMax is the metric conforming to the
+ // "db.client.connections.max" semantic conventions. It represents the maximum
+ // number of open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsMaxName = "db.client.connections.max"
+ DBClientConnectionsMaxUnit = "{connection}"
+ DBClientConnectionsMaxDescription = "The maximum number of open connections allowed"
+
+ // DBClientConnectionsPendingRequests is the metric conforming to the
+ // "db.client.connections.pending_requests" semantic conventions. It represents
+ // the number of pending requests for an open connection, cumulative for the
+ // entire pool.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ DBClientConnectionsPendingRequestsName = "db.client.connections.pending_requests"
+ DBClientConnectionsPendingRequestsUnit = "{request}"
+ DBClientConnectionsPendingRequestsDescription = "The number of pending requests for an open connection, cumulative for the entire pool"
+
+ // DBClientConnectionsTimeouts is the metric conforming to the
+ // "db.client.connections.timeouts" semantic conventions. It represents the
+ // number of connection timeouts that have occurred trying to obtain a
+ // connection from the pool.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ DBClientConnectionsTimeoutsName = "db.client.connections.timeouts"
+ DBClientConnectionsTimeoutsUnit = "{timeout}"
+ DBClientConnectionsTimeoutsDescription = "The number of connection timeouts that have occurred trying to obtain a connection from the pool"
+
+ // DBClientConnectionsCreateTime is the metric conforming to the
+ // "db.client.connections.create_time" semantic conventions. It represents the
+ // time it took to create a new connection.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsCreateTimeName = "db.client.connections.create_time"
+ DBClientConnectionsCreateTimeUnit = "ms"
+ DBClientConnectionsCreateTimeDescription = "The time it took to create a new connection"
+
+ // DBClientConnectionsWaitTime is the metric conforming to the
+ // "db.client.connections.wait_time" semantic conventions. It represents the
+ // time it took to obtain an open connection from the pool.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsWaitTimeName = "db.client.connections.wait_time"
+ DBClientConnectionsWaitTimeUnit = "ms"
+ DBClientConnectionsWaitTimeDescription = "The time it took to obtain an open connection from the pool"
+
+ // DBClientConnectionsUseTime is the metric conforming to the
+ // "db.client.connections.use_time" semantic conventions. It represents the
+ // time between borrowing a connection and returning it to the pool.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsUseTimeName = "db.client.connections.use_time"
+ DBClientConnectionsUseTimeUnit = "ms"
+ DBClientConnectionsUseTimeDescription = "The time between borrowing a connection and returning it to the pool"
+
+ // AspnetcoreRoutingMatchAttempts is the metric conforming to the
+ // "aspnetcore.routing.match_attempts" semantic conventions. It represents the
+ // number of requests that were attempted to be matched to an endpoint.
+ // Instrument: counter
+ // Unit: {match_attempt}
+ // Stability: Experimental
+ AspnetcoreRoutingMatchAttemptsName = "aspnetcore.routing.match_attempts"
+ AspnetcoreRoutingMatchAttemptsUnit = "{match_attempt}"
+ AspnetcoreRoutingMatchAttemptsDescription = "Number of requests that were attempted to be matched to an endpoint."
+
+ // AspnetcoreDiagnosticsExceptions is the metric conforming to the
+ // "aspnetcore.diagnostics.exceptions" semantic conventions. It represents the
+ // number of exceptions caught by exception handling middleware.
+ // Instrument: counter
+ // Unit: {exception}
+ // Stability: Experimental
+ AspnetcoreDiagnosticsExceptionsName = "aspnetcore.diagnostics.exceptions"
+ AspnetcoreDiagnosticsExceptionsUnit = "{exception}"
+ AspnetcoreDiagnosticsExceptionsDescription = "Number of exceptions caught by exception handling middleware."
+
+ // AspnetcoreRateLimitingActiveRequestLeases is the metric conforming to the
+ // "aspnetcore.rate_limiting.active_request_leases" semantic conventions. It
+ // represents the number of requests that are currently active on the server
+ // that hold a rate limiting lease.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ AspnetcoreRateLimitingActiveRequestLeasesName = "aspnetcore.rate_limiting.active_request_leases"
+ AspnetcoreRateLimitingActiveRequestLeasesUnit = "{request}"
+ AspnetcoreRateLimitingActiveRequestLeasesDescription = "Number of requests that are currently active on the server that hold a rate limiting lease."
+
+ // AspnetcoreRateLimitingRequestLeaseDuration is the metric conforming to the
+ // "aspnetcore.rate_limiting.request_lease.duration" semantic conventions. It
+ // represents the duration of rate limiting lease held by requests on the
+ // server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ AspnetcoreRateLimitingRequestLeaseDurationName = "aspnetcore.rate_limiting.request_lease.duration"
+ AspnetcoreRateLimitingRequestLeaseDurationUnit = "s"
+ AspnetcoreRateLimitingRequestLeaseDurationDescription = "The duration of rate limiting lease held by requests on the server."
+
+ // AspnetcoreRateLimitingRequestTimeInQueue is the metric conforming to the
+ // "aspnetcore.rate_limiting.request.time_in_queue" semantic conventions. It
+ // represents the time the request spent in a queue waiting to acquire a rate
+ // limiting lease.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ AspnetcoreRateLimitingRequestTimeInQueueName = "aspnetcore.rate_limiting.request.time_in_queue"
+ AspnetcoreRateLimitingRequestTimeInQueueUnit = "s"
+ AspnetcoreRateLimitingRequestTimeInQueueDescription = "The time the request spent in a queue waiting to acquire a rate limiting lease."
+
+ // AspnetcoreRateLimitingQueuedRequests is the metric conforming to the
+ // "aspnetcore.rate_limiting.queued_requests" semantic conventions. It
+ // represents the number of requests that are currently queued, waiting to
+ // acquire a rate limiting lease.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ AspnetcoreRateLimitingQueuedRequestsName = "aspnetcore.rate_limiting.queued_requests"
+ AspnetcoreRateLimitingQueuedRequestsUnit = "{request}"
+ AspnetcoreRateLimitingQueuedRequestsDescription = "Number of requests that are currently queued, waiting to acquire a rate limiting lease."
+
+ // AspnetcoreRateLimitingRequests is the metric conforming to the
+ // "aspnetcore.rate_limiting.requests" semantic conventions. It represents the
+ // number of requests that tried to acquire a rate limiting lease.
+ // Instrument: counter
+ // Unit: {request}
+ // Stability: Experimental
+ AspnetcoreRateLimitingRequestsName = "aspnetcore.rate_limiting.requests"
+ AspnetcoreRateLimitingRequestsUnit = "{request}"
+ AspnetcoreRateLimitingRequestsDescription = "Number of requests that tried to acquire a rate limiting lease."
+
+ // DNSLookupDuration is the metric conforming to the "dns.lookup.duration"
+ // semantic conventions. It represents the measures the time taken to perform a
+ // DNS lookup.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DNSLookupDurationName = "dns.lookup.duration"
+ DNSLookupDurationUnit = "s"
+ DNSLookupDurationDescription = "Measures the time taken to perform a DNS lookup."
+
+ // HTTPClientOpenConnections is the metric conforming to the
+ // "http.client.open_connections" semantic conventions. It represents the
+ // number of outbound HTTP connections that are currently active or idle on the
+ // client.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ HTTPClientOpenConnectionsName = "http.client.open_connections"
+ HTTPClientOpenConnectionsUnit = "{connection}"
+ HTTPClientOpenConnectionsDescription = "Number of outbound HTTP connections that are currently active or idle on the client."
+
+ // HTTPClientConnectionDuration is the metric conforming to the
+ // "http.client.connection.duration" semantic conventions. It represents the
+ // duration of the successfully established outbound HTTP connections.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ HTTPClientConnectionDurationName = "http.client.connection.duration"
+ HTTPClientConnectionDurationUnit = "s"
+ HTTPClientConnectionDurationDescription = "The duration of the successfully established outbound HTTP connections."
+
+ // HTTPClientActiveRequests is the metric conforming to the
+ // "http.client.active_requests" semantic conventions. It represents the number
+ // of active HTTP requests.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ HTTPClientActiveRequestsName = "http.client.active_requests"
+ HTTPClientActiveRequestsUnit = "{request}"
+ HTTPClientActiveRequestsDescription = "Number of active HTTP requests."
+
+ // HTTPClientRequestTimeInQueue is the metric conforming to the
+ // "http.client.request.time_in_queue" semantic conventions. It represents the
+ // amount of time requests spent on a queue waiting for an available
+ // connection.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ HTTPClientRequestTimeInQueueName = "http.client.request.time_in_queue"
+ HTTPClientRequestTimeInQueueUnit = "s"
+ HTTPClientRequestTimeInQueueDescription = "The amount of time requests spent on a queue waiting for an available connection."
+
+ // KestrelActiveConnections is the metric conforming to the
+ // "kestrel.active_connections" semantic conventions. It represents the number
+ // of connections that are currently active on the server.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ KestrelActiveConnectionsName = "kestrel.active_connections"
+ KestrelActiveConnectionsUnit = "{connection}"
+ KestrelActiveConnectionsDescription = "Number of connections that are currently active on the server."
+
+ // KestrelConnectionDuration is the metric conforming to the
+ // "kestrel.connection.duration" semantic conventions. It represents the
+ // duration of connections on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ KestrelConnectionDurationName = "kestrel.connection.duration"
+ KestrelConnectionDurationUnit = "s"
+ KestrelConnectionDurationDescription = "The duration of connections on the server."
+
+ // KestrelRejectedConnections is the metric conforming to the
+ // "kestrel.rejected_connections" semantic conventions. It represents the
+ // number of connections rejected by the server.
+ // Instrument: counter
+ // Unit: {connection}
+ // Stability: Experimental
+ KestrelRejectedConnectionsName = "kestrel.rejected_connections"
+ KestrelRejectedConnectionsUnit = "{connection}"
+ KestrelRejectedConnectionsDescription = "Number of connections rejected by the server."
+
+ // KestrelQueuedConnections is the metric conforming to the
+ // "kestrel.queued_connections" semantic conventions. It represents the number
+ // of connections that are currently queued and are waiting to start.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ KestrelQueuedConnectionsName = "kestrel.queued_connections"
+ KestrelQueuedConnectionsUnit = "{connection}"
+ KestrelQueuedConnectionsDescription = "Number of connections that are currently queued and are waiting to start."
+
+ // KestrelQueuedRequests is the metric conforming to the
+ // "kestrel.queued_requests" semantic conventions. It represents the number of
+ // HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are
+ // currently queued and are waiting to start.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ KestrelQueuedRequestsName = "kestrel.queued_requests"
+ KestrelQueuedRequestsUnit = "{request}"
+ KestrelQueuedRequestsDescription = "Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start."
+
+ // KestrelUpgradedConnections is the metric conforming to the
+ // "kestrel.upgraded_connections" semantic conventions. It represents the
+ // number of connections that are currently upgraded (WebSockets). .
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ KestrelUpgradedConnectionsName = "kestrel.upgraded_connections"
+ KestrelUpgradedConnectionsUnit = "{connection}"
+ KestrelUpgradedConnectionsDescription = "Number of connections that are currently upgraded (WebSockets). ."
+
+ // KestrelTLSHandshakeDuration is the metric conforming to the
+ // "kestrel.tls_handshake.duration" semantic conventions. It represents the
+ // duration of TLS handshakes on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ KestrelTLSHandshakeDurationName = "kestrel.tls_handshake.duration"
+ KestrelTLSHandshakeDurationUnit = "s"
+ KestrelTLSHandshakeDurationDescription = "The duration of TLS handshakes on the server."
+
+ // KestrelActiveTLSHandshakes is the metric conforming to the
+ // "kestrel.active_tls_handshakes" semantic conventions. It represents the
+ // number of TLS handshakes that are currently in progress on the server.
+ // Instrument: updowncounter
+ // Unit: {handshake}
+ // Stability: Experimental
+ KestrelActiveTLSHandshakesName = "kestrel.active_tls_handshakes"
+ KestrelActiveTLSHandshakesUnit = "{handshake}"
+ KestrelActiveTLSHandshakesDescription = "Number of TLS handshakes that are currently in progress on the server."
+
+ // SignalrServerConnectionDuration is the metric conforming to the
+ // "signalr.server.connection.duration" semantic conventions. It represents the
+ // duration of connections on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ SignalrServerConnectionDurationName = "signalr.server.connection.duration"
+ SignalrServerConnectionDurationUnit = "s"
+ SignalrServerConnectionDurationDescription = "The duration of connections on the server."
+
+ // SignalrServerActiveConnections is the metric conforming to the
+ // "signalr.server.active_connections" semantic conventions. It represents the
+ // number of connections that are currently active on the server.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ SignalrServerActiveConnectionsName = "signalr.server.active_connections"
+ SignalrServerActiveConnectionsUnit = "{connection}"
+ SignalrServerActiveConnectionsDescription = "Number of connections that are currently active on the server."
+
+ // FaaSInvokeDuration is the metric conforming to the "faas.invoke_duration"
+ // semantic conventions. It represents the measures the duration of the
+ // function's logic execution.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSInvokeDurationName = "faas.invoke_duration"
+ FaaSInvokeDurationUnit = "s"
+ FaaSInvokeDurationDescription = "Measures the duration of the function's logic execution"
+
+ // FaaSInitDuration is the metric conforming to the "faas.init_duration"
+ // semantic conventions. It represents the measures the duration of the
+ // function's initialization, such as a cold start.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSInitDurationName = "faas.init_duration"
+ FaaSInitDurationUnit = "s"
+ FaaSInitDurationDescription = "Measures the duration of the function's initialization, such as a cold start"
+
+ // FaaSColdstarts is the metric conforming to the "faas.coldstarts" semantic
+ // conventions. It represents the number of invocation cold starts.
+ // Instrument: counter
+ // Unit: {coldstart}
+ // Stability: Experimental
+ FaaSColdstartsName = "faas.coldstarts"
+ FaaSColdstartsUnit = "{coldstart}"
+ FaaSColdstartsDescription = "Number of invocation cold starts"
+
+ // FaaSErrors is the metric conforming to the "faas.errors" semantic
+ // conventions. It represents the number of invocation errors.
+ // Instrument: counter
+ // Unit: {error}
+ // Stability: Experimental
+ FaaSErrorsName = "faas.errors"
+ FaaSErrorsUnit = "{error}"
+ FaaSErrorsDescription = "Number of invocation errors"
+
+ // FaaSInvocations is the metric conforming to the "faas.invocations" semantic
+ // conventions. It represents the number of successful invocations.
+ // Instrument: counter
+ // Unit: {invocation}
+ // Stability: Experimental
+ FaaSInvocationsName = "faas.invocations"
+ FaaSInvocationsUnit = "{invocation}"
+ FaaSInvocationsDescription = "Number of successful invocations"
+
+ // FaaSTimeouts is the metric conforming to the "faas.timeouts" semantic
+ // conventions. It represents the number of invocation timeouts.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ FaaSTimeoutsName = "faas.timeouts"
+ FaaSTimeoutsUnit = "{timeout}"
+ FaaSTimeoutsDescription = "Number of invocation timeouts"
+
+ // FaaSMemUsage is the metric conforming to the "faas.mem_usage" semantic
+ // conventions. It represents the distribution of max memory usage per
+ // invocation.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ FaaSMemUsageName = "faas.mem_usage"
+ FaaSMemUsageUnit = "By"
+ FaaSMemUsageDescription = "Distribution of max memory usage per invocation"
+
+ // FaaSCPUUsage is the metric conforming to the "faas.cpu_usage" semantic
+ // conventions. It represents the distribution of CPU usage per invocation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSCPUUsageName = "faas.cpu_usage"
+ FaaSCPUUsageUnit = "s"
+ FaaSCPUUsageDescription = "Distribution of CPU usage per invocation"
+
+ // FaaSNetIo is the metric conforming to the "faas.net_io" semantic
+ // conventions. It represents the distribution of net I/O usage per invocation.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ FaaSNetIoName = "faas.net_io"
+ FaaSNetIoUnit = "By"
+ FaaSNetIoDescription = "Distribution of net I/O usage per invocation"
+
+ // HTTPServerRequestDuration is the metric conforming to the
+ // "http.server.request.duration" semantic conventions. It represents the
+ // duration of HTTP server requests.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ HTTPServerRequestDurationName = "http.server.request.duration"
+ HTTPServerRequestDurationUnit = "s"
+ HTTPServerRequestDurationDescription = "Duration of HTTP server requests."
+
+ // HTTPServerActiveRequests is the metric conforming to the
+ // "http.server.active_requests" semantic conventions. It represents the number
+ // of active HTTP server requests.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ HTTPServerActiveRequestsName = "http.server.active_requests"
+ HTTPServerActiveRequestsUnit = "{request}"
+ HTTPServerActiveRequestsDescription = "Number of active HTTP server requests."
+
+ // HTTPServerRequestBodySize is the metric conforming to the
+ // "http.server.request.body.size" semantic conventions. It represents the size
+ // of HTTP server request bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPServerRequestBodySizeName = "http.server.request.body.size"
+ HTTPServerRequestBodySizeUnit = "By"
+ HTTPServerRequestBodySizeDescription = "Size of HTTP server request bodies."
+
+ // HTTPServerResponseBodySize is the metric conforming to the
+ // "http.server.response.body.size" semantic conventions. It represents the
+ // size of HTTP server response bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPServerResponseBodySizeName = "http.server.response.body.size"
+ HTTPServerResponseBodySizeUnit = "By"
+ HTTPServerResponseBodySizeDescription = "Size of HTTP server response bodies."
+
+ // HTTPClientRequestDuration is the metric conforming to the
+ // "http.client.request.duration" semantic conventions. It represents the
+ // duration of HTTP client requests.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ HTTPClientRequestDurationName = "http.client.request.duration"
+ HTTPClientRequestDurationUnit = "s"
+ HTTPClientRequestDurationDescription = "Duration of HTTP client requests."
+
+ // HTTPClientRequestBodySize is the metric conforming to the
+ // "http.client.request.body.size" semantic conventions. It represents the size
+ // of HTTP client request bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPClientRequestBodySizeName = "http.client.request.body.size"
+ HTTPClientRequestBodySizeUnit = "By"
+ HTTPClientRequestBodySizeDescription = "Size of HTTP client request bodies."
+
+ // HTTPClientResponseBodySize is the metric conforming to the
+ // "http.client.response.body.size" semantic conventions. It represents the
+ // size of HTTP client response bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPClientResponseBodySizeName = "http.client.response.body.size"
+ HTTPClientResponseBodySizeUnit = "By"
+ HTTPClientResponseBodySizeDescription = "Size of HTTP client response bodies."
+
+ // JvmMemoryInit is the metric conforming to the "jvm.memory.init" semantic
+ // conventions. It represents the measure of initial memory requested.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmMemoryInitName = "jvm.memory.init"
+ JvmMemoryInitUnit = "By"
+ JvmMemoryInitDescription = "Measure of initial memory requested."
+
+ // JvmSystemCPUUtilization is the metric conforming to the
+ // "jvm.system.cpu.utilization" semantic conventions. It represents the recent
+ // CPU utilization for the whole system as reported by the JVM.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ JvmSystemCPUUtilizationName = "jvm.system.cpu.utilization"
+ JvmSystemCPUUtilizationUnit = "1"
+ JvmSystemCPUUtilizationDescription = "Recent CPU utilization for the whole system as reported by the JVM."
+
+ // JvmSystemCPULoad1m is the metric conforming to the "jvm.system.cpu.load_1m"
+ // semantic conventions. It represents the average CPU load of the whole system
+ // for the last minute as reported by the JVM.
+ // Instrument: gauge
+ // Unit: {run_queue_item}
+ // Stability: Experimental
+ JvmSystemCPULoad1mName = "jvm.system.cpu.load_1m"
+ JvmSystemCPULoad1mUnit = "{run_queue_item}"
+ JvmSystemCPULoad1mDescription = "Average CPU load of the whole system for the last minute as reported by the JVM."
+
+ // JvmBufferMemoryUsage is the metric conforming to the
+ // "jvm.buffer.memory.usage" semantic conventions. It represents the measure of
+ // memory used by buffers.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmBufferMemoryUsageName = "jvm.buffer.memory.usage"
+ JvmBufferMemoryUsageUnit = "By"
+ JvmBufferMemoryUsageDescription = "Measure of memory used by buffers."
+
+ // JvmBufferMemoryLimit is the metric conforming to the
+ // "jvm.buffer.memory.limit" semantic conventions. It represents the measure of
+ // total memory capacity of buffers.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmBufferMemoryLimitName = "jvm.buffer.memory.limit"
+ JvmBufferMemoryLimitUnit = "By"
+ JvmBufferMemoryLimitDescription = "Measure of total memory capacity of buffers."
+
+ // JvmBufferCount is the metric conforming to the "jvm.buffer.count" semantic
+ // conventions. It represents the number of buffers in the pool.
+ // Instrument: updowncounter
+ // Unit: {buffer}
+ // Stability: Experimental
+ JvmBufferCountName = "jvm.buffer.count"
+ JvmBufferCountUnit = "{buffer}"
+ JvmBufferCountDescription = "Number of buffers in the pool."
+
+ // JvmMemoryUsed is the metric conforming to the "jvm.memory.used" semantic
+ // conventions. It represents the measure of memory used.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryUsedName = "jvm.memory.used"
+ JvmMemoryUsedUnit = "By"
+ JvmMemoryUsedDescription = "Measure of memory used."
+
+ // JvmMemoryCommitted is the metric conforming to the "jvm.memory.committed"
+ // semantic conventions. It represents the measure of memory committed.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryCommittedName = "jvm.memory.committed"
+ JvmMemoryCommittedUnit = "By"
+ JvmMemoryCommittedDescription = "Measure of memory committed."
+
+ // JvmMemoryLimit is the metric conforming to the "jvm.memory.limit" semantic
+ // conventions. It represents the measure of max obtainable memory.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryLimitName = "jvm.memory.limit"
+ JvmMemoryLimitUnit = "By"
+ JvmMemoryLimitDescription = "Measure of max obtainable memory."
+
+ // JvmMemoryUsedAfterLastGc is the metric conforming to the
+ // "jvm.memory.used_after_last_gc" semantic conventions. It represents the
+ // measure of memory used, as measured after the most recent garbage collection
+ // event on this pool.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryUsedAfterLastGcName = "jvm.memory.used_after_last_gc"
+ JvmMemoryUsedAfterLastGcUnit = "By"
+ JvmMemoryUsedAfterLastGcDescription = "Measure of memory used, as measured after the most recent garbage collection event on this pool."
+
+ // JvmGcDuration is the metric conforming to the "jvm.gc.duration" semantic
+ // conventions. It represents the duration of JVM garbage collection actions.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ JvmGcDurationName = "jvm.gc.duration"
+ JvmGcDurationUnit = "s"
+ JvmGcDurationDescription = "Duration of JVM garbage collection actions."
+
+ // JvmThreadCount is the metric conforming to the "jvm.thread.count" semantic
+ // conventions. It represents the number of executing platform threads.
+ // Instrument: updowncounter
+ // Unit: {thread}
+ // Stability: Stable
+ JvmThreadCountName = "jvm.thread.count"
+ JvmThreadCountUnit = "{thread}"
+ JvmThreadCountDescription = "Number of executing platform threads."
+
+ // JvmClassLoaded is the metric conforming to the "jvm.class.loaded" semantic
+ // conventions. It represents the number of classes loaded since JVM start.
+ // Instrument: counter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassLoadedName = "jvm.class.loaded"
+ JvmClassLoadedUnit = "{class}"
+ JvmClassLoadedDescription = "Number of classes loaded since JVM start."
+
+ // JvmClassUnloaded is the metric conforming to the "jvm.class.unloaded"
+ // semantic conventions. It represents the number of classes unloaded since JVM
+ // start.
+ // Instrument: counter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassUnloadedName = "jvm.class.unloaded"
+ JvmClassUnloadedUnit = "{class}"
+ JvmClassUnloadedDescription = "Number of classes unloaded since JVM start."
+
+ // JvmClassCount is the metric conforming to the "jvm.class.count" semantic
+ // conventions. It represents the number of classes currently loaded.
+ // Instrument: updowncounter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassCountName = "jvm.class.count"
+ JvmClassCountUnit = "{class}"
+ JvmClassCountDescription = "Number of classes currently loaded."
+
+ // JvmCPUCount is the metric conforming to the "jvm.cpu.count" semantic
+ // conventions. It represents the number of processors available to the Java
+ // virtual machine.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Stable
+ JvmCPUCountName = "jvm.cpu.count"
+ JvmCPUCountUnit = "{cpu}"
+ JvmCPUCountDescription = "Number of processors available to the Java virtual machine."
+
+ // JvmCPUTime is the metric conforming to the "jvm.cpu.time" semantic
+ // conventions. It represents the cPU time used by the process as reported by
+ // the JVM.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Stable
+ JvmCPUTimeName = "jvm.cpu.time"
+ JvmCPUTimeUnit = "s"
+ JvmCPUTimeDescription = "CPU time used by the process as reported by the JVM."
+
+ // JvmCPURecentUtilization is the metric conforming to the
+ // "jvm.cpu.recent_utilization" semantic conventions. It represents the recent
+ // CPU utilization for the process as reported by the JVM.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Stable
+ JvmCPURecentUtilizationName = "jvm.cpu.recent_utilization"
+ JvmCPURecentUtilizationUnit = "1"
+ JvmCPURecentUtilizationDescription = "Recent CPU utilization for the process as reported by the JVM."
+
+ // MessagingPublishDuration is the metric conforming to the
+ // "messaging.publish.duration" semantic conventions. It represents the
+ // measures the duration of publish operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingPublishDurationName = "messaging.publish.duration"
+ MessagingPublishDurationUnit = "s"
+ MessagingPublishDurationDescription = "Measures the duration of publish operation."
+
+ // MessagingReceiveDuration is the metric conforming to the
+ // "messaging.receive.duration" semantic conventions. It represents the
+ // measures the duration of receive operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingReceiveDurationName = "messaging.receive.duration"
+ MessagingReceiveDurationUnit = "s"
+ MessagingReceiveDurationDescription = "Measures the duration of receive operation."
+
+ // MessagingDeliverDuration is the metric conforming to the
+ // "messaging.deliver.duration" semantic conventions. It represents the
+ // measures the duration of deliver operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingDeliverDurationName = "messaging.deliver.duration"
+ MessagingDeliverDurationUnit = "s"
+ MessagingDeliverDurationDescription = "Measures the duration of deliver operation."
+
+ // MessagingPublishMessages is the metric conforming to the
+ // "messaging.publish.messages" semantic conventions. It represents the
+ // measures the number of published messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingPublishMessagesName = "messaging.publish.messages"
+ MessagingPublishMessagesUnit = "{message}"
+ MessagingPublishMessagesDescription = "Measures the number of published messages."
+
+ // MessagingReceiveMessages is the metric conforming to the
+ // "messaging.receive.messages" semantic conventions. It represents the
+ // measures the number of received messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingReceiveMessagesName = "messaging.receive.messages"
+ MessagingReceiveMessagesUnit = "{message}"
+ MessagingReceiveMessagesDescription = "Measures the number of received messages."
+
+ // MessagingDeliverMessages is the metric conforming to the
+ // "messaging.deliver.messages" semantic conventions. It represents the
+ // measures the number of delivered messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingDeliverMessagesName = "messaging.deliver.messages"
+ MessagingDeliverMessagesUnit = "{message}"
+ MessagingDeliverMessagesDescription = "Measures the number of delivered messages."
+
+ // RPCServerDuration is the metric conforming to the "rpc.server.duration"
+ // semantic conventions. It represents the measures the duration of inbound
+ // RPC.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ RPCServerDurationName = "rpc.server.duration"
+ RPCServerDurationUnit = "ms"
+ RPCServerDurationDescription = "Measures the duration of inbound RPC."
+
+ // RPCServerRequestSize is the metric conforming to the
+ // "rpc.server.request.size" semantic conventions. It represents the measures
+ // the size of RPC request messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCServerRequestSizeName = "rpc.server.request.size"
+ RPCServerRequestSizeUnit = "By"
+ RPCServerRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)."
+
+ // RPCServerResponseSize is the metric conforming to the
+ // "rpc.server.response.size" semantic conventions. It represents the measures
+ // the size of RPC response messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCServerResponseSizeName = "rpc.server.response.size"
+ RPCServerResponseSizeUnit = "By"
+ RPCServerResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)."
+
+ // RPCServerRequestsPerRPC is the metric conforming to the
+ // "rpc.server.requests_per_rpc" semantic conventions. It represents the
+ // measures the number of messages received per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCServerRequestsPerRPCName = "rpc.server.requests_per_rpc"
+ RPCServerRequestsPerRPCUnit = "{count}"
+ RPCServerRequestsPerRPCDescription = "Measures the number of messages received per RPC."
+
+ // RPCServerResponsesPerRPC is the metric conforming to the
+ // "rpc.server.responses_per_rpc" semantic conventions. It represents the
+ // measures the number of messages sent per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCServerResponsesPerRPCName = "rpc.server.responses_per_rpc"
+ RPCServerResponsesPerRPCUnit = "{count}"
+ RPCServerResponsesPerRPCDescription = "Measures the number of messages sent per RPC."
+
+ // RPCClientDuration is the metric conforming to the "rpc.client.duration"
+ // semantic conventions. It represents the measures the duration of outbound
+ // RPC.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ RPCClientDurationName = "rpc.client.duration"
+ RPCClientDurationUnit = "ms"
+ RPCClientDurationDescription = "Measures the duration of outbound RPC."
+
+ // RPCClientRequestSize is the metric conforming to the
+ // "rpc.client.request.size" semantic conventions. It represents the measures
+ // the size of RPC request messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCClientRequestSizeName = "rpc.client.request.size"
+ RPCClientRequestSizeUnit = "By"
+ RPCClientRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)."
+
+ // RPCClientResponseSize is the metric conforming to the
+ // "rpc.client.response.size" semantic conventions. It represents the measures
+ // the size of RPC response messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCClientResponseSizeName = "rpc.client.response.size"
+ RPCClientResponseSizeUnit = "By"
+ RPCClientResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)."
+
+ // RPCClientRequestsPerRPC is the metric conforming to the
+ // "rpc.client.requests_per_rpc" semantic conventions. It represents the
+ // measures the number of messages received per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCClientRequestsPerRPCName = "rpc.client.requests_per_rpc"
+ RPCClientRequestsPerRPCUnit = "{count}"
+ RPCClientRequestsPerRPCDescription = "Measures the number of messages received per RPC."
+
+ // RPCClientResponsesPerRPC is the metric conforming to the
+ // "rpc.client.responses_per_rpc" semantic conventions. It represents the
+ // measures the number of messages sent per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCClientResponsesPerRPCName = "rpc.client.responses_per_rpc"
+ RPCClientResponsesPerRPCUnit = "{count}"
+ RPCClientResponsesPerRPCDescription = "Measures the number of messages sent per RPC."
+
+ // SystemCPUTime is the metric conforming to the "system.cpu.time" semantic
+ // conventions. It represents the seconds each logical CPU spent on each mode.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemCPUTimeName = "system.cpu.time"
+ SystemCPUTimeUnit = "s"
+ SystemCPUTimeDescription = "Seconds each logical CPU spent on each mode"
+
+ // SystemCPUUtilization is the metric conforming to the
+ // "system.cpu.utilization" semantic conventions. It represents the difference
+ // in system.cpu.time since the last measurement, divided by the elapsed time
+ // and number of logical CPUs.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ SystemCPUUtilizationName = "system.cpu.utilization"
+ SystemCPUUtilizationUnit = "1"
+ SystemCPUUtilizationDescription = "Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs"
+
+ // SystemCPUFrequency is the metric conforming to the "system.cpu.frequency"
+ // semantic conventions. It represents the reports the current frequency of the
+ // CPU in Hz.
+ // Instrument: gauge
+ // Unit: {Hz}
+ // Stability: Experimental
+ SystemCPUFrequencyName = "system.cpu.frequency"
+ SystemCPUFrequencyUnit = "{Hz}"
+ SystemCPUFrequencyDescription = "Reports the current frequency of the CPU in Hz"
+
+ // SystemCPUPhysicalCount is the metric conforming to the
+ // "system.cpu.physical.count" semantic conventions. It represents the reports
+ // the number of actual physical processor cores on the hardware.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Experimental
+ SystemCPUPhysicalCountName = "system.cpu.physical.count"
+ SystemCPUPhysicalCountUnit = "{cpu}"
+ SystemCPUPhysicalCountDescription = "Reports the number of actual physical processor cores on the hardware"
+
+ // SystemCPULogicalCount is the metric conforming to the
+ // "system.cpu.logical.count" semantic conventions. It represents the reports
+ // the number of logical (virtual) processor cores created by the operating
+ // system to manage multitasking.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Experimental
+ SystemCPULogicalCountName = "system.cpu.logical.count"
+ SystemCPULogicalCountUnit = "{cpu}"
+ SystemCPULogicalCountDescription = "Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking"
+
+ // SystemMemoryUsage is the metric conforming to the "system.memory.usage"
+ // semantic conventions. It represents the reports memory in use by state.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemoryUsageName = "system.memory.usage"
+ SystemMemoryUsageUnit = "By"
+ SystemMemoryUsageDescription = "Reports memory in use by state."
+
+ // SystemMemoryLimit is the metric conforming to the "system.memory.limit"
+ // semantic conventions. It represents the total memory available in the
+ // system.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemoryLimitName = "system.memory.limit"
+ SystemMemoryLimitUnit = "By"
+ SystemMemoryLimitDescription = "Total memory available in the system."
+
+ // SystemMemoryUtilization is the metric conforming to the
+ // "system.memory.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemMemoryUtilizationName = "system.memory.utilization"
+ SystemMemoryUtilizationUnit = "1"
+
+ // SystemPagingUsage is the metric conforming to the "system.paging.usage"
+ // semantic conventions. It represents the unix swap or windows pagefile usage.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemPagingUsageName = "system.paging.usage"
+ SystemPagingUsageUnit = "By"
+ SystemPagingUsageDescription = "Unix swap or windows pagefile usage"
+
+ // SystemPagingUtilization is the metric conforming to the
+ // "system.paging.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingUtilizationName = "system.paging.utilization"
+ SystemPagingUtilizationUnit = "1"
+
+ // SystemPagingFaults is the metric conforming to the "system.paging.faults"
+ // semantic conventions.
+ // Instrument: counter
+ // Unit: {fault}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingFaultsName = "system.paging.faults"
+ SystemPagingFaultsUnit = "{fault}"
+
+ // SystemPagingOperations is the metric conforming to the
+ // "system.paging.operations" semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingOperationsName = "system.paging.operations"
+ SystemPagingOperationsUnit = "{operation}"
+
+ // SystemDiskIo is the metric conforming to the "system.disk.io" semantic
+ // conventions.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskIoName = "system.disk.io"
+ SystemDiskIoUnit = "By"
+
+ // SystemDiskOperations is the metric conforming to the
+ // "system.disk.operations" semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskOperationsName = "system.disk.operations"
+ SystemDiskOperationsUnit = "{operation}"
+
+ // SystemDiskIoTime is the metric conforming to the "system.disk.io_time"
+ // semantic conventions. It represents the time disk spent activated.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemDiskIoTimeName = "system.disk.io_time"
+ SystemDiskIoTimeUnit = "s"
+ SystemDiskIoTimeDescription = "Time disk spent activated"
+
+ // SystemDiskOperationTime is the metric conforming to the
+ // "system.disk.operation_time" semantic conventions. It represents the sum of
+ // the time each operation took to complete.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemDiskOperationTimeName = "system.disk.operation_time"
+ SystemDiskOperationTimeUnit = "s"
+ SystemDiskOperationTimeDescription = "Sum of the time each operation took to complete"
+
+ // SystemDiskMerged is the metric conforming to the "system.disk.merged"
+ // semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskMergedName = "system.disk.merged"
+ SystemDiskMergedUnit = "{operation}"
+
+ // SystemFilesystemUsage is the metric conforming to the
+ // "system.filesystem.usage" semantic conventions.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemFilesystemUsageName = "system.filesystem.usage"
+ SystemFilesystemUsageUnit = "By"
+
+ // SystemFilesystemUtilization is the metric conforming to the
+ // "system.filesystem.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemFilesystemUtilizationName = "system.filesystem.utilization"
+ SystemFilesystemUtilizationUnit = "1"
+
+ // SystemNetworkDropped is the metric conforming to the
+ // "system.network.dropped" semantic conventions. It represents the count of
+ // packets that are dropped or discarded even though there was no error.
+ // Instrument: counter
+ // Unit: {packet}
+ // Stability: Experimental
+ SystemNetworkDroppedName = "system.network.dropped"
+ SystemNetworkDroppedUnit = "{packet}"
+ SystemNetworkDroppedDescription = "Count of packets that are dropped or discarded even though there was no error"
+
+ // SystemNetworkPackets is the metric conforming to the
+ // "system.network.packets" semantic conventions.
+ // Instrument: counter
+ // Unit: {packet}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkPacketsName = "system.network.packets"
+ SystemNetworkPacketsUnit = "{packet}"
+
+ // SystemNetworkErrors is the metric conforming to the "system.network.errors"
+ // semantic conventions. It represents the count of network errors detected.
+ // Instrument: counter
+ // Unit: {error}
+ // Stability: Experimental
+ SystemNetworkErrorsName = "system.network.errors"
+ SystemNetworkErrorsUnit = "{error}"
+ SystemNetworkErrorsDescription = "Count of network errors detected"
+
+ // SystemNetworkIo is the metric conforming to the "system.network.io" semantic
+ // conventions.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkIoName = "system.network.io"
+ SystemNetworkIoUnit = "By"
+
+ // SystemNetworkConnections is the metric conforming to the
+ // "system.network.connections" semantic conventions.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkConnectionsName = "system.network.connections"
+ SystemNetworkConnectionsUnit = "{connection}"
+
+ // SystemProcessesCount is the metric conforming to the
+ // "system.processes.count" semantic conventions. It represents the total
+ // number of processes in each state.
+ // Instrument: updowncounter
+ // Unit: {process}
+ // Stability: Experimental
+ SystemProcessesCountName = "system.processes.count"
+ SystemProcessesCountUnit = "{process}"
+ SystemProcessesCountDescription = "Total number of processes in each state"
+
+ // SystemProcessesCreated is the metric conforming to the
+ // "system.processes.created" semantic conventions. It represents the total
+ // number of processes created over uptime of the host.
+ // Instrument: counter
+ // Unit: {process}
+ // Stability: Experimental
+ SystemProcessesCreatedName = "system.processes.created"
+ SystemProcessesCreatedUnit = "{process}"
+ SystemProcessesCreatedDescription = "Total number of processes created over uptime of the host"
+
+ // SystemLinuxMemoryAvailable is the metric conforming to the
+ // "system.linux.memory.available" semantic conventions. It represents an
+ // estimate of how much memory is available for starting new applications,
+ // without causing swapping.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemLinuxMemoryAvailableName = "system.linux.memory.available"
+ SystemLinuxMemoryAvailableUnit = "By"
+ SystemLinuxMemoryAvailableDescription = "An estimate of how much memory is available for starting new applications, without causing swapping"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go
new file mode 100644
index 0000000000..d66bbe9c23
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go
@@ -0,0 +1,2545 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// A cloud environment (e.g. GCP, Azure, AWS).
+const (
+ // CloudAccountIDKey is the attribute Key conforming to the
+ // "cloud.account.id" semantic conventions. It represents the cloud account
+ // ID the resource is assigned to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '111111111111', 'opentelemetry'
+ CloudAccountIDKey = attribute.Key("cloud.account.id")
+
+ // CloudAvailabilityZoneKey is the attribute Key conforming to the
+ // "cloud.availability_zone" semantic conventions. It represents the cloud
+ // regions often have multiple, isolated locations known as zones to
+ // increase availability. Availability zone represents the zone where the
+ // resource is running.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-east-1c'
+ // Note: Availability zones are called "zones" on Alibaba Cloud and Google
+ // Cloud.
+ CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone")
+
+ // CloudPlatformKey is the attribute Key conforming to the "cloud.platform"
+ // semantic conventions. It represents the cloud platform in use.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The prefix of the service SHOULD match the one specified in
+ // `cloud.provider`.
+ CloudPlatformKey = attribute.Key("cloud.platform")
+
+ // CloudProviderKey is the attribute Key conforming to the "cloud.provider"
+ // semantic conventions. It represents the name of the cloud provider.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ CloudProviderKey = attribute.Key("cloud.provider")
+
+ // CloudRegionKey is the attribute Key conforming to the "cloud.region"
+ // semantic conventions. It represents the geographical region the resource
+ // is running.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-central1', 'us-east-1'
+ // Note: Refer to your provider's docs to see the available regions, for
+ // example [Alibaba Cloud
+ // regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS
+ // regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/),
+ // [Azure
+ // regions](https://azure.microsoft.com/global-infrastructure/geographies/),
+ // [Google Cloud regions](https://cloud.google.com/about/locations), or
+ // [Tencent Cloud
+ // regions](https://www.tencentcloud.com/document/product/213/6091).
+ CloudRegionKey = attribute.Key("cloud.region")
+
+ // CloudResourceIDKey is the attribute Key conforming to the
+ // "cloud.resource_id" semantic conventions. It represents the cloud
+ // provider-specific native identifier of the monitored cloud resource
+ // (e.g. an
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // on AWS, a [fully qualified resource
+ // ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id)
+ // on Azure, a [full resource
+ // name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+ // on GCP)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function',
+ // '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID',
+ // '/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/'
+ // Note: On some cloud providers, it may not be possible to determine the
+ // full ID at startup,
+ // so it may be necessary to set `cloud.resource_id` as a span attribute
+ // instead.
+ //
+ // The exact value to use for `cloud.resource_id` depends on the cloud
+ // provider.
+ // The following well-known definitions MUST be used if you set this
+ // attribute and they apply:
+ //
+ // * **AWS Lambda:** The function
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
+ // Take care not to use the "invoked ARN" directly but replace any
+ // [alias
+ // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
+ // with the resolved function version, as the same runtime instance may
+ // be invokable with
+ // multiple different aliases.
+ // * **GCP:** The [URI of the
+ // resource](https://cloud.google.com/iam/docs/full-resource-names)
+ // * **Azure:** The [Fully Qualified Resource
+ // ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id)
+ // of the invoked function,
+ // *not* the function app, having the form
+ // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`.
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider.
+ CloudResourceIDKey = attribute.Key("cloud.resource_id")
+)
+
+var (
+ // Alibaba Cloud Elastic Compute Service
+ CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs")
+ // Alibaba Cloud Function Compute
+ CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc")
+ // Red Hat OpenShift on Alibaba Cloud
+ CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift")
+ // AWS Elastic Compute Cloud
+ CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2")
+ // AWS Elastic Container Service
+ CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs")
+ // AWS Elastic Kubernetes Service
+ CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks")
+ // AWS Lambda
+ CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda")
+ // AWS Elastic Beanstalk
+ CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk")
+ // AWS App Runner
+ CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner")
+ // Red Hat OpenShift on AWS (ROSA)
+ CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift")
+ // Azure Virtual Machines
+ CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm")
+ // Azure Container Instances
+ CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances")
+ // Azure Kubernetes Service
+ CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks")
+ // Azure Functions
+ CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions")
+ // Azure App Service
+ CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service")
+ // Azure Red Hat OpenShift
+ CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift")
+ // Google Bare Metal Solution (BMS)
+ CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution")
+ // Google Cloud Compute Engine (GCE)
+ CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine")
+ // Google Cloud Run
+ CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run")
+ // Google Cloud Kubernetes Engine (GKE)
+ CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine")
+ // Google Cloud Functions (GCF)
+ CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions")
+ // Google Cloud App Engine (GAE)
+ CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine")
+ // Red Hat OpenShift on Google Cloud
+ CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift")
+ // Red Hat OpenShift on IBM Cloud
+ CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift")
+ // Tencent Cloud Cloud Virtual Machine (CVM)
+ CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm")
+ // Tencent Cloud Elastic Kubernetes Service (EKS)
+ CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks")
+ // Tencent Cloud Serverless Cloud Function (SCF)
+ CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf")
+)
+
+var (
+ // Alibaba Cloud
+ CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ CloudProviderAWS = CloudProviderKey.String("aws")
+ // Microsoft Azure
+ CloudProviderAzure = CloudProviderKey.String("azure")
+ // Google Cloud Platform
+ CloudProviderGCP = CloudProviderKey.String("gcp")
+ // Heroku Platform as a Service
+ CloudProviderHeroku = CloudProviderKey.String("heroku")
+ // IBM Cloud
+ CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud")
+ // Tencent Cloud
+ CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud")
+)
+
+// CloudAccountID returns an attribute KeyValue conforming to the
+// "cloud.account.id" semantic conventions. It represents the cloud account ID
+// the resource is assigned to.
+func CloudAccountID(val string) attribute.KeyValue {
+ return CloudAccountIDKey.String(val)
+}
+
+// CloudAvailabilityZone returns an attribute KeyValue conforming to the
+// "cloud.availability_zone" semantic conventions. It represents the cloud
+// regions often have multiple, isolated locations known as zones to increase
+// availability. Availability zone represents the zone where the resource is
+// running.
+func CloudAvailabilityZone(val string) attribute.KeyValue {
+ return CloudAvailabilityZoneKey.String(val)
+}
+
+// CloudRegion returns an attribute KeyValue conforming to the
+// "cloud.region" semantic conventions. It represents the geographical region
+// the resource is running.
+func CloudRegion(val string) attribute.KeyValue {
+ return CloudRegionKey.String(val)
+}
+
+// CloudResourceID returns an attribute KeyValue conforming to the
+// "cloud.resource_id" semantic conventions. It represents the cloud
+// provider-specific native identifier of the monitored cloud resource (e.g. an
+// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+// on AWS, a [fully qualified resource
+// ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on
+// Azure, a [full resource
+// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+// on GCP)
+func CloudResourceID(val string) attribute.KeyValue {
+ return CloudResourceIDKey.String(val)
+}
+
+// A container instance.
+const (
+ // ContainerCommandKey is the attribute Key conforming to the
+ // "container.command" semantic conventions. It represents the command used
+ // to run the container (i.e. the command name).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol'
+ // Note: If using embedded credentials or sensitive data, it is recommended
+ // to remove them to prevent potential leakage.
+ ContainerCommandKey = attribute.Key("container.command")
+
+ // ContainerCommandArgsKey is the attribute Key conforming to the
+ // "container.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) run by the
+ // container. [2]
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol, --config, config.yaml'
+ ContainerCommandArgsKey = attribute.Key("container.command_args")
+
+ // ContainerCommandLineKey is the attribute Key conforming to the
+ // "container.command_line" semantic conventions. It represents the full
+ // command run by the container as a single string representing the full
+ // command. [2]
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol --config config.yaml'
+ ContainerCommandLineKey = attribute.Key("container.command_line")
+
+ // ContainerIDKey is the attribute Key conforming to the "container.id"
+ // semantic conventions. It represents the container ID. Usually a UUID, as
+ // for example used to [identify Docker
+ // containers](https://docs.docker.com/engine/reference/run/#container-identification).
+ // The UUID might be abbreviated.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'a3bf90e006b2'
+ ContainerIDKey = attribute.Key("container.id")
+
+ // ContainerImageIDKey is the attribute Key conforming to the
+ // "container.image.id" semantic conventions. It represents the runtime
+ // specific image identifier. Usually a hash algorithm followed by a UUID.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f'
+ // Note: Docker defines a sha256 of the image id; `container.image.id`
+ // corresponds to the `Image` field from the Docker container inspect
+ // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect)
+ // endpoint.
+ // K8S defines a link to the container registry repository with digest
+ // `"imageID": "registry.azurecr.io
+ // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
+ // The ID is assinged by the container runtime and can vary in different
+ // environments. Consider using `oci.manifest.digest` if it is important to
+ // identify the same image in different environments/runtimes.
+ ContainerImageIDKey = attribute.Key("container.image.id")
+
+ // ContainerImageNameKey is the attribute Key conforming to the
+ // "container.image.name" semantic conventions. It represents the name of
+ // the image the container was built on.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gcr.io/opentelemetry/operator'
+ ContainerImageNameKey = attribute.Key("container.image.name")
+
+ // ContainerImageRepoDigestsKey is the attribute Key conforming to the
+ // "container.image.repo_digests" semantic conventions. It represents the
+ // repo digests of the container image as provided by the container
+ // runtime.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb',
+ // 'internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578'
+ // Note:
+ // [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect)
+ // and
+ // [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238)
+ // report those under the `RepoDigests` field.
+ ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests")
+
+ // ContainerImageTagsKey is the attribute Key conforming to the
+ // "container.image.tags" semantic conventions. It represents the container
+ // image tags. An example can be found in [Docker Image
+ // Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
+ // Should be only the `` section of the full name for example from
+ // `registry.example.com/my-org/my-image:`.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'v1.27.1', '3.5.7-0'
+ ContainerImageTagsKey = attribute.Key("container.image.tags")
+
+ // ContainerNameKey is the attribute Key conforming to the "container.name"
+ // semantic conventions. It represents the container name used by container
+ // runtime.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-autoconf'
+ ContainerNameKey = attribute.Key("container.name")
+
+ // ContainerRuntimeKey is the attribute Key conforming to the
+ // "container.runtime" semantic conventions. It represents the container
+ // runtime managing this container.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'docker', 'containerd', 'rkt'
+ ContainerRuntimeKey = attribute.Key("container.runtime")
+)
+
+// ContainerCommand returns an attribute KeyValue conforming to the
+// "container.command" semantic conventions. It represents the command used to
+// run the container (i.e. the command name).
+func ContainerCommand(val string) attribute.KeyValue {
+ return ContainerCommandKey.String(val)
+}
+
+// ContainerCommandArgs returns an attribute KeyValue conforming to the
+// "container.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) run by the
+// container. [2]
+func ContainerCommandArgs(val ...string) attribute.KeyValue {
+ return ContainerCommandArgsKey.StringSlice(val)
+}
+
+// ContainerCommandLine returns an attribute KeyValue conforming to the
+// "container.command_line" semantic conventions. It represents the full
+// command run by the container as a single string representing the full
+// command. [2]
+func ContainerCommandLine(val string) attribute.KeyValue {
+ return ContainerCommandLineKey.String(val)
+}
+
+// ContainerID returns an attribute KeyValue conforming to the
+// "container.id" semantic conventions. It represents the container ID. Usually
+// a UUID, as for example used to [identify Docker
+// containers](https://docs.docker.com/engine/reference/run/#container-identification).
+// The UUID might be abbreviated.
+func ContainerID(val string) attribute.KeyValue {
+ return ContainerIDKey.String(val)
+}
+
+// ContainerImageID returns an attribute KeyValue conforming to the
+// "container.image.id" semantic conventions. It represents the runtime
+// specific image identifier. Usually a hash algorithm followed by a UUID.
+func ContainerImageID(val string) attribute.KeyValue {
+ return ContainerImageIDKey.String(val)
+}
+
+// ContainerImageName returns an attribute KeyValue conforming to the
+// "container.image.name" semantic conventions. It represents the name of the
+// image the container was built on.
+func ContainerImageName(val string) attribute.KeyValue {
+ return ContainerImageNameKey.String(val)
+}
+
+// ContainerImageRepoDigests returns an attribute KeyValue conforming to the
+// "container.image.repo_digests" semantic conventions. It represents the repo
+// digests of the container image as provided by the container runtime.
+func ContainerImageRepoDigests(val ...string) attribute.KeyValue {
+ return ContainerImageRepoDigestsKey.StringSlice(val)
+}
+
+// ContainerImageTags returns an attribute KeyValue conforming to the
+// "container.image.tags" semantic conventions. It represents the container
+// image tags. An example can be found in [Docker Image
+// Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
+// Should be only the `` section of the full name for example from
+// `registry.example.com/my-org/my-image:`.
+func ContainerImageTags(val ...string) attribute.KeyValue {
+ return ContainerImageTagsKey.StringSlice(val)
+}
+
+// ContainerName returns an attribute KeyValue conforming to the
+// "container.name" semantic conventions. It represents the container name used
+// by container runtime.
+func ContainerName(val string) attribute.KeyValue {
+ return ContainerNameKey.String(val)
+}
+
+// ContainerRuntime returns an attribute KeyValue conforming to the
+// "container.runtime" semantic conventions. It represents the container
+// runtime managing this container.
+func ContainerRuntime(val string) attribute.KeyValue {
+ return ContainerRuntimeKey.String(val)
+}
+
+// Describes device attributes.
+const (
+ // DeviceIDKey is the attribute Key conforming to the "device.id" semantic
+ // conventions. It represents a unique identifier representing the device
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092'
+ // Note: The device identifier MUST only be defined using the values
+ // outlined below. This value is not an advertising identifier and MUST NOT
+ // be used as such. On iOS (Swift or Objective-C), this value MUST be equal
+ // to the [vendor
+ // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor).
+ // On Android (Java or Kotlin), this value MUST be equal to the Firebase
+ // Installation ID or a globally unique UUID which is persisted across
+ // sessions in your application. More information can be found
+ // [here](https://developer.android.com/training/articles/user-data-ids) on
+ // best practices and exact implementation details. Caution should be taken
+ // when storing personal data or anything which can identify a user. GDPR
+ // and data protection laws may apply, ensure you do your own due
+ // diligence.
+ DeviceIDKey = attribute.Key("device.id")
+
+ // DeviceManufacturerKey is the attribute Key conforming to the
+ // "device.manufacturer" semantic conventions. It represents the name of
+ // the device manufacturer
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Apple', 'Samsung'
+ // Note: The Android OS provides this field via
+ // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER).
+ // iOS apps SHOULD hardcode the value `Apple`.
+ DeviceManufacturerKey = attribute.Key("device.manufacturer")
+
+ // DeviceModelIdentifierKey is the attribute Key conforming to the
+ // "device.model.identifier" semantic conventions. It represents the model
+ // identifier for the device
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iPhone3,4', 'SM-G920F'
+ // Note: It's recommended this value represents a machine-readable version
+ // of the model identifier rather than the market or consumer-friendly name
+ // of the device.
+ DeviceModelIdentifierKey = attribute.Key("device.model.identifier")
+
+ // DeviceModelNameKey is the attribute Key conforming to the
+ // "device.model.name" semantic conventions. It represents the marketing
+ // name for the device model
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6'
+ // Note: It's recommended this value represents a human-readable version of
+ // the device model rather than a machine-readable alternative.
+ DeviceModelNameKey = attribute.Key("device.model.name")
+)
+
+// DeviceID returns an attribute KeyValue conforming to the "device.id"
+// semantic conventions. It represents a unique identifier representing the
+// device
+func DeviceID(val string) attribute.KeyValue {
+ return DeviceIDKey.String(val)
+}
+
+// DeviceManufacturer returns an attribute KeyValue conforming to the
+// "device.manufacturer" semantic conventions. It represents the name of the
+// device manufacturer
+func DeviceManufacturer(val string) attribute.KeyValue {
+ return DeviceManufacturerKey.String(val)
+}
+
+// DeviceModelIdentifier returns an attribute KeyValue conforming to the
+// "device.model.identifier" semantic conventions. It represents the model
+// identifier for the device
+func DeviceModelIdentifier(val string) attribute.KeyValue {
+ return DeviceModelIdentifierKey.String(val)
+}
+
+// DeviceModelName returns an attribute KeyValue conforming to the
+// "device.model.name" semantic conventions. It represents the marketing name
+// for the device model
+func DeviceModelName(val string) attribute.KeyValue {
+ return DeviceModelNameKey.String(val)
+}
+
+// A host is defined as a computing instance. For example, physical servers,
+// virtual machines, switches or disk array.
+const (
+ // HostArchKey is the attribute Key conforming to the "host.arch" semantic
+ // conventions. It represents the CPU architecture the host system is
+ // running on.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ HostArchKey = attribute.Key("host.arch")
+
+ // HostCPUCacheL2SizeKey is the attribute Key conforming to the
+ // "host.cpu.cache.l2.size" semantic conventions. It represents the amount
+ // of level 2 memory cache available to the processor (in Bytes).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 12288000
+ HostCPUCacheL2SizeKey = attribute.Key("host.cpu.cache.l2.size")
+
+ // HostCPUFamilyKey is the attribute Key conforming to the
+ // "host.cpu.family" semantic conventions. It represents the family or
+ // generation of the CPU.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '6', 'PA-RISC 1.1e'
+ HostCPUFamilyKey = attribute.Key("host.cpu.family")
+
+ // HostCPUModelIDKey is the attribute Key conforming to the
+ // "host.cpu.model.id" semantic conventions. It represents the model
+ // identifier. It provides more granular information about the CPU,
+ // distinguishing it from other CPUs within the same family.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '6', '9000/778/B180L'
+ HostCPUModelIDKey = attribute.Key("host.cpu.model.id")
+
+ // HostCPUModelNameKey is the attribute Key conforming to the
+ // "host.cpu.model.name" semantic conventions. It represents the model
+ // designation of the processor.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz'
+ HostCPUModelNameKey = attribute.Key("host.cpu.model.name")
+
+ // HostCPUSteppingKey is the attribute Key conforming to the
+ // "host.cpu.stepping" semantic conventions. It represents the stepping or
+ // core revisions.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1
+ HostCPUSteppingKey = attribute.Key("host.cpu.stepping")
+
+ // HostCPUVendorIDKey is the attribute Key conforming to the
+ // "host.cpu.vendor.id" semantic conventions. It represents the processor
+ // manufacturer identifier. A maximum 12-character string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'GenuineIntel'
+ // Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor
+ // ID string in EBX, EDX and ECX registers. Writing these to memory in this
+ // order results in a 12-character string.
+ HostCPUVendorIDKey = attribute.Key("host.cpu.vendor.id")
+
+ // HostIDKey is the attribute Key conforming to the "host.id" semantic
+ // conventions. It represents the unique host ID. For Cloud, this must be
+ // the instance_id assigned by the cloud provider. For non-containerized
+ // systems, this should be the `machine-id`. See the table below for the
+ // sources to use to determine the `machine-id` based on operating system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'fdbf79e8af94cb7f9e8df36789187052'
+ HostIDKey = attribute.Key("host.id")
+
+ // HostImageIDKey is the attribute Key conforming to the "host.image.id"
+ // semantic conventions. It represents the vM image ID or host OS image ID.
+ // For Cloud, this value is from the provider.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ami-07b06b442921831e5'
+ HostImageIDKey = attribute.Key("host.image.id")
+
+ // HostImageNameKey is the attribute Key conforming to the
+ // "host.image.name" semantic conventions. It represents the name of the VM
+ // image or OS install the host was instantiated from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905'
+ HostImageNameKey = attribute.Key("host.image.name")
+
+ // HostImageVersionKey is the attribute Key conforming to the
+ // "host.image.version" semantic conventions. It represents the version
+ // string of the VM image or host OS as defined in [Version
+ // Attributes](/docs/resource/README.md#version-attributes).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0.1'
+ HostImageVersionKey = attribute.Key("host.image.version")
+
+ // HostIPKey is the attribute Key conforming to the "host.ip" semantic
+ // conventions. It represents the available IP addresses of the host,
+ // excluding loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '192.168.1.140', 'fe80::abc2:4a28:737a:609e'
+ // Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6
+ // addresses MUST be specified in the [RFC
+ // 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format.
+ HostIPKey = attribute.Key("host.ip")
+
+ // HostMacKey is the attribute Key conforming to the "host.mac" semantic
+ // conventions. It represents the available MAC addresses of the host,
+ // excluding loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'AC-DE-48-23-45-67', 'AC-DE-48-23-45-67-01-9F'
+ // Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal
+ // form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf):
+ // as hyphen-separated octets in uppercase hexadecimal form from most to
+ // least significant.
+ HostMacKey = attribute.Key("host.mac")
+
+ // HostNameKey is the attribute Key conforming to the "host.name" semantic
+ // conventions. It represents the name of the host. On Unix systems, it may
+ // contain what the hostname command returns, or the fully qualified
+ // hostname, or another name specified by the user.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-test'
+ HostNameKey = attribute.Key("host.name")
+
+ // HostTypeKey is the attribute Key conforming to the "host.type" semantic
+ // conventions. It represents the type of host. For Cloud, this must be the
+ // machine type.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'n1-standard-1'
+ HostTypeKey = attribute.Key("host.type")
+)
+
+var (
+ // AMD64
+ HostArchAMD64 = HostArchKey.String("amd64")
+ // ARM32
+ HostArchARM32 = HostArchKey.String("arm32")
+ // ARM64
+ HostArchARM64 = HostArchKey.String("arm64")
+ // Itanium
+ HostArchIA64 = HostArchKey.String("ia64")
+ // 32-bit PowerPC
+ HostArchPPC32 = HostArchKey.String("ppc32")
+ // 64-bit PowerPC
+ HostArchPPC64 = HostArchKey.String("ppc64")
+ // IBM z/Architecture
+ HostArchS390x = HostArchKey.String("s390x")
+ // 32-bit x86
+ HostArchX86 = HostArchKey.String("x86")
+)
+
+// HostCPUCacheL2Size returns an attribute KeyValue conforming to the
+// "host.cpu.cache.l2.size" semantic conventions. It represents the amount of
+// level 2 memory cache available to the processor (in Bytes).
+func HostCPUCacheL2Size(val int) attribute.KeyValue {
+ return HostCPUCacheL2SizeKey.Int(val)
+}
+
+// HostCPUFamily returns an attribute KeyValue conforming to the
+// "host.cpu.family" semantic conventions. It represents the family or
+// generation of the CPU.
+func HostCPUFamily(val string) attribute.KeyValue {
+ return HostCPUFamilyKey.String(val)
+}
+
+// HostCPUModelID returns an attribute KeyValue conforming to the
+// "host.cpu.model.id" semantic conventions. It represents the model
+// identifier. It provides more granular information about the CPU,
+// distinguishing it from other CPUs within the same family.
+func HostCPUModelID(val string) attribute.KeyValue {
+ return HostCPUModelIDKey.String(val)
+}
+
+// HostCPUModelName returns an attribute KeyValue conforming to the
+// "host.cpu.model.name" semantic conventions. It represents the model
+// designation of the processor.
+func HostCPUModelName(val string) attribute.KeyValue {
+ return HostCPUModelNameKey.String(val)
+}
+
+// HostCPUStepping returns an attribute KeyValue conforming to the
+// "host.cpu.stepping" semantic conventions. It represents the stepping or core
+// revisions.
+func HostCPUStepping(val int) attribute.KeyValue {
+ return HostCPUSteppingKey.Int(val)
+}
+
+// HostCPUVendorID returns an attribute KeyValue conforming to the
+// "host.cpu.vendor.id" semantic conventions. It represents the processor
+// manufacturer identifier. A maximum 12-character string.
+func HostCPUVendorID(val string) attribute.KeyValue {
+ return HostCPUVendorIDKey.String(val)
+}
+
+// HostID returns an attribute KeyValue conforming to the "host.id" semantic
+// conventions. It represents the unique host ID. For Cloud, this must be the
+// instance_id assigned by the cloud provider. For non-containerized systems,
+// this should be the `machine-id`. See the table below for the sources to use
+// to determine the `machine-id` based on operating system.
+func HostID(val string) attribute.KeyValue {
+ return HostIDKey.String(val)
+}
+
+// HostImageID returns an attribute KeyValue conforming to the
+// "host.image.id" semantic conventions. It represents the vM image ID or host
+// OS image ID. For Cloud, this value is from the provider.
+func HostImageID(val string) attribute.KeyValue {
+ return HostImageIDKey.String(val)
+}
+
+// HostImageName returns an attribute KeyValue conforming to the
+// "host.image.name" semantic conventions. It represents the name of the VM
+// image or OS install the host was instantiated from.
+func HostImageName(val string) attribute.KeyValue {
+ return HostImageNameKey.String(val)
+}
+
+// HostImageVersion returns an attribute KeyValue conforming to the
+// "host.image.version" semantic conventions. It represents the version string
+// of the VM image or host OS as defined in [Version
+// Attributes](/docs/resource/README.md#version-attributes).
+func HostImageVersion(val string) attribute.KeyValue {
+ return HostImageVersionKey.String(val)
+}
+
+// HostIP returns an attribute KeyValue conforming to the "host.ip" semantic
+// conventions. It represents the available IP addresses of the host, excluding
+// loopback interfaces.
+func HostIP(val ...string) attribute.KeyValue {
+ return HostIPKey.StringSlice(val)
+}
+
+// HostMac returns an attribute KeyValue conforming to the "host.mac"
+// semantic conventions. It represents the available MAC addresses of the host,
+// excluding loopback interfaces.
+func HostMac(val ...string) attribute.KeyValue {
+ return HostMacKey.StringSlice(val)
+}
+
+// HostName returns an attribute KeyValue conforming to the "host.name"
+// semantic conventions. It represents the name of the host. On Unix systems,
+// it may contain what the hostname command returns, or the fully qualified
+// hostname, or another name specified by the user.
+func HostName(val string) attribute.KeyValue {
+ return HostNameKey.String(val)
+}
+
+// HostType returns an attribute KeyValue conforming to the "host.type"
+// semantic conventions. It represents the type of host. For Cloud, this must
+// be the machine type.
+func HostType(val string) attribute.KeyValue {
+ return HostTypeKey.String(val)
+}
+
+// Kubernetes resource attributes.
+const (
+ // K8SClusterNameKey is the attribute Key conforming to the
+ // "k8s.cluster.name" semantic conventions. It represents the name of the
+ // cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-cluster'
+ K8SClusterNameKey = attribute.Key("k8s.cluster.name")
+
+ // K8SClusterUIDKey is the attribute Key conforming to the
+ // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for
+ // the cluster, set to the UID of the `kube-system` namespace.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d'
+ // Note: K8S doesn't have support for obtaining a cluster ID. If this is
+ // ever
+ // added, we will recommend collecting the `k8s.cluster.uid` through the
+ // official APIs. In the meantime, we are able to use the `uid` of the
+ // `kube-system` namespace as a proxy for cluster ID. Read on for the
+ // rationale.
+ //
+ // Every object created in a K8S cluster is assigned a distinct UID. The
+ // `kube-system` namespace is used by Kubernetes itself and will exist
+ // for the lifetime of the cluster. Using the `uid` of the `kube-system`
+ // namespace is a reasonable proxy for the K8S ClusterID as it will only
+ // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are
+ // UUIDs as standardized by
+ // [ISO/IEC 9834-8 and ITU-T
+ // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html).
+ // Which states:
+ //
+ // > If generated according to one of the mechanisms defined in Rec.
+ // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be
+ // different from all other UUIDs generated before 3603 A.D., or is
+ // extremely likely to be different (depending on the mechanism chosen).
+ //
+ // Therefore, UIDs between clusters should be extremely unlikely to
+ // conflict.
+ K8SClusterUIDKey = attribute.Key("k8s.cluster.uid")
+
+ // K8SContainerNameKey is the attribute Key conforming to the
+ // "k8s.container.name" semantic conventions. It represents the name of the
+ // Container from Pod specification, must be unique within a Pod. Container
+ // runtime usually uses different globally unique name (`container.name`).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'redis'
+ K8SContainerNameKey = attribute.Key("k8s.container.name")
+
+ // K8SContainerRestartCountKey is the attribute Key conforming to the
+ // "k8s.container.restart_count" semantic conventions. It represents the
+ // number of times the container was restarted. This attribute can be used
+ // to identify a particular container (running or stopped) within a
+ // container spec.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 2
+ K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count")
+
+ // K8SCronJobNameKey is the attribute Key conforming to the
+ // "k8s.cronjob.name" semantic conventions. It represents the name of the
+ // CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SCronJobNameKey = attribute.Key("k8s.cronjob.name")
+
+ // K8SCronJobUIDKey is the attribute Key conforming to the
+ // "k8s.cronjob.uid" semantic conventions. It represents the UID of the
+ // CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid")
+
+ // K8SDaemonSetNameKey is the attribute Key conforming to the
+ // "k8s.daemonset.name" semantic conventions. It represents the name of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name")
+
+ // K8SDaemonSetUIDKey is the attribute Key conforming to the
+ // "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid")
+
+ // K8SDeploymentNameKey is the attribute Key conforming to the
+ // "k8s.deployment.name" semantic conventions. It represents the name of
+ // the Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SDeploymentNameKey = attribute.Key("k8s.deployment.name")
+
+ // K8SDeploymentUIDKey is the attribute Key conforming to the
+ // "k8s.deployment.uid" semantic conventions. It represents the UID of the
+ // Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid")
+
+ // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name"
+ // semantic conventions. It represents the name of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SJobNameKey = attribute.Key("k8s.job.name")
+
+ // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid"
+ // semantic conventions. It represents the UID of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SJobUIDKey = attribute.Key("k8s.job.uid")
+
+ // K8SNamespaceNameKey is the attribute Key conforming to the
+ // "k8s.namespace.name" semantic conventions. It represents the name of the
+ // namespace that the pod is running in.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'default'
+ K8SNamespaceNameKey = attribute.Key("k8s.namespace.name")
+
+ // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name"
+ // semantic conventions. It represents the name of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'node-1'
+ K8SNodeNameKey = attribute.Key("k8s.node.name")
+
+ // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid"
+ // semantic conventions. It represents the UID of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2'
+ K8SNodeUIDKey = attribute.Key("k8s.node.uid")
+
+ // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name"
+ // semantic conventions. It represents the name of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-pod-autoconf'
+ K8SPodNameKey = attribute.Key("k8s.pod.name")
+
+ // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid"
+ // semantic conventions. It represents the UID of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SPodUIDKey = attribute.Key("k8s.pod.uid")
+
+ // K8SReplicaSetNameKey is the attribute Key conforming to the
+ // "k8s.replicaset.name" semantic conventions. It represents the name of
+ // the ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name")
+
+ // K8SReplicaSetUIDKey is the attribute Key conforming to the
+ // "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+ // ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid")
+
+ // K8SStatefulSetNameKey is the attribute Key conforming to the
+ // "k8s.statefulset.name" semantic conventions. It represents the name of
+ // the StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name")
+
+ // K8SStatefulSetUIDKey is the attribute Key conforming to the
+ // "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+ // StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid")
+)
+
+// K8SClusterName returns an attribute KeyValue conforming to the
+// "k8s.cluster.name" semantic conventions. It represents the name of the
+// cluster.
+func K8SClusterName(val string) attribute.KeyValue {
+ return K8SClusterNameKey.String(val)
+}
+
+// K8SClusterUID returns an attribute KeyValue conforming to the
+// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the
+// cluster, set to the UID of the `kube-system` namespace.
+func K8SClusterUID(val string) attribute.KeyValue {
+ return K8SClusterUIDKey.String(val)
+}
+
+// K8SContainerName returns an attribute KeyValue conforming to the
+// "k8s.container.name" semantic conventions. It represents the name of the
+// Container from Pod specification, must be unique within a Pod. Container
+// runtime usually uses different globally unique name (`container.name`).
+func K8SContainerName(val string) attribute.KeyValue {
+ return K8SContainerNameKey.String(val)
+}
+
+// K8SContainerRestartCount returns an attribute KeyValue conforming to the
+// "k8s.container.restart_count" semantic conventions. It represents the number
+// of times the container was restarted. This attribute can be used to identify
+// a particular container (running or stopped) within a container spec.
+func K8SContainerRestartCount(val int) attribute.KeyValue {
+ return K8SContainerRestartCountKey.Int(val)
+}
+
+// K8SCronJobName returns an attribute KeyValue conforming to the
+// "k8s.cronjob.name" semantic conventions. It represents the name of the
+// CronJob.
+func K8SCronJobName(val string) attribute.KeyValue {
+ return K8SCronJobNameKey.String(val)
+}
+
+// K8SCronJobUID returns an attribute KeyValue conforming to the
+// "k8s.cronjob.uid" semantic conventions. It represents the UID of the
+// CronJob.
+func K8SCronJobUID(val string) attribute.KeyValue {
+ return K8SCronJobUIDKey.String(val)
+}
+
+// K8SDaemonSetName returns an attribute KeyValue conforming to the
+// "k8s.daemonset.name" semantic conventions. It represents the name of the
+// DaemonSet.
+func K8SDaemonSetName(val string) attribute.KeyValue {
+ return K8SDaemonSetNameKey.String(val)
+}
+
+// K8SDaemonSetUID returns an attribute KeyValue conforming to the
+// "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+// DaemonSet.
+func K8SDaemonSetUID(val string) attribute.KeyValue {
+ return K8SDaemonSetUIDKey.String(val)
+}
+
+// K8SDeploymentName returns an attribute KeyValue conforming to the
+// "k8s.deployment.name" semantic conventions. It represents the name of the
+// Deployment.
+func K8SDeploymentName(val string) attribute.KeyValue {
+ return K8SDeploymentNameKey.String(val)
+}
+
+// K8SDeploymentUID returns an attribute KeyValue conforming to the
+// "k8s.deployment.uid" semantic conventions. It represents the UID of the
+// Deployment.
+func K8SDeploymentUID(val string) attribute.KeyValue {
+ return K8SDeploymentUIDKey.String(val)
+}
+
+// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name"
+// semantic conventions. It represents the name of the Job.
+func K8SJobName(val string) attribute.KeyValue {
+ return K8SJobNameKey.String(val)
+}
+
+// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid"
+// semantic conventions. It represents the UID of the Job.
+func K8SJobUID(val string) attribute.KeyValue {
+ return K8SJobUIDKey.String(val)
+}
+
+// K8SNamespaceName returns an attribute KeyValue conforming to the
+// "k8s.namespace.name" semantic conventions. It represents the name of the
+// namespace that the pod is running in.
+func K8SNamespaceName(val string) attribute.KeyValue {
+ return K8SNamespaceNameKey.String(val)
+}
+
+// K8SNodeName returns an attribute KeyValue conforming to the
+// "k8s.node.name" semantic conventions. It represents the name of the Node.
+func K8SNodeName(val string) attribute.KeyValue {
+ return K8SNodeNameKey.String(val)
+}
+
+// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid"
+// semantic conventions. It represents the UID of the Node.
+func K8SNodeUID(val string) attribute.KeyValue {
+ return K8SNodeUIDKey.String(val)
+}
+
+// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name"
+// semantic conventions. It represents the name of the Pod.
+func K8SPodName(val string) attribute.KeyValue {
+ return K8SPodNameKey.String(val)
+}
+
+// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid"
+// semantic conventions. It represents the UID of the Pod.
+func K8SPodUID(val string) attribute.KeyValue {
+ return K8SPodUIDKey.String(val)
+}
+
+// K8SReplicaSetName returns an attribute KeyValue conforming to the
+// "k8s.replicaset.name" semantic conventions. It represents the name of the
+// ReplicaSet.
+func K8SReplicaSetName(val string) attribute.KeyValue {
+ return K8SReplicaSetNameKey.String(val)
+}
+
+// K8SReplicaSetUID returns an attribute KeyValue conforming to the
+// "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+// ReplicaSet.
+func K8SReplicaSetUID(val string) attribute.KeyValue {
+ return K8SReplicaSetUIDKey.String(val)
+}
+
+// K8SStatefulSetName returns an attribute KeyValue conforming to the
+// "k8s.statefulset.name" semantic conventions. It represents the name of the
+// StatefulSet.
+func K8SStatefulSetName(val string) attribute.KeyValue {
+ return K8SStatefulSetNameKey.String(val)
+}
+
+// K8SStatefulSetUID returns an attribute KeyValue conforming to the
+// "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+// StatefulSet.
+func K8SStatefulSetUID(val string) attribute.KeyValue {
+ return K8SStatefulSetUIDKey.String(val)
+}
+
+// An OCI image manifest.
+const (
+ // OciManifestDigestKey is the attribute Key conforming to the
+ // "oci.manifest.digest" semantic conventions. It represents the digest of
+ // the OCI image manifest. For container images specifically is the digest
+ // by which the container image is known.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4'
+ // Note: Follows [OCI Image Manifest
+ // Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md),
+ // and specifically the [Digest
+ // property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests).
+ // An example can be found in [Example Image
+ // Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest).
+ OciManifestDigestKey = attribute.Key("oci.manifest.digest")
+)
+
+// OciManifestDigest returns an attribute KeyValue conforming to the
+// "oci.manifest.digest" semantic conventions. It represents the digest of the
+// OCI image manifest. For container images specifically is the digest by which
+// the container image is known.
+func OciManifestDigest(val string) attribute.KeyValue {
+ return OciManifestDigestKey.String(val)
+}
+
+// The operating system (OS) on which the process represented by this resource
+// is running.
+const (
+ // OSBuildIDKey is the attribute Key conforming to the "os.build_id"
+ // semantic conventions. It represents the unique identifier for a
+ // particular build or compilation of the operating system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'TQ3C.230805.001.B2', '20E247', '22621'
+ OSBuildIDKey = attribute.Key("os.build_id")
+
+ // OSDescriptionKey is the attribute Key conforming to the "os.description"
+ // semantic conventions. It represents the human readable (not intended to
+ // be parsed) OS version information, like e.g. reported by `ver` or
+ // `lsb_release -a` commands.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1
+ // LTS'
+ OSDescriptionKey = attribute.Key("os.description")
+
+ // OSNameKey is the attribute Key conforming to the "os.name" semantic
+ // conventions. It represents the human readable operating system name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iOS', 'Android', 'Ubuntu'
+ OSNameKey = attribute.Key("os.name")
+
+ // OSTypeKey is the attribute Key conforming to the "os.type" semantic
+ // conventions. It represents the operating system type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ OSTypeKey = attribute.Key("os.type")
+
+ // OSVersionKey is the attribute Key conforming to the "os.version"
+ // semantic conventions. It represents the version string of the operating
+ // system as defined in [Version
+ // Attributes](/docs/resource/README.md#version-attributes).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.2.1', '18.04.1'
+ OSVersionKey = attribute.Key("os.version")
+)
+
+var (
+ // Microsoft Windows
+ OSTypeWindows = OSTypeKey.String("windows")
+ // Linux
+ OSTypeLinux = OSTypeKey.String("linux")
+ // Apple Darwin
+ OSTypeDarwin = OSTypeKey.String("darwin")
+ // FreeBSD
+ OSTypeFreeBSD = OSTypeKey.String("freebsd")
+ // NetBSD
+ OSTypeNetBSD = OSTypeKey.String("netbsd")
+ // OpenBSD
+ OSTypeOpenBSD = OSTypeKey.String("openbsd")
+ // DragonFly BSD
+ OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd")
+ // HP-UX (Hewlett Packard Unix)
+ OSTypeHPUX = OSTypeKey.String("hpux")
+ // AIX (Advanced Interactive eXecutive)
+ OSTypeAIX = OSTypeKey.String("aix")
+ // SunOS, Oracle Solaris
+ OSTypeSolaris = OSTypeKey.String("solaris")
+ // IBM z/OS
+ OSTypeZOS = OSTypeKey.String("z_os")
+)
+
+// OSBuildID returns an attribute KeyValue conforming to the "os.build_id"
+// semantic conventions. It represents the unique identifier for a particular
+// build or compilation of the operating system.
+func OSBuildID(val string) attribute.KeyValue {
+ return OSBuildIDKey.String(val)
+}
+
+// OSDescription returns an attribute KeyValue conforming to the
+// "os.description" semantic conventions. It represents the human readable (not
+// intended to be parsed) OS version information, like e.g. reported by `ver`
+// or `lsb_release -a` commands.
+func OSDescription(val string) attribute.KeyValue {
+ return OSDescriptionKey.String(val)
+}
+
+// OSName returns an attribute KeyValue conforming to the "os.name" semantic
+// conventions. It represents the human readable operating system name.
+func OSName(val string) attribute.KeyValue {
+ return OSNameKey.String(val)
+}
+
+// OSVersion returns an attribute KeyValue conforming to the "os.version"
+// semantic conventions. It represents the version string of the operating
+// system as defined in [Version
+// Attributes](/docs/resource/README.md#version-attributes).
+func OSVersion(val string) attribute.KeyValue {
+ return OSVersionKey.String(val)
+}
+
+// An operating system process.
+const (
+ // ProcessCommandKey is the attribute Key conforming to the
+ // "process.command" semantic conventions. It represents the command used
+ // to launch the process (i.e. the command name). On Linux based systems,
+ // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can
+ // be set to the first parameter extracted from `GetCommandLineW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'cmd/otelcol'
+ ProcessCommandKey = attribute.Key("process.command")
+
+ // ProcessCommandArgsKey is the attribute Key conforming to the
+ // "process.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) as received
+ // by the process. On Linux-based systems (and some other Unixoid systems
+ // supporting procfs), can be set according to the list of null-delimited
+ // strings extracted from `proc/[pid]/cmdline`. For libc-based executables,
+ // this would be the full argv vector passed to `main`.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'cmd/otecol', '--config=config.yaml'
+ ProcessCommandArgsKey = attribute.Key("process.command_args")
+
+ // ProcessCommandLineKey is the attribute Key conforming to the
+ // "process.command_line" semantic conventions. It represents the full
+ // command used to launch the process as a single string representing the
+ // full command. On Windows, can be set to the result of `GetCommandLineW`.
+ // Do not set this if you have to assemble it just for monitoring; use
+ // `process.command_args` instead.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"'
+ ProcessCommandLineKey = attribute.Key("process.command_line")
+
+ // ProcessExecutableNameKey is the attribute Key conforming to the
+ // "process.executable.name" semantic conventions. It represents the name
+ // of the process executable. On Linux based systems, can be set to the
+ // `Name` in `proc/[pid]/status`. On Windows, can be set to the base name
+ // of `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcol'
+ ProcessExecutableNameKey = attribute.Key("process.executable.name")
+
+ // ProcessExecutablePathKey is the attribute Key conforming to the
+ // "process.executable.path" semantic conventions. It represents the full
+ // path to the process executable. On Linux based systems, can be set to
+ // the target of `proc/[pid]/exe`. On Windows, can be set to the result of
+ // `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/usr/bin/cmd/otelcol'
+ ProcessExecutablePathKey = attribute.Key("process.executable.path")
+
+ // ProcessOwnerKey is the attribute Key conforming to the "process.owner"
+ // semantic conventions. It represents the username of the user that owns
+ // the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'root'
+ ProcessOwnerKey = attribute.Key("process.owner")
+
+ // ProcessParentPIDKey is the attribute Key conforming to the
+ // "process.parent_pid" semantic conventions. It represents the parent
+ // Process identifier (PPID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 111
+ ProcessParentPIDKey = attribute.Key("process.parent_pid")
+
+ // ProcessPIDKey is the attribute Key conforming to the "process.pid"
+ // semantic conventions. It represents the process identifier (PID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1234
+ ProcessPIDKey = attribute.Key("process.pid")
+
+ // ProcessRuntimeDescriptionKey is the attribute Key conforming to the
+ // "process.runtime.description" semantic conventions. It represents an
+ // additional description about the runtime of the process, for example a
+ // specific vendor customization of the runtime environment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0'
+ ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description")
+
+ // ProcessRuntimeNameKey is the attribute Key conforming to the
+ // "process.runtime.name" semantic conventions. It represents the name of
+ // the runtime of this process. For compiled native binaries, this SHOULD
+ // be the name of the compiler.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'OpenJDK Runtime Environment'
+ ProcessRuntimeNameKey = attribute.Key("process.runtime.name")
+
+ // ProcessRuntimeVersionKey is the attribute Key conforming to the
+ // "process.runtime.version" semantic conventions. It represents the
+ // version of the runtime of this process, as returned by the runtime
+ // without modification.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.0.2'
+ ProcessRuntimeVersionKey = attribute.Key("process.runtime.version")
+)
+
+// ProcessCommand returns an attribute KeyValue conforming to the
+// "process.command" semantic conventions. It represents the command used to
+// launch the process (i.e. the command name). On Linux based systems, can be
+// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to
+// the first parameter extracted from `GetCommandLineW`.
+func ProcessCommand(val string) attribute.KeyValue {
+ return ProcessCommandKey.String(val)
+}
+
+// ProcessCommandArgs returns an attribute KeyValue conforming to the
+// "process.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) as received by
+// the process. On Linux-based systems (and some other Unixoid systems
+// supporting procfs), can be set according to the list of null-delimited
+// strings extracted from `proc/[pid]/cmdline`. For libc-based executables,
+// this would be the full argv vector passed to `main`.
+func ProcessCommandArgs(val ...string) attribute.KeyValue {
+ return ProcessCommandArgsKey.StringSlice(val)
+}
+
+// ProcessCommandLine returns an attribute KeyValue conforming to the
+// "process.command_line" semantic conventions. It represents the full command
+// used to launch the process as a single string representing the full command.
+// On Windows, can be set to the result of `GetCommandLineW`. Do not set this
+// if you have to assemble it just for monitoring; use `process.command_args`
+// instead.
+func ProcessCommandLine(val string) attribute.KeyValue {
+ return ProcessCommandLineKey.String(val)
+}
+
+// ProcessExecutableName returns an attribute KeyValue conforming to the
+// "process.executable.name" semantic conventions. It represents the name of
+// the process executable. On Linux based systems, can be set to the `Name` in
+// `proc/[pid]/status`. On Windows, can be set to the base name of
+// `GetProcessImageFileNameW`.
+func ProcessExecutableName(val string) attribute.KeyValue {
+ return ProcessExecutableNameKey.String(val)
+}
+
+// ProcessExecutablePath returns an attribute KeyValue conforming to the
+// "process.executable.path" semantic conventions. It represents the full path
+// to the process executable. On Linux based systems, can be set to the target
+// of `proc/[pid]/exe`. On Windows, can be set to the result of
+// `GetProcessImageFileNameW`.
+func ProcessExecutablePath(val string) attribute.KeyValue {
+ return ProcessExecutablePathKey.String(val)
+}
+
+// ProcessOwner returns an attribute KeyValue conforming to the
+// "process.owner" semantic conventions. It represents the username of the user
+// that owns the process.
+func ProcessOwner(val string) attribute.KeyValue {
+ return ProcessOwnerKey.String(val)
+}
+
+// ProcessParentPID returns an attribute KeyValue conforming to the
+// "process.parent_pid" semantic conventions. It represents the parent Process
+// identifier (PPID).
+func ProcessParentPID(val int) attribute.KeyValue {
+ return ProcessParentPIDKey.Int(val)
+}
+
+// ProcessPID returns an attribute KeyValue conforming to the "process.pid"
+// semantic conventions. It represents the process identifier (PID).
+func ProcessPID(val int) attribute.KeyValue {
+ return ProcessPIDKey.Int(val)
+}
+
+// ProcessRuntimeDescription returns an attribute KeyValue conforming to the
+// "process.runtime.description" semantic conventions. It represents an
+// additional description about the runtime of the process, for example a
+// specific vendor customization of the runtime environment.
+func ProcessRuntimeDescription(val string) attribute.KeyValue {
+ return ProcessRuntimeDescriptionKey.String(val)
+}
+
+// ProcessRuntimeName returns an attribute KeyValue conforming to the
+// "process.runtime.name" semantic conventions. It represents the name of the
+// runtime of this process. For compiled native binaries, this SHOULD be the
+// name of the compiler.
+func ProcessRuntimeName(val string) attribute.KeyValue {
+ return ProcessRuntimeNameKey.String(val)
+}
+
+// ProcessRuntimeVersion returns an attribute KeyValue conforming to the
+// "process.runtime.version" semantic conventions. It represents the version of
+// the runtime of this process, as returned by the runtime without
+// modification.
+func ProcessRuntimeVersion(val string) attribute.KeyValue {
+ return ProcessRuntimeVersionKey.String(val)
+}
+
+// The Android platform on which the Android application is running.
+const (
+ // AndroidOSAPILevelKey is the attribute Key conforming to the
+ // "android.os.api_level" semantic conventions. It represents the uniquely
+ // identifies the framework API revision offered by a version
+ // (`os.version`) of the android operating system. More information can be
+ // found
+ // [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '33', '32'
+ AndroidOSAPILevelKey = attribute.Key("android.os.api_level")
+)
+
+// AndroidOSAPILevel returns an attribute KeyValue conforming to the
+// "android.os.api_level" semantic conventions. It represents the uniquely
+// identifies the framework API revision offered by a version (`os.version`) of
+// the android operating system. More information can be found
+// [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
+func AndroidOSAPILevel(val string) attribute.KeyValue {
+ return AndroidOSAPILevelKey.String(val)
+}
+
+// The web browser in which the application represented by the resource is
+// running. The `browser.*` attributes MUST be used only for resources that
+// represent applications running in a web browser (regardless of whether
+// running on a mobile or desktop device).
+const (
+ // BrowserBrandsKey is the attribute Key conforming to the "browser.brands"
+ // semantic conventions. It represents the array of brand name and version
+ // separated by a space
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99'
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.brands`).
+ BrowserBrandsKey = attribute.Key("browser.brands")
+
+ // BrowserLanguageKey is the attribute Key conforming to the
+ // "browser.language" semantic conventions. It represents the preferred
+ // language of the user using the browser
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'en', 'en-US', 'fr', 'fr-FR'
+ // Note: This value is intended to be taken from the Navigator API
+ // `navigator.language`.
+ BrowserLanguageKey = attribute.Key("browser.language")
+
+ // BrowserMobileKey is the attribute Key conforming to the "browser.mobile"
+ // semantic conventions. It represents a boolean that is true if the
+ // browser is running on a mobile device
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.mobile`). If unavailable, this attribute
+ // SHOULD be left unset.
+ BrowserMobileKey = attribute.Key("browser.mobile")
+
+ // BrowserPlatformKey is the attribute Key conforming to the
+ // "browser.platform" semantic conventions. It represents the platform on
+ // which the browser is running
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Windows', 'macOS', 'Android'
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.platform`). If unavailable, the legacy
+ // `navigator.platform` API SHOULD NOT be used instead and this attribute
+ // SHOULD be left unset in order for the values to be consistent.
+ // The list of possible values is defined in the [W3C User-Agent Client
+ // Hints
+ // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform).
+ // Note that some (but not all) of these values can overlap with values in
+ // the [`os.type` and `os.name` attributes](./os.md). However, for
+ // consistency, the values in the `browser.platform` attribute should
+ // capture the exact value that the user agent provides.
+ BrowserPlatformKey = attribute.Key("browser.platform")
+)
+
+// BrowserBrands returns an attribute KeyValue conforming to the
+// "browser.brands" semantic conventions. It represents the array of brand name
+// and version separated by a space
+func BrowserBrands(val ...string) attribute.KeyValue {
+ return BrowserBrandsKey.StringSlice(val)
+}
+
+// BrowserLanguage returns an attribute KeyValue conforming to the
+// "browser.language" semantic conventions. It represents the preferred
+// language of the user using the browser
+func BrowserLanguage(val string) attribute.KeyValue {
+ return BrowserLanguageKey.String(val)
+}
+
+// BrowserMobile returns an attribute KeyValue conforming to the
+// "browser.mobile" semantic conventions. It represents a boolean that is true
+// if the browser is running on a mobile device
+func BrowserMobile(val bool) attribute.KeyValue {
+ return BrowserMobileKey.Bool(val)
+}
+
+// BrowserPlatform returns an attribute KeyValue conforming to the
+// "browser.platform" semantic conventions. It represents the platform on which
+// the browser is running
+func BrowserPlatform(val string) attribute.KeyValue {
+ return BrowserPlatformKey.String(val)
+}
+
+// Resources used by AWS Elastic Container Service (ECS).
+const (
+ // AWSECSClusterARNKey is the attribute Key conforming to the
+ // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an
+ // [ECS
+ // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
+ AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn")
+
+ // AWSECSContainerARNKey is the attribute Key conforming to the
+ // "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+ // Resource Name (ARN) of an [ECS container
+ // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9'
+ AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn")
+
+ // AWSECSLaunchtypeKey is the attribute Key conforming to the
+ // "aws.ecs.launchtype" semantic conventions. It represents the [launch
+ // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // for an ECS task.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype")
+
+ // AWSECSTaskARNKey is the attribute Key conforming to the
+ // "aws.ecs.task.arn" semantic conventions. It represents the ARN of an
+ // [ECS task
+ // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b'
+ AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn")
+
+ // AWSECSTaskFamilyKey is the attribute Key conforming to the
+ // "aws.ecs.task.family" semantic conventions. It represents the task
+ // definition family this task definition is a member of.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-family'
+ AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family")
+
+ // AWSECSTaskRevisionKey is the attribute Key conforming to the
+ // "aws.ecs.task.revision" semantic conventions. It represents the revision
+ // for this task definition.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '8', '26'
+ AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision")
+)
+
+var (
+ // ec2
+ AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2")
+ // fargate
+ AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate")
+)
+
+// AWSECSClusterARN returns an attribute KeyValue conforming to the
+// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS
+// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
+func AWSECSClusterARN(val string) attribute.KeyValue {
+ return AWSECSClusterARNKey.String(val)
+}
+
+// AWSECSContainerARN returns an attribute KeyValue conforming to the
+// "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+// Resource Name (ARN) of an [ECS container
+// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
+func AWSECSContainerARN(val string) attribute.KeyValue {
+ return AWSECSContainerARNKey.String(val)
+}
+
+// AWSECSTaskARN returns an attribute KeyValue conforming to the
+// "aws.ecs.task.arn" semantic conventions. It represents the ARN of an [ECS
+// task
+// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).
+func AWSECSTaskARN(val string) attribute.KeyValue {
+ return AWSECSTaskARNKey.String(val)
+}
+
+// AWSECSTaskFamily returns an attribute KeyValue conforming to the
+// "aws.ecs.task.family" semantic conventions. It represents the task
+// definition family this task definition is a member of.
+func AWSECSTaskFamily(val string) attribute.KeyValue {
+ return AWSECSTaskFamilyKey.String(val)
+}
+
+// AWSECSTaskRevision returns an attribute KeyValue conforming to the
+// "aws.ecs.task.revision" semantic conventions. It represents the revision for
+// this task definition.
+func AWSECSTaskRevision(val string) attribute.KeyValue {
+ return AWSECSTaskRevisionKey.String(val)
+}
+
+// Resources used by AWS Elastic Kubernetes Service (EKS).
+const (
+ // AWSEKSClusterARNKey is the attribute Key conforming to the
+ // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an
+ // EKS cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
+ AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn")
+)
+
+// AWSEKSClusterARN returns an attribute KeyValue conforming to the
+// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS
+// cluster.
+func AWSEKSClusterARN(val string) attribute.KeyValue {
+ return AWSEKSClusterARNKey.String(val)
+}
+
+// Resources specific to Amazon Web Services.
+const (
+ // AWSLogGroupARNsKey is the attribute Key conforming to the
+ // "aws.log.group.arns" semantic conventions. It represents the Amazon
+ // Resource Name(s) (ARN) of the AWS log group(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*'
+ // Note: See the [log group ARN format
+ // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
+ AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns")
+
+ // AWSLogGroupNamesKey is the attribute Key conforming to the
+ // "aws.log.group.names" semantic conventions. It represents the name(s) of
+ // the AWS log group(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/aws/lambda/my-function', 'opentelemetry-service'
+ // Note: Multiple log groups must be supported for cases like
+ // multi-container applications, where a single application has sidecar
+ // containers, and each write to their own log group.
+ AWSLogGroupNamesKey = attribute.Key("aws.log.group.names")
+
+ // AWSLogStreamARNsKey is the attribute Key conforming to the
+ // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of
+ // the AWS log stream(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
+ // Note: See the [log stream ARN format
+ // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
+ // One log group can contain several log streams, so these ARNs necessarily
+ // identify both a log group and a log stream.
+ AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns")
+
+ // AWSLogStreamNamesKey is the attribute Key conforming to the
+ // "aws.log.stream.names" semantic conventions. It represents the name(s)
+ // of the AWS log stream(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
+ AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names")
+)
+
+// AWSLogGroupARNs returns an attribute KeyValue conforming to the
+// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource
+// Name(s) (ARN) of the AWS log group(s).
+func AWSLogGroupARNs(val ...string) attribute.KeyValue {
+ return AWSLogGroupARNsKey.StringSlice(val)
+}
+
+// AWSLogGroupNames returns an attribute KeyValue conforming to the
+// "aws.log.group.names" semantic conventions. It represents the name(s) of the
+// AWS log group(s) an application is writing to.
+func AWSLogGroupNames(val ...string) attribute.KeyValue {
+ return AWSLogGroupNamesKey.StringSlice(val)
+}
+
+// AWSLogStreamARNs returns an attribute KeyValue conforming to the
+// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the
+// AWS log stream(s).
+func AWSLogStreamARNs(val ...string) attribute.KeyValue {
+ return AWSLogStreamARNsKey.StringSlice(val)
+}
+
+// AWSLogStreamNames returns an attribute KeyValue conforming to the
+// "aws.log.stream.names" semantic conventions. It represents the name(s) of
+// the AWS log stream(s) an application is writing to.
+func AWSLogStreamNames(val ...string) attribute.KeyValue {
+ return AWSLogStreamNamesKey.StringSlice(val)
+}
+
+// Resource used by Google Cloud Run.
+const (
+ // GCPCloudRunJobExecutionKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.execution" semantic conventions. It represents the
+ // name of the Cloud Run
+ // [execution](https://cloud.google.com/run/docs/managing/job-executions)
+ // being run for the Job, as set by the
+ // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+ // environment variable.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'job-name-xxxx', 'sample-job-mdw84'
+ GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution")
+
+ // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.task_index" semantic conventions. It represents the
+ // index for a task within an execution as provided by the
+ // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+ // environment variable.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1
+ GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index")
+)
+
+// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.execution" semantic conventions. It represents the name
+// of the Cloud Run
+// [execution](https://cloud.google.com/run/docs/managing/job-executions) being
+// run for the Job, as set by the
+// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+// environment variable.
+func GCPCloudRunJobExecution(val string) attribute.KeyValue {
+ return GCPCloudRunJobExecutionKey.String(val)
+}
+
+// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index
+// for a task within an execution as provided by the
+// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+// environment variable.
+func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue {
+ return GCPCloudRunJobTaskIndexKey.Int(val)
+}
+
+// Resources used by Google Compute Engine (GCE).
+const (
+ // GCPGceInstanceHostnameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.hostname" semantic conventions. It represents the
+ // hostname of a GCE instance. This is the full value of the default or
+ // [custom
+ // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-host1234.example.com',
+ // 'sample-vm.us-west1-b.c.my-project.internal'
+ GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname")
+
+ // GCPGceInstanceNameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.name" semantic conventions. It represents the instance
+ // name of a GCE instance. This is the value provided by `host.name`, the
+ // visible name of the instance in the Cloud Console UI, and the prefix for
+ // the default hostname of the instance as defined by the [default internal
+ // DNS
+ // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'instance-1', 'my-vm-name'
+ GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name")
+)
+
+// GCPGceInstanceHostname returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname
+// of a GCE instance. This is the full value of the default or [custom
+// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
+func GCPGceInstanceHostname(val string) attribute.KeyValue {
+ return GCPGceInstanceHostnameKey.String(val)
+}
+
+// GCPGceInstanceName returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.name" semantic conventions. It represents the instance
+// name of a GCE instance. This is the value provided by `host.name`, the
+// visible name of the instance in the Cloud Console UI, and the prefix for the
+// default hostname of the instance as defined by the [default internal DNS
+// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
+func GCPGceInstanceName(val string) attribute.KeyValue {
+ return GCPGceInstanceNameKey.String(val)
+}
+
+// Heroku dyno metadata
+const (
+ // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id"
+ // semantic conventions. It represents the unique identifier for the
+ // application
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da'
+ HerokuAppIDKey = attribute.Key("heroku.app.id")
+
+ // HerokuReleaseCommitKey is the attribute Key conforming to the
+ // "heroku.release.commit" semantic conventions. It represents the commit
+ // hash for the current release
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec'
+ HerokuReleaseCommitKey = attribute.Key("heroku.release.commit")
+
+ // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the
+ // "heroku.release.creation_timestamp" semantic conventions. It represents
+ // the time and date the release was created
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2022-10-23T18:00:42Z'
+ HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp")
+)
+
+// HerokuAppID returns an attribute KeyValue conforming to the
+// "heroku.app.id" semantic conventions. It represents the unique identifier
+// for the application
+func HerokuAppID(val string) attribute.KeyValue {
+ return HerokuAppIDKey.String(val)
+}
+
+// HerokuReleaseCommit returns an attribute KeyValue conforming to the
+// "heroku.release.commit" semantic conventions. It represents the commit hash
+// for the current release
+func HerokuReleaseCommit(val string) attribute.KeyValue {
+ return HerokuReleaseCommitKey.String(val)
+}
+
+// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming
+// to the "heroku.release.creation_timestamp" semantic conventions. It
+// represents the time and date the release was created
+func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue {
+ return HerokuReleaseCreationTimestampKey.String(val)
+}
+
+// The software deployment.
+const (
+ // DeploymentEnvironmentKey is the attribute Key conforming to the
+ // "deployment.environment" semantic conventions. It represents the name of
+ // the [deployment
+ // environment](https://wikipedia.org/wiki/Deployment_environment) (aka
+ // deployment tier).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'staging', 'production'
+ // Note: `deployment.environment` does not affect the uniqueness
+ // constraints defined through
+ // the `service.namespace`, `service.name` and `service.instance.id`
+ // resource attributes.
+ // This implies that resources carrying the following attribute
+ // combinations MUST be
+ // considered to be identifying the same service:
+ //
+ // * `service.name=frontend`, `deployment.environment=production`
+ // * `service.name=frontend`, `deployment.environment=staging`.
+ DeploymentEnvironmentKey = attribute.Key("deployment.environment")
+)
+
+// DeploymentEnvironment returns an attribute KeyValue conforming to the
+// "deployment.environment" semantic conventions. It represents the name of the
+// [deployment environment](https://wikipedia.org/wiki/Deployment_environment)
+// (aka deployment tier).
+func DeploymentEnvironment(val string) attribute.KeyValue {
+ return DeploymentEnvironmentKey.String(val)
+}
+
+// A serverless instance.
+const (
+ // FaaSInstanceKey is the attribute Key conforming to the "faas.instance"
+ // semantic conventions. It represents the execution environment ID as a
+ // string, that will be potentially reused for other invocations to the
+ // same function/function version.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de'
+ // Note: * **AWS Lambda:** Use the (full) log stream name.
+ FaaSInstanceKey = attribute.Key("faas.instance")
+
+ // FaaSMaxMemoryKey is the attribute Key conforming to the
+ // "faas.max_memory" semantic conventions. It represents the amount of
+ // memory available to the serverless function converted to Bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 134217728
+ // Note: It's recommended to set this attribute since e.g. too little
+ // memory can easily stop a Java AWS Lambda function from working
+ // correctly. On AWS Lambda, the environment variable
+ // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must
+ // be multiplied by 1,048,576).
+ FaaSMaxMemoryKey = attribute.Key("faas.max_memory")
+
+ // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic
+ // conventions. It represents the name of the single function that this
+ // runtime instance executes.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'my-function', 'myazurefunctionapp/some-function-name'
+ // Note: This is the name of the function as configured/deployed on the
+ // FaaS
+ // platform and is usually different from the name of the callback
+ // function (which may be stored in the
+ // [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes)
+ // span attributes).
+ //
+ // For some cloud providers, the above definition is ambiguous. The
+ // following
+ // definition of function name MUST be used for this attribute
+ // (and consequently the span name) for the listed cloud
+ // providers/products:
+ //
+ // * **Azure:** The full name `/`, i.e., function app name
+ // followed by a forward slash followed by the function name (this form
+ // can also be seen in the resource JSON for the function).
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider (see also the `cloud.resource_id` attribute).
+ FaaSNameKey = attribute.Key("faas.name")
+
+ // FaaSVersionKey is the attribute Key conforming to the "faas.version"
+ // semantic conventions. It represents the immutable version of the
+ // function being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '26', 'pinkfroid-00002'
+ // Note: Depending on the cloud provider and platform, use:
+ //
+ // * **AWS Lambda:** The [function
+ // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
+ // (an integer represented as a decimal string).
+ // * **Google Cloud Run (Services):** The
+ // [revision](https://cloud.google.com/run/docs/managing/revisions)
+ // (i.e., the function name plus the revision suffix).
+ // * **Google Cloud Functions:** The value of the
+ // [`K_REVISION` environment
+ // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
+ // * **Azure Functions:** Not applicable. Do not set this attribute.
+ FaaSVersionKey = attribute.Key("faas.version")
+)
+
+// FaaSInstance returns an attribute KeyValue conforming to the
+// "faas.instance" semantic conventions. It represents the execution
+// environment ID as a string, that will be potentially reused for other
+// invocations to the same function/function version.
+func FaaSInstance(val string) attribute.KeyValue {
+ return FaaSInstanceKey.String(val)
+}
+
+// FaaSMaxMemory returns an attribute KeyValue conforming to the
+// "faas.max_memory" semantic conventions. It represents the amount of memory
+// available to the serverless function converted to Bytes.
+func FaaSMaxMemory(val int) attribute.KeyValue {
+ return FaaSMaxMemoryKey.Int(val)
+}
+
+// FaaSName returns an attribute KeyValue conforming to the "faas.name"
+// semantic conventions. It represents the name of the single function that
+// this runtime instance executes.
+func FaaSName(val string) attribute.KeyValue {
+ return FaaSNameKey.String(val)
+}
+
+// FaaSVersion returns an attribute KeyValue conforming to the
+// "faas.version" semantic conventions. It represents the immutable version of
+// the function being executed.
+func FaaSVersion(val string) attribute.KeyValue {
+ return FaaSVersionKey.String(val)
+}
+
+// A service instance.
+const (
+ // ServiceNameKey is the attribute Key conforming to the "service.name"
+ // semantic conventions. It represents the logical name of the service.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'shoppingcart'
+ // Note: MUST be the same for all instances of horizontally scaled
+ // services. If the value was not specified, SDKs MUST fallback to
+ // `unknown_service:` concatenated with
+ // [`process.executable.name`](process.md#process), e.g.
+ // `unknown_service:bash`. If `process.executable.name` is not available,
+ // the value MUST be set to `unknown_service`.
+ ServiceNameKey = attribute.Key("service.name")
+
+ // ServiceVersionKey is the attribute Key conforming to the
+ // "service.version" semantic conventions. It represents the version string
+ // of the service API or implementation. The format is not defined by these
+ // conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2.0.0', 'a01dbef8a'
+ ServiceVersionKey = attribute.Key("service.version")
+)
+
+// ServiceName returns an attribute KeyValue conforming to the
+// "service.name" semantic conventions. It represents the logical name of the
+// service.
+func ServiceName(val string) attribute.KeyValue {
+ return ServiceNameKey.String(val)
+}
+
+// ServiceVersion returns an attribute KeyValue conforming to the
+// "service.version" semantic conventions. It represents the version string of
+// the service API or implementation. The format is not defined by these
+// conventions.
+func ServiceVersion(val string) attribute.KeyValue {
+ return ServiceVersionKey.String(val)
+}
+
+// A service instance.
+const (
+ // ServiceInstanceIDKey is the attribute Key conforming to the
+ // "service.instance.id" semantic conventions. It represents the string ID
+ // of the service instance.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-k8s-pod-deployment-1',
+ // '627cc493-f310-47de-96bd-71410b7dec09'
+ // Note: MUST be unique for each instance of the same
+ // `service.namespace,service.name` pair (in other words
+ // `service.namespace,service.name,service.instance.id` triplet MUST be
+ // globally unique). The ID helps to distinguish instances of the same
+ // service that exist at the same time (e.g. instances of a horizontally
+ // scaled service). It is preferable for the ID to be persistent and stay
+ // the same for the lifetime of the service instance, however it is
+ // acceptable that the ID is ephemeral and changes during important
+ // lifetime events for the service (e.g. service restarts). If the service
+ // has no inherent unique ID that can be used as the value of this
+ // attribute it is recommended to generate a random Version 1 or Version 4
+ // RFC 4122 UUID (services aiming for reproducible UUIDs may also use
+ // Version 5, see RFC 4122 for more recommendations).
+ ServiceInstanceIDKey = attribute.Key("service.instance.id")
+
+ // ServiceNamespaceKey is the attribute Key conforming to the
+ // "service.namespace" semantic conventions. It represents a namespace for
+ // `service.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Shop'
+ // Note: A string value having a meaning that helps to distinguish a group
+ // of services, for example the team name that owns a group of services.
+ // `service.name` is expected to be unique within the same namespace. If
+ // `service.namespace` is not specified in the Resource then `service.name`
+ // is expected to be unique for all services that have no explicit
+ // namespace defined (so the empty/unspecified namespace is simply one more
+ // valid namespace). Zero-length namespace string is assumed equal to
+ // unspecified namespace.
+ ServiceNamespaceKey = attribute.Key("service.namespace")
+)
+
+// ServiceInstanceID returns an attribute KeyValue conforming to the
+// "service.instance.id" semantic conventions. It represents the string ID of
+// the service instance.
+func ServiceInstanceID(val string) attribute.KeyValue {
+ return ServiceInstanceIDKey.String(val)
+}
+
+// ServiceNamespace returns an attribute KeyValue conforming to the
+// "service.namespace" semantic conventions. It represents a namespace for
+// `service.name`.
+func ServiceNamespace(val string) attribute.KeyValue {
+ return ServiceNamespaceKey.String(val)
+}
+
+// The telemetry SDK used to capture data recorded by the instrumentation
+// libraries.
+const (
+ // TelemetrySDKLanguageKey is the attribute Key conforming to the
+ // "telemetry.sdk.language" semantic conventions. It represents the
+ // language of the telemetry SDK.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language")
+
+ // TelemetrySDKNameKey is the attribute Key conforming to the
+ // "telemetry.sdk.name" semantic conventions. It represents the name of the
+ // telemetry SDK as defined above.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute
+ // to `opentelemetry`.
+ // If another SDK, like a fork or a vendor-provided implementation, is
+ // used, this SDK MUST set the
+ // `telemetry.sdk.name` attribute to the fully-qualified class or module
+ // name of this SDK's main entry point
+ // or another suitable identifier depending on the language.
+ // The identifier `opentelemetry` is reserved and MUST NOT be used in this
+ // case.
+ // All custom identifiers SHOULD be stable across different versions of an
+ // implementation.
+ TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
+
+ // TelemetrySDKVersionKey is the attribute Key conforming to the
+ // "telemetry.sdk.version" semantic conventions. It represents the version
+ // string of the telemetry SDK.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: '1.2.3'
+ TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version")
+)
+
+var (
+ // cpp
+ TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp")
+ // dotnet
+ TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet")
+ // erlang
+ TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang")
+ // go
+ TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go")
+ // java
+ TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java")
+ // nodejs
+ TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs")
+ // php
+ TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php")
+ // python
+ TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python")
+ // ruby
+ TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby")
+ // rust
+ TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust")
+ // swift
+ TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift")
+ // webjs
+ TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs")
+)
+
+// TelemetrySDKName returns an attribute KeyValue conforming to the
+// "telemetry.sdk.name" semantic conventions. It represents the name of the
+// telemetry SDK as defined above.
+func TelemetrySDKName(val string) attribute.KeyValue {
+ return TelemetrySDKNameKey.String(val)
+}
+
+// TelemetrySDKVersion returns an attribute KeyValue conforming to the
+// "telemetry.sdk.version" semantic conventions. It represents the version
+// string of the telemetry SDK.
+func TelemetrySDKVersion(val string) attribute.KeyValue {
+ return TelemetrySDKVersionKey.String(val)
+}
+
+// The telemetry SDK used to capture data recorded by the instrumentation
+// libraries.
+const (
+ // TelemetryDistroNameKey is the attribute Key conforming to the
+ // "telemetry.distro.name" semantic conventions. It represents the name of
+ // the auto instrumentation agent or distribution, if used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'parts-unlimited-java'
+ // Note: Official auto instrumentation agents and distributions SHOULD set
+ // the `telemetry.distro.name` attribute to
+ // a string starting with `opentelemetry-`, e.g.
+ // `opentelemetry-java-instrumentation`.
+ TelemetryDistroNameKey = attribute.Key("telemetry.distro.name")
+
+ // TelemetryDistroVersionKey is the attribute Key conforming to the
+ // "telemetry.distro.version" semantic conventions. It represents the
+ // version string of the auto instrumentation agent or distribution, if
+ // used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.2.3'
+ TelemetryDistroVersionKey = attribute.Key("telemetry.distro.version")
+)
+
+// TelemetryDistroName returns an attribute KeyValue conforming to the
+// "telemetry.distro.name" semantic conventions. It represents the name of the
+// auto instrumentation agent or distribution, if used.
+func TelemetryDistroName(val string) attribute.KeyValue {
+ return TelemetryDistroNameKey.String(val)
+}
+
+// TelemetryDistroVersion returns an attribute KeyValue conforming to the
+// "telemetry.distro.version" semantic conventions. It represents the version
+// string of the auto instrumentation agent or distribution, if used.
+func TelemetryDistroVersion(val string) attribute.KeyValue {
+ return TelemetryDistroVersionKey.String(val)
+}
+
+// Resource describing the packaged software running the application code. Web
+// engines are typically executed using process.runtime.
+const (
+ // WebEngineDescriptionKey is the attribute Key conforming to the
+ // "webengine.description" semantic conventions. It represents the
+ // additional description of the web engine (e.g. detailed version and
+ // edition information).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) -
+ // 2.2.2.Final'
+ WebEngineDescriptionKey = attribute.Key("webengine.description")
+
+ // WebEngineNameKey is the attribute Key conforming to the "webengine.name"
+ // semantic conventions. It represents the name of the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'WildFly'
+ WebEngineNameKey = attribute.Key("webengine.name")
+
+ // WebEngineVersionKey is the attribute Key conforming to the
+ // "webengine.version" semantic conventions. It represents the version of
+ // the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '21.0.0'
+ WebEngineVersionKey = attribute.Key("webengine.version")
+)
+
+// WebEngineDescription returns an attribute KeyValue conforming to the
+// "webengine.description" semantic conventions. It represents the additional
+// description of the web engine (e.g. detailed version and edition
+// information).
+func WebEngineDescription(val string) attribute.KeyValue {
+ return WebEngineDescriptionKey.String(val)
+}
+
+// WebEngineName returns an attribute KeyValue conforming to the
+// "webengine.name" semantic conventions. It represents the name of the web
+// engine.
+func WebEngineName(val string) attribute.KeyValue {
+ return WebEngineNameKey.String(val)
+}
+
+// WebEngineVersion returns an attribute KeyValue conforming to the
+// "webengine.version" semantic conventions. It represents the version of the
+// web engine.
+func WebEngineVersion(val string) attribute.KeyValue {
+ return WebEngineVersionKey.String(val)
+}
+
+// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's
+// concepts.
+const (
+ // OTelScopeNameKey is the attribute Key conforming to the
+ // "otel.scope.name" semantic conventions. It represents the name of the
+ // instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'io.opentelemetry.contrib.mongodb'
+ OTelScopeNameKey = attribute.Key("otel.scope.name")
+
+ // OTelScopeVersionKey is the attribute Key conforming to the
+ // "otel.scope.version" semantic conventions. It represents the version of
+ // the instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.0.0'
+ OTelScopeVersionKey = attribute.Key("otel.scope.version")
+)
+
+// OTelScopeName returns an attribute KeyValue conforming to the
+// "otel.scope.name" semantic conventions. It represents the name of the
+// instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+func OTelScopeName(val string) attribute.KeyValue {
+ return OTelScopeNameKey.String(val)
+}
+
+// OTelScopeVersion returns an attribute KeyValue conforming to the
+// "otel.scope.version" semantic conventions. It represents the version of the
+// instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+func OTelScopeVersion(val string) attribute.KeyValue {
+ return OTelScopeVersionKey.String(val)
+}
+
+// Span attributes used by non-OTLP exporters to represent OpenTelemetry
+// Scope's concepts.
+const (
+ // OTelLibraryNameKey is the attribute Key conforming to the
+ // "otel.library.name" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: 'io.opentelemetry.contrib.mongodb'
+ // Deprecated: use the `otel.scope.name` attribute.
+ OTelLibraryNameKey = attribute.Key("otel.library.name")
+
+ // OTelLibraryVersionKey is the attribute Key conforming to the
+ // "otel.library.version" semantic conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: deprecated
+ // Examples: '1.0.0'
+ // Deprecated: use the `otel.scope.version` attribute.
+ OTelLibraryVersionKey = attribute.Key("otel.library.version")
+)
+
+// OTelLibraryName returns an attribute KeyValue conforming to the
+// "otel.library.name" semantic conventions.
+//
+// Deprecated: use the `otel.scope.name` attribute.
+func OTelLibraryName(val string) attribute.KeyValue {
+ return OTelLibraryNameKey.String(val)
+}
+
+// OTelLibraryVersion returns an attribute KeyValue conforming to the
+// "otel.library.version" semantic conventions.
+//
+// Deprecated: use the `otel.scope.version` attribute.
+func OTelLibraryVersion(val string) attribute.KeyValue {
+ return OTelLibraryVersionKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go
new file mode 100644
index 0000000000..fe80b1731d
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+// SchemaURL is the schema URL that matches the version of the semantic conventions
+// that this package defines. Semconv packages starting from v1.4.0 must declare
+// non-empty schema URL in the form https://opentelemetry.io/schemas/
+const SchemaURL = "https://opentelemetry.io/schemas/1.24.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go
new file mode 100644
index 0000000000..c1718234e5
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go
@@ -0,0 +1,1323 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// Operations that access some remote service.
+const (
+ // PeerServiceKey is the attribute Key conforming to the "peer.service"
+ // semantic conventions. It represents the
+ // [`service.name`](/docs/resource/README.md#service) of the remote
+ // service. SHOULD be equal to the actual `service.name` resource attribute
+ // of the remote service if any.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'AuthTokenCache'
+ PeerServiceKey = attribute.Key("peer.service")
+)
+
+// PeerService returns an attribute KeyValue conforming to the
+// "peer.service" semantic conventions. It represents the
+// [`service.name`](/docs/resource/README.md#service) of the remote service.
+// SHOULD be equal to the actual `service.name` resource attribute of the
+// remote service if any.
+func PeerService(val string) attribute.KeyValue {
+ return PeerServiceKey.String(val)
+}
+
+// These attributes may be used for any operation with an authenticated and/or
+// authorized enduser.
+const (
+ // EnduserIDKey is the attribute Key conforming to the "enduser.id"
+ // semantic conventions. It represents the username or client_id extracted
+ // from the access token or
+ // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header
+ // in the inbound request from outside the system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'username'
+ EnduserIDKey = attribute.Key("enduser.id")
+
+ // EnduserRoleKey is the attribute Key conforming to the "enduser.role"
+ // semantic conventions. It represents the actual/assumed role the client
+ // is making the request under extracted from token or application security
+ // context.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'admin'
+ EnduserRoleKey = attribute.Key("enduser.role")
+
+ // EnduserScopeKey is the attribute Key conforming to the "enduser.scope"
+ // semantic conventions. It represents the scopes or granted authorities
+ // the client currently possesses extracted from token or application
+ // security context. The value would come from the scope associated with an
+ // [OAuth 2.0 Access
+ // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
+ // value in a [SAML 2.0
+ // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'read:message, write:files'
+ EnduserScopeKey = attribute.Key("enduser.scope")
+)
+
+// EnduserID returns an attribute KeyValue conforming to the "enduser.id"
+// semantic conventions. It represents the username or client_id extracted from
+// the access token or
+// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in
+// the inbound request from outside the system.
+func EnduserID(val string) attribute.KeyValue {
+ return EnduserIDKey.String(val)
+}
+
+// EnduserRole returns an attribute KeyValue conforming to the
+// "enduser.role" semantic conventions. It represents the actual/assumed role
+// the client is making the request under extracted from token or application
+// security context.
+func EnduserRole(val string) attribute.KeyValue {
+ return EnduserRoleKey.String(val)
+}
+
+// EnduserScope returns an attribute KeyValue conforming to the
+// "enduser.scope" semantic conventions. It represents the scopes or granted
+// authorities the client currently possesses extracted from token or
+// application security context. The value would come from the scope associated
+// with an [OAuth 2.0 Access
+// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
+// value in a [SAML 2.0
+// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
+func EnduserScope(val string) attribute.KeyValue {
+ return EnduserScopeKey.String(val)
+}
+
+// These attributes allow to report this unit of code and therefore to provide
+// more context about the span.
+const (
+ // CodeColumnKey is the attribute Key conforming to the "code.column"
+ // semantic conventions. It represents the column number in `code.filepath`
+ // best representing the operation. It SHOULD point within the code unit
+ // named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 16
+ CodeColumnKey = attribute.Key("code.column")
+
+ // CodeFilepathKey is the attribute Key conforming to the "code.filepath"
+ // semantic conventions. It represents the source code file name that
+ // identifies the code unit as uniquely as possible (preferably an absolute
+ // file path).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/usr/local/MyApplication/content_root/app/index.php'
+ CodeFilepathKey = attribute.Key("code.filepath")
+
+ // CodeFunctionKey is the attribute Key conforming to the "code.function"
+ // semantic conventions. It represents the method or function name, or
+ // equivalent (usually rightmost part of the code unit's name).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'serveRequest'
+ CodeFunctionKey = attribute.Key("code.function")
+
+ // CodeLineNumberKey is the attribute Key conforming to the "code.lineno"
+ // semantic conventions. It represents the line number in `code.filepath`
+ // best representing the operation. It SHOULD point within the code unit
+ // named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ CodeLineNumberKey = attribute.Key("code.lineno")
+
+ // CodeNamespaceKey is the attribute Key conforming to the "code.namespace"
+ // semantic conventions. It represents the "namespace" within which
+ // `code.function` is defined. Usually the qualified class or module name,
+ // such that `code.namespace` + some separator + `code.function` form a
+ // unique identifier for the code unit.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com.example.MyHTTPService'
+ CodeNamespaceKey = attribute.Key("code.namespace")
+
+ // CodeStacktraceKey is the attribute Key conforming to the
+ // "code.stacktrace" semantic conventions. It represents a stacktrace as a
+ // string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'at
+ // com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ CodeStacktraceKey = attribute.Key("code.stacktrace")
+)
+
+// CodeColumn returns an attribute KeyValue conforming to the "code.column"
+// semantic conventions. It represents the column number in `code.filepath`
+// best representing the operation. It SHOULD point within the code unit named
+// in `code.function`.
+func CodeColumn(val int) attribute.KeyValue {
+ return CodeColumnKey.Int(val)
+}
+
+// CodeFilepath returns an attribute KeyValue conforming to the
+// "code.filepath" semantic conventions. It represents the source code file
+// name that identifies the code unit as uniquely as possible (preferably an
+// absolute file path).
+func CodeFilepath(val string) attribute.KeyValue {
+ return CodeFilepathKey.String(val)
+}
+
+// CodeFunction returns an attribute KeyValue conforming to the
+// "code.function" semantic conventions. It represents the method or function
+// name, or equivalent (usually rightmost part of the code unit's name).
+func CodeFunction(val string) attribute.KeyValue {
+ return CodeFunctionKey.String(val)
+}
+
+// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno"
+// semantic conventions. It represents the line number in `code.filepath` best
+// representing the operation. It SHOULD point within the code unit named in
+// `code.function`.
+func CodeLineNumber(val int) attribute.KeyValue {
+ return CodeLineNumberKey.Int(val)
+}
+
+// CodeNamespace returns an attribute KeyValue conforming to the
+// "code.namespace" semantic conventions. It represents the "namespace" within
+// which `code.function` is defined. Usually the qualified class or module
+// name, such that `code.namespace` + some separator + `code.function` form a
+// unique identifier for the code unit.
+func CodeNamespace(val string) attribute.KeyValue {
+ return CodeNamespaceKey.String(val)
+}
+
+// CodeStacktrace returns an attribute KeyValue conforming to the
+// "code.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func CodeStacktrace(val string) attribute.KeyValue {
+ return CodeStacktraceKey.String(val)
+}
+
+// These attributes may be used for any operation to store information about a
+// thread that started a span.
+const (
+ // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic
+ // conventions. It represents the current "managed" thread ID (as opposed
+ // to OS thread ID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ ThreadIDKey = attribute.Key("thread.id")
+
+ // ThreadNameKey is the attribute Key conforming to the "thread.name"
+ // semantic conventions. It represents the current thread name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'main'
+ ThreadNameKey = attribute.Key("thread.name")
+)
+
+// ThreadID returns an attribute KeyValue conforming to the "thread.id"
+// semantic conventions. It represents the current "managed" thread ID (as
+// opposed to OS thread ID).
+func ThreadID(val int) attribute.KeyValue {
+ return ThreadIDKey.Int(val)
+}
+
+// ThreadName returns an attribute KeyValue conforming to the "thread.name"
+// semantic conventions. It represents the current thread name.
+func ThreadName(val string) attribute.KeyValue {
+ return ThreadNameKey.String(val)
+}
+
+// Span attributes used by AWS Lambda (in addition to general `faas`
+// attributes).
+const (
+ // AWSLambdaInvokedARNKey is the attribute Key conforming to the
+ // "aws.lambda.invoked_arn" semantic conventions. It represents the full
+ // invoked ARN as provided on the `Context` passed to the function
+ // (`Lambda-Runtime-Invoked-Function-ARN` header on the
+ // `/runtime/invocation/next` applicable).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'
+ // Note: This may be different from `cloud.resource_id` if an alias is
+ // involved.
+ AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn")
+)
+
+// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the
+// "aws.lambda.invoked_arn" semantic conventions. It represents the full
+// invoked ARN as provided on the `Context` passed to the function
+// (`Lambda-Runtime-Invoked-Function-ARN` header on the
+// `/runtime/invocation/next` applicable).
+func AWSLambdaInvokedARN(val string) attribute.KeyValue {
+ return AWSLambdaInvokedARNKey.String(val)
+}
+
+// Attributes for CloudEvents. CloudEvents is a specification on how to define
+// event data in a standard way. These attributes can be attached to spans when
+// performing operations with CloudEvents, regardless of the protocol being
+// used.
+const (
+ // CloudeventsEventIDKey is the attribute Key conforming to the
+ // "cloudevents.event_id" semantic conventions. It represents the
+ // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
+ // uniquely identifies the event.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001'
+ CloudeventsEventIDKey = attribute.Key("cloudevents.event_id")
+
+ // CloudeventsEventSourceKey is the attribute Key conforming to the
+ // "cloudevents.event_source" semantic conventions. It represents the
+ // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
+ // identifies the context in which an event happened.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'https://github.com/cloudevents',
+ // '/cloudevents/spec/pull/123', 'my-service'
+ CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source")
+
+ // CloudeventsEventSpecVersionKey is the attribute Key conforming to the
+ // "cloudevents.event_spec_version" semantic conventions. It represents the
+ // [version of the CloudEvents
+ // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
+ // which the event uses.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.0'
+ CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version")
+
+ // CloudeventsEventSubjectKey is the attribute Key conforming to the
+ // "cloudevents.event_subject" semantic conventions. It represents the
+ // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
+ // of the event in the context of the event producer (identified by
+ // source).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mynewfile.jpg'
+ CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject")
+
+ // CloudeventsEventTypeKey is the attribute Key conforming to the
+ // "cloudevents.event_type" semantic conventions. It represents the
+ // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
+ // contains a value describing the type of event related to the originating
+ // occurrence.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com.github.pull_request.opened',
+ // 'com.example.object.deleted.v2'
+ CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type")
+)
+
+// CloudeventsEventID returns an attribute KeyValue conforming to the
+// "cloudevents.event_id" semantic conventions. It represents the
+// [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
+// uniquely identifies the event.
+func CloudeventsEventID(val string) attribute.KeyValue {
+ return CloudeventsEventIDKey.String(val)
+}
+
+// CloudeventsEventSource returns an attribute KeyValue conforming to the
+// "cloudevents.event_source" semantic conventions. It represents the
+// [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
+// identifies the context in which an event happened.
+func CloudeventsEventSource(val string) attribute.KeyValue {
+ return CloudeventsEventSourceKey.String(val)
+}
+
+// CloudeventsEventSpecVersion returns an attribute KeyValue conforming to
+// the "cloudevents.event_spec_version" semantic conventions. It represents the
+// [version of the CloudEvents
+// specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
+// which the event uses.
+func CloudeventsEventSpecVersion(val string) attribute.KeyValue {
+ return CloudeventsEventSpecVersionKey.String(val)
+}
+
+// CloudeventsEventSubject returns an attribute KeyValue conforming to the
+// "cloudevents.event_subject" semantic conventions. It represents the
+// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
+// of the event in the context of the event producer (identified by source).
+func CloudeventsEventSubject(val string) attribute.KeyValue {
+ return CloudeventsEventSubjectKey.String(val)
+}
+
+// CloudeventsEventType returns an attribute KeyValue conforming to the
+// "cloudevents.event_type" semantic conventions. It represents the
+// [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
+// contains a value describing the type of event related to the originating
+// occurrence.
+func CloudeventsEventType(val string) attribute.KeyValue {
+ return CloudeventsEventTypeKey.String(val)
+}
+
+// Semantic conventions for the OpenTracing Shim
+const (
+ // OpentracingRefTypeKey is the attribute Key conforming to the
+ // "opentracing.ref_type" semantic conventions. It represents the
+ // parent-child Reference type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The causal relationship between a child Span and a parent Span.
+ OpentracingRefTypeKey = attribute.Key("opentracing.ref_type")
+)
+
+var (
+ // The parent Span depends on the child Span in some capacity
+ OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of")
+ // The parent Span doesn't depend in any way on the result of the child Span
+ OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from")
+)
+
+// Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's
+// concepts.
+const (
+ // OTelStatusCodeKey is the attribute Key conforming to the
+ // "otel.status_code" semantic conventions. It represents the name of the
+ // code, either "OK" or "ERROR". MUST NOT be set if the status code is
+ // UNSET.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ OTelStatusCodeKey = attribute.Key("otel.status_code")
+
+ // OTelStatusDescriptionKey is the attribute Key conforming to the
+ // "otel.status_description" semantic conventions. It represents the
+ // description of the Status if it has a value, otherwise not set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'resource not found'
+ OTelStatusDescriptionKey = attribute.Key("otel.status_description")
+)
+
+var (
+ // The operation has been validated by an Application developer or Operator to have completed successfully
+ OTelStatusCodeOk = OTelStatusCodeKey.String("OK")
+ // The operation contains an error
+ OTelStatusCodeError = OTelStatusCodeKey.String("ERROR")
+)
+
+// OTelStatusDescription returns an attribute KeyValue conforming to the
+// "otel.status_description" semantic conventions. It represents the
+// description of the Status if it has a value, otherwise not set.
+func OTelStatusDescription(val string) attribute.KeyValue {
+ return OTelStatusDescriptionKey.String(val)
+}
+
+// This semantic convention describes an instance of a function that runs
+// without provisioning or managing of servers (also known as serverless
+// functions or Function as a Service (FaaS)) with spans.
+const (
+ // FaaSInvocationIDKey is the attribute Key conforming to the
+ // "faas.invocation_id" semantic conventions. It represents the invocation
+ // ID of the current function invocation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
+ FaaSInvocationIDKey = attribute.Key("faas.invocation_id")
+)
+
+// FaaSInvocationID returns an attribute KeyValue conforming to the
+// "faas.invocation_id" semantic conventions. It represents the invocation ID
+// of the current function invocation.
+func FaaSInvocationID(val string) attribute.KeyValue {
+ return FaaSInvocationIDKey.String(val)
+}
+
+// Semantic Convention for FaaS triggered as a response to some data source
+// operation such as a database or filesystem read/write.
+const (
+ // FaaSDocumentCollectionKey is the attribute Key conforming to the
+ // "faas.document.collection" semantic conventions. It represents the name
+ // of the source on which the triggering operation was performed. For
+ // example, in Cloud Storage or S3 corresponds to the bucket name, and in
+ // Cosmos DB to the database name.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: experimental
+ // Examples: 'myBucketName', 'myDBName'
+ FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
+
+ // FaaSDocumentNameKey is the attribute Key conforming to the
+ // "faas.document.name" semantic conventions. It represents the document
+ // name/table subjected to the operation. For example, in Cloud Storage or
+ // S3 is the name of the file, and in Cosmos DB the table name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myFile.txt', 'myTableName'
+ FaaSDocumentNameKey = attribute.Key("faas.document.name")
+
+ // FaaSDocumentOperationKey is the attribute Key conforming to the
+ // "faas.document.operation" semantic conventions. It represents the
+ // describes the type of the operation that was performed on the data.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: experimental
+ FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
+
+ // FaaSDocumentTimeKey is the attribute Key conforming to the
+ // "faas.document.time" semantic conventions. It represents a string
+ // containing the time when the data was accessed in the [ISO
+ // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+ // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2020-01-23T13:47:06Z'
+ FaaSDocumentTimeKey = attribute.Key("faas.document.time")
+)
+
+var (
+ // When a new object is created
+ FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
+ // When an object is modified
+ FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
+ // When an object is deleted
+ FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
+)
+
+// FaaSDocumentCollection returns an attribute KeyValue conforming to the
+// "faas.document.collection" semantic conventions. It represents the name of
+// the source on which the triggering operation was performed. For example, in
+// Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the
+// database name.
+func FaaSDocumentCollection(val string) attribute.KeyValue {
+ return FaaSDocumentCollectionKey.String(val)
+}
+
+// FaaSDocumentName returns an attribute KeyValue conforming to the
+// "faas.document.name" semantic conventions. It represents the document
+// name/table subjected to the operation. For example, in Cloud Storage or S3
+// is the name of the file, and in Cosmos DB the table name.
+func FaaSDocumentName(val string) attribute.KeyValue {
+ return FaaSDocumentNameKey.String(val)
+}
+
+// FaaSDocumentTime returns an attribute KeyValue conforming to the
+// "faas.document.time" semantic conventions. It represents a string containing
+// the time when the data was accessed in the [ISO
+// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+func FaaSDocumentTime(val string) attribute.KeyValue {
+ return FaaSDocumentTimeKey.String(val)
+}
+
+// Semantic Convention for FaaS scheduled to be executed regularly.
+const (
+ // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic
+ // conventions. It represents a string containing the schedule period as
+ // [Cron
+ // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0/5 * * * ? *'
+ FaaSCronKey = attribute.Key("faas.cron")
+
+ // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic
+ // conventions. It represents a string containing the function invocation
+ // time in the [ISO
+ // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+ // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2020-01-23T13:47:06Z'
+ FaaSTimeKey = attribute.Key("faas.time")
+)
+
+// FaaSCron returns an attribute KeyValue conforming to the "faas.cron"
+// semantic conventions. It represents a string containing the schedule period
+// as [Cron
+// Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
+func FaaSCron(val string) attribute.KeyValue {
+ return FaaSCronKey.String(val)
+}
+
+// FaaSTime returns an attribute KeyValue conforming to the "faas.time"
+// semantic conventions. It represents a string containing the function
+// invocation time in the [ISO
+// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+func FaaSTime(val string) attribute.KeyValue {
+ return FaaSTimeKey.String(val)
+}
+
+// Contains additional attributes for incoming FaaS spans.
+const (
+ // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart"
+ // semantic conventions. It represents a boolean that is true if the
+ // serverless function is executed for the first time (aka cold-start).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSColdstartKey = attribute.Key("faas.coldstart")
+)
+
+// FaaSColdstart returns an attribute KeyValue conforming to the
+// "faas.coldstart" semantic conventions. It represents a boolean that is true
+// if the serverless function is executed for the first time (aka cold-start).
+func FaaSColdstart(val bool) attribute.KeyValue {
+ return FaaSColdstartKey.Bool(val)
+}
+
+// The `aws` conventions apply to operations using the AWS SDK. They map
+// request or response parameters in AWS SDK API calls to attributes on a Span.
+// The conventions have been collected over time based on feedback from AWS
+// users of tracing and will continue to evolve as new interesting conventions
+// are found.
+// Some descriptions are also provided for populating general OpenTelemetry
+// semantic conventions based on these APIs.
+const (
+ // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id"
+ // semantic conventions. It represents the AWS request ID as returned in
+ // the response headers `x-amz-request-id` or `x-amz-requestid`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ'
+ AWSRequestIDKey = attribute.Key("aws.request_id")
+)
+
+// AWSRequestID returns an attribute KeyValue conforming to the
+// "aws.request_id" semantic conventions. It represents the AWS request ID as
+// returned in the response headers `x-amz-request-id` or `x-amz-requestid`.
+func AWSRequestID(val string) attribute.KeyValue {
+ return AWSRequestIDKey.String(val)
+}
+
+// Attributes that exist for multiple DynamoDB request types.
+const (
+ // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the
+ // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+ // value of the `AttributesToGet` request parameter.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'lives', 'id'
+ AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
+
+ // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the
+ // "aws.dynamodb.consistent_read" semantic conventions. It represents the
+ // value of the `ConsistentRead` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
+
+ // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the
+ // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+ // JSON-serialized value of each item in the `ConsumedCapacity` response
+ // field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": {
+ // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" :
+ // { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table":
+ // { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number }, "TableName": "string",
+ // "WriteCapacityUnits": number }'
+ AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity")
+
+ // AWSDynamoDBIndexNameKey is the attribute Key conforming to the
+ // "aws.dynamodb.index_name" semantic conventions. It represents the value
+ // of the `IndexName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'name_to_group'
+ AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
+
+ // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to
+ // the "aws.dynamodb.item_collection_metrics" semantic conventions. It
+ // represents the JSON-serialized value of the `ItemCollectionMetrics`
+ // response field.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B":
+ // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": {
+ // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ],
+ // "NULL": boolean, "S": "string", "SS": [ "string" ] } },
+ // "SizeEstimateRangeGB": [ number ] } ] }'
+ AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics")
+
+ // AWSDynamoDBLimitKey is the attribute Key conforming to the
+ // "aws.dynamodb.limit" semantic conventions. It represents the value of
+ // the `Limit` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
+
+ // AWSDynamoDBProjectionKey is the attribute Key conforming to the
+ // "aws.dynamodb.projection" semantic conventions. It represents the value
+ // of the `ProjectionExpression` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Title', 'Title, Price, Color', 'Title, Description,
+ // RelatedItems, ProductReviews'
+ AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection")
+
+ // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to
+ // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It
+ // represents the value of the `ProvisionedThroughput.ReadCapacityUnits`
+ // request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
+
+ // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming
+ // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions.
+ // It represents the value of the
+ // `ProvisionedThroughput.WriteCapacityUnits` request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
+
+ // AWSDynamoDBSelectKey is the attribute Key conforming to the
+ // "aws.dynamodb.select" semantic conventions. It represents the value of
+ // the `Select` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ALL_ATTRIBUTES', 'COUNT'
+ AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
+
+ // AWSDynamoDBTableNamesKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_names" semantic conventions. It represents the keys
+ // in the `RequestItems` object field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Users', 'Cats'
+ AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
+)
+
+// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to
+// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+// value of the `AttributesToGet` request parameter.
+func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributesToGetKey.StringSlice(val)
+}
+
+// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the
+// "aws.dynamodb.consistent_read" semantic conventions. It represents the value
+// of the `ConsistentRead` request parameter.
+func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue {
+ return AWSDynamoDBConsistentReadKey.Bool(val)
+}
+
+// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to
+// the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+// JSON-serialized value of each item in the `ConsumedCapacity` response field.
+func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue {
+ return AWSDynamoDBConsumedCapacityKey.StringSlice(val)
+}
+
+// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the
+// "aws.dynamodb.index_name" semantic conventions. It represents the value of
+// the `IndexName` request parameter.
+func AWSDynamoDBIndexName(val string) attribute.KeyValue {
+ return AWSDynamoDBIndexNameKey.String(val)
+}
+
+// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming
+// to the "aws.dynamodb.item_collection_metrics" semantic conventions. It
+// represents the JSON-serialized value of the `ItemCollectionMetrics` response
+// field.
+func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue {
+ return AWSDynamoDBItemCollectionMetricsKey.String(val)
+}
+
+// AWSDynamoDBLimit returns an attribute KeyValue conforming to the
+// "aws.dynamodb.limit" semantic conventions. It represents the value of the
+// `Limit` request parameter.
+func AWSDynamoDBLimit(val int) attribute.KeyValue {
+ return AWSDynamoDBLimitKey.Int(val)
+}
+
+// AWSDynamoDBProjection returns an attribute KeyValue conforming to the
+// "aws.dynamodb.projection" semantic conventions. It represents the value of
+// the `ProjectionExpression` request parameter.
+func AWSDynamoDBProjection(val string) attribute.KeyValue {
+ return AWSDynamoDBProjectionKey.String(val)
+}
+
+// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue
+// conforming to the "aws.dynamodb.provisioned_read_capacity" semantic
+// conventions. It represents the value of the
+// `ProvisionedThroughput.ReadCapacityUnits` request parameter.
+func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedReadCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue
+// conforming to the "aws.dynamodb.provisioned_write_capacity" semantic
+// conventions. It represents the value of the
+// `ProvisionedThroughput.WriteCapacityUnits` request parameter.
+func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBSelect returns an attribute KeyValue conforming to the
+// "aws.dynamodb.select" semantic conventions. It represents the value of the
+// `Select` request parameter.
+func AWSDynamoDBSelect(val string) attribute.KeyValue {
+ return AWSDynamoDBSelectKey.String(val)
+}
+
+// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_names" semantic conventions. It represents the keys in
+// the `RequestItems` object field.
+func AWSDynamoDBTableNames(val ...string) attribute.KeyValue {
+ return AWSDynamoDBTableNamesKey.StringSlice(val)
+}
+
+// DynamoDB.CreateTable
+const (
+ // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to
+ // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It
+ // represents the JSON-serialized value of each item of the
+ // `GlobalSecondaryIndexes` request field
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName":
+ // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [
+ // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": {
+ // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }'
+ AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes")
+
+ // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to
+ // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
+ // represents the JSON-serialized value of each item of the
+ // `LocalSecondaryIndexes` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "IndexARN": "string", "IndexName": "string",
+ // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }'
+ AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes")
+)
+
+// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_indexes" semantic
+// conventions. It represents the JSON-serialized value of each item of the
+// `GlobalSecondaryIndexes` request field
+func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val)
+}
+
+// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming
+// to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
+// represents the JSON-serialized value of each item of the
+// `LocalSecondaryIndexes` request field.
+func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val)
+}
+
+// DynamoDB.ListTables
+const (
+ // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the
+ // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents
+ // the value of the `ExclusiveStartTableName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Users', 'CatsTable'
+ AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
+
+ // AWSDynamoDBTableCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_count" semantic conventions. It represents the the
+ // number of items in the `TableNames` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 20
+ AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
+)
+
+// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming
+// to the "aws.dynamodb.exclusive_start_table" semantic conventions. It
+// represents the value of the `ExclusiveStartTableName` request parameter.
+func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue {
+ return AWSDynamoDBExclusiveStartTableKey.String(val)
+}
+
+// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_count" semantic conventions. It represents the the
+// number of items in the `TableNames` response parameter.
+func AWSDynamoDBTableCount(val int) attribute.KeyValue {
+ return AWSDynamoDBTableCountKey.Int(val)
+}
+
+// DynamoDB.Query
+const (
+ // AWSDynamoDBScanForwardKey is the attribute Key conforming to the
+ // "aws.dynamodb.scan_forward" semantic conventions. It represents the
+ // value of the `ScanIndexForward` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
+)
+
+// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of
+// the `ScanIndexForward` request parameter.
+func AWSDynamoDBScanForward(val bool) attribute.KeyValue {
+ return AWSDynamoDBScanForwardKey.Bool(val)
+}
+
+// DynamoDB.Scan
+const (
+ // AWSDynamoDBCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.count" semantic conventions. It represents the value of
+ // the `Count` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
+
+ // AWSDynamoDBScannedCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.scanned_count" semantic conventions. It represents the
+ // value of the `ScannedCount` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 50
+ AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
+
+ // AWSDynamoDBSegmentKey is the attribute Key conforming to the
+ // "aws.dynamodb.segment" semantic conventions. It represents the value of
+ // the `Segment` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
+
+ // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the
+ // "aws.dynamodb.total_segments" semantic conventions. It represents the
+ // value of the `TotalSegments` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
+)
+
+// AWSDynamoDBCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.count" semantic conventions. It represents the value of the
+// `Count` response parameter.
+func AWSDynamoDBCount(val int) attribute.KeyValue {
+ return AWSDynamoDBCountKey.Int(val)
+}
+
+// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scanned_count" semantic conventions. It represents the value
+// of the `ScannedCount` response parameter.
+func AWSDynamoDBScannedCount(val int) attribute.KeyValue {
+ return AWSDynamoDBScannedCountKey.Int(val)
+}
+
+// AWSDynamoDBSegment returns an attribute KeyValue conforming to the
+// "aws.dynamodb.segment" semantic conventions. It represents the value of the
+// `Segment` request parameter.
+func AWSDynamoDBSegment(val int) attribute.KeyValue {
+ return AWSDynamoDBSegmentKey.Int(val)
+}
+
+// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the
+// "aws.dynamodb.total_segments" semantic conventions. It represents the value
+// of the `TotalSegments` request parameter.
+func AWSDynamoDBTotalSegments(val int) attribute.KeyValue {
+ return AWSDynamoDBTotalSegmentsKey.Int(val)
+}
+
+// DynamoDB.UpdateTable
+const (
+ // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to
+ // the "aws.dynamodb.attribute_definitions" semantic conventions. It
+ // represents the JSON-serialized value of each item in the
+ // `AttributeDefinitions` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
+ AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
+
+ // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key
+ // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+ // conventions. It represents the JSON-serialized value of each item in the
+ // the `GlobalSecondaryIndexUpdates` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" },
+ // "ProvisionedThroughput": { "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }'
+ AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
+)
+
+// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming
+// to the "aws.dynamodb.attribute_definitions" semantic conventions. It
+// represents the JSON-serialized value of each item in the
+// `AttributeDefinitions` request field.
+func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val)
+}
+
+// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+// conventions. It represents the JSON-serialized value of each item in the the
+// `GlobalSecondaryIndexUpdates` request field.
+func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val)
+}
+
+// Attributes that exist for S3 request types.
+const (
+ // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket"
+ // semantic conventions. It represents the S3 bucket name the request
+ // refers to. Corresponds to the `--bucket` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'some-bucket-name'
+ // Note: The `bucket` attribute is applicable to all S3 operations that
+ // reference a bucket, i.e. that require the bucket name as a mandatory
+ // parameter.
+ // This applies to almost all S3 operations except `list-buckets`.
+ AWSS3BucketKey = attribute.Key("aws.s3.bucket")
+
+ // AWSS3CopySourceKey is the attribute Key conforming to the
+ // "aws.s3.copy_source" semantic conventions. It represents the source
+ // object (in the form `bucket`/`key`) for the copy operation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'someFile.yml'
+ // Note: The `copy_source` attribute applies to S3 copy operations and
+ // corresponds to the `--copy-source` parameter
+ // of the [copy-object operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html).
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source")
+
+ // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete"
+ // semantic conventions. It represents the delete request container that
+ // specifies the objects to be deleted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean'
+ // Note: The `delete` attribute is only applicable to the
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // operation.
+ // The `delete` attribute corresponds to the `--delete` parameter of the
+ // [delete-objects operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html).
+ AWSS3DeleteKey = attribute.Key("aws.s3.delete")
+
+ // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic
+ // conventions. It represents the S3 object key the request refers to.
+ // Corresponds to the `--key` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'someFile.yml'
+ // Note: The `key` attribute is applicable to all object-related S3
+ // operations, i.e. that require the object key as a mandatory parameter.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // -
+ // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html)
+ // -
+ // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html)
+ // -
+ // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html)
+ // -
+ // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html)
+ // -
+ // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html)
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3KeyKey = attribute.Key("aws.s3.key")
+
+ // AWSS3PartNumberKey is the attribute Key conforming to the
+ // "aws.s3.part_number" semantic conventions. It represents the part number
+ // of the part being uploaded in a multipart-upload operation. This is a
+ // positive integer between 1 and 10,000.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3456
+ // Note: The `part_number` attribute is only applicable to the
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // and
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ // operations.
+ // The `part_number` attribute corresponds to the `--part-number` parameter
+ // of the
+ // [upload-part operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html).
+ AWSS3PartNumberKey = attribute.Key("aws.s3.part_number")
+
+ // AWSS3UploadIDKey is the attribute Key conforming to the
+ // "aws.s3.upload_id" semantic conventions. It represents the upload ID
+ // that identifies the multipart upload.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ'
+ // Note: The `upload_id` attribute applies to S3 multipart-upload
+ // operations and corresponds to the `--upload-id` parameter
+ // of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // multipart operations.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id")
+)
+
+// AWSS3Bucket returns an attribute KeyValue conforming to the
+// "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the
+// request refers to. Corresponds to the `--bucket` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Bucket(val string) attribute.KeyValue {
+ return AWSS3BucketKey.String(val)
+}
+
+// AWSS3CopySource returns an attribute KeyValue conforming to the
+// "aws.s3.copy_source" semantic conventions. It represents the source object
+// (in the form `bucket`/`key`) for the copy operation.
+func AWSS3CopySource(val string) attribute.KeyValue {
+ return AWSS3CopySourceKey.String(val)
+}
+
+// AWSS3Delete returns an attribute KeyValue conforming to the
+// "aws.s3.delete" semantic conventions. It represents the delete request
+// container that specifies the objects to be deleted.
+func AWSS3Delete(val string) attribute.KeyValue {
+ return AWSS3DeleteKey.String(val)
+}
+
+// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key"
+// semantic conventions. It represents the S3 object key the request refers to.
+// Corresponds to the `--key` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Key(val string) attribute.KeyValue {
+ return AWSS3KeyKey.String(val)
+}
+
+// AWSS3PartNumber returns an attribute KeyValue conforming to the
+// "aws.s3.part_number" semantic conventions. It represents the part number of
+// the part being uploaded in a multipart-upload operation. This is a positive
+// integer between 1 and 10,000.
+func AWSS3PartNumber(val int) attribute.KeyValue {
+ return AWSS3PartNumberKey.Int(val)
+}
+
+// AWSS3UploadID returns an attribute KeyValue conforming to the
+// "aws.s3.upload_id" semantic conventions. It represents the upload ID that
+// identifies the multipart upload.
+func AWSS3UploadID(val string) attribute.KeyValue {
+ return AWSS3UploadIDKey.String(val)
+}
+
+// Semantic conventions to apply when instrumenting the GraphQL implementation.
+// They map GraphQL operations to attributes on a Span.
+const (
+ // GraphqlDocumentKey is the attribute Key conforming to the
+ // "graphql.document" semantic conventions. It represents the GraphQL
+ // document being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'query findBookByID { bookByID(id: ?) { name } }'
+ // Note: The value may be sanitized to exclude sensitive information.
+ GraphqlDocumentKey = attribute.Key("graphql.document")
+
+ // GraphqlOperationNameKey is the attribute Key conforming to the
+ // "graphql.operation.name" semantic conventions. It represents the name of
+ // the operation being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'findBookByID'
+ GraphqlOperationNameKey = attribute.Key("graphql.operation.name")
+
+ // GraphqlOperationTypeKey is the attribute Key conforming to the
+ // "graphql.operation.type" semantic conventions. It represents the type of
+ // the operation being executed.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'query', 'mutation', 'subscription'
+ GraphqlOperationTypeKey = attribute.Key("graphql.operation.type")
+)
+
+var (
+ // GraphQL query
+ GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query")
+ // GraphQL mutation
+ GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation")
+ // GraphQL subscription
+ GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription")
+)
+
+// GraphqlDocument returns an attribute KeyValue conforming to the
+// "graphql.document" semantic conventions. It represents the GraphQL document
+// being executed.
+func GraphqlDocument(val string) attribute.KeyValue {
+ return GraphqlDocumentKey.String(val)
+}
+
+// GraphqlOperationName returns an attribute KeyValue conforming to the
+// "graphql.operation.name" semantic conventions. It represents the name of the
+// operation being executed.
+func GraphqlOperationName(val string) attribute.KeyValue {
+ return GraphqlOperationNameKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md
new file mode 100644
index 0000000000..2de1fc3c6b
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.26.0
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.26.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go
new file mode 100644
index 0000000000..d8dc822b26
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go
@@ -0,0 +1,8996 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// The Android platform on which the Android application is running.
+const (
+ // AndroidOSAPILevelKey is the attribute Key conforming to the
+ // "android.os.api_level" semantic conventions. It represents the uniquely
+ // identifies the framework API revision offered by a version
+ // (`os.version`) of the android operating system. More information can be
+ // found
+ // [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '33', '32'
+ AndroidOSAPILevelKey = attribute.Key("android.os.api_level")
+)
+
+// AndroidOSAPILevel returns an attribute KeyValue conforming to the
+// "android.os.api_level" semantic conventions. It represents the uniquely
+// identifies the framework API revision offered by a version (`os.version`) of
+// the android operating system. More information can be found
+// [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
+func AndroidOSAPILevel(val string) attribute.KeyValue {
+ return AndroidOSAPILevelKey.String(val)
+}
+
+// ASP.NET Core attributes
+const (
+ // AspnetcoreRateLimitingResultKey is the attribute Key conforming to the
+ // "aspnetcore.rate_limiting.result" semantic conventions. It represents
+ // the rate-limiting result, shows whether the lease was acquired or
+ // contains a rejection reason
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'acquired', 'request_canceled'
+ AspnetcoreRateLimitingResultKey = attribute.Key("aspnetcore.rate_limiting.result")
+
+ // AspnetcoreDiagnosticsHandlerTypeKey is the attribute Key conforming to
+ // the "aspnetcore.diagnostics.handler.type" semantic conventions. It
+ // represents the full type name of the
+ // [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
+ // implementation that handled the exception.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (if and only if the exception
+ // was handled by this handler.)
+ // Stability: stable
+ // Examples: 'Contoso.MyHandler'
+ AspnetcoreDiagnosticsHandlerTypeKey = attribute.Key("aspnetcore.diagnostics.handler.type")
+
+ // AspnetcoreDiagnosticsExceptionResultKey is the attribute Key conforming
+ // to the "aspnetcore.diagnostics.exception.result" semantic conventions.
+ // It represents the aSP.NET Core exception middleware handling result
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'handled', 'unhandled'
+ AspnetcoreDiagnosticsExceptionResultKey = attribute.Key("aspnetcore.diagnostics.exception.result")
+
+ // AspnetcoreRateLimitingPolicyKey is the attribute Key conforming to the
+ // "aspnetcore.rate_limiting.policy" semantic conventions. It represents
+ // the rate limiting policy name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'fixed', 'sliding', 'token'
+ AspnetcoreRateLimitingPolicyKey = attribute.Key("aspnetcore.rate_limiting.policy")
+
+ // AspnetcoreRequestIsUnhandledKey is the attribute Key conforming to the
+ // "aspnetcore.request.is_unhandled" semantic conventions. It represents
+ // the flag indicating if request was handled by the application pipeline.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: True
+ AspnetcoreRequestIsUnhandledKey = attribute.Key("aspnetcore.request.is_unhandled")
+
+ // AspnetcoreRoutingIsFallbackKey is the attribute Key conforming to the
+ // "aspnetcore.routing.is_fallback" semantic conventions. It represents a
+ // value that indicates whether the matched route is a fallback route.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: True
+ AspnetcoreRoutingIsFallbackKey = attribute.Key("aspnetcore.routing.is_fallback")
+
+ // AspnetcoreRoutingMatchStatusKey is the attribute Key conforming to the
+ // "aspnetcore.routing.match_status" semantic conventions. It represents
+ // the match result - success or failure
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'success', 'failure'
+ AspnetcoreRoutingMatchStatusKey = attribute.Key("aspnetcore.routing.match_status")
+)
+
+var (
+ // Lease was acquired
+ AspnetcoreRateLimitingResultAcquired = AspnetcoreRateLimitingResultKey.String("acquired")
+ // Lease request was rejected by the endpoint limiter
+ AspnetcoreRateLimitingResultEndpointLimiter = AspnetcoreRateLimitingResultKey.String("endpoint_limiter")
+ // Lease request was rejected by the global limiter
+ AspnetcoreRateLimitingResultGlobalLimiter = AspnetcoreRateLimitingResultKey.String("global_limiter")
+ // Lease request was canceled
+ AspnetcoreRateLimitingResultRequestCanceled = AspnetcoreRateLimitingResultKey.String("request_canceled")
+)
+
+var (
+ // Exception was handled by the exception handling middleware
+ AspnetcoreDiagnosticsExceptionResultHandled = AspnetcoreDiagnosticsExceptionResultKey.String("handled")
+ // Exception was not handled by the exception handling middleware
+ AspnetcoreDiagnosticsExceptionResultUnhandled = AspnetcoreDiagnosticsExceptionResultKey.String("unhandled")
+ // Exception handling was skipped because the response had started
+ AspnetcoreDiagnosticsExceptionResultSkipped = AspnetcoreDiagnosticsExceptionResultKey.String("skipped")
+ // Exception handling didn't run because the request was aborted
+ AspnetcoreDiagnosticsExceptionResultAborted = AspnetcoreDiagnosticsExceptionResultKey.String("aborted")
+)
+
+var (
+ // Match succeeded
+ AspnetcoreRoutingMatchStatusSuccess = AspnetcoreRoutingMatchStatusKey.String("success")
+ // Match failed
+ AspnetcoreRoutingMatchStatusFailure = AspnetcoreRoutingMatchStatusKey.String("failure")
+)
+
+// AspnetcoreDiagnosticsHandlerType returns an attribute KeyValue conforming
+// to the "aspnetcore.diagnostics.handler.type" semantic conventions. It
+// represents the full type name of the
+// [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
+// implementation that handled the exception.
+func AspnetcoreDiagnosticsHandlerType(val string) attribute.KeyValue {
+ return AspnetcoreDiagnosticsHandlerTypeKey.String(val)
+}
+
+// AspnetcoreRateLimitingPolicy returns an attribute KeyValue conforming to
+// the "aspnetcore.rate_limiting.policy" semantic conventions. It represents
+// the rate limiting policy name.
+func AspnetcoreRateLimitingPolicy(val string) attribute.KeyValue {
+ return AspnetcoreRateLimitingPolicyKey.String(val)
+}
+
+// AspnetcoreRequestIsUnhandled returns an attribute KeyValue conforming to
+// the "aspnetcore.request.is_unhandled" semantic conventions. It represents
+// the flag indicating if request was handled by the application pipeline.
+func AspnetcoreRequestIsUnhandled(val bool) attribute.KeyValue {
+ return AspnetcoreRequestIsUnhandledKey.Bool(val)
+}
+
+// AspnetcoreRoutingIsFallback returns an attribute KeyValue conforming to
+// the "aspnetcore.routing.is_fallback" semantic conventions. It represents a
+// value that indicates whether the matched route is a fallback route.
+func AspnetcoreRoutingIsFallback(val bool) attribute.KeyValue {
+ return AspnetcoreRoutingIsFallbackKey.Bool(val)
+}
+
+// Generic attributes for AWS services.
+const (
+ // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id"
+ // semantic conventions. It represents the AWS request ID as returned in
+ // the response headers `x-amz-request-id` or `x-amz-requestid`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ'
+ AWSRequestIDKey = attribute.Key("aws.request_id")
+)
+
+// AWSRequestID returns an attribute KeyValue conforming to the
+// "aws.request_id" semantic conventions. It represents the AWS request ID as
+// returned in the response headers `x-amz-request-id` or `x-amz-requestid`.
+func AWSRequestID(val string) attribute.KeyValue {
+ return AWSRequestIDKey.String(val)
+}
+
+// Attributes for AWS DynamoDB.
+const (
+ // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to
+ // the "aws.dynamodb.attribute_definitions" semantic conventions. It
+ // represents the JSON-serialized value of each item in the
+ // `AttributeDefinitions` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
+ AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
+
+ // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the
+ // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+ // value of the `AttributesToGet` request parameter.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'lives', 'id'
+ AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
+
+ // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the
+ // "aws.dynamodb.consistent_read" semantic conventions. It represents the
+ // value of the `ConsistentRead` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
+
+ // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the
+ // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+ // JSON-serialized value of each item in the `ConsumedCapacity` response
+ // field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": {
+ // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" :
+ // { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table":
+ // { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number }, "TableName": "string",
+ // "WriteCapacityUnits": number }'
+ AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity")
+
+ // AWSDynamoDBCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.count" semantic conventions. It represents the value of
+ // the `Count` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
+
+ // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the
+ // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents
+ // the value of the `ExclusiveStartTableName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Users', 'CatsTable'
+ AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
+
+ // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key
+ // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+ // conventions. It represents the JSON-serialized value of each item in the
+ // `GlobalSecondaryIndexUpdates` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" },
+ // "ProvisionedThroughput": { "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }'
+ AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
+
+ // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to
+ // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It
+ // represents the JSON-serialized value of each item of the
+ // `GlobalSecondaryIndexes` request field
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName":
+ // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [
+ // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": {
+ // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }'
+ AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes")
+
+ // AWSDynamoDBIndexNameKey is the attribute Key conforming to the
+ // "aws.dynamodb.index_name" semantic conventions. It represents the value
+ // of the `IndexName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'name_to_group'
+ AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
+
+ // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to
+ // the "aws.dynamodb.item_collection_metrics" semantic conventions. It
+ // represents the JSON-serialized value of the `ItemCollectionMetrics`
+ // response field.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B":
+ // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": {
+ // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ],
+ // "NULL": boolean, "S": "string", "SS": [ "string" ] } },
+ // "SizeEstimateRangeGB": [ number ] } ] }'
+ AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics")
+
+ // AWSDynamoDBLimitKey is the attribute Key conforming to the
+ // "aws.dynamodb.limit" semantic conventions. It represents the value of
+ // the `Limit` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
+
+ // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to
+ // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
+ // represents the JSON-serialized value of each item of the
+ // `LocalSecondaryIndexes` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "IndexARN": "string", "IndexName": "string",
+ // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }'
+ AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes")
+
+ // AWSDynamoDBProjectionKey is the attribute Key conforming to the
+ // "aws.dynamodb.projection" semantic conventions. It represents the value
+ // of the `ProjectionExpression` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Title', 'Title, Price, Color', 'Title, Description,
+ // RelatedItems, ProductReviews'
+ AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection")
+
+ // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to
+ // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It
+ // represents the value of the `ProvisionedThroughput.ReadCapacityUnits`
+ // request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
+
+ // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming
+ // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions.
+ // It represents the value of the
+ // `ProvisionedThroughput.WriteCapacityUnits` request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
+
+ // AWSDynamoDBScanForwardKey is the attribute Key conforming to the
+ // "aws.dynamodb.scan_forward" semantic conventions. It represents the
+ // value of the `ScanIndexForward` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
+
+ // AWSDynamoDBScannedCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.scanned_count" semantic conventions. It represents the
+ // value of the `ScannedCount` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 50
+ AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
+
+ // AWSDynamoDBSegmentKey is the attribute Key conforming to the
+ // "aws.dynamodb.segment" semantic conventions. It represents the value of
+ // the `Segment` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
+
+ // AWSDynamoDBSelectKey is the attribute Key conforming to the
+ // "aws.dynamodb.select" semantic conventions. It represents the value of
+ // the `Select` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ALL_ATTRIBUTES', 'COUNT'
+ AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
+
+ // AWSDynamoDBTableCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_count" semantic conventions. It represents the
+ // number of items in the `TableNames` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 20
+ AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
+
+ // AWSDynamoDBTableNamesKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_names" semantic conventions. It represents the keys
+ // in the `RequestItems` object field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Users', 'Cats'
+ AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
+
+ // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the
+ // "aws.dynamodb.total_segments" semantic conventions. It represents the
+ // value of the `TotalSegments` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
+)
+
+// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming
+// to the "aws.dynamodb.attribute_definitions" semantic conventions. It
+// represents the JSON-serialized value of each item in the
+// `AttributeDefinitions` request field.
+func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val)
+}
+
+// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to
+// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+// value of the `AttributesToGet` request parameter.
+func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributesToGetKey.StringSlice(val)
+}
+
+// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the
+// "aws.dynamodb.consistent_read" semantic conventions. It represents the value
+// of the `ConsistentRead` request parameter.
+func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue {
+ return AWSDynamoDBConsistentReadKey.Bool(val)
+}
+
+// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to
+// the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+// JSON-serialized value of each item in the `ConsumedCapacity` response field.
+func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue {
+ return AWSDynamoDBConsumedCapacityKey.StringSlice(val)
+}
+
+// AWSDynamoDBCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.count" semantic conventions. It represents the value of the
+// `Count` response parameter.
+func AWSDynamoDBCount(val int) attribute.KeyValue {
+ return AWSDynamoDBCountKey.Int(val)
+}
+
+// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming
+// to the "aws.dynamodb.exclusive_start_table" semantic conventions. It
+// represents the value of the `ExclusiveStartTableName` request parameter.
+func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue {
+ return AWSDynamoDBExclusiveStartTableKey.String(val)
+}
+
+// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+// conventions. It represents the JSON-serialized value of each item in the
+// `GlobalSecondaryIndexUpdates` request field.
+func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val)
+}
+
+// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_indexes" semantic
+// conventions. It represents the JSON-serialized value of each item of the
+// `GlobalSecondaryIndexes` request field
+func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val)
+}
+
+// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the
+// "aws.dynamodb.index_name" semantic conventions. It represents the value of
+// the `IndexName` request parameter.
+func AWSDynamoDBIndexName(val string) attribute.KeyValue {
+ return AWSDynamoDBIndexNameKey.String(val)
+}
+
+// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming
+// to the "aws.dynamodb.item_collection_metrics" semantic conventions. It
+// represents the JSON-serialized value of the `ItemCollectionMetrics` response
+// field.
+func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue {
+ return AWSDynamoDBItemCollectionMetricsKey.String(val)
+}
+
+// AWSDynamoDBLimit returns an attribute KeyValue conforming to the
+// "aws.dynamodb.limit" semantic conventions. It represents the value of the
+// `Limit` request parameter.
+func AWSDynamoDBLimit(val int) attribute.KeyValue {
+ return AWSDynamoDBLimitKey.Int(val)
+}
+
+// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming
+// to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
+// represents the JSON-serialized value of each item of the
+// `LocalSecondaryIndexes` request field.
+func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val)
+}
+
+// AWSDynamoDBProjection returns an attribute KeyValue conforming to the
+// "aws.dynamodb.projection" semantic conventions. It represents the value of
+// the `ProjectionExpression` request parameter.
+func AWSDynamoDBProjection(val string) attribute.KeyValue {
+ return AWSDynamoDBProjectionKey.String(val)
+}
+
+// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue
+// conforming to the "aws.dynamodb.provisioned_read_capacity" semantic
+// conventions. It represents the value of the
+// `ProvisionedThroughput.ReadCapacityUnits` request parameter.
+func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedReadCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue
+// conforming to the "aws.dynamodb.provisioned_write_capacity" semantic
+// conventions. It represents the value of the
+// `ProvisionedThroughput.WriteCapacityUnits` request parameter.
+func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of
+// the `ScanIndexForward` request parameter.
+func AWSDynamoDBScanForward(val bool) attribute.KeyValue {
+ return AWSDynamoDBScanForwardKey.Bool(val)
+}
+
+// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scanned_count" semantic conventions. It represents the value
+// of the `ScannedCount` response parameter.
+func AWSDynamoDBScannedCount(val int) attribute.KeyValue {
+ return AWSDynamoDBScannedCountKey.Int(val)
+}
+
+// AWSDynamoDBSegment returns an attribute KeyValue conforming to the
+// "aws.dynamodb.segment" semantic conventions. It represents the value of the
+// `Segment` request parameter.
+func AWSDynamoDBSegment(val int) attribute.KeyValue {
+ return AWSDynamoDBSegmentKey.Int(val)
+}
+
+// AWSDynamoDBSelect returns an attribute KeyValue conforming to the
+// "aws.dynamodb.select" semantic conventions. It represents the value of the
+// `Select` request parameter.
+func AWSDynamoDBSelect(val string) attribute.KeyValue {
+ return AWSDynamoDBSelectKey.String(val)
+}
+
+// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_count" semantic conventions. It represents the number of
+// items in the `TableNames` response parameter.
+func AWSDynamoDBTableCount(val int) attribute.KeyValue {
+ return AWSDynamoDBTableCountKey.Int(val)
+}
+
+// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_names" semantic conventions. It represents the keys in
+// the `RequestItems` object field.
+func AWSDynamoDBTableNames(val ...string) attribute.KeyValue {
+ return AWSDynamoDBTableNamesKey.StringSlice(val)
+}
+
+// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the
+// "aws.dynamodb.total_segments" semantic conventions. It represents the value
+// of the `TotalSegments` request parameter.
+func AWSDynamoDBTotalSegments(val int) attribute.KeyValue {
+ return AWSDynamoDBTotalSegmentsKey.Int(val)
+}
+
+// Attributes for AWS Elastic Container Service (ECS).
+const (
+ // AWSECSTaskIDKey is the attribute Key conforming to the "aws.ecs.task.id"
+ // semantic conventions. It represents the ID of a running ECS task. The ID
+ // MUST be extracted from `task.arn`.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If and only if `task.arn` is
+ // populated.)
+ // Stability: experimental
+ // Examples: '10838bed-421f-43ef-870a-f43feacbbb5b',
+ // '23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd'
+ AWSECSTaskIDKey = attribute.Key("aws.ecs.task.id")
+
+ // AWSECSClusterARNKey is the attribute Key conforming to the
+ // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an
+ // [ECS
+ // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
+ AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn")
+
+ // AWSECSContainerARNKey is the attribute Key conforming to the
+ // "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+ // Resource Name (ARN) of an [ECS container
+ // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9'
+ AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn")
+
+ // AWSECSLaunchtypeKey is the attribute Key conforming to the
+ // "aws.ecs.launchtype" semantic conventions. It represents the [launch
+ // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // for an ECS task.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype")
+
+ // AWSECSTaskARNKey is the attribute Key conforming to the
+ // "aws.ecs.task.arn" semantic conventions. It represents the ARN of a
+ // running [ECS
+ // task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b',
+ // 'arn:aws:ecs:us-west-1:123456789123:task/my-cluster/task-id/23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd'
+ AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn")
+
+ // AWSECSTaskFamilyKey is the attribute Key conforming to the
+ // "aws.ecs.task.family" semantic conventions. It represents the family
+ // name of the [ECS task
+ // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)
+ // used to create the ECS task.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-family'
+ AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family")
+
+ // AWSECSTaskRevisionKey is the attribute Key conforming to the
+ // "aws.ecs.task.revision" semantic conventions. It represents the revision
+ // for the task definition used to create the ECS task.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '8', '26'
+ AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision")
+)
+
+var (
+ // ec2
+ AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2")
+ // fargate
+ AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate")
+)
+
+// AWSECSTaskID returns an attribute KeyValue conforming to the
+// "aws.ecs.task.id" semantic conventions. It represents the ID of a running
+// ECS task. The ID MUST be extracted from `task.arn`.
+func AWSECSTaskID(val string) attribute.KeyValue {
+ return AWSECSTaskIDKey.String(val)
+}
+
+// AWSECSClusterARN returns an attribute KeyValue conforming to the
+// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS
+// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
+func AWSECSClusterARN(val string) attribute.KeyValue {
+ return AWSECSClusterARNKey.String(val)
+}
+
+// AWSECSContainerARN returns an attribute KeyValue conforming to the
+// "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+// Resource Name (ARN) of an [ECS container
+// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
+func AWSECSContainerARN(val string) attribute.KeyValue {
+ return AWSECSContainerARNKey.String(val)
+}
+
+// AWSECSTaskARN returns an attribute KeyValue conforming to the
+// "aws.ecs.task.arn" semantic conventions. It represents the ARN of a running
+// [ECS
+// task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids).
+func AWSECSTaskARN(val string) attribute.KeyValue {
+ return AWSECSTaskARNKey.String(val)
+}
+
+// AWSECSTaskFamily returns an attribute KeyValue conforming to the
+// "aws.ecs.task.family" semantic conventions. It represents the family name of
+// the [ECS task
+// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)
+// used to create the ECS task.
+func AWSECSTaskFamily(val string) attribute.KeyValue {
+ return AWSECSTaskFamilyKey.String(val)
+}
+
+// AWSECSTaskRevision returns an attribute KeyValue conforming to the
+// "aws.ecs.task.revision" semantic conventions. It represents the revision for
+// the task definition used to create the ECS task.
+func AWSECSTaskRevision(val string) attribute.KeyValue {
+ return AWSECSTaskRevisionKey.String(val)
+}
+
+// Attributes for AWS Elastic Kubernetes Service (EKS).
+const (
+ // AWSEKSClusterARNKey is the attribute Key conforming to the
+ // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an
+ // EKS cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
+ AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn")
+)
+
+// AWSEKSClusterARN returns an attribute KeyValue conforming to the
+// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS
+// cluster.
+func AWSEKSClusterARN(val string) attribute.KeyValue {
+ return AWSEKSClusterARNKey.String(val)
+}
+
+// Attributes for AWS Logs.
+const (
+ // AWSLogGroupARNsKey is the attribute Key conforming to the
+ // "aws.log.group.arns" semantic conventions. It represents the Amazon
+ // Resource Name(s) (ARN) of the AWS log group(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*'
+ // Note: See the [log group ARN format
+ // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
+ AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns")
+
+ // AWSLogGroupNamesKey is the attribute Key conforming to the
+ // "aws.log.group.names" semantic conventions. It represents the name(s) of
+ // the AWS log group(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/aws/lambda/my-function', 'opentelemetry-service'
+ // Note: Multiple log groups must be supported for cases like
+ // multi-container applications, where a single application has sidecar
+ // containers, and each write to their own log group.
+ AWSLogGroupNamesKey = attribute.Key("aws.log.group.names")
+
+ // AWSLogStreamARNsKey is the attribute Key conforming to the
+ // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of
+ // the AWS log stream(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
+ // Note: See the [log stream ARN format
+ // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
+ // One log group can contain several log streams, so these ARNs necessarily
+ // identify both a log group and a log stream.
+ AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns")
+
+ // AWSLogStreamNamesKey is the attribute Key conforming to the
+ // "aws.log.stream.names" semantic conventions. It represents the name(s)
+ // of the AWS log stream(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
+ AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names")
+)
+
+// AWSLogGroupARNs returns an attribute KeyValue conforming to the
+// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource
+// Name(s) (ARN) of the AWS log group(s).
+func AWSLogGroupARNs(val ...string) attribute.KeyValue {
+ return AWSLogGroupARNsKey.StringSlice(val)
+}
+
+// AWSLogGroupNames returns an attribute KeyValue conforming to the
+// "aws.log.group.names" semantic conventions. It represents the name(s) of the
+// AWS log group(s) an application is writing to.
+func AWSLogGroupNames(val ...string) attribute.KeyValue {
+ return AWSLogGroupNamesKey.StringSlice(val)
+}
+
+// AWSLogStreamARNs returns an attribute KeyValue conforming to the
+// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the
+// AWS log stream(s).
+func AWSLogStreamARNs(val ...string) attribute.KeyValue {
+ return AWSLogStreamARNsKey.StringSlice(val)
+}
+
+// AWSLogStreamNames returns an attribute KeyValue conforming to the
+// "aws.log.stream.names" semantic conventions. It represents the name(s) of
+// the AWS log stream(s) an application is writing to.
+func AWSLogStreamNames(val ...string) attribute.KeyValue {
+ return AWSLogStreamNamesKey.StringSlice(val)
+}
+
+// Attributes for AWS Lambda.
+const (
+ // AWSLambdaInvokedARNKey is the attribute Key conforming to the
+ // "aws.lambda.invoked_arn" semantic conventions. It represents the full
+ // invoked ARN as provided on the `Context` passed to the function
+ // (`Lambda-Runtime-Invoked-Function-ARN` header on the
+ // `/runtime/invocation/next` applicable).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'
+ // Note: This may be different from `cloud.resource_id` if an alias is
+ // involved.
+ AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn")
+)
+
+// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the
+// "aws.lambda.invoked_arn" semantic conventions. It represents the full
+// invoked ARN as provided on the `Context` passed to the function
+// (`Lambda-Runtime-Invoked-Function-ARN` header on the
+// `/runtime/invocation/next` applicable).
+func AWSLambdaInvokedARN(val string) attribute.KeyValue {
+ return AWSLambdaInvokedARNKey.String(val)
+}
+
+// Attributes for AWS S3.
+const (
+ // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket"
+ // semantic conventions. It represents the S3 bucket name the request
+ // refers to. Corresponds to the `--bucket` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'some-bucket-name'
+ // Note: The `bucket` attribute is applicable to all S3 operations that
+ // reference a bucket, i.e. that require the bucket name as a mandatory
+ // parameter.
+ // This applies to almost all S3 operations except `list-buckets`.
+ AWSS3BucketKey = attribute.Key("aws.s3.bucket")
+
+ // AWSS3CopySourceKey is the attribute Key conforming to the
+ // "aws.s3.copy_source" semantic conventions. It represents the source
+ // object (in the form `bucket`/`key`) for the copy operation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'someFile.yml'
+ // Note: The `copy_source` attribute applies to S3 copy operations and
+ // corresponds to the `--copy-source` parameter
+ // of the [copy-object operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html).
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source")
+
+ // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete"
+ // semantic conventions. It represents the delete request container that
+ // specifies the objects to be deleted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean'
+ // Note: The `delete` attribute is only applicable to the
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // operation.
+ // The `delete` attribute corresponds to the `--delete` parameter of the
+ // [delete-objects operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html).
+ AWSS3DeleteKey = attribute.Key("aws.s3.delete")
+
+ // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic
+ // conventions. It represents the S3 object key the request refers to.
+ // Corresponds to the `--key` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'someFile.yml'
+ // Note: The `key` attribute is applicable to all object-related S3
+ // operations, i.e. that require the object key as a mandatory parameter.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // -
+ // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html)
+ // -
+ // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html)
+ // -
+ // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html)
+ // -
+ // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html)
+ // -
+ // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html)
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3KeyKey = attribute.Key("aws.s3.key")
+
+ // AWSS3PartNumberKey is the attribute Key conforming to the
+ // "aws.s3.part_number" semantic conventions. It represents the part number
+ // of the part being uploaded in a multipart-upload operation. This is a
+ // positive integer between 1 and 10,000.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3456
+ // Note: The `part_number` attribute is only applicable to the
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // and
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ // operations.
+ // The `part_number` attribute corresponds to the `--part-number` parameter
+ // of the
+ // [upload-part operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html).
+ AWSS3PartNumberKey = attribute.Key("aws.s3.part_number")
+
+ // AWSS3UploadIDKey is the attribute Key conforming to the
+ // "aws.s3.upload_id" semantic conventions. It represents the upload ID
+ // that identifies the multipart upload.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ'
+ // Note: The `upload_id` attribute applies to S3 multipart-upload
+ // operations and corresponds to the `--upload-id` parameter
+ // of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // multipart operations.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id")
+)
+
+// AWSS3Bucket returns an attribute KeyValue conforming to the
+// "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the
+// request refers to. Corresponds to the `--bucket` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Bucket(val string) attribute.KeyValue {
+ return AWSS3BucketKey.String(val)
+}
+
+// AWSS3CopySource returns an attribute KeyValue conforming to the
+// "aws.s3.copy_source" semantic conventions. It represents the source object
+// (in the form `bucket`/`key`) for the copy operation.
+func AWSS3CopySource(val string) attribute.KeyValue {
+ return AWSS3CopySourceKey.String(val)
+}
+
+// AWSS3Delete returns an attribute KeyValue conforming to the
+// "aws.s3.delete" semantic conventions. It represents the delete request
+// container that specifies the objects to be deleted.
+func AWSS3Delete(val string) attribute.KeyValue {
+ return AWSS3DeleteKey.String(val)
+}
+
+// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key"
+// semantic conventions. It represents the S3 object key the request refers to.
+// Corresponds to the `--key` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Key(val string) attribute.KeyValue {
+ return AWSS3KeyKey.String(val)
+}
+
+// AWSS3PartNumber returns an attribute KeyValue conforming to the
+// "aws.s3.part_number" semantic conventions. It represents the part number of
+// the part being uploaded in a multipart-upload operation. This is a positive
+// integer between 1 and 10,000.
+func AWSS3PartNumber(val int) attribute.KeyValue {
+ return AWSS3PartNumberKey.Int(val)
+}
+
+// AWSS3UploadID returns an attribute KeyValue conforming to the
+// "aws.s3.upload_id" semantic conventions. It represents the upload ID that
+// identifies the multipart upload.
+func AWSS3UploadID(val string) attribute.KeyValue {
+ return AWSS3UploadIDKey.String(val)
+}
+
+// The web browser attributes
+const (
+ // BrowserBrandsKey is the attribute Key conforming to the "browser.brands"
+ // semantic conventions. It represents the array of brand name and version
+ // separated by a space
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99'
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.brands`).
+ BrowserBrandsKey = attribute.Key("browser.brands")
+
+ // BrowserLanguageKey is the attribute Key conforming to the
+ // "browser.language" semantic conventions. It represents the preferred
+ // language of the user using the browser
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'en', 'en-US', 'fr', 'fr-FR'
+ // Note: This value is intended to be taken from the Navigator API
+ // `navigator.language`.
+ BrowserLanguageKey = attribute.Key("browser.language")
+
+ // BrowserMobileKey is the attribute Key conforming to the "browser.mobile"
+ // semantic conventions. It represents a boolean that is true if the
+ // browser is running on a mobile device
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.mobile`). If unavailable, this attribute
+ // SHOULD be left unset.
+ BrowserMobileKey = attribute.Key("browser.mobile")
+
+ // BrowserPlatformKey is the attribute Key conforming to the
+ // "browser.platform" semantic conventions. It represents the platform on
+ // which the browser is running
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Windows', 'macOS', 'Android'
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.platform`). If unavailable, the legacy
+ // `navigator.platform` API SHOULD NOT be used instead and this attribute
+ // SHOULD be left unset in order for the values to be consistent.
+ // The list of possible values is defined in the [W3C User-Agent Client
+ // Hints
+ // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform).
+ // Note that some (but not all) of these values can overlap with values in
+ // the [`os.type` and `os.name` attributes](./os.md). However, for
+ // consistency, the values in the `browser.platform` attribute should
+ // capture the exact value that the user agent provides.
+ BrowserPlatformKey = attribute.Key("browser.platform")
+)
+
+// BrowserBrands returns an attribute KeyValue conforming to the
+// "browser.brands" semantic conventions. It represents the array of brand name
+// and version separated by a space
+func BrowserBrands(val ...string) attribute.KeyValue {
+ return BrowserBrandsKey.StringSlice(val)
+}
+
+// BrowserLanguage returns an attribute KeyValue conforming to the
+// "browser.language" semantic conventions. It represents the preferred
+// language of the user using the browser
+func BrowserLanguage(val string) attribute.KeyValue {
+ return BrowserLanguageKey.String(val)
+}
+
+// BrowserMobile returns an attribute KeyValue conforming to the
+// "browser.mobile" semantic conventions. It represents a boolean that is true
+// if the browser is running on a mobile device
+func BrowserMobile(val bool) attribute.KeyValue {
+ return BrowserMobileKey.Bool(val)
+}
+
+// BrowserPlatform returns an attribute KeyValue conforming to the
+// "browser.platform" semantic conventions. It represents the platform on which
+// the browser is running
+func BrowserPlatform(val string) attribute.KeyValue {
+ return BrowserPlatformKey.String(val)
+}
+
+// These attributes may be used to describe the client in a connection-based
+// network interaction where there is one side that initiates the connection
+// (the client is the side that initiates the connection). This covers all TCP
+// network interactions since TCP is connection-based and one side initiates
+// the connection (an exception is made for peer-to-peer communication over TCP
+// where the "user-facing" surface of the protocol / API doesn't expose a clear
+// notion of client and server). This also covers UDP network interactions
+// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
+const (
+ // ClientAddressKey is the attribute Key conforming to the "client.address"
+ // semantic conventions. It represents the client address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix
+ // domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'client.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the server side, and when communicating through
+ // an intermediary, `client.address` SHOULD represent the client address
+ // behind any intermediaries, for example proxies, if it's available.
+ ClientAddressKey = attribute.Key("client.address")
+
+ // ClientPortKey is the attribute Key conforming to the "client.port"
+ // semantic conventions. It represents the client port number.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ // Note: When observed from the server side, and when communicating through
+ // an intermediary, `client.port` SHOULD represent the client port behind
+ // any intermediaries, for example proxies, if it's available.
+ ClientPortKey = attribute.Key("client.port")
+)
+
+// ClientAddress returns an attribute KeyValue conforming to the
+// "client.address" semantic conventions. It represents the client address -
+// domain name if available without reverse DNS lookup; otherwise, IP address
+// or Unix domain socket name.
+func ClientAddress(val string) attribute.KeyValue {
+ return ClientAddressKey.String(val)
+}
+
+// ClientPort returns an attribute KeyValue conforming to the "client.port"
+// semantic conventions. It represents the client port number.
+func ClientPort(val int) attribute.KeyValue {
+ return ClientPortKey.Int(val)
+}
+
+// A cloud environment (e.g. GCP, Azure, AWS).
+const (
+ // CloudAccountIDKey is the attribute Key conforming to the
+ // "cloud.account.id" semantic conventions. It represents the cloud account
+ // ID the resource is assigned to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '111111111111', 'opentelemetry'
+ CloudAccountIDKey = attribute.Key("cloud.account.id")
+
+ // CloudAvailabilityZoneKey is the attribute Key conforming to the
+ // "cloud.availability_zone" semantic conventions. It represents the cloud
+ // regions often have multiple, isolated locations known as zones to
+ // increase availability. Availability zone represents the zone where the
+ // resource is running.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-east-1c'
+ // Note: Availability zones are called "zones" on Alibaba Cloud and Google
+ // Cloud.
+ CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone")
+
+ // CloudPlatformKey is the attribute Key conforming to the "cloud.platform"
+ // semantic conventions. It represents the cloud platform in use.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The prefix of the service SHOULD match the one specified in
+ // `cloud.provider`.
+ CloudPlatformKey = attribute.Key("cloud.platform")
+
+ // CloudProviderKey is the attribute Key conforming to the "cloud.provider"
+ // semantic conventions. It represents the name of the cloud provider.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ CloudProviderKey = attribute.Key("cloud.provider")
+
+ // CloudRegionKey is the attribute Key conforming to the "cloud.region"
+ // semantic conventions. It represents the geographical region the resource
+ // is running.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-central1', 'us-east-1'
+ // Note: Refer to your provider's docs to see the available regions, for
+ // example [Alibaba Cloud
+ // regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS
+ // regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/),
+ // [Azure
+ // regions](https://azure.microsoft.com/global-infrastructure/geographies/),
+ // [Google Cloud regions](https://cloud.google.com/about/locations), or
+ // [Tencent Cloud
+ // regions](https://www.tencentcloud.com/document/product/213/6091).
+ CloudRegionKey = attribute.Key("cloud.region")
+
+ // CloudResourceIDKey is the attribute Key conforming to the
+ // "cloud.resource_id" semantic conventions. It represents the cloud
+ // provider-specific native identifier of the monitored cloud resource
+ // (e.g. an
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // on AWS, a [fully qualified resource
+ // ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id)
+ // on Azure, a [full resource
+ // name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+ // on GCP)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function',
+ // '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID',
+ // '/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/'
+ // Note: On some cloud providers, it may not be possible to determine the
+ // full ID at startup,
+ // so it may be necessary to set `cloud.resource_id` as a span attribute
+ // instead.
+ //
+ // The exact value to use for `cloud.resource_id` depends on the cloud
+ // provider.
+ // The following well-known definitions MUST be used if you set this
+ // attribute and they apply:
+ //
+ // * **AWS Lambda:** The function
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
+ // Take care not to use the "invoked ARN" directly but replace any
+ // [alias
+ // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
+ // with the resolved function version, as the same runtime instance may
+ // be invokable with
+ // multiple different aliases.
+ // * **GCP:** The [URI of the
+ // resource](https://cloud.google.com/iam/docs/full-resource-names)
+ // * **Azure:** The [Fully Qualified Resource
+ // ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id)
+ // of the invoked function,
+ // *not* the function app, having the form
+ // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`.
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider.
+ CloudResourceIDKey = attribute.Key("cloud.resource_id")
+)
+
+var (
+ // Alibaba Cloud Elastic Compute Service
+ CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs")
+ // Alibaba Cloud Function Compute
+ CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc")
+ // Red Hat OpenShift on Alibaba Cloud
+ CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift")
+ // AWS Elastic Compute Cloud
+ CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2")
+ // AWS Elastic Container Service
+ CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs")
+ // AWS Elastic Kubernetes Service
+ CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks")
+ // AWS Lambda
+ CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda")
+ // AWS Elastic Beanstalk
+ CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk")
+ // AWS App Runner
+ CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner")
+ // Red Hat OpenShift on AWS (ROSA)
+ CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift")
+ // Azure Virtual Machines
+ CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm")
+ // Azure Container Apps
+ CloudPlatformAzureContainerApps = CloudPlatformKey.String("azure_container_apps")
+ // Azure Container Instances
+ CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances")
+ // Azure Kubernetes Service
+ CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks")
+ // Azure Functions
+ CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions")
+ // Azure App Service
+ CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service")
+ // Azure Red Hat OpenShift
+ CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift")
+ // Google Bare Metal Solution (BMS)
+ CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution")
+ // Google Cloud Compute Engine (GCE)
+ CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine")
+ // Google Cloud Run
+ CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run")
+ // Google Cloud Kubernetes Engine (GKE)
+ CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine")
+ // Google Cloud Functions (GCF)
+ CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions")
+ // Google Cloud App Engine (GAE)
+ CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine")
+ // Red Hat OpenShift on Google Cloud
+ CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift")
+ // Red Hat OpenShift on IBM Cloud
+ CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift")
+ // Tencent Cloud Cloud Virtual Machine (CVM)
+ CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm")
+ // Tencent Cloud Elastic Kubernetes Service (EKS)
+ CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks")
+ // Tencent Cloud Serverless Cloud Function (SCF)
+ CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf")
+)
+
+var (
+ // Alibaba Cloud
+ CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ CloudProviderAWS = CloudProviderKey.String("aws")
+ // Microsoft Azure
+ CloudProviderAzure = CloudProviderKey.String("azure")
+ // Google Cloud Platform
+ CloudProviderGCP = CloudProviderKey.String("gcp")
+ // Heroku Platform as a Service
+ CloudProviderHeroku = CloudProviderKey.String("heroku")
+ // IBM Cloud
+ CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud")
+ // Tencent Cloud
+ CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud")
+)
+
+// CloudAccountID returns an attribute KeyValue conforming to the
+// "cloud.account.id" semantic conventions. It represents the cloud account ID
+// the resource is assigned to.
+func CloudAccountID(val string) attribute.KeyValue {
+ return CloudAccountIDKey.String(val)
+}
+
+// CloudAvailabilityZone returns an attribute KeyValue conforming to the
+// "cloud.availability_zone" semantic conventions. It represents the cloud
+// regions often have multiple, isolated locations known as zones to increase
+// availability. Availability zone represents the zone where the resource is
+// running.
+func CloudAvailabilityZone(val string) attribute.KeyValue {
+ return CloudAvailabilityZoneKey.String(val)
+}
+
+// CloudRegion returns an attribute KeyValue conforming to the
+// "cloud.region" semantic conventions. It represents the geographical region
+// the resource is running.
+func CloudRegion(val string) attribute.KeyValue {
+ return CloudRegionKey.String(val)
+}
+
+// CloudResourceID returns an attribute KeyValue conforming to the
+// "cloud.resource_id" semantic conventions. It represents the cloud
+// provider-specific native identifier of the monitored cloud resource (e.g. an
+// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+// on AWS, a [fully qualified resource
+// ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on
+// Azure, a [full resource
+// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+// on GCP)
+func CloudResourceID(val string) attribute.KeyValue {
+ return CloudResourceIDKey.String(val)
+}
+
+// Attributes for CloudEvents.
+const (
+ // CloudeventsEventIDKey is the attribute Key conforming to the
+ // "cloudevents.event_id" semantic conventions. It represents the
+ // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
+ // uniquely identifies the event.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001'
+ CloudeventsEventIDKey = attribute.Key("cloudevents.event_id")
+
+ // CloudeventsEventSourceKey is the attribute Key conforming to the
+ // "cloudevents.event_source" semantic conventions. It represents the
+ // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
+ // identifies the context in which an event happened.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'https://github.com/cloudevents',
+ // '/cloudevents/spec/pull/123', 'my-service'
+ CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source")
+
+ // CloudeventsEventSpecVersionKey is the attribute Key conforming to the
+ // "cloudevents.event_spec_version" semantic conventions. It represents the
+ // [version of the CloudEvents
+ // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
+ // which the event uses.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.0'
+ CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version")
+
+ // CloudeventsEventSubjectKey is the attribute Key conforming to the
+ // "cloudevents.event_subject" semantic conventions. It represents the
+ // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
+ // of the event in the context of the event producer (identified by
+ // source).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mynewfile.jpg'
+ CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject")
+
+ // CloudeventsEventTypeKey is the attribute Key conforming to the
+ // "cloudevents.event_type" semantic conventions. It represents the
+ // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
+ // contains a value describing the type of event related to the originating
+ // occurrence.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com.github.pull_request.opened',
+ // 'com.example.object.deleted.v2'
+ CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type")
+)
+
+// CloudeventsEventID returns an attribute KeyValue conforming to the
+// "cloudevents.event_id" semantic conventions. It represents the
+// [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
+// uniquely identifies the event.
+func CloudeventsEventID(val string) attribute.KeyValue {
+ return CloudeventsEventIDKey.String(val)
+}
+
+// CloudeventsEventSource returns an attribute KeyValue conforming to the
+// "cloudevents.event_source" semantic conventions. It represents the
+// [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
+// identifies the context in which an event happened.
+func CloudeventsEventSource(val string) attribute.KeyValue {
+ return CloudeventsEventSourceKey.String(val)
+}
+
+// CloudeventsEventSpecVersion returns an attribute KeyValue conforming to
+// the "cloudevents.event_spec_version" semantic conventions. It represents the
+// [version of the CloudEvents
+// specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
+// which the event uses.
+func CloudeventsEventSpecVersion(val string) attribute.KeyValue {
+ return CloudeventsEventSpecVersionKey.String(val)
+}
+
+// CloudeventsEventSubject returns an attribute KeyValue conforming to the
+// "cloudevents.event_subject" semantic conventions. It represents the
+// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
+// of the event in the context of the event producer (identified by source).
+func CloudeventsEventSubject(val string) attribute.KeyValue {
+ return CloudeventsEventSubjectKey.String(val)
+}
+
+// CloudeventsEventType returns an attribute KeyValue conforming to the
+// "cloudevents.event_type" semantic conventions. It represents the
+// [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
+// contains a value describing the type of event related to the originating
+// occurrence.
+func CloudeventsEventType(val string) attribute.KeyValue {
+ return CloudeventsEventTypeKey.String(val)
+}
+
+// These attributes allow to report this unit of code and therefore to provide
+// more context about the span.
+const (
+ // CodeColumnKey is the attribute Key conforming to the "code.column"
+ // semantic conventions. It represents the column number in `code.filepath`
+ // best representing the operation. It SHOULD point within the code unit
+ // named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 16
+ CodeColumnKey = attribute.Key("code.column")
+
+ // CodeFilepathKey is the attribute Key conforming to the "code.filepath"
+ // semantic conventions. It represents the source code file name that
+ // identifies the code unit as uniquely as possible (preferably an absolute
+ // file path).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/usr/local/MyApplication/content_root/app/index.php'
+ CodeFilepathKey = attribute.Key("code.filepath")
+
+ // CodeFunctionKey is the attribute Key conforming to the "code.function"
+ // semantic conventions. It represents the method or function name, or
+ // equivalent (usually rightmost part of the code unit's name).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'serveRequest'
+ CodeFunctionKey = attribute.Key("code.function")
+
+ // CodeLineNumberKey is the attribute Key conforming to the "code.lineno"
+ // semantic conventions. It represents the line number in `code.filepath`
+ // best representing the operation. It SHOULD point within the code unit
+ // named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ CodeLineNumberKey = attribute.Key("code.lineno")
+
+ // CodeNamespaceKey is the attribute Key conforming to the "code.namespace"
+ // semantic conventions. It represents the "namespace" within which
+ // `code.function` is defined. Usually the qualified class or module name,
+ // such that `code.namespace` + some separator + `code.function` form a
+ // unique identifier for the code unit.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com.example.MyHTTPService'
+ CodeNamespaceKey = attribute.Key("code.namespace")
+
+ // CodeStacktraceKey is the attribute Key conforming to the
+ // "code.stacktrace" semantic conventions. It represents a stacktrace as a
+ // string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'at
+ // com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ CodeStacktraceKey = attribute.Key("code.stacktrace")
+)
+
+// CodeColumn returns an attribute KeyValue conforming to the "code.column"
+// semantic conventions. It represents the column number in `code.filepath`
+// best representing the operation. It SHOULD point within the code unit named
+// in `code.function`.
+func CodeColumn(val int) attribute.KeyValue {
+ return CodeColumnKey.Int(val)
+}
+
+// CodeFilepath returns an attribute KeyValue conforming to the
+// "code.filepath" semantic conventions. It represents the source code file
+// name that identifies the code unit as uniquely as possible (preferably an
+// absolute file path).
+func CodeFilepath(val string) attribute.KeyValue {
+ return CodeFilepathKey.String(val)
+}
+
+// CodeFunction returns an attribute KeyValue conforming to the
+// "code.function" semantic conventions. It represents the method or function
+// name, or equivalent (usually rightmost part of the code unit's name).
+func CodeFunction(val string) attribute.KeyValue {
+ return CodeFunctionKey.String(val)
+}
+
+// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno"
+// semantic conventions. It represents the line number in `code.filepath` best
+// representing the operation. It SHOULD point within the code unit named in
+// `code.function`.
+func CodeLineNumber(val int) attribute.KeyValue {
+ return CodeLineNumberKey.Int(val)
+}
+
+// CodeNamespace returns an attribute KeyValue conforming to the
+// "code.namespace" semantic conventions. It represents the "namespace" within
+// which `code.function` is defined. Usually the qualified class or module
+// name, such that `code.namespace` + some separator + `code.function` form a
+// unique identifier for the code unit.
+func CodeNamespace(val string) attribute.KeyValue {
+ return CodeNamespaceKey.String(val)
+}
+
+// CodeStacktrace returns an attribute KeyValue conforming to the
+// "code.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func CodeStacktrace(val string) attribute.KeyValue {
+ return CodeStacktraceKey.String(val)
+}
+
+// A container instance.
+const (
+ // ContainerCommandKey is the attribute Key conforming to the
+ // "container.command" semantic conventions. It represents the command used
+ // to run the container (i.e. the command name).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol'
+ // Note: If using embedded credentials or sensitive data, it is recommended
+ // to remove them to prevent potential leakage.
+ ContainerCommandKey = attribute.Key("container.command")
+
+ // ContainerCommandArgsKey is the attribute Key conforming to the
+ // "container.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) run by the
+ // container. [2]
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol, --config, config.yaml'
+ ContainerCommandArgsKey = attribute.Key("container.command_args")
+
+ // ContainerCommandLineKey is the attribute Key conforming to the
+ // "container.command_line" semantic conventions. It represents the full
+ // command run by the container as a single string representing the full
+ // command. [2]
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol --config config.yaml'
+ ContainerCommandLineKey = attribute.Key("container.command_line")
+
+ // ContainerCPUStateKey is the attribute Key conforming to the
+ // "container.cpu.state" semantic conventions. It represents the CPU state
+ // for this data point.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'user', 'kernel'
+ ContainerCPUStateKey = attribute.Key("container.cpu.state")
+
+ // ContainerIDKey is the attribute Key conforming to the "container.id"
+ // semantic conventions. It represents the container ID. Usually a UUID, as
+ // for example used to [identify Docker
+ // containers](https://docs.docker.com/engine/reference/run/#container-identification).
+ // The UUID might be abbreviated.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'a3bf90e006b2'
+ ContainerIDKey = attribute.Key("container.id")
+
+ // ContainerImageIDKey is the attribute Key conforming to the
+ // "container.image.id" semantic conventions. It represents the runtime
+ // specific image identifier. Usually a hash algorithm followed by a UUID.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f'
+ // Note: Docker defines a sha256 of the image id; `container.image.id`
+ // corresponds to the `Image` field from the Docker container inspect
+ // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect)
+ // endpoint.
+ // K8S defines a link to the container registry repository with digest
+ // `"imageID": "registry.azurecr.io
+ // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
+ // The ID is assigned by the container runtime and can vary in different
+ // environments. Consider using `oci.manifest.digest` if it is important to
+ // identify the same image in different environments/runtimes.
+ ContainerImageIDKey = attribute.Key("container.image.id")
+
+ // ContainerImageNameKey is the attribute Key conforming to the
+ // "container.image.name" semantic conventions. It represents the name of
+ // the image the container was built on.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gcr.io/opentelemetry/operator'
+ ContainerImageNameKey = attribute.Key("container.image.name")
+
+ // ContainerImageRepoDigestsKey is the attribute Key conforming to the
+ // "container.image.repo_digests" semantic conventions. It represents the
+ // repo digests of the container image as provided by the container
+ // runtime.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb',
+ // 'internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578'
+ // Note:
+ // [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect)
+ // and
+ // [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238)
+ // report those under the `RepoDigests` field.
+ ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests")
+
+ // ContainerImageTagsKey is the attribute Key conforming to the
+ // "container.image.tags" semantic conventions. It represents the container
+ // image tags. An example can be found in [Docker Image
+ // Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
+ // Should be only the `` section of the full name for example from
+ // `registry.example.com/my-org/my-image:`.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'v1.27.1', '3.5.7-0'
+ ContainerImageTagsKey = attribute.Key("container.image.tags")
+
+ // ContainerNameKey is the attribute Key conforming to the "container.name"
+ // semantic conventions. It represents the container name used by container
+ // runtime.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-autoconf'
+ ContainerNameKey = attribute.Key("container.name")
+
+ // ContainerRuntimeKey is the attribute Key conforming to the
+ // "container.runtime" semantic conventions. It represents the container
+ // runtime managing this container.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'docker', 'containerd', 'rkt'
+ ContainerRuntimeKey = attribute.Key("container.runtime")
+)
+
+var (
+ // When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows)
+ ContainerCPUStateUser = ContainerCPUStateKey.String("user")
+ // When CPU is used by the system (host OS)
+ ContainerCPUStateSystem = ContainerCPUStateKey.String("system")
+ // When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows)
+ ContainerCPUStateKernel = ContainerCPUStateKey.String("kernel")
+)
+
+// ContainerCommand returns an attribute KeyValue conforming to the
+// "container.command" semantic conventions. It represents the command used to
+// run the container (i.e. the command name).
+func ContainerCommand(val string) attribute.KeyValue {
+ return ContainerCommandKey.String(val)
+}
+
+// ContainerCommandArgs returns an attribute KeyValue conforming to the
+// "container.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) run by the
+// container. [2]
+func ContainerCommandArgs(val ...string) attribute.KeyValue {
+ return ContainerCommandArgsKey.StringSlice(val)
+}
+
+// ContainerCommandLine returns an attribute KeyValue conforming to the
+// "container.command_line" semantic conventions. It represents the full
+// command run by the container as a single string representing the full
+// command. [2]
+func ContainerCommandLine(val string) attribute.KeyValue {
+ return ContainerCommandLineKey.String(val)
+}
+
+// ContainerID returns an attribute KeyValue conforming to the
+// "container.id" semantic conventions. It represents the container ID. Usually
+// a UUID, as for example used to [identify Docker
+// containers](https://docs.docker.com/engine/reference/run/#container-identification).
+// The UUID might be abbreviated.
+func ContainerID(val string) attribute.KeyValue {
+ return ContainerIDKey.String(val)
+}
+
+// ContainerImageID returns an attribute KeyValue conforming to the
+// "container.image.id" semantic conventions. It represents the runtime
+// specific image identifier. Usually a hash algorithm followed by a UUID.
+func ContainerImageID(val string) attribute.KeyValue {
+ return ContainerImageIDKey.String(val)
+}
+
+// ContainerImageName returns an attribute KeyValue conforming to the
+// "container.image.name" semantic conventions. It represents the name of the
+// image the container was built on.
+func ContainerImageName(val string) attribute.KeyValue {
+ return ContainerImageNameKey.String(val)
+}
+
+// ContainerImageRepoDigests returns an attribute KeyValue conforming to the
+// "container.image.repo_digests" semantic conventions. It represents the repo
+// digests of the container image as provided by the container runtime.
+func ContainerImageRepoDigests(val ...string) attribute.KeyValue {
+ return ContainerImageRepoDigestsKey.StringSlice(val)
+}
+
+// ContainerImageTags returns an attribute KeyValue conforming to the
+// "container.image.tags" semantic conventions. It represents the container
+// image tags. An example can be found in [Docker Image
+// Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
+// Should be only the `` section of the full name for example from
+// `registry.example.com/my-org/my-image:`.
+func ContainerImageTags(val ...string) attribute.KeyValue {
+ return ContainerImageTagsKey.StringSlice(val)
+}
+
+// ContainerName returns an attribute KeyValue conforming to the
+// "container.name" semantic conventions. It represents the container name used
+// by container runtime.
+func ContainerName(val string) attribute.KeyValue {
+ return ContainerNameKey.String(val)
+}
+
+// ContainerRuntime returns an attribute KeyValue conforming to the
+// "container.runtime" semantic conventions. It represents the container
+// runtime managing this container.
+func ContainerRuntime(val string) attribute.KeyValue {
+ return ContainerRuntimeKey.String(val)
+}
+
+// This group defines the attributes used to describe telemetry in the context
+// of databases.
+const (
+ // DBClientConnectionsPoolNameKey is the attribute Key conforming to the
+ // "db.client.connections.pool.name" semantic conventions. It represents
+ // the name of the connection pool; unique within the instrumented
+ // application. In case the connection pool implementation doesn't provide
+ // a name, instrumentation should use a combination of `server.address` and
+ // `server.port` attributes formatted as `server.address:server.port`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myDataSource'
+ DBClientConnectionsPoolNameKey = attribute.Key("db.client.connections.pool.name")
+
+ // DBClientConnectionsStateKey is the attribute Key conforming to the
+ // "db.client.connections.state" semantic conventions. It represents the
+ // state of a connection in the pool
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'idle'
+ DBClientConnectionsStateKey = attribute.Key("db.client.connections.state")
+
+ // DBCollectionNameKey is the attribute Key conforming to the
+ // "db.collection.name" semantic conventions. It represents the name of a
+ // collection (table, container) within the database.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'public.users', 'customers'
+ // Note: If the collection name is parsed from the query, it SHOULD match
+ // the value provided in the query and may be qualified with the schema and
+ // database name.
+ // It is RECOMMENDED to capture the value as provided by the application
+ // without attempting to do any case normalization.
+ DBCollectionNameKey = attribute.Key("db.collection.name")
+
+ // DBNamespaceKey is the attribute Key conforming to the "db.namespace"
+ // semantic conventions. It represents the name of the database, fully
+ // qualified within the server address and port.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'customers', 'test.users'
+ // Note: If a database system has multiple namespace components, they
+ // SHOULD be concatenated (potentially using database system specific
+ // conventions) from most general to most specific namespace component, and
+ // more specific namespaces SHOULD NOT be captured without the more general
+ // namespaces, to ensure that "startswith" queries for the more general
+ // namespaces will be valid.
+ // Semantic conventions for individual database systems SHOULD document
+ // what `db.namespace` means in the context of that system.
+ // It is RECOMMENDED to capture the value as provided by the application
+ // without attempting to do any case normalization.
+ DBNamespaceKey = attribute.Key("db.namespace")
+
+ // DBOperationNameKey is the attribute Key conforming to the
+ // "db.operation.name" semantic conventions. It represents the name of the
+ // operation or command being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'findAndModify', 'HMSET', 'SELECT'
+ // Note: It is RECOMMENDED to capture the value as provided by the
+ // application without attempting to do any case normalization.
+ DBOperationNameKey = attribute.Key("db.operation.name")
+
+ // DBQueryTextKey is the attribute Key conforming to the "db.query.text"
+ // semantic conventions. It represents the database query being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'SELECT * FROM wuser_table where username = ?', 'SET mykey
+ // "WuValue"'
+ DBQueryTextKey = attribute.Key("db.query.text")
+
+ // DBSystemKey is the attribute Key conforming to the "db.system" semantic
+ // conventions. It represents the database management system (DBMS) product
+ // as identified by the client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The actual DBMS may differ from the one identified by the client.
+ // For example, when using PostgreSQL client libraries to connect to a
+ // CockroachDB, the `db.system` is set to `postgresql` based on the
+ // instrumentation's best knowledge.
+ DBSystemKey = attribute.Key("db.system")
+)
+
+var (
+ // idle
+ DBClientConnectionsStateIdle = DBClientConnectionsStateKey.String("idle")
+ // used
+ DBClientConnectionsStateUsed = DBClientConnectionsStateKey.String("used")
+)
+
+var (
+ // Some other SQL database. Fallback only. See notes
+ DBSystemOtherSQL = DBSystemKey.String("other_sql")
+ // Microsoft SQL Server
+ DBSystemMSSQL = DBSystemKey.String("mssql")
+ // Microsoft SQL Server Compact
+ DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact")
+ // MySQL
+ DBSystemMySQL = DBSystemKey.String("mysql")
+ // Oracle Database
+ DBSystemOracle = DBSystemKey.String("oracle")
+ // IBM DB2
+ DBSystemDB2 = DBSystemKey.String("db2")
+ // PostgreSQL
+ DBSystemPostgreSQL = DBSystemKey.String("postgresql")
+ // Amazon Redshift
+ DBSystemRedshift = DBSystemKey.String("redshift")
+ // Apache Hive
+ DBSystemHive = DBSystemKey.String("hive")
+ // Cloudscape
+ DBSystemCloudscape = DBSystemKey.String("cloudscape")
+ // HyperSQL DataBase
+ DBSystemHSQLDB = DBSystemKey.String("hsqldb")
+ // Progress Database
+ DBSystemProgress = DBSystemKey.String("progress")
+ // SAP MaxDB
+ DBSystemMaxDB = DBSystemKey.String("maxdb")
+ // SAP HANA
+ DBSystemHanaDB = DBSystemKey.String("hanadb")
+ // Ingres
+ DBSystemIngres = DBSystemKey.String("ingres")
+ // FirstSQL
+ DBSystemFirstSQL = DBSystemKey.String("firstsql")
+ // EnterpriseDB
+ DBSystemEDB = DBSystemKey.String("edb")
+ // InterSystems Caché
+ DBSystemCache = DBSystemKey.String("cache")
+ // Adabas (Adaptable Database System)
+ DBSystemAdabas = DBSystemKey.String("adabas")
+ // Firebird
+ DBSystemFirebird = DBSystemKey.String("firebird")
+ // Apache Derby
+ DBSystemDerby = DBSystemKey.String("derby")
+ // FileMaker
+ DBSystemFilemaker = DBSystemKey.String("filemaker")
+ // Informix
+ DBSystemInformix = DBSystemKey.String("informix")
+ // InstantDB
+ DBSystemInstantDB = DBSystemKey.String("instantdb")
+ // InterBase
+ DBSystemInterbase = DBSystemKey.String("interbase")
+ // MariaDB
+ DBSystemMariaDB = DBSystemKey.String("mariadb")
+ // Netezza
+ DBSystemNetezza = DBSystemKey.String("netezza")
+ // Pervasive PSQL
+ DBSystemPervasive = DBSystemKey.String("pervasive")
+ // PointBase
+ DBSystemPointbase = DBSystemKey.String("pointbase")
+ // SQLite
+ DBSystemSqlite = DBSystemKey.String("sqlite")
+ // Sybase
+ DBSystemSybase = DBSystemKey.String("sybase")
+ // Teradata
+ DBSystemTeradata = DBSystemKey.String("teradata")
+ // Vertica
+ DBSystemVertica = DBSystemKey.String("vertica")
+ // H2
+ DBSystemH2 = DBSystemKey.String("h2")
+ // ColdFusion IMQ
+ DBSystemColdfusion = DBSystemKey.String("coldfusion")
+ // Apache Cassandra
+ DBSystemCassandra = DBSystemKey.String("cassandra")
+ // Apache HBase
+ DBSystemHBase = DBSystemKey.String("hbase")
+ // MongoDB
+ DBSystemMongoDB = DBSystemKey.String("mongodb")
+ // Redis
+ DBSystemRedis = DBSystemKey.String("redis")
+ // Couchbase
+ DBSystemCouchbase = DBSystemKey.String("couchbase")
+ // CouchDB
+ DBSystemCouchDB = DBSystemKey.String("couchdb")
+ // Microsoft Azure Cosmos DB
+ DBSystemCosmosDB = DBSystemKey.String("cosmosdb")
+ // Amazon DynamoDB
+ DBSystemDynamoDB = DBSystemKey.String("dynamodb")
+ // Neo4j
+ DBSystemNeo4j = DBSystemKey.String("neo4j")
+ // Apache Geode
+ DBSystemGeode = DBSystemKey.String("geode")
+ // Elasticsearch
+ DBSystemElasticsearch = DBSystemKey.String("elasticsearch")
+ // Memcached
+ DBSystemMemcached = DBSystemKey.String("memcached")
+ // CockroachDB
+ DBSystemCockroachdb = DBSystemKey.String("cockroachdb")
+ // OpenSearch
+ DBSystemOpensearch = DBSystemKey.String("opensearch")
+ // ClickHouse
+ DBSystemClickhouse = DBSystemKey.String("clickhouse")
+ // Cloud Spanner
+ DBSystemSpanner = DBSystemKey.String("spanner")
+ // Trino
+ DBSystemTrino = DBSystemKey.String("trino")
+)
+
+// DBClientConnectionsPoolName returns an attribute KeyValue conforming to
+// the "db.client.connections.pool.name" semantic conventions. It represents
+// the name of the connection pool; unique within the instrumented application.
+// In case the connection pool implementation doesn't provide a name,
+// instrumentation should use a combination of `server.address` and
+// `server.port` attributes formatted as `server.address:server.port`.
+func DBClientConnectionsPoolName(val string) attribute.KeyValue {
+ return DBClientConnectionsPoolNameKey.String(val)
+}
+
+// DBCollectionName returns an attribute KeyValue conforming to the
+// "db.collection.name" semantic conventions. It represents the name of a
+// collection (table, container) within the database.
+func DBCollectionName(val string) attribute.KeyValue {
+ return DBCollectionNameKey.String(val)
+}
+
+// DBNamespace returns an attribute KeyValue conforming to the
+// "db.namespace" semantic conventions. It represents the name of the database,
+// fully qualified within the server address and port.
+func DBNamespace(val string) attribute.KeyValue {
+ return DBNamespaceKey.String(val)
+}
+
+// DBOperationName returns an attribute KeyValue conforming to the
+// "db.operation.name" semantic conventions. It represents the name of the
+// operation or command being executed.
+func DBOperationName(val string) attribute.KeyValue {
+ return DBOperationNameKey.String(val)
+}
+
+// DBQueryText returns an attribute KeyValue conforming to the
+// "db.query.text" semantic conventions. It represents the database query being
+// executed.
+func DBQueryText(val string) attribute.KeyValue {
+ return DBQueryTextKey.String(val)
+}
+
+// This group defines attributes for Cassandra.
+const (
+ // DBCassandraConsistencyLevelKey is the attribute Key conforming to the
+ // "db.cassandra.consistency_level" semantic conventions. It represents the
+ // consistency level of the query. Based on consistency values from
+ // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level")
+
+ // DBCassandraCoordinatorDCKey is the attribute Key conforming to the
+ // "db.cassandra.coordinator.dc" semantic conventions. It represents the
+ // data center of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-west-2'
+ DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc")
+
+ // DBCassandraCoordinatorIDKey is the attribute Key conforming to the
+ // "db.cassandra.coordinator.id" semantic conventions. It represents the ID
+ // of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
+ DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id")
+
+ // DBCassandraIdempotenceKey is the attribute Key conforming to the
+ // "db.cassandra.idempotence" semantic conventions. It represents the
+ // whether or not the query is idempotent.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence")
+
+ // DBCassandraPageSizeKey is the attribute Key conforming to the
+ // "db.cassandra.page_size" semantic conventions. It represents the fetch
+ // size used for paging, i.e. how many rows will be returned at once.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 5000
+ DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size")
+
+ // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming
+ // to the "db.cassandra.speculative_execution_count" semantic conventions.
+ // It represents the number of times a query was speculatively executed.
+ // Not set or `0` if the query was not executed speculatively.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 2
+ DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count")
+)
+
+var (
+ // all
+ DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all")
+ // each_quorum
+ DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum")
+ // quorum
+ DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum")
+ // local_quorum
+ DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum")
+ // one
+ DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one")
+ // two
+ DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two")
+ // three
+ DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three")
+ // local_one
+ DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one")
+ // any
+ DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any")
+ // serial
+ DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial")
+ // local_serial
+ DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial")
+)
+
+// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the
+// "db.cassandra.coordinator.dc" semantic conventions. It represents the data
+// center of the coordinating node for a query.
+func DBCassandraCoordinatorDC(val string) attribute.KeyValue {
+ return DBCassandraCoordinatorDCKey.String(val)
+}
+
+// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the
+// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of
+// the coordinating node for a query.
+func DBCassandraCoordinatorID(val string) attribute.KeyValue {
+ return DBCassandraCoordinatorIDKey.String(val)
+}
+
+// DBCassandraIdempotence returns an attribute KeyValue conforming to the
+// "db.cassandra.idempotence" semantic conventions. It represents the whether
+// or not the query is idempotent.
+func DBCassandraIdempotence(val bool) attribute.KeyValue {
+ return DBCassandraIdempotenceKey.Bool(val)
+}
+
+// DBCassandraPageSize returns an attribute KeyValue conforming to the
+// "db.cassandra.page_size" semantic conventions. It represents the fetch size
+// used for paging, i.e. how many rows will be returned at once.
+func DBCassandraPageSize(val int) attribute.KeyValue {
+ return DBCassandraPageSizeKey.Int(val)
+}
+
+// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue
+// conforming to the "db.cassandra.speculative_execution_count" semantic
+// conventions. It represents the number of times a query was speculatively
+// executed. Not set or `0` if the query was not executed speculatively.
+func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue {
+ return DBCassandraSpeculativeExecutionCountKey.Int(val)
+}
+
+// This group defines attributes for Azure Cosmos DB.
+const (
+ // DBCosmosDBClientIDKey is the attribute Key conforming to the
+ // "db.cosmosdb.client_id" semantic conventions. It represents the unique
+ // Cosmos client instance id.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d'
+ DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id")
+
+ // DBCosmosDBConnectionModeKey is the attribute Key conforming to the
+ // "db.cosmosdb.connection_mode" semantic conventions. It represents the
+ // cosmos client connection mode.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode")
+
+ // DBCosmosDBOperationTypeKey is the attribute Key conforming to the
+ // "db.cosmosdb.operation_type" semantic conventions. It represents the
+ // cosmosDB Operation Type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type")
+
+ // DBCosmosDBRequestChargeKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+ // consumed for that operation
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 46.18, 1.0
+ DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge")
+
+ // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_content_length" semantic conventions. It represents
+ // the request payload size in bytes
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length")
+
+ // DBCosmosDBStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos
+ // DB status code.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 200, 201
+ DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code")
+
+ // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.sub_status_code" semantic conventions. It represents the
+ // cosmos DB sub status code.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1000, 1002
+ DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code")
+)
+
+var (
+ // Gateway (HTTP) connections mode
+ DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway")
+ // Direct connection
+ DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct")
+)
+
+var (
+ // invalid
+ DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid")
+ // create
+ DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create")
+ // patch
+ DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch")
+ // read
+ DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read")
+ // read_feed
+ DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed")
+ // delete
+ DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete")
+ // replace
+ DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace")
+ // execute
+ DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute")
+ // query
+ DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query")
+ // head
+ DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head")
+ // head_feed
+ DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed")
+ // upsert
+ DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert")
+ // batch
+ DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch")
+ // query_plan
+ DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan")
+ // execute_javascript
+ DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript")
+)
+
+// DBCosmosDBClientID returns an attribute KeyValue conforming to the
+// "db.cosmosdb.client_id" semantic conventions. It represents the unique
+// Cosmos client instance id.
+func DBCosmosDBClientID(val string) attribute.KeyValue {
+ return DBCosmosDBClientIDKey.String(val)
+}
+
+// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the
+// "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+// consumed for that operation
+func DBCosmosDBRequestCharge(val float64) attribute.KeyValue {
+ return DBCosmosDBRequestChargeKey.Float64(val)
+}
+
+// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming
+// to the "db.cosmosdb.request_content_length" semantic conventions. It
+// represents the request payload size in bytes
+func DBCosmosDBRequestContentLength(val int) attribute.KeyValue {
+ return DBCosmosDBRequestContentLengthKey.Int(val)
+}
+
+// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB
+// status code.
+func DBCosmosDBStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBStatusCodeKey.Int(val)
+}
+
+// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos
+// DB sub status code.
+func DBCosmosDBSubStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBSubStatusCodeKey.Int(val)
+}
+
+// This group defines attributes for Elasticsearch.
+const (
+ // DBElasticsearchClusterNameKey is the attribute Key conforming to the
+ // "db.elasticsearch.cluster.name" semantic conventions. It represents the
+ // represents the identifier of an Elasticsearch cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'e9106fc68e3044f0b1475b04bf4ffd5f'
+ DBElasticsearchClusterNameKey = attribute.Key("db.elasticsearch.cluster.name")
+
+ // DBElasticsearchNodeNameKey is the attribute Key conforming to the
+ // "db.elasticsearch.node.name" semantic conventions. It represents the
+ // represents the human-readable identifier of the node/instance to which a
+ // request was routed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'instance-0000000001'
+ DBElasticsearchNodeNameKey = attribute.Key("db.elasticsearch.node.name")
+)
+
+// DBElasticsearchClusterName returns an attribute KeyValue conforming to
+// the "db.elasticsearch.cluster.name" semantic conventions. It represents the
+// represents the identifier of an Elasticsearch cluster.
+func DBElasticsearchClusterName(val string) attribute.KeyValue {
+ return DBElasticsearchClusterNameKey.String(val)
+}
+
+// DBElasticsearchNodeName returns an attribute KeyValue conforming to the
+// "db.elasticsearch.node.name" semantic conventions. It represents the
+// represents the human-readable identifier of the node/instance to which a
+// request was routed.
+func DBElasticsearchNodeName(val string) attribute.KeyValue {
+ return DBElasticsearchNodeNameKey.String(val)
+}
+
+// Attributes for software deployments.
+const (
+ // DeploymentEnvironmentKey is the attribute Key conforming to the
+ // "deployment.environment" semantic conventions. It represents the name of
+ // the [deployment
+ // environment](https://wikipedia.org/wiki/Deployment_environment) (aka
+ // deployment tier).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'staging', 'production'
+ // Note: `deployment.environment` does not affect the uniqueness
+ // constraints defined through
+ // the `service.namespace`, `service.name` and `service.instance.id`
+ // resource attributes.
+ // This implies that resources carrying the following attribute
+ // combinations MUST be
+ // considered to be identifying the same service:
+ //
+ // * `service.name=frontend`, `deployment.environment=production`
+ // * `service.name=frontend`, `deployment.environment=staging`.
+ DeploymentEnvironmentKey = attribute.Key("deployment.environment")
+)
+
+// DeploymentEnvironment returns an attribute KeyValue conforming to the
+// "deployment.environment" semantic conventions. It represents the name of the
+// [deployment environment](https://wikipedia.org/wiki/Deployment_environment)
+// (aka deployment tier).
+func DeploymentEnvironment(val string) attribute.KeyValue {
+ return DeploymentEnvironmentKey.String(val)
+}
+
+// Attributes that represents an occurrence of a lifecycle transition on the
+// Android platform.
+const (
+ // AndroidStateKey is the attribute Key conforming to the "android.state"
+ // semantic conventions. It represents the deprecated use the
+ // `device.app.lifecycle` event definition including `android.state` as a
+ // payload field instead.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The Android lifecycle states are defined in [Activity lifecycle
+ // callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc),
+ // and from which the `OS identifiers` are derived.
+ AndroidStateKey = attribute.Key("android.state")
+)
+
+var (
+ // Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time
+ AndroidStateCreated = AndroidStateKey.String("created")
+ // Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state
+ AndroidStateBackground = AndroidStateKey.String("background")
+ // Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states
+ AndroidStateForeground = AndroidStateKey.String("foreground")
+)
+
+// These attributes may be used to describe the receiver of a network
+// exchange/packet. These should be used when there is no client/server
+// relationship between the two sides, or when that relationship is unknown.
+// This covers low-level network interactions (e.g. packet tracing) where you
+// don't know if there was a connection or which side initiated it. This also
+// covers unidirectional UDP flows and peer-to-peer communication where the
+// "user-facing" surface of the protocol / API doesn't expose a clear notion of
+// client and server.
+const (
+ // DestinationAddressKey is the attribute Key conforming to the
+ // "destination.address" semantic conventions. It represents the
+ // destination address - domain name if available without reverse DNS
+ // lookup; otherwise, IP address or Unix domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'destination.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the source side, and when communicating through
+ // an intermediary, `destination.address` SHOULD represent the destination
+ // address behind any intermediaries, for example proxies, if it's
+ // available.
+ DestinationAddressKey = attribute.Key("destination.address")
+
+ // DestinationPortKey is the attribute Key conforming to the
+ // "destination.port" semantic conventions. It represents the destination
+ // port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3389, 2888
+ DestinationPortKey = attribute.Key("destination.port")
+)
+
+// DestinationAddress returns an attribute KeyValue conforming to the
+// "destination.address" semantic conventions. It represents the destination
+// address - domain name if available without reverse DNS lookup; otherwise, IP
+// address or Unix domain socket name.
+func DestinationAddress(val string) attribute.KeyValue {
+ return DestinationAddressKey.String(val)
+}
+
+// DestinationPort returns an attribute KeyValue conforming to the
+// "destination.port" semantic conventions. It represents the destination port
+// number
+func DestinationPort(val int) attribute.KeyValue {
+ return DestinationPortKey.Int(val)
+}
+
+// Describes device attributes.
+const (
+ // DeviceIDKey is the attribute Key conforming to the "device.id" semantic
+ // conventions. It represents a unique identifier representing the device
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092'
+ // Note: The device identifier MUST only be defined using the values
+ // outlined below. This value is not an advertising identifier and MUST NOT
+ // be used as such. On iOS (Swift or Objective-C), this value MUST be equal
+ // to the [vendor
+ // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor).
+ // On Android (Java or Kotlin), this value MUST be equal to the Firebase
+ // Installation ID or a globally unique UUID which is persisted across
+ // sessions in your application. More information can be found
+ // [here](https://developer.android.com/training/articles/user-data-ids) on
+ // best practices and exact implementation details. Caution should be taken
+ // when storing personal data or anything which can identify a user. GDPR
+ // and data protection laws may apply, ensure you do your own due
+ // diligence.
+ DeviceIDKey = attribute.Key("device.id")
+
+ // DeviceManufacturerKey is the attribute Key conforming to the
+ // "device.manufacturer" semantic conventions. It represents the name of
+ // the device manufacturer
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Apple', 'Samsung'
+ // Note: The Android OS provides this field via
+ // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER).
+ // iOS apps SHOULD hardcode the value `Apple`.
+ DeviceManufacturerKey = attribute.Key("device.manufacturer")
+
+ // DeviceModelIdentifierKey is the attribute Key conforming to the
+ // "device.model.identifier" semantic conventions. It represents the model
+ // identifier for the device
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iPhone3,4', 'SM-G920F'
+ // Note: It's recommended this value represents a machine-readable version
+ // of the model identifier rather than the market or consumer-friendly name
+ // of the device.
+ DeviceModelIdentifierKey = attribute.Key("device.model.identifier")
+
+ // DeviceModelNameKey is the attribute Key conforming to the
+ // "device.model.name" semantic conventions. It represents the marketing
+ // name for the device model
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6'
+ // Note: It's recommended this value represents a human-readable version of
+ // the device model rather than a machine-readable alternative.
+ DeviceModelNameKey = attribute.Key("device.model.name")
+)
+
+// DeviceID returns an attribute KeyValue conforming to the "device.id"
+// semantic conventions. It represents a unique identifier representing the
+// device
+func DeviceID(val string) attribute.KeyValue {
+ return DeviceIDKey.String(val)
+}
+
+// DeviceManufacturer returns an attribute KeyValue conforming to the
+// "device.manufacturer" semantic conventions. It represents the name of the
+// device manufacturer
+func DeviceManufacturer(val string) attribute.KeyValue {
+ return DeviceManufacturerKey.String(val)
+}
+
+// DeviceModelIdentifier returns an attribute KeyValue conforming to the
+// "device.model.identifier" semantic conventions. It represents the model
+// identifier for the device
+func DeviceModelIdentifier(val string) attribute.KeyValue {
+ return DeviceModelIdentifierKey.String(val)
+}
+
+// DeviceModelName returns an attribute KeyValue conforming to the
+// "device.model.name" semantic conventions. It represents the marketing name
+// for the device model
+func DeviceModelName(val string) attribute.KeyValue {
+ return DeviceModelNameKey.String(val)
+}
+
+// These attributes may be used for any disk related operation.
+const (
+ // DiskIoDirectionKey is the attribute Key conforming to the
+ // "disk.io.direction" semantic conventions. It represents the disk IO
+ // operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'read'
+ DiskIoDirectionKey = attribute.Key("disk.io.direction")
+)
+
+var (
+ // read
+ DiskIoDirectionRead = DiskIoDirectionKey.String("read")
+ // write
+ DiskIoDirectionWrite = DiskIoDirectionKey.String("write")
+)
+
+// The shared attributes used to report a DNS query.
+const (
+ // DNSQuestionNameKey is the attribute Key conforming to the
+ // "dns.question.name" semantic conventions. It represents the name being
+ // queried.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'www.example.com', 'opentelemetry.io'
+ // Note: If the name field contains non-printable characters (below 32 or
+ // above 126), those characters should be represented as escaped base 10
+ // integers (\DDD). Back slashes and quotes should be escaped. Tabs,
+ // carriage returns, and line feeds should be converted to \t, \r, and \n
+ // respectively.
+ DNSQuestionNameKey = attribute.Key("dns.question.name")
+)
+
+// DNSQuestionName returns an attribute KeyValue conforming to the
+// "dns.question.name" semantic conventions. It represents the name being
+// queried.
+func DNSQuestionName(val string) attribute.KeyValue {
+ return DNSQuestionNameKey.String(val)
+}
+
+// Attributes for operations with an authenticated and/or authorized enduser.
+const (
+ // EnduserIDKey is the attribute Key conforming to the "enduser.id"
+ // semantic conventions. It represents the username or client_id extracted
+ // from the access token or
+ // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header
+ // in the inbound request from outside the system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'username'
+ EnduserIDKey = attribute.Key("enduser.id")
+
+ // EnduserRoleKey is the attribute Key conforming to the "enduser.role"
+ // semantic conventions. It represents the actual/assumed role the client
+ // is making the request under extracted from token or application security
+ // context.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'admin'
+ EnduserRoleKey = attribute.Key("enduser.role")
+
+ // EnduserScopeKey is the attribute Key conforming to the "enduser.scope"
+ // semantic conventions. It represents the scopes or granted authorities
+ // the client currently possesses extracted from token or application
+ // security context. The value would come from the scope associated with an
+ // [OAuth 2.0 Access
+ // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
+ // value in a [SAML 2.0
+ // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'read:message, write:files'
+ EnduserScopeKey = attribute.Key("enduser.scope")
+)
+
+// EnduserID returns an attribute KeyValue conforming to the "enduser.id"
+// semantic conventions. It represents the username or client_id extracted from
+// the access token or
+// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in
+// the inbound request from outside the system.
+func EnduserID(val string) attribute.KeyValue {
+ return EnduserIDKey.String(val)
+}
+
+// EnduserRole returns an attribute KeyValue conforming to the
+// "enduser.role" semantic conventions. It represents the actual/assumed role
+// the client is making the request under extracted from token or application
+// security context.
+func EnduserRole(val string) attribute.KeyValue {
+ return EnduserRoleKey.String(val)
+}
+
+// EnduserScope returns an attribute KeyValue conforming to the
+// "enduser.scope" semantic conventions. It represents the scopes or granted
+// authorities the client currently possesses extracted from token or
+// application security context. The value would come from the scope associated
+// with an [OAuth 2.0 Access
+// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
+// value in a [SAML 2.0
+// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
+func EnduserScope(val string) attribute.KeyValue {
+ return EnduserScopeKey.String(val)
+}
+
+// The shared attributes used to report an error.
+const (
+ // ErrorTypeKey is the attribute Key conforming to the "error.type"
+ // semantic conventions. It represents the describes a class of error the
+ // operation ended with.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'timeout', 'java.net.UnknownHostException',
+ // 'server_certificate_invalid', '500'
+ // Note: The `error.type` SHOULD be predictable, and SHOULD have low
+ // cardinality.
+ //
+ // When `error.type` is set to a type (e.g., an exception type), its
+ // canonical class name identifying the type within the artifact SHOULD be
+ // used.
+ //
+ // Instrumentations SHOULD document the list of errors they report.
+ //
+ // The cardinality of `error.type` within one instrumentation library
+ // SHOULD be low.
+ // Telemetry consumers that aggregate data from multiple instrumentation
+ // libraries and applications
+ // should be prepared for `error.type` to have high cardinality at query
+ // time when no
+ // additional filters are applied.
+ //
+ // If the operation has completed successfully, instrumentations SHOULD NOT
+ // set `error.type`.
+ //
+ // If a specific domain defines its own set of error identifiers (such as
+ // HTTP or gRPC status codes),
+ // it's RECOMMENDED to:
+ //
+ // * Use a domain-specific attribute
+ // * Set `error.type` to capture all errors, regardless of whether they are
+ // defined within the domain-specific set or not.
+ ErrorTypeKey = attribute.Key("error.type")
+)
+
+var (
+ // A fallback error value to be used when the instrumentation doesn't define a custom value
+ ErrorTypeOther = ErrorTypeKey.String("_OTHER")
+)
+
+// Attributes for Events represented using Log Records.
+const (
+ // EventNameKey is the attribute Key conforming to the "event.name"
+ // semantic conventions. It represents the identifies the class / type of
+ // event.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'browser.mouse.click', 'device.app.lifecycle'
+ // Note: Event names are subject to the same rules as [attribute
+ // names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.33.0/specification/common/attribute-naming.md).
+ // Notably, event names are namespaced to avoid collisions and provide a
+ // clean separation of semantics for events in separate domains like
+ // browser, mobile, and kubernetes.
+ EventNameKey = attribute.Key("event.name")
+)
+
+// EventName returns an attribute KeyValue conforming to the "event.name"
+// semantic conventions. It represents the identifies the class / type of
+// event.
+func EventName(val string) attribute.KeyValue {
+ return EventNameKey.String(val)
+}
+
+// The shared attributes used to report a single exception associated with a
+// span or log.
+const (
+ // ExceptionEscapedKey is the attribute Key conforming to the
+ // "exception.escaped" semantic conventions. It represents the sHOULD be
+ // set to true if the exception event is recorded at a point where it is
+ // known that the exception is escaping the scope of the span.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Note: An exception is considered to have escaped (or left) the scope of
+ // a span,
+ // if that span is ended while the exception is still logically "in
+ // flight".
+ // This may be actually "in flight" in some languages (e.g. if the
+ // exception
+ // is passed to a Context manager's `__exit__` method in Python) but will
+ // usually be caught at the point of recording the exception in most
+ // languages.
+ //
+ // It is usually not possible to determine at the point where an exception
+ // is thrown
+ // whether it will escape the scope of a span.
+ // However, it is trivial to know that an exception
+ // will escape, if one checks for an active exception just before ending
+ // the span,
+ // as done in the [example for recording span
+ // exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception).
+ //
+ // It follows that an exception may still escape the scope of the span
+ // even if the `exception.escaped` attribute was not set or set to false,
+ // since the event might have been recorded at a time where it was not
+ // clear whether the exception will escape.
+ ExceptionEscapedKey = attribute.Key("exception.escaped")
+
+ // ExceptionMessageKey is the attribute Key conforming to the
+ // "exception.message" semantic conventions. It represents the exception
+ // message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'Division by zero', "Can't convert 'int' object to str
+ // implicitly"
+ ExceptionMessageKey = attribute.Key("exception.message")
+
+ // ExceptionStacktraceKey is the attribute Key conforming to the
+ // "exception.stacktrace" semantic conventions. It represents a stacktrace
+ // as a string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test
+ // exception\\n at '
+ // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
+
+ // ExceptionTypeKey is the attribute Key conforming to the "exception.type"
+ // semantic conventions. It represents the type of the exception (its
+ // fully-qualified class name, if applicable). The dynamic type of the
+ // exception should be preferred over the static type in languages that
+ // support it.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'java.net.ConnectException', 'OSError'
+ ExceptionTypeKey = attribute.Key("exception.type")
+)
+
+// ExceptionEscaped returns an attribute KeyValue conforming to the
+// "exception.escaped" semantic conventions. It represents the sHOULD be set to
+// true if the exception event is recorded at a point where it is known that
+// the exception is escaping the scope of the span.
+func ExceptionEscaped(val bool) attribute.KeyValue {
+ return ExceptionEscapedKey.Bool(val)
+}
+
+// ExceptionMessage returns an attribute KeyValue conforming to the
+// "exception.message" semantic conventions. It represents the exception
+// message.
+func ExceptionMessage(val string) attribute.KeyValue {
+ return ExceptionMessageKey.String(val)
+}
+
+// ExceptionStacktrace returns an attribute KeyValue conforming to the
+// "exception.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func ExceptionStacktrace(val string) attribute.KeyValue {
+ return ExceptionStacktraceKey.String(val)
+}
+
+// ExceptionType returns an attribute KeyValue conforming to the
+// "exception.type" semantic conventions. It represents the type of the
+// exception (its fully-qualified class name, if applicable). The dynamic type
+// of the exception should be preferred over the static type in languages that
+// support it.
+func ExceptionType(val string) attribute.KeyValue {
+ return ExceptionTypeKey.String(val)
+}
+
+// FaaS attributes
+const (
+ // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart"
+ // semantic conventions. It represents a boolean that is true if the
+ // serverless function is executed for the first time (aka cold-start).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSColdstartKey = attribute.Key("faas.coldstart")
+
+ // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic
+ // conventions. It represents a string containing the schedule period as
+ // [Cron
+ // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0/5 * * * ? *'
+ FaaSCronKey = attribute.Key("faas.cron")
+
+ // FaaSDocumentCollectionKey is the attribute Key conforming to the
+ // "faas.document.collection" semantic conventions. It represents the name
+ // of the source on which the triggering operation was performed. For
+ // example, in Cloud Storage or S3 corresponds to the bucket name, and in
+ // Cosmos DB to the database name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myBucketName', 'myDBName'
+ FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
+
+ // FaaSDocumentNameKey is the attribute Key conforming to the
+ // "faas.document.name" semantic conventions. It represents the document
+ // name/table subjected to the operation. For example, in Cloud Storage or
+ // S3 is the name of the file, and in Cosmos DB the table name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myFile.txt', 'myTableName'
+ FaaSDocumentNameKey = attribute.Key("faas.document.name")
+
+ // FaaSDocumentOperationKey is the attribute Key conforming to the
+ // "faas.document.operation" semantic conventions. It represents the
+ // describes the type of the operation that was performed on the data.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
+
+ // FaaSDocumentTimeKey is the attribute Key conforming to the
+ // "faas.document.time" semantic conventions. It represents a string
+ // containing the time when the data was accessed in the [ISO
+ // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+ // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2020-01-23T13:47:06Z'
+ FaaSDocumentTimeKey = attribute.Key("faas.document.time")
+
+ // FaaSInstanceKey is the attribute Key conforming to the "faas.instance"
+ // semantic conventions. It represents the execution environment ID as a
+ // string, that will be potentially reused for other invocations to the
+ // same function/function version.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de'
+ // Note: * **AWS Lambda:** Use the (full) log stream name.
+ FaaSInstanceKey = attribute.Key("faas.instance")
+
+ // FaaSInvocationIDKey is the attribute Key conforming to the
+ // "faas.invocation_id" semantic conventions. It represents the invocation
+ // ID of the current function invocation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
+ FaaSInvocationIDKey = attribute.Key("faas.invocation_id")
+
+ // FaaSInvokedNameKey is the attribute Key conforming to the
+ // "faas.invoked_name" semantic conventions. It represents the name of the
+ // invoked function.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-function'
+ // Note: SHOULD be equal to the `faas.name` resource attribute of the
+ // invoked function.
+ FaaSInvokedNameKey = attribute.Key("faas.invoked_name")
+
+ // FaaSInvokedProviderKey is the attribute Key conforming to the
+ // "faas.invoked_provider" semantic conventions. It represents the cloud
+ // provider of the invoked function.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: SHOULD be equal to the `cloud.provider` resource attribute of the
+ // invoked function.
+ FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider")
+
+ // FaaSInvokedRegionKey is the attribute Key conforming to the
+ // "faas.invoked_region" semantic conventions. It represents the cloud
+ // region of the invoked function.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'eu-central-1'
+ // Note: SHOULD be equal to the `cloud.region` resource attribute of the
+ // invoked function.
+ FaaSInvokedRegionKey = attribute.Key("faas.invoked_region")
+
+ // FaaSMaxMemoryKey is the attribute Key conforming to the
+ // "faas.max_memory" semantic conventions. It represents the amount of
+ // memory available to the serverless function converted to Bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 134217728
+ // Note: It's recommended to set this attribute since e.g. too little
+ // memory can easily stop a Java AWS Lambda function from working
+ // correctly. On AWS Lambda, the environment variable
+ // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must
+ // be multiplied by 1,048,576).
+ FaaSMaxMemoryKey = attribute.Key("faas.max_memory")
+
+ // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic
+ // conventions. It represents the name of the single function that this
+ // runtime instance executes.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-function', 'myazurefunctionapp/some-function-name'
+ // Note: This is the name of the function as configured/deployed on the
+ // FaaS
+ // platform and is usually different from the name of the callback
+ // function (which may be stored in the
+ // [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes)
+ // span attributes).
+ //
+ // For some cloud providers, the above definition is ambiguous. The
+ // following
+ // definition of function name MUST be used for this attribute
+ // (and consequently the span name) for the listed cloud
+ // providers/products:
+ //
+ // * **Azure:** The full name `/`, i.e., function app name
+ // followed by a forward slash followed by the function name (this form
+ // can also be seen in the resource JSON for the function).
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider (see also the `cloud.resource_id` attribute).
+ FaaSNameKey = attribute.Key("faas.name")
+
+ // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic
+ // conventions. It represents a string containing the function invocation
+ // time in the [ISO
+ // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+ // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2020-01-23T13:47:06Z'
+ FaaSTimeKey = attribute.Key("faas.time")
+
+ // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger"
+ // semantic conventions. It represents the type of the trigger which caused
+ // this function invocation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSTriggerKey = attribute.Key("faas.trigger")
+
+ // FaaSVersionKey is the attribute Key conforming to the "faas.version"
+ // semantic conventions. It represents the immutable version of the
+ // function being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '26', 'pinkfroid-00002'
+ // Note: Depending on the cloud provider and platform, use:
+ //
+ // * **AWS Lambda:** The [function
+ // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
+ // (an integer represented as a decimal string).
+ // * **Google Cloud Run (Services):** The
+ // [revision](https://cloud.google.com/run/docs/managing/revisions)
+ // (i.e., the function name plus the revision suffix).
+ // * **Google Cloud Functions:** The value of the
+ // [`K_REVISION` environment
+ // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
+ // * **Azure Functions:** Not applicable. Do not set this attribute.
+ FaaSVersionKey = attribute.Key("faas.version")
+)
+
+var (
+ // When a new object is created
+ FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
+ // When an object is modified
+ FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
+ // When an object is deleted
+ FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
+)
+
+var (
+ // Alibaba Cloud
+ FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws")
+ // Microsoft Azure
+ FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure")
+ // Google Cloud Platform
+ FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp")
+ // Tencent Cloud
+ FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud")
+)
+
+var (
+ // A response to some data source operation such as a database or filesystem read/write
+ FaaSTriggerDatasource = FaaSTriggerKey.String("datasource")
+ // To provide an answer to an inbound HTTP request
+ FaaSTriggerHTTP = FaaSTriggerKey.String("http")
+ // A function is set to be executed when messages are sent to a messaging system
+ FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub")
+ // A function is scheduled to be executed regularly
+ FaaSTriggerTimer = FaaSTriggerKey.String("timer")
+ // If none of the others apply
+ FaaSTriggerOther = FaaSTriggerKey.String("other")
+)
+
+// FaaSColdstart returns an attribute KeyValue conforming to the
+// "faas.coldstart" semantic conventions. It represents a boolean that is true
+// if the serverless function is executed for the first time (aka cold-start).
+func FaaSColdstart(val bool) attribute.KeyValue {
+ return FaaSColdstartKey.Bool(val)
+}
+
+// FaaSCron returns an attribute KeyValue conforming to the "faas.cron"
+// semantic conventions. It represents a string containing the schedule period
+// as [Cron
+// Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
+func FaaSCron(val string) attribute.KeyValue {
+ return FaaSCronKey.String(val)
+}
+
+// FaaSDocumentCollection returns an attribute KeyValue conforming to the
+// "faas.document.collection" semantic conventions. It represents the name of
+// the source on which the triggering operation was performed. For example, in
+// Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the
+// database name.
+func FaaSDocumentCollection(val string) attribute.KeyValue {
+ return FaaSDocumentCollectionKey.String(val)
+}
+
+// FaaSDocumentName returns an attribute KeyValue conforming to the
+// "faas.document.name" semantic conventions. It represents the document
+// name/table subjected to the operation. For example, in Cloud Storage or S3
+// is the name of the file, and in Cosmos DB the table name.
+func FaaSDocumentName(val string) attribute.KeyValue {
+ return FaaSDocumentNameKey.String(val)
+}
+
+// FaaSDocumentTime returns an attribute KeyValue conforming to the
+// "faas.document.time" semantic conventions. It represents a string containing
+// the time when the data was accessed in the [ISO
+// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+func FaaSDocumentTime(val string) attribute.KeyValue {
+ return FaaSDocumentTimeKey.String(val)
+}
+
+// FaaSInstance returns an attribute KeyValue conforming to the
+// "faas.instance" semantic conventions. It represents the execution
+// environment ID as a string, that will be potentially reused for other
+// invocations to the same function/function version.
+func FaaSInstance(val string) attribute.KeyValue {
+ return FaaSInstanceKey.String(val)
+}
+
+// FaaSInvocationID returns an attribute KeyValue conforming to the
+// "faas.invocation_id" semantic conventions. It represents the invocation ID
+// of the current function invocation.
+func FaaSInvocationID(val string) attribute.KeyValue {
+ return FaaSInvocationIDKey.String(val)
+}
+
+// FaaSInvokedName returns an attribute KeyValue conforming to the
+// "faas.invoked_name" semantic conventions. It represents the name of the
+// invoked function.
+func FaaSInvokedName(val string) attribute.KeyValue {
+ return FaaSInvokedNameKey.String(val)
+}
+
+// FaaSInvokedRegion returns an attribute KeyValue conforming to the
+// "faas.invoked_region" semantic conventions. It represents the cloud region
+// of the invoked function.
+func FaaSInvokedRegion(val string) attribute.KeyValue {
+ return FaaSInvokedRegionKey.String(val)
+}
+
+// FaaSMaxMemory returns an attribute KeyValue conforming to the
+// "faas.max_memory" semantic conventions. It represents the amount of memory
+// available to the serverless function converted to Bytes.
+func FaaSMaxMemory(val int) attribute.KeyValue {
+ return FaaSMaxMemoryKey.Int(val)
+}
+
+// FaaSName returns an attribute KeyValue conforming to the "faas.name"
+// semantic conventions. It represents the name of the single function that
+// this runtime instance executes.
+func FaaSName(val string) attribute.KeyValue {
+ return FaaSNameKey.String(val)
+}
+
+// FaaSTime returns an attribute KeyValue conforming to the "faas.time"
+// semantic conventions. It represents a string containing the function
+// invocation time in the [ISO
+// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+func FaaSTime(val string) attribute.KeyValue {
+ return FaaSTimeKey.String(val)
+}
+
+// FaaSVersion returns an attribute KeyValue conforming to the
+// "faas.version" semantic conventions. It represents the immutable version of
+// the function being executed.
+func FaaSVersion(val string) attribute.KeyValue {
+ return FaaSVersionKey.String(val)
+}
+
+// Attributes for Feature Flags.
+const (
+ // FeatureFlagKeyKey is the attribute Key conforming to the
+ // "feature_flag.key" semantic conventions. It represents the unique
+ // identifier of the feature flag.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'logo-color'
+ FeatureFlagKeyKey = attribute.Key("feature_flag.key")
+
+ // FeatureFlagProviderNameKey is the attribute Key conforming to the
+ // "feature_flag.provider_name" semantic conventions. It represents the
+ // name of the service provider that performs the flag evaluation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Flag Manager'
+ FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name")
+
+ // FeatureFlagVariantKey is the attribute Key conforming to the
+ // "feature_flag.variant" semantic conventions. It represents the sHOULD be
+ // a semantic identifier for a value. If one is unavailable, a stringified
+ // version of the value can be used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'red', 'true', 'on'
+ // Note: A semantic identifier, commonly referred to as a variant, provides
+ // a means
+ // for referring to a value without including the value itself. This can
+ // provide additional context for understanding the meaning behind a value.
+ // For example, the variant `red` maybe be used for the value `#c05543`.
+ //
+ // A stringified version of the value can be used in situations where a
+ // semantic identifier is unavailable. String representation of the value
+ // should be determined by the implementer.
+ FeatureFlagVariantKey = attribute.Key("feature_flag.variant")
+)
+
+// FeatureFlagKey returns an attribute KeyValue conforming to the
+// "feature_flag.key" semantic conventions. It represents the unique identifier
+// of the feature flag.
+func FeatureFlagKey(val string) attribute.KeyValue {
+ return FeatureFlagKeyKey.String(val)
+}
+
+// FeatureFlagProviderName returns an attribute KeyValue conforming to the
+// "feature_flag.provider_name" semantic conventions. It represents the name of
+// the service provider that performs the flag evaluation.
+func FeatureFlagProviderName(val string) attribute.KeyValue {
+ return FeatureFlagProviderNameKey.String(val)
+}
+
+// FeatureFlagVariant returns an attribute KeyValue conforming to the
+// "feature_flag.variant" semantic conventions. It represents the sHOULD be a
+// semantic identifier for a value. If one is unavailable, a stringified
+// version of the value can be used.
+func FeatureFlagVariant(val string) attribute.KeyValue {
+ return FeatureFlagVariantKey.String(val)
+}
+
+// Describes file attributes.
+const (
+ // FileDirectoryKey is the attribute Key conforming to the "file.directory"
+ // semantic conventions. It represents the directory where the file is
+ // located. It should include the drive letter, when appropriate.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/home/user', 'C:\\Program Files\\MyApp'
+ FileDirectoryKey = attribute.Key("file.directory")
+
+ // FileExtensionKey is the attribute Key conforming to the "file.extension"
+ // semantic conventions. It represents the file extension, excluding the
+ // leading dot.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'png', 'gz'
+ // Note: When the file name has multiple extensions (example.tar.gz), only
+ // the last one should be captured ("gz", not "tar.gz").
+ FileExtensionKey = attribute.Key("file.extension")
+
+ // FileNameKey is the attribute Key conforming to the "file.name" semantic
+ // conventions. It represents the name of the file including the extension,
+ // without the directory.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'example.png'
+ FileNameKey = attribute.Key("file.name")
+
+ // FilePathKey is the attribute Key conforming to the "file.path" semantic
+ // conventions. It represents the full path to the file, including the file
+ // name. It should include the drive letter, when appropriate.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/home/alice/example.png', 'C:\\Program
+ // Files\\MyApp\\myapp.exe'
+ FilePathKey = attribute.Key("file.path")
+
+ // FileSizeKey is the attribute Key conforming to the "file.size" semantic
+ // conventions. It represents the file size in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FileSizeKey = attribute.Key("file.size")
+)
+
+// FileDirectory returns an attribute KeyValue conforming to the
+// "file.directory" semantic conventions. It represents the directory where the
+// file is located. It should include the drive letter, when appropriate.
+func FileDirectory(val string) attribute.KeyValue {
+ return FileDirectoryKey.String(val)
+}
+
+// FileExtension returns an attribute KeyValue conforming to the
+// "file.extension" semantic conventions. It represents the file extension,
+// excluding the leading dot.
+func FileExtension(val string) attribute.KeyValue {
+ return FileExtensionKey.String(val)
+}
+
+// FileName returns an attribute KeyValue conforming to the "file.name"
+// semantic conventions. It represents the name of the file including the
+// extension, without the directory.
+func FileName(val string) attribute.KeyValue {
+ return FileNameKey.String(val)
+}
+
+// FilePath returns an attribute KeyValue conforming to the "file.path"
+// semantic conventions. It represents the full path to the file, including the
+// file name. It should include the drive letter, when appropriate.
+func FilePath(val string) attribute.KeyValue {
+ return FilePathKey.String(val)
+}
+
+// FileSize returns an attribute KeyValue conforming to the "file.size"
+// semantic conventions. It represents the file size in bytes.
+func FileSize(val int) attribute.KeyValue {
+ return FileSizeKey.Int(val)
+}
+
+// Attributes for Google Cloud Run.
+const (
+ // GCPCloudRunJobExecutionKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.execution" semantic conventions. It represents the
+ // name of the Cloud Run
+ // [execution](https://cloud.google.com/run/docs/managing/job-executions)
+ // being run for the Job, as set by the
+ // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+ // environment variable.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'job-name-xxxx', 'sample-job-mdw84'
+ GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution")
+
+ // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.task_index" semantic conventions. It represents the
+ // index for a task within an execution as provided by the
+ // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+ // environment variable.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1
+ GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index")
+)
+
+// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.execution" semantic conventions. It represents the name
+// of the Cloud Run
+// [execution](https://cloud.google.com/run/docs/managing/job-executions) being
+// run for the Job, as set by the
+// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+// environment variable.
+func GCPCloudRunJobExecution(val string) attribute.KeyValue {
+ return GCPCloudRunJobExecutionKey.String(val)
+}
+
+// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index
+// for a task within an execution as provided by the
+// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+// environment variable.
+func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue {
+ return GCPCloudRunJobTaskIndexKey.Int(val)
+}
+
+// Attributes for Google Compute Engine (GCE).
+const (
+ // GCPGceInstanceHostnameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.hostname" semantic conventions. It represents the
+ // hostname of a GCE instance. This is the full value of the default or
+ // [custom
+ // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-host1234.example.com',
+ // 'sample-vm.us-west1-b.c.my-project.internal'
+ GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname")
+
+ // GCPGceInstanceNameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.name" semantic conventions. It represents the instance
+ // name of a GCE instance. This is the value provided by `host.name`, the
+ // visible name of the instance in the Cloud Console UI, and the prefix for
+ // the default hostname of the instance as defined by the [default internal
+ // DNS
+ // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'instance-1', 'my-vm-name'
+ GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name")
+)
+
+// GCPGceInstanceHostname returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname
+// of a GCE instance. This is the full value of the default or [custom
+// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
+func GCPGceInstanceHostname(val string) attribute.KeyValue {
+ return GCPGceInstanceHostnameKey.String(val)
+}
+
+// GCPGceInstanceName returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.name" semantic conventions. It represents the instance
+// name of a GCE instance. This is the value provided by `host.name`, the
+// visible name of the instance in the Cloud Console UI, and the prefix for the
+// default hostname of the instance as defined by the [default internal DNS
+// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
+func GCPGceInstanceName(val string) attribute.KeyValue {
+ return GCPGceInstanceNameKey.String(val)
+}
+
+// The attributes used to describe telemetry in the context of LLM (Large
+// Language Models) requests and responses.
+const (
+ // GenAiCompletionKey is the attribute Key conforming to the
+ // "gen_ai.completion" semantic conventions. It represents the full
+ // response received from the LLM.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: "[{'role': 'assistant', 'content': 'The capital of France is
+ // Paris.'}]"
+ // Note: It's RECOMMENDED to format completions as JSON string matching
+ // [OpenAI messages
+ // format](https://platform.openai.com/docs/guides/text-generation)
+ GenAiCompletionKey = attribute.Key("gen_ai.completion")
+
+ // GenAiPromptKey is the attribute Key conforming to the "gen_ai.prompt"
+ // semantic conventions. It represents the full prompt sent to an LLM.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: "[{'role': 'user', 'content': 'What is the capital of
+ // France?'}]"
+ // Note: It's RECOMMENDED to format prompts as JSON string matching [OpenAI
+ // messages
+ // format](https://platform.openai.com/docs/guides/text-generation)
+ GenAiPromptKey = attribute.Key("gen_ai.prompt")
+
+ // GenAiRequestMaxTokensKey is the attribute Key conforming to the
+ // "gen_ai.request.max_tokens" semantic conventions. It represents the
+ // maximum number of tokens the LLM generates for a request.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ GenAiRequestMaxTokensKey = attribute.Key("gen_ai.request.max_tokens")
+
+ // GenAiRequestModelKey is the attribute Key conforming to the
+ // "gen_ai.request.model" semantic conventions. It represents the name of
+ // the LLM a request is being made to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gpt-4'
+ GenAiRequestModelKey = attribute.Key("gen_ai.request.model")
+
+ // GenAiRequestTemperatureKey is the attribute Key conforming to the
+ // "gen_ai.request.temperature" semantic conventions. It represents the
+ // temperature setting for the LLM request.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0.0
+ GenAiRequestTemperatureKey = attribute.Key("gen_ai.request.temperature")
+
+ // GenAiRequestTopPKey is the attribute Key conforming to the
+ // "gen_ai.request.top_p" semantic conventions. It represents the top_p
+ // sampling setting for the LLM request.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0
+ GenAiRequestTopPKey = attribute.Key("gen_ai.request.top_p")
+
+ // GenAiResponseFinishReasonsKey is the attribute Key conforming to the
+ // "gen_ai.response.finish_reasons" semantic conventions. It represents the
+ // array of reasons the model stopped generating tokens, corresponding to
+ // each generation received.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'stop'
+ GenAiResponseFinishReasonsKey = attribute.Key("gen_ai.response.finish_reasons")
+
+ // GenAiResponseIDKey is the attribute Key conforming to the
+ // "gen_ai.response.id" semantic conventions. It represents the unique
+ // identifier for the completion.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'chatcmpl-123'
+ GenAiResponseIDKey = attribute.Key("gen_ai.response.id")
+
+ // GenAiResponseModelKey is the attribute Key conforming to the
+ // "gen_ai.response.model" semantic conventions. It represents the name of
+ // the LLM a response was generated from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gpt-4-0613'
+ GenAiResponseModelKey = attribute.Key("gen_ai.response.model")
+
+ // GenAiSystemKey is the attribute Key conforming to the "gen_ai.system"
+ // semantic conventions. It represents the Generative AI product as
+ // identified by the client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'openai'
+ // Note: The actual GenAI product may differ from the one identified by the
+ // client. For example, when using OpenAI client libraries to communicate
+ // with Mistral, the `gen_ai.system` is set to `openai` based on the
+ // instrumentation's best knowledge.
+ GenAiSystemKey = attribute.Key("gen_ai.system")
+
+ // GenAiUsageCompletionTokensKey is the attribute Key conforming to the
+ // "gen_ai.usage.completion_tokens" semantic conventions. It represents the
+ // number of tokens used in the LLM response (completion).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 180
+ GenAiUsageCompletionTokensKey = attribute.Key("gen_ai.usage.completion_tokens")
+
+ // GenAiUsagePromptTokensKey is the attribute Key conforming to the
+ // "gen_ai.usage.prompt_tokens" semantic conventions. It represents the
+ // number of tokens used in the LLM prompt.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ GenAiUsagePromptTokensKey = attribute.Key("gen_ai.usage.prompt_tokens")
+)
+
+var (
+ // OpenAI
+ GenAiSystemOpenai = GenAiSystemKey.String("openai")
+)
+
+// GenAiCompletion returns an attribute KeyValue conforming to the
+// "gen_ai.completion" semantic conventions. It represents the full response
+// received from the LLM.
+func GenAiCompletion(val string) attribute.KeyValue {
+ return GenAiCompletionKey.String(val)
+}
+
+// GenAiPrompt returns an attribute KeyValue conforming to the
+// "gen_ai.prompt" semantic conventions. It represents the full prompt sent to
+// an LLM.
+func GenAiPrompt(val string) attribute.KeyValue {
+ return GenAiPromptKey.String(val)
+}
+
+// GenAiRequestMaxTokens returns an attribute KeyValue conforming to the
+// "gen_ai.request.max_tokens" semantic conventions. It represents the maximum
+// number of tokens the LLM generates for a request.
+func GenAiRequestMaxTokens(val int) attribute.KeyValue {
+ return GenAiRequestMaxTokensKey.Int(val)
+}
+
+// GenAiRequestModel returns an attribute KeyValue conforming to the
+// "gen_ai.request.model" semantic conventions. It represents the name of the
+// LLM a request is being made to.
+func GenAiRequestModel(val string) attribute.KeyValue {
+ return GenAiRequestModelKey.String(val)
+}
+
+// GenAiRequestTemperature returns an attribute KeyValue conforming to the
+// "gen_ai.request.temperature" semantic conventions. It represents the
+// temperature setting for the LLM request.
+func GenAiRequestTemperature(val float64) attribute.KeyValue {
+ return GenAiRequestTemperatureKey.Float64(val)
+}
+
+// GenAiRequestTopP returns an attribute KeyValue conforming to the
+// "gen_ai.request.top_p" semantic conventions. It represents the top_p
+// sampling setting for the LLM request.
+func GenAiRequestTopP(val float64) attribute.KeyValue {
+ return GenAiRequestTopPKey.Float64(val)
+}
+
+// GenAiResponseFinishReasons returns an attribute KeyValue conforming to
+// the "gen_ai.response.finish_reasons" semantic conventions. It represents the
+// array of reasons the model stopped generating tokens, corresponding to each
+// generation received.
+func GenAiResponseFinishReasons(val ...string) attribute.KeyValue {
+ return GenAiResponseFinishReasonsKey.StringSlice(val)
+}
+
+// GenAiResponseID returns an attribute KeyValue conforming to the
+// "gen_ai.response.id" semantic conventions. It represents the unique
+// identifier for the completion.
+func GenAiResponseID(val string) attribute.KeyValue {
+ return GenAiResponseIDKey.String(val)
+}
+
+// GenAiResponseModel returns an attribute KeyValue conforming to the
+// "gen_ai.response.model" semantic conventions. It represents the name of the
+// LLM a response was generated from.
+func GenAiResponseModel(val string) attribute.KeyValue {
+ return GenAiResponseModelKey.String(val)
+}
+
+// GenAiUsageCompletionTokens returns an attribute KeyValue conforming to
+// the "gen_ai.usage.completion_tokens" semantic conventions. It represents the
+// number of tokens used in the LLM response (completion).
+func GenAiUsageCompletionTokens(val int) attribute.KeyValue {
+ return GenAiUsageCompletionTokensKey.Int(val)
+}
+
+// GenAiUsagePromptTokens returns an attribute KeyValue conforming to the
+// "gen_ai.usage.prompt_tokens" semantic conventions. It represents the number
+// of tokens used in the LLM prompt.
+func GenAiUsagePromptTokens(val int) attribute.KeyValue {
+ return GenAiUsagePromptTokensKey.Int(val)
+}
+
+// Attributes for GraphQL.
+const (
+ // GraphqlDocumentKey is the attribute Key conforming to the
+ // "graphql.document" semantic conventions. It represents the GraphQL
+ // document being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'query findBookByID { bookByID(id: ?) { name } }'
+ // Note: The value may be sanitized to exclude sensitive information.
+ GraphqlDocumentKey = attribute.Key("graphql.document")
+
+ // GraphqlOperationNameKey is the attribute Key conforming to the
+ // "graphql.operation.name" semantic conventions. It represents the name of
+ // the operation being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'findBookByID'
+ GraphqlOperationNameKey = attribute.Key("graphql.operation.name")
+
+ // GraphqlOperationTypeKey is the attribute Key conforming to the
+ // "graphql.operation.type" semantic conventions. It represents the type of
+ // the operation being executed.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'query', 'mutation', 'subscription'
+ GraphqlOperationTypeKey = attribute.Key("graphql.operation.type")
+)
+
+var (
+ // GraphQL query
+ GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query")
+ // GraphQL mutation
+ GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation")
+ // GraphQL subscription
+ GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription")
+)
+
+// GraphqlDocument returns an attribute KeyValue conforming to the
+// "graphql.document" semantic conventions. It represents the GraphQL document
+// being executed.
+func GraphqlDocument(val string) attribute.KeyValue {
+ return GraphqlDocumentKey.String(val)
+}
+
+// GraphqlOperationName returns an attribute KeyValue conforming to the
+// "graphql.operation.name" semantic conventions. It represents the name of the
+// operation being executed.
+func GraphqlOperationName(val string) attribute.KeyValue {
+ return GraphqlOperationNameKey.String(val)
+}
+
+// Attributes for the Android platform on which the Android application is
+// running.
+const (
+ // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id"
+ // semantic conventions. It represents the unique identifier for the
+ // application
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da'
+ HerokuAppIDKey = attribute.Key("heroku.app.id")
+
+ // HerokuReleaseCommitKey is the attribute Key conforming to the
+ // "heroku.release.commit" semantic conventions. It represents the commit
+ // hash for the current release
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec'
+ HerokuReleaseCommitKey = attribute.Key("heroku.release.commit")
+
+ // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the
+ // "heroku.release.creation_timestamp" semantic conventions. It represents
+ // the time and date the release was created
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2022-10-23T18:00:42Z'
+ HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp")
+)
+
+// HerokuAppID returns an attribute KeyValue conforming to the
+// "heroku.app.id" semantic conventions. It represents the unique identifier
+// for the application
+func HerokuAppID(val string) attribute.KeyValue {
+ return HerokuAppIDKey.String(val)
+}
+
+// HerokuReleaseCommit returns an attribute KeyValue conforming to the
+// "heroku.release.commit" semantic conventions. It represents the commit hash
+// for the current release
+func HerokuReleaseCommit(val string) attribute.KeyValue {
+ return HerokuReleaseCommitKey.String(val)
+}
+
+// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming
+// to the "heroku.release.creation_timestamp" semantic conventions. It
+// represents the time and date the release was created
+func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue {
+ return HerokuReleaseCreationTimestampKey.String(val)
+}
+
+// A host is defined as a computing instance. For example, physical servers,
+// virtual machines, switches or disk array.
+const (
+ // HostArchKey is the attribute Key conforming to the "host.arch" semantic
+ // conventions. It represents the CPU architecture the host system is
+ // running on.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ HostArchKey = attribute.Key("host.arch")
+
+ // HostCPUCacheL2SizeKey is the attribute Key conforming to the
+ // "host.cpu.cache.l2.size" semantic conventions. It represents the amount
+ // of level 2 memory cache available to the processor (in Bytes).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 12288000
+ HostCPUCacheL2SizeKey = attribute.Key("host.cpu.cache.l2.size")
+
+ // HostCPUFamilyKey is the attribute Key conforming to the
+ // "host.cpu.family" semantic conventions. It represents the family or
+ // generation of the CPU.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '6', 'PA-RISC 1.1e'
+ HostCPUFamilyKey = attribute.Key("host.cpu.family")
+
+ // HostCPUModelIDKey is the attribute Key conforming to the
+ // "host.cpu.model.id" semantic conventions. It represents the model
+ // identifier. It provides more granular information about the CPU,
+ // distinguishing it from other CPUs within the same family.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '6', '9000/778/B180L'
+ HostCPUModelIDKey = attribute.Key("host.cpu.model.id")
+
+ // HostCPUModelNameKey is the attribute Key conforming to the
+ // "host.cpu.model.name" semantic conventions. It represents the model
+ // designation of the processor.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz'
+ HostCPUModelNameKey = attribute.Key("host.cpu.model.name")
+
+ // HostCPUSteppingKey is the attribute Key conforming to the
+ // "host.cpu.stepping" semantic conventions. It represents the stepping or
+ // core revisions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1', 'r1p1'
+ HostCPUSteppingKey = attribute.Key("host.cpu.stepping")
+
+ // HostCPUVendorIDKey is the attribute Key conforming to the
+ // "host.cpu.vendor.id" semantic conventions. It represents the processor
+ // manufacturer identifier. A maximum 12-character string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'GenuineIntel'
+ // Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor
+ // ID string in EBX, EDX and ECX registers. Writing these to memory in this
+ // order results in a 12-character string.
+ HostCPUVendorIDKey = attribute.Key("host.cpu.vendor.id")
+
+ // HostIDKey is the attribute Key conforming to the "host.id" semantic
+ // conventions. It represents the unique host ID. For Cloud, this must be
+ // the instance_id assigned by the cloud provider. For non-containerized
+ // systems, this should be the `machine-id`. See the table below for the
+ // sources to use to determine the `machine-id` based on operating system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'fdbf79e8af94cb7f9e8df36789187052'
+ HostIDKey = attribute.Key("host.id")
+
+ // HostImageIDKey is the attribute Key conforming to the "host.image.id"
+ // semantic conventions. It represents the vM image ID or host OS image ID.
+ // For Cloud, this value is from the provider.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ami-07b06b442921831e5'
+ HostImageIDKey = attribute.Key("host.image.id")
+
+ // HostImageNameKey is the attribute Key conforming to the
+ // "host.image.name" semantic conventions. It represents the name of the VM
+ // image or OS install the host was instantiated from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905'
+ HostImageNameKey = attribute.Key("host.image.name")
+
+ // HostImageVersionKey is the attribute Key conforming to the
+ // "host.image.version" semantic conventions. It represents the version
+ // string of the VM image or host OS as defined in [Version
+ // Attributes](/docs/resource/README.md#version-attributes).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0.1'
+ HostImageVersionKey = attribute.Key("host.image.version")
+
+ // HostIPKey is the attribute Key conforming to the "host.ip" semantic
+ // conventions. It represents the available IP addresses of the host,
+ // excluding loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '192.168.1.140', 'fe80::abc2:4a28:737a:609e'
+ // Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6
+ // addresses MUST be specified in the [RFC
+ // 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format.
+ HostIPKey = attribute.Key("host.ip")
+
+ // HostMacKey is the attribute Key conforming to the "host.mac" semantic
+ // conventions. It represents the available MAC addresses of the host,
+ // excluding loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'AC-DE-48-23-45-67', 'AC-DE-48-23-45-67-01-9F'
+ // Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal
+ // form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf):
+ // as hyphen-separated octets in uppercase hexadecimal form from most to
+ // least significant.
+ HostMacKey = attribute.Key("host.mac")
+
+ // HostNameKey is the attribute Key conforming to the "host.name" semantic
+ // conventions. It represents the name of the host. On Unix systems, it may
+ // contain what the hostname command returns, or the fully qualified
+ // hostname, or another name specified by the user.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-test'
+ HostNameKey = attribute.Key("host.name")
+
+ // HostTypeKey is the attribute Key conforming to the "host.type" semantic
+ // conventions. It represents the type of host. For Cloud, this must be the
+ // machine type.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'n1-standard-1'
+ HostTypeKey = attribute.Key("host.type")
+)
+
+var (
+ // AMD64
+ HostArchAMD64 = HostArchKey.String("amd64")
+ // ARM32
+ HostArchARM32 = HostArchKey.String("arm32")
+ // ARM64
+ HostArchARM64 = HostArchKey.String("arm64")
+ // Itanium
+ HostArchIA64 = HostArchKey.String("ia64")
+ // 32-bit PowerPC
+ HostArchPPC32 = HostArchKey.String("ppc32")
+ // 64-bit PowerPC
+ HostArchPPC64 = HostArchKey.String("ppc64")
+ // IBM z/Architecture
+ HostArchS390x = HostArchKey.String("s390x")
+ // 32-bit x86
+ HostArchX86 = HostArchKey.String("x86")
+)
+
+// HostCPUCacheL2Size returns an attribute KeyValue conforming to the
+// "host.cpu.cache.l2.size" semantic conventions. It represents the amount of
+// level 2 memory cache available to the processor (in Bytes).
+func HostCPUCacheL2Size(val int) attribute.KeyValue {
+ return HostCPUCacheL2SizeKey.Int(val)
+}
+
+// HostCPUFamily returns an attribute KeyValue conforming to the
+// "host.cpu.family" semantic conventions. It represents the family or
+// generation of the CPU.
+func HostCPUFamily(val string) attribute.KeyValue {
+ return HostCPUFamilyKey.String(val)
+}
+
+// HostCPUModelID returns an attribute KeyValue conforming to the
+// "host.cpu.model.id" semantic conventions. It represents the model
+// identifier. It provides more granular information about the CPU,
+// distinguishing it from other CPUs within the same family.
+func HostCPUModelID(val string) attribute.KeyValue {
+ return HostCPUModelIDKey.String(val)
+}
+
+// HostCPUModelName returns an attribute KeyValue conforming to the
+// "host.cpu.model.name" semantic conventions. It represents the model
+// designation of the processor.
+func HostCPUModelName(val string) attribute.KeyValue {
+ return HostCPUModelNameKey.String(val)
+}
+
+// HostCPUStepping returns an attribute KeyValue conforming to the
+// "host.cpu.stepping" semantic conventions. It represents the stepping or core
+// revisions.
+func HostCPUStepping(val string) attribute.KeyValue {
+ return HostCPUSteppingKey.String(val)
+}
+
+// HostCPUVendorID returns an attribute KeyValue conforming to the
+// "host.cpu.vendor.id" semantic conventions. It represents the processor
+// manufacturer identifier. A maximum 12-character string.
+func HostCPUVendorID(val string) attribute.KeyValue {
+ return HostCPUVendorIDKey.String(val)
+}
+
+// HostID returns an attribute KeyValue conforming to the "host.id" semantic
+// conventions. It represents the unique host ID. For Cloud, this must be the
+// instance_id assigned by the cloud provider. For non-containerized systems,
+// this should be the `machine-id`. See the table below for the sources to use
+// to determine the `machine-id` based on operating system.
+func HostID(val string) attribute.KeyValue {
+ return HostIDKey.String(val)
+}
+
+// HostImageID returns an attribute KeyValue conforming to the
+// "host.image.id" semantic conventions. It represents the vM image ID or host
+// OS image ID. For Cloud, this value is from the provider.
+func HostImageID(val string) attribute.KeyValue {
+ return HostImageIDKey.String(val)
+}
+
+// HostImageName returns an attribute KeyValue conforming to the
+// "host.image.name" semantic conventions. It represents the name of the VM
+// image or OS install the host was instantiated from.
+func HostImageName(val string) attribute.KeyValue {
+ return HostImageNameKey.String(val)
+}
+
+// HostImageVersion returns an attribute KeyValue conforming to the
+// "host.image.version" semantic conventions. It represents the version string
+// of the VM image or host OS as defined in [Version
+// Attributes](/docs/resource/README.md#version-attributes).
+func HostImageVersion(val string) attribute.KeyValue {
+ return HostImageVersionKey.String(val)
+}
+
+// HostIP returns an attribute KeyValue conforming to the "host.ip" semantic
+// conventions. It represents the available IP addresses of the host, excluding
+// loopback interfaces.
+func HostIP(val ...string) attribute.KeyValue {
+ return HostIPKey.StringSlice(val)
+}
+
+// HostMac returns an attribute KeyValue conforming to the "host.mac"
+// semantic conventions. It represents the available MAC addresses of the host,
+// excluding loopback interfaces.
+func HostMac(val ...string) attribute.KeyValue {
+ return HostMacKey.StringSlice(val)
+}
+
+// HostName returns an attribute KeyValue conforming to the "host.name"
+// semantic conventions. It represents the name of the host. On Unix systems,
+// it may contain what the hostname command returns, or the fully qualified
+// hostname, or another name specified by the user.
+func HostName(val string) attribute.KeyValue {
+ return HostNameKey.String(val)
+}
+
+// HostType returns an attribute KeyValue conforming to the "host.type"
+// semantic conventions. It represents the type of host. For Cloud, this must
+// be the machine type.
+func HostType(val string) attribute.KeyValue {
+ return HostTypeKey.String(val)
+}
+
+// Semantic convention attributes in the HTTP namespace.
+const (
+ // HTTPConnectionStateKey is the attribute Key conforming to the
+ // "http.connection.state" semantic conventions. It represents the state of
+ // the HTTP connection in the HTTP connection pool.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'active', 'idle'
+ HTTPConnectionStateKey = attribute.Key("http.connection.state")
+
+ // HTTPRequestBodySizeKey is the attribute Key conforming to the
+ // "http.request.body.size" semantic conventions. It represents the size of
+ // the request payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3495
+ HTTPRequestBodySizeKey = attribute.Key("http.request.body.size")
+
+ // HTTPRequestMethodKey is the attribute Key conforming to the
+ // "http.request.method" semantic conventions. It represents the hTTP
+ // request method.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'GET', 'POST', 'HEAD'
+ // Note: HTTP request method value SHOULD be "known" to the
+ // instrumentation.
+ // By default, this convention defines "known" methods as the ones listed
+ // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
+ // and the PATCH method defined in
+ // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
+ //
+ // If the HTTP request method is not known to instrumentation, it MUST set
+ // the `http.request.method` attribute to `_OTHER`.
+ //
+ // If the HTTP instrumentation could end up converting valid HTTP request
+ // methods to `_OTHER`, then it MUST provide a way to override
+ // the list of known HTTP methods. If this override is done via environment
+ // variable, then the environment variable MUST be named
+ // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated
+ // list of case-sensitive known HTTP methods
+ // (this list MUST be a full override of the default known method, it is
+ // not a list of known methods in addition to the defaults).
+ //
+ // HTTP method names are case-sensitive and `http.request.method` attribute
+ // value MUST match a known HTTP method name exactly.
+ // Instrumentations for specific web frameworks that consider HTTP methods
+ // to be case insensitive, SHOULD populate a canonical equivalent.
+ // Tracing instrumentations that do so, MUST also set
+ // `http.request.method_original` to the original value.
+ HTTPRequestMethodKey = attribute.Key("http.request.method")
+
+ // HTTPRequestMethodOriginalKey is the attribute Key conforming to the
+ // "http.request.method_original" semantic conventions. It represents the
+ // original HTTP method sent by the client in the request line.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'GeT', 'ACL', 'foo'
+ HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original")
+
+ // HTTPRequestResendCountKey is the attribute Key conforming to the
+ // "http.request.resend_count" semantic conventions. It represents the
+ // ordinal number of request resending attempt (for any reason, including
+ // redirects).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3
+ // Note: The resend count SHOULD be updated each time an HTTP request gets
+ // resent by the client, regardless of what was the cause of the resending
+ // (e.g. redirection, authorization failure, 503 Server Unavailable,
+ // network issues, or any other).
+ HTTPRequestResendCountKey = attribute.Key("http.request.resend_count")
+
+ // HTTPRequestSizeKey is the attribute Key conforming to the
+ // "http.request.size" semantic conventions. It represents the total size
+ // of the request in bytes. This should be the total number of bytes sent
+ // over the wire, including the request line (HTTP/1.1), framing (HTTP/2
+ // and HTTP/3), headers, and request body if any.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1437
+ HTTPRequestSizeKey = attribute.Key("http.request.size")
+
+ // HTTPResponseBodySizeKey is the attribute Key conforming to the
+ // "http.response.body.size" semantic conventions. It represents the size
+ // of the response payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3495
+ HTTPResponseBodySizeKey = attribute.Key("http.response.body.size")
+
+ // HTTPResponseSizeKey is the attribute Key conforming to the
+ // "http.response.size" semantic conventions. It represents the total size
+ // of the response in bytes. This should be the total number of bytes sent
+ // over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and
+ // HTTP/3), headers, and response body and trailers if any.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1437
+ HTTPResponseSizeKey = attribute.Key("http.response.size")
+
+ // HTTPResponseStatusCodeKey is the attribute Key conforming to the
+ // "http.response.status_code" semantic conventions. It represents the
+ // [HTTP response status
+ // code](https://tools.ietf.org/html/rfc7231#section-6).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 200
+ HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code")
+
+ // HTTPRouteKey is the attribute Key conforming to the "http.route"
+ // semantic conventions. It represents the matched route, that is, the path
+ // template in the format used by the respective server framework.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
+ // Note: MUST NOT be populated when this is not supported by the HTTP
+ // server framework as the route attribute should have low-cardinality and
+ // the URI path can NOT substitute it.
+ // SHOULD include the [application
+ // root](/docs/http/http-spans.md#http-server-definitions) if there is one.
+ HTTPRouteKey = attribute.Key("http.route")
+)
+
+var (
+ // active state
+ HTTPConnectionStateActive = HTTPConnectionStateKey.String("active")
+ // idle state
+ HTTPConnectionStateIdle = HTTPConnectionStateKey.String("idle")
+)
+
+var (
+ // CONNECT method
+ HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT")
+ // DELETE method
+ HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE")
+ // GET method
+ HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET")
+ // HEAD method
+ HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD")
+ // OPTIONS method
+ HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS")
+ // PATCH method
+ HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH")
+ // POST method
+ HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST")
+ // PUT method
+ HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT")
+ // TRACE method
+ HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE")
+ // Any HTTP method that the instrumentation has no prior knowledge of
+ HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER")
+)
+
+// HTTPRequestBodySize returns an attribute KeyValue conforming to the
+// "http.request.body.size" semantic conventions. It represents the size of the
+// request payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPRequestBodySize(val int) attribute.KeyValue {
+ return HTTPRequestBodySizeKey.Int(val)
+}
+
+// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the
+// "http.request.method_original" semantic conventions. It represents the
+// original HTTP method sent by the client in the request line.
+func HTTPRequestMethodOriginal(val string) attribute.KeyValue {
+ return HTTPRequestMethodOriginalKey.String(val)
+}
+
+// HTTPRequestResendCount returns an attribute KeyValue conforming to the
+// "http.request.resend_count" semantic conventions. It represents the ordinal
+// number of request resending attempt (for any reason, including redirects).
+func HTTPRequestResendCount(val int) attribute.KeyValue {
+ return HTTPRequestResendCountKey.Int(val)
+}
+
+// HTTPRequestSize returns an attribute KeyValue conforming to the
+// "http.request.size" semantic conventions. It represents the total size of
+// the request in bytes. This should be the total number of bytes sent over the
+// wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3),
+// headers, and request body if any.
+func HTTPRequestSize(val int) attribute.KeyValue {
+ return HTTPRequestSizeKey.Int(val)
+}
+
+// HTTPResponseBodySize returns an attribute KeyValue conforming to the
+// "http.response.body.size" semantic conventions. It represents the size of
+// the response payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPResponseBodySize(val int) attribute.KeyValue {
+ return HTTPResponseBodySizeKey.Int(val)
+}
+
+// HTTPResponseSize returns an attribute KeyValue conforming to the
+// "http.response.size" semantic conventions. It represents the total size of
+// the response in bytes. This should be the total number of bytes sent over
+// the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3),
+// headers, and response body and trailers if any.
+func HTTPResponseSize(val int) attribute.KeyValue {
+ return HTTPResponseSizeKey.Int(val)
+}
+
+// HTTPResponseStatusCode returns an attribute KeyValue conforming to the
+// "http.response.status_code" semantic conventions. It represents the [HTTP
+// response status code](https://tools.ietf.org/html/rfc7231#section-6).
+func HTTPResponseStatusCode(val int) attribute.KeyValue {
+ return HTTPResponseStatusCodeKey.Int(val)
+}
+
+// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
+// semantic conventions. It represents the matched route, that is, the path
+// template in the format used by the respective server framework.
+func HTTPRoute(val string) attribute.KeyValue {
+ return HTTPRouteKey.String(val)
+}
+
+// Java Virtual machine related attributes.
+const (
+ // JvmBufferPoolNameKey is the attribute Key conforming to the
+ // "jvm.buffer.pool.name" semantic conventions. It represents the name of
+ // the buffer pool.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mapped', 'direct'
+ // Note: Pool names are generally obtained via
+ // [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()).
+ JvmBufferPoolNameKey = attribute.Key("jvm.buffer.pool.name")
+
+ // JvmGcActionKey is the attribute Key conforming to the "jvm.gc.action"
+ // semantic conventions. It represents the name of the garbage collector
+ // action.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'end of minor GC', 'end of major GC'
+ // Note: Garbage collector action is generally obtained via
+ // [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).
+ JvmGcActionKey = attribute.Key("jvm.gc.action")
+
+ // JvmGcNameKey is the attribute Key conforming to the "jvm.gc.name"
+ // semantic conventions. It represents the name of the garbage collector.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'G1 Young Generation', 'G1 Old Generation'
+ // Note: Garbage collector name is generally obtained via
+ // [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).
+ JvmGcNameKey = attribute.Key("jvm.gc.name")
+
+ // JvmMemoryPoolNameKey is the attribute Key conforming to the
+ // "jvm.memory.pool.name" semantic conventions. It represents the name of
+ // the memory pool.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space'
+ // Note: Pool names are generally obtained via
+ // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).
+ JvmMemoryPoolNameKey = attribute.Key("jvm.memory.pool.name")
+
+ // JvmMemoryTypeKey is the attribute Key conforming to the
+ // "jvm.memory.type" semantic conventions. It represents the type of
+ // memory.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'heap', 'non_heap'
+ JvmMemoryTypeKey = attribute.Key("jvm.memory.type")
+
+ // JvmThreadDaemonKey is the attribute Key conforming to the
+ // "jvm.thread.daemon" semantic conventions. It represents the whether the
+ // thread is daemon or not.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ JvmThreadDaemonKey = attribute.Key("jvm.thread.daemon")
+
+ // JvmThreadStateKey is the attribute Key conforming to the
+ // "jvm.thread.state" semantic conventions. It represents the state of the
+ // thread.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'runnable', 'blocked'
+ JvmThreadStateKey = attribute.Key("jvm.thread.state")
+)
+
+var (
+ // Heap memory
+ JvmMemoryTypeHeap = JvmMemoryTypeKey.String("heap")
+ // Non-heap memory
+ JvmMemoryTypeNonHeap = JvmMemoryTypeKey.String("non_heap")
+)
+
+var (
+ // A thread that has not yet started is in this state
+ JvmThreadStateNew = JvmThreadStateKey.String("new")
+ // A thread executing in the Java virtual machine is in this state
+ JvmThreadStateRunnable = JvmThreadStateKey.String("runnable")
+ // A thread that is blocked waiting for a monitor lock is in this state
+ JvmThreadStateBlocked = JvmThreadStateKey.String("blocked")
+ // A thread that is waiting indefinitely for another thread to perform a particular action is in this state
+ JvmThreadStateWaiting = JvmThreadStateKey.String("waiting")
+ // A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state
+ JvmThreadStateTimedWaiting = JvmThreadStateKey.String("timed_waiting")
+ // A thread that has exited is in this state
+ JvmThreadStateTerminated = JvmThreadStateKey.String("terminated")
+)
+
+// JvmBufferPoolName returns an attribute KeyValue conforming to the
+// "jvm.buffer.pool.name" semantic conventions. It represents the name of the
+// buffer pool.
+func JvmBufferPoolName(val string) attribute.KeyValue {
+ return JvmBufferPoolNameKey.String(val)
+}
+
+// JvmGcAction returns an attribute KeyValue conforming to the
+// "jvm.gc.action" semantic conventions. It represents the name of the garbage
+// collector action.
+func JvmGcAction(val string) attribute.KeyValue {
+ return JvmGcActionKey.String(val)
+}
+
+// JvmGcName returns an attribute KeyValue conforming to the "jvm.gc.name"
+// semantic conventions. It represents the name of the garbage collector.
+func JvmGcName(val string) attribute.KeyValue {
+ return JvmGcNameKey.String(val)
+}
+
+// JvmMemoryPoolName returns an attribute KeyValue conforming to the
+// "jvm.memory.pool.name" semantic conventions. It represents the name of the
+// memory pool.
+func JvmMemoryPoolName(val string) attribute.KeyValue {
+ return JvmMemoryPoolNameKey.String(val)
+}
+
+// JvmThreadDaemon returns an attribute KeyValue conforming to the
+// "jvm.thread.daemon" semantic conventions. It represents the whether the
+// thread is daemon or not.
+func JvmThreadDaemon(val bool) attribute.KeyValue {
+ return JvmThreadDaemonKey.Bool(val)
+}
+
+// Kubernetes resource attributes.
+const (
+ // K8SClusterNameKey is the attribute Key conforming to the
+ // "k8s.cluster.name" semantic conventions. It represents the name of the
+ // cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-cluster'
+ K8SClusterNameKey = attribute.Key("k8s.cluster.name")
+
+ // K8SClusterUIDKey is the attribute Key conforming to the
+ // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for
+ // the cluster, set to the UID of the `kube-system` namespace.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d'
+ // Note: K8S doesn't have support for obtaining a cluster ID. If this is
+ // ever
+ // added, we will recommend collecting the `k8s.cluster.uid` through the
+ // official APIs. In the meantime, we are able to use the `uid` of the
+ // `kube-system` namespace as a proxy for cluster ID. Read on for the
+ // rationale.
+ //
+ // Every object created in a K8S cluster is assigned a distinct UID. The
+ // `kube-system` namespace is used by Kubernetes itself and will exist
+ // for the lifetime of the cluster. Using the `uid` of the `kube-system`
+ // namespace is a reasonable proxy for the K8S ClusterID as it will only
+ // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are
+ // UUIDs as standardized by
+ // [ISO/IEC 9834-8 and ITU-T
+ // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html).
+ // Which states:
+ //
+ // > If generated according to one of the mechanisms defined in Rec.
+ // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be
+ // different from all other UUIDs generated before 3603 A.D., or is
+ // extremely likely to be different (depending on the mechanism chosen).
+ //
+ // Therefore, UIDs between clusters should be extremely unlikely to
+ // conflict.
+ K8SClusterUIDKey = attribute.Key("k8s.cluster.uid")
+
+ // K8SContainerNameKey is the attribute Key conforming to the
+ // "k8s.container.name" semantic conventions. It represents the name of the
+ // Container from Pod specification, must be unique within a Pod. Container
+ // runtime usually uses different globally unique name (`container.name`).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'redis'
+ K8SContainerNameKey = attribute.Key("k8s.container.name")
+
+ // K8SContainerRestartCountKey is the attribute Key conforming to the
+ // "k8s.container.restart_count" semantic conventions. It represents the
+ // number of times the container was restarted. This attribute can be used
+ // to identify a particular container (running or stopped) within a
+ // container spec.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count")
+
+ // K8SContainerStatusLastTerminatedReasonKey is the attribute Key
+ // conforming to the "k8s.container.status.last_terminated_reason" semantic
+ // conventions. It represents the last terminated reason of the Container.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Evicted', 'Error'
+ K8SContainerStatusLastTerminatedReasonKey = attribute.Key("k8s.container.status.last_terminated_reason")
+
+ // K8SCronJobNameKey is the attribute Key conforming to the
+ // "k8s.cronjob.name" semantic conventions. It represents the name of the
+ // CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SCronJobNameKey = attribute.Key("k8s.cronjob.name")
+
+ // K8SCronJobUIDKey is the attribute Key conforming to the
+ // "k8s.cronjob.uid" semantic conventions. It represents the UID of the
+ // CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid")
+
+ // K8SDaemonSetNameKey is the attribute Key conforming to the
+ // "k8s.daemonset.name" semantic conventions. It represents the name of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name")
+
+ // K8SDaemonSetUIDKey is the attribute Key conforming to the
+ // "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid")
+
+ // K8SDeploymentNameKey is the attribute Key conforming to the
+ // "k8s.deployment.name" semantic conventions. It represents the name of
+ // the Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SDeploymentNameKey = attribute.Key("k8s.deployment.name")
+
+ // K8SDeploymentUIDKey is the attribute Key conforming to the
+ // "k8s.deployment.uid" semantic conventions. It represents the UID of the
+ // Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid")
+
+ // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name"
+ // semantic conventions. It represents the name of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SJobNameKey = attribute.Key("k8s.job.name")
+
+ // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid"
+ // semantic conventions. It represents the UID of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SJobUIDKey = attribute.Key("k8s.job.uid")
+
+ // K8SNamespaceNameKey is the attribute Key conforming to the
+ // "k8s.namespace.name" semantic conventions. It represents the name of the
+ // namespace that the pod is running in.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'default'
+ K8SNamespaceNameKey = attribute.Key("k8s.namespace.name")
+
+ // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name"
+ // semantic conventions. It represents the name of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'node-1'
+ K8SNodeNameKey = attribute.Key("k8s.node.name")
+
+ // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid"
+ // semantic conventions. It represents the UID of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2'
+ K8SNodeUIDKey = attribute.Key("k8s.node.uid")
+
+ // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name"
+ // semantic conventions. It represents the name of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-pod-autoconf'
+ K8SPodNameKey = attribute.Key("k8s.pod.name")
+
+ // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid"
+ // semantic conventions. It represents the UID of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SPodUIDKey = attribute.Key("k8s.pod.uid")
+
+ // K8SReplicaSetNameKey is the attribute Key conforming to the
+ // "k8s.replicaset.name" semantic conventions. It represents the name of
+ // the ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name")
+
+ // K8SReplicaSetUIDKey is the attribute Key conforming to the
+ // "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+ // ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid")
+
+ // K8SStatefulSetNameKey is the attribute Key conforming to the
+ // "k8s.statefulset.name" semantic conventions. It represents the name of
+ // the StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name")
+
+ // K8SStatefulSetUIDKey is the attribute Key conforming to the
+ // "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+ // StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid")
+)
+
+// K8SClusterName returns an attribute KeyValue conforming to the
+// "k8s.cluster.name" semantic conventions. It represents the name of the
+// cluster.
+func K8SClusterName(val string) attribute.KeyValue {
+ return K8SClusterNameKey.String(val)
+}
+
+// K8SClusterUID returns an attribute KeyValue conforming to the
+// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the
+// cluster, set to the UID of the `kube-system` namespace.
+func K8SClusterUID(val string) attribute.KeyValue {
+ return K8SClusterUIDKey.String(val)
+}
+
+// K8SContainerName returns an attribute KeyValue conforming to the
+// "k8s.container.name" semantic conventions. It represents the name of the
+// Container from Pod specification, must be unique within a Pod. Container
+// runtime usually uses different globally unique name (`container.name`).
+func K8SContainerName(val string) attribute.KeyValue {
+ return K8SContainerNameKey.String(val)
+}
+
+// K8SContainerRestartCount returns an attribute KeyValue conforming to the
+// "k8s.container.restart_count" semantic conventions. It represents the number
+// of times the container was restarted. This attribute can be used to identify
+// a particular container (running or stopped) within a container spec.
+func K8SContainerRestartCount(val int) attribute.KeyValue {
+ return K8SContainerRestartCountKey.Int(val)
+}
+
+// K8SContainerStatusLastTerminatedReason returns an attribute KeyValue
+// conforming to the "k8s.container.status.last_terminated_reason" semantic
+// conventions. It represents the last terminated reason of the Container.
+func K8SContainerStatusLastTerminatedReason(val string) attribute.KeyValue {
+ return K8SContainerStatusLastTerminatedReasonKey.String(val)
+}
+
+// K8SCronJobName returns an attribute KeyValue conforming to the
+// "k8s.cronjob.name" semantic conventions. It represents the name of the
+// CronJob.
+func K8SCronJobName(val string) attribute.KeyValue {
+ return K8SCronJobNameKey.String(val)
+}
+
+// K8SCronJobUID returns an attribute KeyValue conforming to the
+// "k8s.cronjob.uid" semantic conventions. It represents the UID of the
+// CronJob.
+func K8SCronJobUID(val string) attribute.KeyValue {
+ return K8SCronJobUIDKey.String(val)
+}
+
+// K8SDaemonSetName returns an attribute KeyValue conforming to the
+// "k8s.daemonset.name" semantic conventions. It represents the name of the
+// DaemonSet.
+func K8SDaemonSetName(val string) attribute.KeyValue {
+ return K8SDaemonSetNameKey.String(val)
+}
+
+// K8SDaemonSetUID returns an attribute KeyValue conforming to the
+// "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+// DaemonSet.
+func K8SDaemonSetUID(val string) attribute.KeyValue {
+ return K8SDaemonSetUIDKey.String(val)
+}
+
+// K8SDeploymentName returns an attribute KeyValue conforming to the
+// "k8s.deployment.name" semantic conventions. It represents the name of the
+// Deployment.
+func K8SDeploymentName(val string) attribute.KeyValue {
+ return K8SDeploymentNameKey.String(val)
+}
+
+// K8SDeploymentUID returns an attribute KeyValue conforming to the
+// "k8s.deployment.uid" semantic conventions. It represents the UID of the
+// Deployment.
+func K8SDeploymentUID(val string) attribute.KeyValue {
+ return K8SDeploymentUIDKey.String(val)
+}
+
+// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name"
+// semantic conventions. It represents the name of the Job.
+func K8SJobName(val string) attribute.KeyValue {
+ return K8SJobNameKey.String(val)
+}
+
+// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid"
+// semantic conventions. It represents the UID of the Job.
+func K8SJobUID(val string) attribute.KeyValue {
+ return K8SJobUIDKey.String(val)
+}
+
+// K8SNamespaceName returns an attribute KeyValue conforming to the
+// "k8s.namespace.name" semantic conventions. It represents the name of the
+// namespace that the pod is running in.
+func K8SNamespaceName(val string) attribute.KeyValue {
+ return K8SNamespaceNameKey.String(val)
+}
+
+// K8SNodeName returns an attribute KeyValue conforming to the
+// "k8s.node.name" semantic conventions. It represents the name of the Node.
+func K8SNodeName(val string) attribute.KeyValue {
+ return K8SNodeNameKey.String(val)
+}
+
+// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid"
+// semantic conventions. It represents the UID of the Node.
+func K8SNodeUID(val string) attribute.KeyValue {
+ return K8SNodeUIDKey.String(val)
+}
+
+// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name"
+// semantic conventions. It represents the name of the Pod.
+func K8SPodName(val string) attribute.KeyValue {
+ return K8SPodNameKey.String(val)
+}
+
+// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid"
+// semantic conventions. It represents the UID of the Pod.
+func K8SPodUID(val string) attribute.KeyValue {
+ return K8SPodUIDKey.String(val)
+}
+
+// K8SReplicaSetName returns an attribute KeyValue conforming to the
+// "k8s.replicaset.name" semantic conventions. It represents the name of the
+// ReplicaSet.
+func K8SReplicaSetName(val string) attribute.KeyValue {
+ return K8SReplicaSetNameKey.String(val)
+}
+
+// K8SReplicaSetUID returns an attribute KeyValue conforming to the
+// "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+// ReplicaSet.
+func K8SReplicaSetUID(val string) attribute.KeyValue {
+ return K8SReplicaSetUIDKey.String(val)
+}
+
+// K8SStatefulSetName returns an attribute KeyValue conforming to the
+// "k8s.statefulset.name" semantic conventions. It represents the name of the
+// StatefulSet.
+func K8SStatefulSetName(val string) attribute.KeyValue {
+ return K8SStatefulSetNameKey.String(val)
+}
+
+// K8SStatefulSetUID returns an attribute KeyValue conforming to the
+// "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+// StatefulSet.
+func K8SStatefulSetUID(val string) attribute.KeyValue {
+ return K8SStatefulSetUIDKey.String(val)
+}
+
+// Log attributes
+const (
+ // LogIostreamKey is the attribute Key conforming to the "log.iostream"
+ // semantic conventions. It represents the stream associated with the log.
+ // See below for a list of well-known values.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ LogIostreamKey = attribute.Key("log.iostream")
+)
+
+var (
+ // Logs from stdout stream
+ LogIostreamStdout = LogIostreamKey.String("stdout")
+ // Events from stderr stream
+ LogIostreamStderr = LogIostreamKey.String("stderr")
+)
+
+// Attributes for a file to which log was emitted.
+const (
+ // LogFileNameKey is the attribute Key conforming to the "log.file.name"
+ // semantic conventions. It represents the basename of the file.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'audit.log'
+ LogFileNameKey = attribute.Key("log.file.name")
+
+ // LogFileNameResolvedKey is the attribute Key conforming to the
+ // "log.file.name_resolved" semantic conventions. It represents the
+ // basename of the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'uuid.log'
+ LogFileNameResolvedKey = attribute.Key("log.file.name_resolved")
+
+ // LogFilePathKey is the attribute Key conforming to the "log.file.path"
+ // semantic conventions. It represents the full path to the file.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/var/log/mysql/audit.log'
+ LogFilePathKey = attribute.Key("log.file.path")
+
+ // LogFilePathResolvedKey is the attribute Key conforming to the
+ // "log.file.path_resolved" semantic conventions. It represents the full
+ // path to the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/var/lib/docker/uuid.log'
+ LogFilePathResolvedKey = attribute.Key("log.file.path_resolved")
+)
+
+// LogFileName returns an attribute KeyValue conforming to the
+// "log.file.name" semantic conventions. It represents the basename of the
+// file.
+func LogFileName(val string) attribute.KeyValue {
+ return LogFileNameKey.String(val)
+}
+
+// LogFileNameResolved returns an attribute KeyValue conforming to the
+// "log.file.name_resolved" semantic conventions. It represents the basename of
+// the file, with symlinks resolved.
+func LogFileNameResolved(val string) attribute.KeyValue {
+ return LogFileNameResolvedKey.String(val)
+}
+
+// LogFilePath returns an attribute KeyValue conforming to the
+// "log.file.path" semantic conventions. It represents the full path to the
+// file.
+func LogFilePath(val string) attribute.KeyValue {
+ return LogFilePathKey.String(val)
+}
+
+// LogFilePathResolved returns an attribute KeyValue conforming to the
+// "log.file.path_resolved" semantic conventions. It represents the full path
+// to the file, with symlinks resolved.
+func LogFilePathResolved(val string) attribute.KeyValue {
+ return LogFilePathResolvedKey.String(val)
+}
+
+// The generic attributes that may be used in any Log Record.
+const (
+ // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
+ // semantic conventions. It represents a unique identifier for the Log
+ // Record.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
+ // Note: If an id is provided, other log records with the same id will be
+ // considered duplicates and can be removed safely. This means, that two
+ // distinguishable log records MUST have different values.
+ // The id MAY be an [Universally Unique Lexicographically Sortable
+ // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
+ // (e.g. UUID) may be used as needed.
+ LogRecordUIDKey = attribute.Key("log.record.uid")
+)
+
+// LogRecordUID returns an attribute KeyValue conforming to the
+// "log.record.uid" semantic conventions. It represents a unique identifier for
+// the Log Record.
+func LogRecordUID(val string) attribute.KeyValue {
+ return LogRecordUIDKey.String(val)
+}
+
+// Attributes describing telemetry around messaging systems and messaging
+// activities.
+const (
+ // MessagingBatchMessageCountKey is the attribute Key conforming to the
+ // "messaging.batch.message_count" semantic conventions. It represents the
+ // number of messages sent, received, or processed in the scope of the
+ // batching operation.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1, 2
+ // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on
+ // spans that operate with a single message. When a messaging client
+ // library supports both batch and single-message API for the same
+ // operation, instrumentations SHOULD use `messaging.batch.message_count`
+ // for batching APIs and SHOULD NOT use it for single-message APIs.
+ MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
+
+ // MessagingClientIDKey is the attribute Key conforming to the
+ // "messaging.client.id" semantic conventions. It represents a unique
+ // identifier for the client that consumes or produces a message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'client-5', 'myhost@8742@s8083jm'
+ MessagingClientIDKey = attribute.Key("messaging.client.id")
+
+ // MessagingDestinationAnonymousKey is the attribute Key conforming to the
+ // "messaging.destination.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message destination is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
+
+ // MessagingDestinationNameKey is the attribute Key conforming to the
+ // "messaging.destination.name" semantic conventions. It represents the
+ // message destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Destination name SHOULD uniquely identify a specific queue, topic
+ // or other entity within the broker. If
+ // the broker doesn't have such notion, the destination name SHOULD
+ // uniquely identify the broker.
+ MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
+
+ // MessagingDestinationPartitionIDKey is the attribute Key conforming to
+ // the "messaging.destination.partition.id" semantic conventions. It
+ // represents the identifier of the partition messages are sent to or
+ // received from, unique within the `messaging.destination.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1'
+ MessagingDestinationPartitionIDKey = attribute.Key("messaging.destination.partition.id")
+
+ // MessagingDestinationTemplateKey is the attribute Key conforming to the
+ // "messaging.destination.template" semantic conventions. It represents the
+ // low cardinality representation of the messaging destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/customers/{customerID}'
+ // Note: Destination names could be constructed from templates. An example
+ // would be a destination name involving a user name or product id.
+ // Although the destination name in this case is of high cardinality, the
+ // underlying template is of low cardinality and can be effectively used
+ // for grouping and aggregation.
+ MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
+
+ // MessagingDestinationTemporaryKey is the attribute Key conforming to the
+ // "messaging.destination.temporary" semantic conventions. It represents a
+ // boolean that is true if the message destination is temporary and might
+ // not exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
+
+ // MessagingDestinationPublishAnonymousKey is the attribute Key conforming
+ // to the "messaging.destination_publish.anonymous" semantic conventions.
+ // It represents a boolean that is true if the publish message destination
+ // is anonymous (could be unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationPublishAnonymousKey = attribute.Key("messaging.destination_publish.anonymous")
+
+ // MessagingDestinationPublishNameKey is the attribute Key conforming to
+ // the "messaging.destination_publish.name" semantic conventions. It
+ // represents the name of the original destination the message was
+ // published to
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: The name SHOULD uniquely identify a specific queue, topic, or
+ // other entity within the broker. If
+ // the broker doesn't have such notion, the original destination name
+ // SHOULD uniquely identify the broker.
+ MessagingDestinationPublishNameKey = attribute.Key("messaging.destination_publish.name")
+
+ // MessagingMessageBodySizeKey is the attribute Key conforming to the
+ // "messaging.message.body.size" semantic conventions. It represents the
+ // size of the message body in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1439
+ // Note: This can refer to both the compressed or uncompressed body size.
+ // If both sizes are known, the uncompressed
+ // body size should be used.
+ MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size")
+
+ // MessagingMessageConversationIDKey is the attribute Key conforming to the
+ // "messaging.message.conversation_id" semantic conventions. It represents
+ // the conversation ID identifying the conversation to which the message
+ // belongs, represented as a string. Sometimes called "Correlation ID".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyConversationID'
+ MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
+
+ // MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the
+ // "messaging.message.envelope.size" semantic conventions. It represents
+ // the size of the message body and metadata in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2738
+ // Note: This can refer to both the compressed or uncompressed size. If
+ // both sizes are known, the uncompressed
+ // size should be used.
+ MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size")
+
+ // MessagingMessageIDKey is the attribute Key conforming to the
+ // "messaging.message.id" semantic conventions. It represents a value used
+ // by the messaging system as an identifier for the message, represented as
+ // a string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
+ MessagingMessageIDKey = attribute.Key("messaging.message.id")
+
+ // MessagingOperationNameKey is the attribute Key conforming to the
+ // "messaging.operation.name" semantic conventions. It represents the
+ // system-specific name of the messaging operation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ack', 'nack', 'send'
+ MessagingOperationNameKey = attribute.Key("messaging.operation.name")
+
+ // MessagingOperationTypeKey is the attribute Key conforming to the
+ // "messaging.operation.type" semantic conventions. It represents a string
+ // identifying the type of the messaging operation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: If a custom value is used, it MUST be of low cardinality.
+ MessagingOperationTypeKey = attribute.Key("messaging.operation.type")
+
+ // MessagingSystemKey is the attribute Key conforming to the
+ // "messaging.system" semantic conventions. It represents the messaging
+ // system as identified by the client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The actual messaging system may differ from the one known by the
+ // client. For example, when using Kafka client libraries to communicate
+ // with Azure Event Hubs, the `messaging.system` is set to `kafka` based on
+ // the instrumentation's best knowledge.
+ MessagingSystemKey = attribute.Key("messaging.system")
+)
+
+var (
+ // One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created
+ MessagingOperationTypePublish = MessagingOperationTypeKey.String("publish")
+ // A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios
+ MessagingOperationTypeCreate = MessagingOperationTypeKey.String("create")
+ // One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages
+ MessagingOperationTypeReceive = MessagingOperationTypeKey.String("receive")
+ // One or more messages are delivered to or processed by a consumer
+ MessagingOperationTypeDeliver = MessagingOperationTypeKey.String("process")
+ // One or more messages are settled
+ MessagingOperationTypeSettle = MessagingOperationTypeKey.String("settle")
+)
+
+var (
+ // Apache ActiveMQ
+ MessagingSystemActivemq = MessagingSystemKey.String("activemq")
+ // Amazon Simple Queue Service (SQS)
+ MessagingSystemAWSSqs = MessagingSystemKey.String("aws_sqs")
+ // Azure Event Grid
+ MessagingSystemEventgrid = MessagingSystemKey.String("eventgrid")
+ // Azure Event Hubs
+ MessagingSystemEventhubs = MessagingSystemKey.String("eventhubs")
+ // Azure Service Bus
+ MessagingSystemServicebus = MessagingSystemKey.String("servicebus")
+ // Google Cloud Pub/Sub
+ MessagingSystemGCPPubsub = MessagingSystemKey.String("gcp_pubsub")
+ // Java Message Service
+ MessagingSystemJms = MessagingSystemKey.String("jms")
+ // Apache Kafka
+ MessagingSystemKafka = MessagingSystemKey.String("kafka")
+ // RabbitMQ
+ MessagingSystemRabbitmq = MessagingSystemKey.String("rabbitmq")
+ // Apache RocketMQ
+ MessagingSystemRocketmq = MessagingSystemKey.String("rocketmq")
+)
+
+// MessagingBatchMessageCount returns an attribute KeyValue conforming to
+// the "messaging.batch.message_count" semantic conventions. It represents the
+// number of messages sent, received, or processed in the scope of the batching
+// operation.
+func MessagingBatchMessageCount(val int) attribute.KeyValue {
+ return MessagingBatchMessageCountKey.Int(val)
+}
+
+// MessagingClientID returns an attribute KeyValue conforming to the
+// "messaging.client.id" semantic conventions. It represents a unique
+// identifier for the client that consumes or produces a message.
+func MessagingClientID(val string) attribute.KeyValue {
+ return MessagingClientIDKey.String(val)
+}
+
+// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
+// the "messaging.destination.anonymous" semantic conventions. It represents a
+// boolean that is true if the message destination is anonymous (could be
+// unnamed or have auto-generated name).
+func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationName returns an attribute KeyValue conforming to the
+// "messaging.destination.name" semantic conventions. It represents the message
+// destination name
+func MessagingDestinationName(val string) attribute.KeyValue {
+ return MessagingDestinationNameKey.String(val)
+}
+
+// MessagingDestinationPartitionID returns an attribute KeyValue conforming
+// to the "messaging.destination.partition.id" semantic conventions. It
+// represents the identifier of the partition messages are sent to or received
+// from, unique within the `messaging.destination.name`.
+func MessagingDestinationPartitionID(val string) attribute.KeyValue {
+ return MessagingDestinationPartitionIDKey.String(val)
+}
+
+// MessagingDestinationTemplate returns an attribute KeyValue conforming to
+// the "messaging.destination.template" semantic conventions. It represents the
+// low cardinality representation of the messaging destination name
+func MessagingDestinationTemplate(val string) attribute.KeyValue {
+ return MessagingDestinationTemplateKey.String(val)
+}
+
+// MessagingDestinationTemporary returns an attribute KeyValue conforming to
+// the "messaging.destination.temporary" semantic conventions. It represents a
+// boolean that is true if the message destination is temporary and might not
+// exist anymore after messages are processed.
+func MessagingDestinationTemporary(val bool) attribute.KeyValue {
+ return MessagingDestinationTemporaryKey.Bool(val)
+}
+
+// MessagingDestinationPublishAnonymous returns an attribute KeyValue
+// conforming to the "messaging.destination_publish.anonymous" semantic
+// conventions. It represents a boolean that is true if the publish message
+// destination is anonymous (could be unnamed or have auto-generated name).
+func MessagingDestinationPublishAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationPublishAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationPublishName returns an attribute KeyValue conforming
+// to the "messaging.destination_publish.name" semantic conventions. It
+// represents the name of the original destination the message was published to
+func MessagingDestinationPublishName(val string) attribute.KeyValue {
+ return MessagingDestinationPublishNameKey.String(val)
+}
+
+// MessagingMessageBodySize returns an attribute KeyValue conforming to the
+// "messaging.message.body.size" semantic conventions. It represents the size
+// of the message body in bytes.
+func MessagingMessageBodySize(val int) attribute.KeyValue {
+ return MessagingMessageBodySizeKey.Int(val)
+}
+
+// MessagingMessageConversationID returns an attribute KeyValue conforming
+// to the "messaging.message.conversation_id" semantic conventions. It
+// represents the conversation ID identifying the conversation to which the
+// message belongs, represented as a string. Sometimes called "Correlation ID".
+func MessagingMessageConversationID(val string) attribute.KeyValue {
+ return MessagingMessageConversationIDKey.String(val)
+}
+
+// MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to
+// the "messaging.message.envelope.size" semantic conventions. It represents
+// the size of the message body and metadata in bytes.
+func MessagingMessageEnvelopeSize(val int) attribute.KeyValue {
+ return MessagingMessageEnvelopeSizeKey.Int(val)
+}
+
+// MessagingMessageID returns an attribute KeyValue conforming to the
+// "messaging.message.id" semantic conventions. It represents a value used by
+// the messaging system as an identifier for the message, represented as a
+// string.
+func MessagingMessageID(val string) attribute.KeyValue {
+ return MessagingMessageIDKey.String(val)
+}
+
+// MessagingOperationName returns an attribute KeyValue conforming to the
+// "messaging.operation.name" semantic conventions. It represents the
+// system-specific name of the messaging operation.
+func MessagingOperationName(val string) attribute.KeyValue {
+ return MessagingOperationNameKey.String(val)
+}
+
+// This group describes attributes specific to Apache Kafka.
+const (
+ // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
+ // "messaging.kafka.consumer.group" semantic conventions. It represents the
+ // name of the Kafka Consumer Group that is handling the message. Only
+ // applies to consumers, not producers.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-group'
+ MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
+
+ // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
+ // "messaging.kafka.message.key" semantic conventions. It represents the
+ // message keys in Kafka are used for grouping alike messages to ensure
+ // they're processed on the same partition. They differ from
+ // `messaging.message.id` in that they're not unique. If the key is `null`,
+ // the attribute MUST NOT be set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myKey'
+ // Note: If the key type is not string, it's string representation has to
+ // be supplied for the attribute. If the key has no unambiguous, canonical
+ // string form, don't include its value.
+ MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
+
+ // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
+ // "messaging.kafka.message.offset" semantic conventions. It represents the
+ // offset of a record in the corresponding Kafka partition.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
+
+ // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
+ // "messaging.kafka.message.tombstone" semantic conventions. It represents
+ // a boolean that is true if the message is a tombstone.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
+)
+
+// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
+// the "messaging.kafka.consumer.group" semantic conventions. It represents the
+// name of the Kafka Consumer Group that is handling the message. Only applies
+// to consumers, not producers.
+func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
+ return MessagingKafkaConsumerGroupKey.String(val)
+}
+
+// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
+// "messaging.kafka.message.key" semantic conventions. It represents the
+// message keys in Kafka are used for grouping alike messages to ensure they're
+// processed on the same partition. They differ from `messaging.message.id` in
+// that they're not unique. If the key is `null`, the attribute MUST NOT be
+// set.
+func MessagingKafkaMessageKey(val string) attribute.KeyValue {
+ return MessagingKafkaMessageKeyKey.String(val)
+}
+
+// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
+// the "messaging.kafka.message.offset" semantic conventions. It represents the
+// offset of a record in the corresponding Kafka partition.
+func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
+ return MessagingKafkaMessageOffsetKey.Int(val)
+}
+
+// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
+// to the "messaging.kafka.message.tombstone" semantic conventions. It
+// represents a boolean that is true if the message is a tombstone.
+func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
+ return MessagingKafkaMessageTombstoneKey.Bool(val)
+}
+
+// This group describes attributes specific to RabbitMQ.
+const (
+ // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
+ // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+ // conventions. It represents the rabbitMQ message routing key.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myKey'
+ MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
+
+ // MessagingRabbitmqMessageDeliveryTagKey is the attribute Key conforming
+ // to the "messaging.rabbitmq.message.delivery_tag" semantic conventions.
+ // It represents the rabbitMQ message delivery tag
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 123
+ MessagingRabbitmqMessageDeliveryTagKey = attribute.Key("messaging.rabbitmq.message.delivery_tag")
+)
+
+// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+// conventions. It represents the rabbitMQ message routing key.
+func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
+ return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
+}
+
+// MessagingRabbitmqMessageDeliveryTag returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.message.delivery_tag" semantic
+// conventions. It represents the rabbitMQ message delivery tag
+func MessagingRabbitmqMessageDeliveryTag(val int) attribute.KeyValue {
+ return MessagingRabbitmqMessageDeliveryTagKey.Int(val)
+}
+
+// This group describes attributes specific to RocketMQ.
+const (
+ // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_group" semantic conventions. It represents
+ // the name of the RocketMQ producer/consumer group that is handling the
+ // message. The client type is identified by the SpanKind.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myConsumerGroup'
+ MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
+
+ // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
+ // the "messaging.rocketmq.consumption_model" semantic conventions. It
+ // represents the model of message consumption. This only applies to
+ // consumer spans.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
+
+ // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+ // conventions. It represents the delay time level for delay message, which
+ // determines the message delay time.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3
+ MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
+
+ // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delivery_timestamp"
+ // semantic conventions. It represents the timestamp in milliseconds that
+ // the delay message is expected to be delivered to consumer.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1665987217045
+ MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
+
+ // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.group" semantic conventions. It represents
+ // the it is essential for FIFO message. Messages that belong to the same
+ // message group are always processed one by one within the same consumer
+ // group.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myMessageGroup'
+ MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
+
+ // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.keys" semantic conventions. It represents
+ // the key(s) of message, another way to mark message besides message id.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'keyA', 'keyB'
+ MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
+
+ // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.tag" semantic conventions. It represents the
+ // secondary classifier of message besides topic.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'tagA'
+ MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
+
+ // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.type" semantic conventions. It represents
+ // the type of message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
+
+ // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
+ // "messaging.rocketmq.namespace" semantic conventions. It represents the
+ // namespace of RocketMQ resources, resources in different namespaces are
+ // individual.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myNamespace'
+ MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
+)
+
+var (
+ // Clustering consumption model
+ MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
+ // Broadcasting consumption model
+ MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
+)
+
+var (
+ // Normal message
+ MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
+ // FIFO message
+ MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
+ // Delay message
+ MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
+ // Transaction message
+ MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
+)
+
+// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.client_group" semantic conventions. It represents
+// the name of the RocketMQ producer/consumer group that is handling the
+// message. The client type is identified by the SpanKind.
+func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqClientGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+// conventions. It represents the delay time level for delay message, which
+// determines the message delay time.
+func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
+}
+
+// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
+// conventions. It represents the timestamp in milliseconds that the delay
+// message is expected to be delivered to consumer.
+func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
+}
+
+// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.group" semantic conventions. It represents
+// the it is essential for FIFO message. Messages that belong to the same
+// message group are always processed one by one within the same consumer
+// group.
+func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.keys" semantic conventions. It represents
+// the key(s) of message, another way to mark message besides message id.
+func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
+ return MessagingRocketmqMessageKeysKey.StringSlice(val)
+}
+
+// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
+// secondary classifier of message besides topic.
+func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageTagKey.String(val)
+}
+
+// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.namespace" semantic conventions. It represents the
+// namespace of RocketMQ resources, resources in different namespaces are
+// individual.
+func MessagingRocketmqNamespace(val string) attribute.KeyValue {
+ return MessagingRocketmqNamespaceKey.String(val)
+}
+
+// This group describes attributes specific to GCP Pub/Sub.
+const (
+ // MessagingGCPPubsubMessageAckDeadlineKey is the attribute Key conforming
+ // to the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions.
+ // It represents the ack deadline in seconds set for the modify ack
+ // deadline request.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ MessagingGCPPubsubMessageAckDeadlineKey = attribute.Key("messaging.gcp_pubsub.message.ack_deadline")
+
+ // MessagingGCPPubsubMessageAckIDKey is the attribute Key conforming to the
+ // "messaging.gcp_pubsub.message.ack_id" semantic conventions. It
+ // represents the ack id for a given message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ack_id'
+ MessagingGCPPubsubMessageAckIDKey = attribute.Key("messaging.gcp_pubsub.message.ack_id")
+
+ // MessagingGCPPubsubMessageDeliveryAttemptKey is the attribute Key
+ // conforming to the "messaging.gcp_pubsub.message.delivery_attempt"
+ // semantic conventions. It represents the delivery attempt for a given
+ // message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2
+ MessagingGCPPubsubMessageDeliveryAttemptKey = attribute.Key("messaging.gcp_pubsub.message.delivery_attempt")
+
+ // MessagingGCPPubsubMessageOrderingKeyKey is the attribute Key conforming
+ // to the "messaging.gcp_pubsub.message.ordering_key" semantic conventions.
+ // It represents the ordering key for a given message. If the attribute is
+ // not present, the message does not have an ordering key.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ordering_key'
+ MessagingGCPPubsubMessageOrderingKeyKey = attribute.Key("messaging.gcp_pubsub.message.ordering_key")
+)
+
+// MessagingGCPPubsubMessageAckDeadline returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.ack_deadline" semantic
+// conventions. It represents the ack deadline in seconds set for the modify
+// ack deadline request.
+func MessagingGCPPubsubMessageAckDeadline(val int) attribute.KeyValue {
+ return MessagingGCPPubsubMessageAckDeadlineKey.Int(val)
+}
+
+// MessagingGCPPubsubMessageAckID returns an attribute KeyValue conforming
+// to the "messaging.gcp_pubsub.message.ack_id" semantic conventions. It
+// represents the ack id for a given message.
+func MessagingGCPPubsubMessageAckID(val string) attribute.KeyValue {
+ return MessagingGCPPubsubMessageAckIDKey.String(val)
+}
+
+// MessagingGCPPubsubMessageDeliveryAttempt returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.delivery_attempt" semantic
+// conventions. It represents the delivery attempt for a given message.
+func MessagingGCPPubsubMessageDeliveryAttempt(val int) attribute.KeyValue {
+ return MessagingGCPPubsubMessageDeliveryAttemptKey.Int(val)
+}
+
+// MessagingGCPPubsubMessageOrderingKey returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.ordering_key" semantic
+// conventions. It represents the ordering key for a given message. If the
+// attribute is not present, the message does not have an ordering key.
+func MessagingGCPPubsubMessageOrderingKey(val string) attribute.KeyValue {
+ return MessagingGCPPubsubMessageOrderingKeyKey.String(val)
+}
+
+// This group describes attributes specific to Azure Service Bus.
+const (
+ // MessagingServicebusDestinationSubscriptionNameKey is the attribute Key
+ // conforming to the "messaging.servicebus.destination.subscription_name"
+ // semantic conventions. It represents the name of the subscription in the
+ // topic messages are received from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mySubscription'
+ MessagingServicebusDestinationSubscriptionNameKey = attribute.Key("messaging.servicebus.destination.subscription_name")
+
+ // MessagingServicebusDispositionStatusKey is the attribute Key conforming
+ // to the "messaging.servicebus.disposition_status" semantic conventions.
+ // It represents the describes the [settlement
+ // type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingServicebusDispositionStatusKey = attribute.Key("messaging.servicebus.disposition_status")
+
+ // MessagingServicebusMessageDeliveryCountKey is the attribute Key
+ // conforming to the "messaging.servicebus.message.delivery_count" semantic
+ // conventions. It represents the number of deliveries that have been
+ // attempted for this message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2
+ MessagingServicebusMessageDeliveryCountKey = attribute.Key("messaging.servicebus.message.delivery_count")
+
+ // MessagingServicebusMessageEnqueuedTimeKey is the attribute Key
+ // conforming to the "messaging.servicebus.message.enqueued_time" semantic
+ // conventions. It represents the UTC epoch seconds at which the message
+ // has been accepted and stored in the entity.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1701393730
+ MessagingServicebusMessageEnqueuedTimeKey = attribute.Key("messaging.servicebus.message.enqueued_time")
+)
+
+var (
+ // Message is completed
+ MessagingServicebusDispositionStatusComplete = MessagingServicebusDispositionStatusKey.String("complete")
+ // Message is abandoned
+ MessagingServicebusDispositionStatusAbandon = MessagingServicebusDispositionStatusKey.String("abandon")
+ // Message is sent to dead letter queue
+ MessagingServicebusDispositionStatusDeadLetter = MessagingServicebusDispositionStatusKey.String("dead_letter")
+ // Message is deferred
+ MessagingServicebusDispositionStatusDefer = MessagingServicebusDispositionStatusKey.String("defer")
+)
+
+// MessagingServicebusDestinationSubscriptionName returns an attribute
+// KeyValue conforming to the
+// "messaging.servicebus.destination.subscription_name" semantic conventions.
+// It represents the name of the subscription in the topic messages are
+// received from.
+func MessagingServicebusDestinationSubscriptionName(val string) attribute.KeyValue {
+ return MessagingServicebusDestinationSubscriptionNameKey.String(val)
+}
+
+// MessagingServicebusMessageDeliveryCount returns an attribute KeyValue
+// conforming to the "messaging.servicebus.message.delivery_count" semantic
+// conventions. It represents the number of deliveries that have been attempted
+// for this message.
+func MessagingServicebusMessageDeliveryCount(val int) attribute.KeyValue {
+ return MessagingServicebusMessageDeliveryCountKey.Int(val)
+}
+
+// MessagingServicebusMessageEnqueuedTime returns an attribute KeyValue
+// conforming to the "messaging.servicebus.message.enqueued_time" semantic
+// conventions. It represents the UTC epoch seconds at which the message has
+// been accepted and stored in the entity.
+func MessagingServicebusMessageEnqueuedTime(val int) attribute.KeyValue {
+ return MessagingServicebusMessageEnqueuedTimeKey.Int(val)
+}
+
+// This group describes attributes specific to Azure Event Hubs.
+const (
+ // MessagingEventhubsConsumerGroupKey is the attribute Key conforming to
+ // the "messaging.eventhubs.consumer.group" semantic conventions. It
+ // represents the name of the consumer group the event consumer is
+ // associated with.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'indexer'
+ MessagingEventhubsConsumerGroupKey = attribute.Key("messaging.eventhubs.consumer.group")
+
+ // MessagingEventhubsMessageEnqueuedTimeKey is the attribute Key conforming
+ // to the "messaging.eventhubs.message.enqueued_time" semantic conventions.
+ // It represents the UTC epoch seconds at which the message has been
+ // accepted and stored in the entity.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1701393730
+ MessagingEventhubsMessageEnqueuedTimeKey = attribute.Key("messaging.eventhubs.message.enqueued_time")
+)
+
+// MessagingEventhubsConsumerGroup returns an attribute KeyValue conforming
+// to the "messaging.eventhubs.consumer.group" semantic conventions. It
+// represents the name of the consumer group the event consumer is associated
+// with.
+func MessagingEventhubsConsumerGroup(val string) attribute.KeyValue {
+ return MessagingEventhubsConsumerGroupKey.String(val)
+}
+
+// MessagingEventhubsMessageEnqueuedTime returns an attribute KeyValue
+// conforming to the "messaging.eventhubs.message.enqueued_time" semantic
+// conventions. It represents the UTC epoch seconds at which the message has
+// been accepted and stored in the entity.
+func MessagingEventhubsMessageEnqueuedTime(val int) attribute.KeyValue {
+ return MessagingEventhubsMessageEnqueuedTimeKey.Int(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetworkCarrierIccKey is the attribute Key conforming to the
+ // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+ // alpha-2 2-character country code associated with the mobile carrier
+ // network.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'DE'
+ NetworkCarrierIccKey = attribute.Key("network.carrier.icc")
+
+ // NetworkCarrierMccKey is the attribute Key conforming to the
+ // "network.carrier.mcc" semantic conventions. It represents the mobile
+ // carrier country code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '310'
+ NetworkCarrierMccKey = attribute.Key("network.carrier.mcc")
+
+ // NetworkCarrierMncKey is the attribute Key conforming to the
+ // "network.carrier.mnc" semantic conventions. It represents the mobile
+ // carrier network code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '001'
+ NetworkCarrierMncKey = attribute.Key("network.carrier.mnc")
+
+ // NetworkCarrierNameKey is the attribute Key conforming to the
+ // "network.carrier.name" semantic conventions. It represents the name of
+ // the mobile carrier.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'sprint'
+ NetworkCarrierNameKey = attribute.Key("network.carrier.name")
+
+ // NetworkConnectionSubtypeKey is the attribute Key conforming to the
+ // "network.connection.subtype" semantic conventions. It represents the
+ // this describes more details regarding the connection.type. It may be the
+ // type of cell technology connection, but it could be used for describing
+ // details about a wifi connection.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'LTE'
+ NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype")
+
+ // NetworkConnectionTypeKey is the attribute Key conforming to the
+ // "network.connection.type" semantic conventions. It represents the
+ // internet connection type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'wifi'
+ NetworkConnectionTypeKey = attribute.Key("network.connection.type")
+
+ // NetworkIoDirectionKey is the attribute Key conforming to the
+ // "network.io.direction" semantic conventions. It represents the network
+ // IO operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'transmit'
+ NetworkIoDirectionKey = attribute.Key("network.io.direction")
+
+ // NetworkLocalAddressKey is the attribute Key conforming to the
+ // "network.local.address" semantic conventions. It represents the local
+ // address of the network connection - IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '10.1.2.80', '/tmp/my.sock'
+ NetworkLocalAddressKey = attribute.Key("network.local.address")
+
+ // NetworkLocalPortKey is the attribute Key conforming to the
+ // "network.local.port" semantic conventions. It represents the local port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ NetworkLocalPortKey = attribute.Key("network.local.port")
+
+ // NetworkPeerAddressKey is the attribute Key conforming to the
+ // "network.peer.address" semantic conventions. It represents the peer
+ // address of the network connection - IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '10.1.2.80', '/tmp/my.sock'
+ NetworkPeerAddressKey = attribute.Key("network.peer.address")
+
+ // NetworkPeerPortKey is the attribute Key conforming to the
+ // "network.peer.port" semantic conventions. It represents the peer port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ NetworkPeerPortKey = attribute.Key("network.peer.port")
+
+ // NetworkProtocolNameKey is the attribute Key conforming to the
+ // "network.protocol.name" semantic conventions. It represents the [OSI
+ // application layer](https://osi-model.com/application-layer/) or non-OSI
+ // equivalent.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'amqp', 'http', 'mqtt'
+ // Note: The value SHOULD be normalized to lowercase.
+ NetworkProtocolNameKey = attribute.Key("network.protocol.name")
+
+ // NetworkProtocolVersionKey is the attribute Key conforming to the
+ // "network.protocol.version" semantic conventions. It represents the
+ // actual version of the protocol used for network communication.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '1.1', '2'
+ // Note: If protocol version is subject to negotiation (for example using
+ // [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute
+ // SHOULD be set to the negotiated version. If the actual protocol version
+ // is not known, this attribute SHOULD NOT be set.
+ NetworkProtocolVersionKey = attribute.Key("network.protocol.version")
+
+ // NetworkTransportKey is the attribute Key conforming to the
+ // "network.transport" semantic conventions. It represents the [OSI
+ // transport layer](https://osi-model.com/transport-layer/) or
+ // [inter-process communication
+ // method](https://wikipedia.org/wiki/Inter-process_communication).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'tcp', 'udp'
+ // Note: The value SHOULD be normalized to lowercase.
+ //
+ // Consider always setting the transport when setting a port number, since
+ // a port number is ambiguous without knowing the transport. For example
+ // different processes could be listening on TCP port 12345 and UDP port
+ // 12345.
+ NetworkTransportKey = attribute.Key("network.transport")
+
+ // NetworkTypeKey is the attribute Key conforming to the "network.type"
+ // semantic conventions. It represents the [OSI network
+ // layer](https://osi-model.com/network-layer/) or non-OSI equivalent.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'ipv4', 'ipv6'
+ // Note: The value SHOULD be normalized to lowercase.
+ NetworkTypeKey = attribute.Key("network.type")
+)
+
+var (
+ // GPRS
+ NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs")
+ // EDGE
+ NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge")
+ // UMTS
+ NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts")
+ // CDMA
+ NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma")
+ // EVDO Rel. 0
+ NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0")
+ // EVDO Rev. A
+ NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a")
+ // CDMA2000 1XRTT
+ NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt")
+ // HSDPA
+ NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa")
+ // HSUPA
+ NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa")
+ // HSPA
+ NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa")
+ // IDEN
+ NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden")
+ // EVDO Rev. B
+ NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b")
+ // LTE
+ NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte")
+ // EHRPD
+ NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd")
+ // HSPAP
+ NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap")
+ // GSM
+ NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm")
+ // TD-SCDMA
+ NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma")
+ // IWLAN
+ NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan")
+ // 5G NR (New Radio)
+ NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr")
+ // 5G NRNSA (New Radio Non-Standalone)
+ NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa")
+ // LTE CA
+ NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca")
+)
+
+var (
+ // wifi
+ NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi")
+ // wired
+ NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired")
+ // cell
+ NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell")
+ // unavailable
+ NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable")
+ // unknown
+ NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown")
+)
+
+var (
+ // transmit
+ NetworkIoDirectionTransmit = NetworkIoDirectionKey.String("transmit")
+ // receive
+ NetworkIoDirectionReceive = NetworkIoDirectionKey.String("receive")
+)
+
+var (
+ // TCP
+ NetworkTransportTCP = NetworkTransportKey.String("tcp")
+ // UDP
+ NetworkTransportUDP = NetworkTransportKey.String("udp")
+ // Named or anonymous pipe
+ NetworkTransportPipe = NetworkTransportKey.String("pipe")
+ // Unix domain socket
+ NetworkTransportUnix = NetworkTransportKey.String("unix")
+)
+
+var (
+ // IPv4
+ NetworkTypeIpv4 = NetworkTypeKey.String("ipv4")
+ // IPv6
+ NetworkTypeIpv6 = NetworkTypeKey.String("ipv6")
+)
+
+// NetworkCarrierIcc returns an attribute KeyValue conforming to the
+// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+// alpha-2 2-character country code associated with the mobile carrier network.
+func NetworkCarrierIcc(val string) attribute.KeyValue {
+ return NetworkCarrierIccKey.String(val)
+}
+
+// NetworkCarrierMcc returns an attribute KeyValue conforming to the
+// "network.carrier.mcc" semantic conventions. It represents the mobile carrier
+// country code.
+func NetworkCarrierMcc(val string) attribute.KeyValue {
+ return NetworkCarrierMccKey.String(val)
+}
+
+// NetworkCarrierMnc returns an attribute KeyValue conforming to the
+// "network.carrier.mnc" semantic conventions. It represents the mobile carrier
+// network code.
+func NetworkCarrierMnc(val string) attribute.KeyValue {
+ return NetworkCarrierMncKey.String(val)
+}
+
+// NetworkCarrierName returns an attribute KeyValue conforming to the
+// "network.carrier.name" semantic conventions. It represents the name of the
+// mobile carrier.
+func NetworkCarrierName(val string) attribute.KeyValue {
+ return NetworkCarrierNameKey.String(val)
+}
+
+// NetworkLocalAddress returns an attribute KeyValue conforming to the
+// "network.local.address" semantic conventions. It represents the local
+// address of the network connection - IP address or Unix domain socket name.
+func NetworkLocalAddress(val string) attribute.KeyValue {
+ return NetworkLocalAddressKey.String(val)
+}
+
+// NetworkLocalPort returns an attribute KeyValue conforming to the
+// "network.local.port" semantic conventions. It represents the local port
+// number of the network connection.
+func NetworkLocalPort(val int) attribute.KeyValue {
+ return NetworkLocalPortKey.Int(val)
+}
+
+// NetworkPeerAddress returns an attribute KeyValue conforming to the
+// "network.peer.address" semantic conventions. It represents the peer address
+// of the network connection - IP address or Unix domain socket name.
+func NetworkPeerAddress(val string) attribute.KeyValue {
+ return NetworkPeerAddressKey.String(val)
+}
+
+// NetworkPeerPort returns an attribute KeyValue conforming to the
+// "network.peer.port" semantic conventions. It represents the peer port number
+// of the network connection.
+func NetworkPeerPort(val int) attribute.KeyValue {
+ return NetworkPeerPortKey.Int(val)
+}
+
+// NetworkProtocolName returns an attribute KeyValue conforming to the
+// "network.protocol.name" semantic conventions. It represents the [OSI
+// application layer](https://osi-model.com/application-layer/) or non-OSI
+// equivalent.
+func NetworkProtocolName(val string) attribute.KeyValue {
+ return NetworkProtocolNameKey.String(val)
+}
+
+// NetworkProtocolVersion returns an attribute KeyValue conforming to the
+// "network.protocol.version" semantic conventions. It represents the actual
+// version of the protocol used for network communication.
+func NetworkProtocolVersion(val string) attribute.KeyValue {
+ return NetworkProtocolVersionKey.String(val)
+}
+
+// An OCI image manifest.
+const (
+ // OciManifestDigestKey is the attribute Key conforming to the
+ // "oci.manifest.digest" semantic conventions. It represents the digest of
+ // the OCI image manifest. For container images specifically is the digest
+ // by which the container image is known.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4'
+ // Note: Follows [OCI Image Manifest
+ // Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md),
+ // and specifically the [Digest
+ // property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests).
+ // An example can be found in [Example Image
+ // Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest).
+ OciManifestDigestKey = attribute.Key("oci.manifest.digest")
+)
+
+// OciManifestDigest returns an attribute KeyValue conforming to the
+// "oci.manifest.digest" semantic conventions. It represents the digest of the
+// OCI image manifest. For container images specifically is the digest by which
+// the container image is known.
+func OciManifestDigest(val string) attribute.KeyValue {
+ return OciManifestDigestKey.String(val)
+}
+
+// Attributes used by the OpenTracing Shim layer.
+const (
+ // OpentracingRefTypeKey is the attribute Key conforming to the
+ // "opentracing.ref_type" semantic conventions. It represents the
+ // parent-child Reference type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The causal relationship between a child Span and a parent Span.
+ OpentracingRefTypeKey = attribute.Key("opentracing.ref_type")
+)
+
+var (
+ // The parent Span depends on the child Span in some capacity
+ OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of")
+ // The parent Span doesn't depend in any way on the result of the child Span
+ OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from")
+)
+
+// The operating system (OS) on which the process represented by this resource
+// is running.
+const (
+ // OSBuildIDKey is the attribute Key conforming to the "os.build_id"
+ // semantic conventions. It represents the unique identifier for a
+ // particular build or compilation of the operating system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'TQ3C.230805.001.B2', '20E247', '22621'
+ OSBuildIDKey = attribute.Key("os.build_id")
+
+ // OSDescriptionKey is the attribute Key conforming to the "os.description"
+ // semantic conventions. It represents the human readable (not intended to
+ // be parsed) OS version information, like e.g. reported by `ver` or
+ // `lsb_release -a` commands.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1
+ // LTS'
+ OSDescriptionKey = attribute.Key("os.description")
+
+ // OSNameKey is the attribute Key conforming to the "os.name" semantic
+ // conventions. It represents the human readable operating system name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iOS', 'Android', 'Ubuntu'
+ OSNameKey = attribute.Key("os.name")
+
+ // OSTypeKey is the attribute Key conforming to the "os.type" semantic
+ // conventions. It represents the operating system type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ OSTypeKey = attribute.Key("os.type")
+
+ // OSVersionKey is the attribute Key conforming to the "os.version"
+ // semantic conventions. It represents the version string of the operating
+ // system as defined in [Version
+ // Attributes](/docs/resource/README.md#version-attributes).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.2.1', '18.04.1'
+ OSVersionKey = attribute.Key("os.version")
+)
+
+var (
+ // Microsoft Windows
+ OSTypeWindows = OSTypeKey.String("windows")
+ // Linux
+ OSTypeLinux = OSTypeKey.String("linux")
+ // Apple Darwin
+ OSTypeDarwin = OSTypeKey.String("darwin")
+ // FreeBSD
+ OSTypeFreeBSD = OSTypeKey.String("freebsd")
+ // NetBSD
+ OSTypeNetBSD = OSTypeKey.String("netbsd")
+ // OpenBSD
+ OSTypeOpenBSD = OSTypeKey.String("openbsd")
+ // DragonFly BSD
+ OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd")
+ // HP-UX (Hewlett Packard Unix)
+ OSTypeHPUX = OSTypeKey.String("hpux")
+ // AIX (Advanced Interactive eXecutive)
+ OSTypeAIX = OSTypeKey.String("aix")
+ // SunOS, Oracle Solaris
+ OSTypeSolaris = OSTypeKey.String("solaris")
+ // IBM z/OS
+ OSTypeZOS = OSTypeKey.String("z_os")
+)
+
+// OSBuildID returns an attribute KeyValue conforming to the "os.build_id"
+// semantic conventions. It represents the unique identifier for a particular
+// build or compilation of the operating system.
+func OSBuildID(val string) attribute.KeyValue {
+ return OSBuildIDKey.String(val)
+}
+
+// OSDescription returns an attribute KeyValue conforming to the
+// "os.description" semantic conventions. It represents the human readable (not
+// intended to be parsed) OS version information, like e.g. reported by `ver`
+// or `lsb_release -a` commands.
+func OSDescription(val string) attribute.KeyValue {
+ return OSDescriptionKey.String(val)
+}
+
+// OSName returns an attribute KeyValue conforming to the "os.name" semantic
+// conventions. It represents the human readable operating system name.
+func OSName(val string) attribute.KeyValue {
+ return OSNameKey.String(val)
+}
+
+// OSVersion returns an attribute KeyValue conforming to the "os.version"
+// semantic conventions. It represents the version string of the operating
+// system as defined in [Version
+// Attributes](/docs/resource/README.md#version-attributes).
+func OSVersion(val string) attribute.KeyValue {
+ return OSVersionKey.String(val)
+}
+
+// Attributes reserved for OpenTelemetry
+const (
+ // OTelStatusCodeKey is the attribute Key conforming to the
+ // "otel.status_code" semantic conventions. It represents the name of the
+ // code, either "OK" or "ERROR". MUST NOT be set if the status code is
+ // UNSET.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ OTelStatusCodeKey = attribute.Key("otel.status_code")
+
+ // OTelStatusDescriptionKey is the attribute Key conforming to the
+ // "otel.status_description" semantic conventions. It represents the
+ // description of the Status if it has a value, otherwise not set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'resource not found'
+ OTelStatusDescriptionKey = attribute.Key("otel.status_description")
+)
+
+var (
+ // The operation has been validated by an Application developer or Operator to have completed successfully
+ OTelStatusCodeOk = OTelStatusCodeKey.String("OK")
+ // The operation contains an error
+ OTelStatusCodeError = OTelStatusCodeKey.String("ERROR")
+)
+
+// OTelStatusDescription returns an attribute KeyValue conforming to the
+// "otel.status_description" semantic conventions. It represents the
+// description of the Status if it has a value, otherwise not set.
+func OTelStatusDescription(val string) attribute.KeyValue {
+ return OTelStatusDescriptionKey.String(val)
+}
+
+// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's
+// concepts.
+const (
+ // OTelScopeNameKey is the attribute Key conforming to the
+ // "otel.scope.name" semantic conventions. It represents the name of the
+ // instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'io.opentelemetry.contrib.mongodb'
+ OTelScopeNameKey = attribute.Key("otel.scope.name")
+
+ // OTelScopeVersionKey is the attribute Key conforming to the
+ // "otel.scope.version" semantic conventions. It represents the version of
+ // the instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '1.0.0'
+ OTelScopeVersionKey = attribute.Key("otel.scope.version")
+)
+
+// OTelScopeName returns an attribute KeyValue conforming to the
+// "otel.scope.name" semantic conventions. It represents the name of the
+// instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+func OTelScopeName(val string) attribute.KeyValue {
+ return OTelScopeNameKey.String(val)
+}
+
+// OTelScopeVersion returns an attribute KeyValue conforming to the
+// "otel.scope.version" semantic conventions. It represents the version of the
+// instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+func OTelScopeVersion(val string) attribute.KeyValue {
+ return OTelScopeVersionKey.String(val)
+}
+
+// Operations that access some remote service.
+const (
+ // PeerServiceKey is the attribute Key conforming to the "peer.service"
+ // semantic conventions. It represents the
+ // [`service.name`](/docs/resource/README.md#service) of the remote
+ // service. SHOULD be equal to the actual `service.name` resource attribute
+ // of the remote service if any.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'AuthTokenCache'
+ PeerServiceKey = attribute.Key("peer.service")
+)
+
+// PeerService returns an attribute KeyValue conforming to the
+// "peer.service" semantic conventions. It represents the
+// [`service.name`](/docs/resource/README.md#service) of the remote service.
+// SHOULD be equal to the actual `service.name` resource attribute of the
+// remote service if any.
+func PeerService(val string) attribute.KeyValue {
+ return PeerServiceKey.String(val)
+}
+
+// An operating system process.
+const (
+ // ProcessCommandKey is the attribute Key conforming to the
+ // "process.command" semantic conventions. It represents the command used
+ // to launch the process (i.e. the command name). On Linux based systems,
+ // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can
+ // be set to the first parameter extracted from `GetCommandLineW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'cmd/otelcol'
+ ProcessCommandKey = attribute.Key("process.command")
+
+ // ProcessCommandArgsKey is the attribute Key conforming to the
+ // "process.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) as received
+ // by the process. On Linux-based systems (and some other Unixoid systems
+ // supporting procfs), can be set according to the list of null-delimited
+ // strings extracted from `proc/[pid]/cmdline`. For libc-based executables,
+ // this would be the full argv vector passed to `main`.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'cmd/otecol', '--config=config.yaml'
+ ProcessCommandArgsKey = attribute.Key("process.command_args")
+
+ // ProcessCommandLineKey is the attribute Key conforming to the
+ // "process.command_line" semantic conventions. It represents the full
+ // command used to launch the process as a single string representing the
+ // full command. On Windows, can be set to the result of `GetCommandLineW`.
+ // Do not set this if you have to assemble it just for monitoring; use
+ // `process.command_args` instead.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"'
+ ProcessCommandLineKey = attribute.Key("process.command_line")
+
+ // ProcessContextSwitchTypeKey is the attribute Key conforming to the
+ // "process.context_switch_type" semantic conventions. It represents the
+ // specifies whether the context switches for this data point were
+ // voluntary or involuntary.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessContextSwitchTypeKey = attribute.Key("process.context_switch_type")
+
+ // ProcessCreationTimeKey is the attribute Key conforming to the
+ // "process.creation.time" semantic conventions. It represents the date and
+ // time the process was created, in ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2023-11-21T09:25:34.853Z'
+ ProcessCreationTimeKey = attribute.Key("process.creation.time")
+
+ // ProcessExecutableNameKey is the attribute Key conforming to the
+ // "process.executable.name" semantic conventions. It represents the name
+ // of the process executable. On Linux based systems, can be set to the
+ // `Name` in `proc/[pid]/status`. On Windows, can be set to the base name
+ // of `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcol'
+ ProcessExecutableNameKey = attribute.Key("process.executable.name")
+
+ // ProcessExecutablePathKey is the attribute Key conforming to the
+ // "process.executable.path" semantic conventions. It represents the full
+ // path to the process executable. On Linux based systems, can be set to
+ // the target of `proc/[pid]/exe`. On Windows, can be set to the result of
+ // `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/usr/bin/cmd/otelcol'
+ ProcessExecutablePathKey = attribute.Key("process.executable.path")
+
+ // ProcessExitCodeKey is the attribute Key conforming to the
+ // "process.exit.code" semantic conventions. It represents the exit code of
+ // the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 127
+ ProcessExitCodeKey = attribute.Key("process.exit.code")
+
+ // ProcessExitTimeKey is the attribute Key conforming to the
+ // "process.exit.time" semantic conventions. It represents the date and
+ // time the process exited, in ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2023-11-21T09:26:12.315Z'
+ ProcessExitTimeKey = attribute.Key("process.exit.time")
+
+ // ProcessGroupLeaderPIDKey is the attribute Key conforming to the
+ // "process.group_leader.pid" semantic conventions. It represents the PID
+ // of the process's group leader. This is also the process group ID (PGID)
+ // of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 23
+ ProcessGroupLeaderPIDKey = attribute.Key("process.group_leader.pid")
+
+ // ProcessInteractiveKey is the attribute Key conforming to the
+ // "process.interactive" semantic conventions. It represents the whether
+ // the process is connected to an interactive shell.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessInteractiveKey = attribute.Key("process.interactive")
+
+ // ProcessOwnerKey is the attribute Key conforming to the "process.owner"
+ // semantic conventions. It represents the username of the user that owns
+ // the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'root'
+ ProcessOwnerKey = attribute.Key("process.owner")
+
+ // ProcessPagingFaultTypeKey is the attribute Key conforming to the
+ // "process.paging.fault_type" semantic conventions. It represents the type
+ // of page fault for this data point. Type `major` is for major/hard page
+ // faults, and `minor` is for minor/soft page faults.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessPagingFaultTypeKey = attribute.Key("process.paging.fault_type")
+
+ // ProcessParentPIDKey is the attribute Key conforming to the
+ // "process.parent_pid" semantic conventions. It represents the parent
+ // Process identifier (PPID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 111
+ ProcessParentPIDKey = attribute.Key("process.parent_pid")
+
+ // ProcessPIDKey is the attribute Key conforming to the "process.pid"
+ // semantic conventions. It represents the process identifier (PID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1234
+ ProcessPIDKey = attribute.Key("process.pid")
+
+ // ProcessRealUserIDKey is the attribute Key conforming to the
+ // "process.real_user.id" semantic conventions. It represents the real user
+ // ID (RUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1000
+ ProcessRealUserIDKey = attribute.Key("process.real_user.id")
+
+ // ProcessRealUserNameKey is the attribute Key conforming to the
+ // "process.real_user.name" semantic conventions. It represents the
+ // username of the real user of the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'operator'
+ ProcessRealUserNameKey = attribute.Key("process.real_user.name")
+
+ // ProcessRuntimeDescriptionKey is the attribute Key conforming to the
+ // "process.runtime.description" semantic conventions. It represents an
+ // additional description about the runtime of the process, for example a
+ // specific vendor customization of the runtime environment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0'
+ ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description")
+
+ // ProcessRuntimeNameKey is the attribute Key conforming to the
+ // "process.runtime.name" semantic conventions. It represents the name of
+ // the runtime of this process. For compiled native binaries, this SHOULD
+ // be the name of the compiler.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'OpenJDK Runtime Environment'
+ ProcessRuntimeNameKey = attribute.Key("process.runtime.name")
+
+ // ProcessRuntimeVersionKey is the attribute Key conforming to the
+ // "process.runtime.version" semantic conventions. It represents the
+ // version of the runtime of this process, as returned by the runtime
+ // without modification.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.0.2'
+ ProcessRuntimeVersionKey = attribute.Key("process.runtime.version")
+
+ // ProcessSavedUserIDKey is the attribute Key conforming to the
+ // "process.saved_user.id" semantic conventions. It represents the saved
+ // user ID (SUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1002
+ ProcessSavedUserIDKey = attribute.Key("process.saved_user.id")
+
+ // ProcessSavedUserNameKey is the attribute Key conforming to the
+ // "process.saved_user.name" semantic conventions. It represents the
+ // username of the saved user.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'operator'
+ ProcessSavedUserNameKey = attribute.Key("process.saved_user.name")
+
+ // ProcessSessionLeaderPIDKey is the attribute Key conforming to the
+ // "process.session_leader.pid" semantic conventions. It represents the PID
+ // of the process's session leader. This is also the session ID (SID) of
+ // the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 14
+ ProcessSessionLeaderPIDKey = attribute.Key("process.session_leader.pid")
+
+ // ProcessUserIDKey is the attribute Key conforming to the
+ // "process.user.id" semantic conventions. It represents the effective user
+ // ID (EUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1001
+ ProcessUserIDKey = attribute.Key("process.user.id")
+
+ // ProcessUserNameKey is the attribute Key conforming to the
+ // "process.user.name" semantic conventions. It represents the username of
+ // the effective user of the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'root'
+ ProcessUserNameKey = attribute.Key("process.user.name")
+
+ // ProcessVpidKey is the attribute Key conforming to the "process.vpid"
+ // semantic conventions. It represents the virtual process identifier.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 12
+ // Note: The process ID within a PID namespace. This is not necessarily
+ // unique across all processes on the host but it is unique within the
+ // process namespace that the process exists within.
+ ProcessVpidKey = attribute.Key("process.vpid")
+)
+
+var (
+ // voluntary
+ ProcessContextSwitchTypeVoluntary = ProcessContextSwitchTypeKey.String("voluntary")
+ // involuntary
+ ProcessContextSwitchTypeInvoluntary = ProcessContextSwitchTypeKey.String("involuntary")
+)
+
+var (
+ // major
+ ProcessPagingFaultTypeMajor = ProcessPagingFaultTypeKey.String("major")
+ // minor
+ ProcessPagingFaultTypeMinor = ProcessPagingFaultTypeKey.String("minor")
+)
+
+// ProcessCommand returns an attribute KeyValue conforming to the
+// "process.command" semantic conventions. It represents the command used to
+// launch the process (i.e. the command name). On Linux based systems, can be
+// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to
+// the first parameter extracted from `GetCommandLineW`.
+func ProcessCommand(val string) attribute.KeyValue {
+ return ProcessCommandKey.String(val)
+}
+
+// ProcessCommandArgs returns an attribute KeyValue conforming to the
+// "process.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) as received by
+// the process. On Linux-based systems (and some other Unixoid systems
+// supporting procfs), can be set according to the list of null-delimited
+// strings extracted from `proc/[pid]/cmdline`. For libc-based executables,
+// this would be the full argv vector passed to `main`.
+func ProcessCommandArgs(val ...string) attribute.KeyValue {
+ return ProcessCommandArgsKey.StringSlice(val)
+}
+
+// ProcessCommandLine returns an attribute KeyValue conforming to the
+// "process.command_line" semantic conventions. It represents the full command
+// used to launch the process as a single string representing the full command.
+// On Windows, can be set to the result of `GetCommandLineW`. Do not set this
+// if you have to assemble it just for monitoring; use `process.command_args`
+// instead.
+func ProcessCommandLine(val string) attribute.KeyValue {
+ return ProcessCommandLineKey.String(val)
+}
+
+// ProcessCreationTime returns an attribute KeyValue conforming to the
+// "process.creation.time" semantic conventions. It represents the date and
+// time the process was created, in ISO 8601 format.
+func ProcessCreationTime(val string) attribute.KeyValue {
+ return ProcessCreationTimeKey.String(val)
+}
+
+// ProcessExecutableName returns an attribute KeyValue conforming to the
+// "process.executable.name" semantic conventions. It represents the name of
+// the process executable. On Linux based systems, can be set to the `Name` in
+// `proc/[pid]/status`. On Windows, can be set to the base name of
+// `GetProcessImageFileNameW`.
+func ProcessExecutableName(val string) attribute.KeyValue {
+ return ProcessExecutableNameKey.String(val)
+}
+
+// ProcessExecutablePath returns an attribute KeyValue conforming to the
+// "process.executable.path" semantic conventions. It represents the full path
+// to the process executable. On Linux based systems, can be set to the target
+// of `proc/[pid]/exe`. On Windows, can be set to the result of
+// `GetProcessImageFileNameW`.
+func ProcessExecutablePath(val string) attribute.KeyValue {
+ return ProcessExecutablePathKey.String(val)
+}
+
+// ProcessExitCode returns an attribute KeyValue conforming to the
+// "process.exit.code" semantic conventions. It represents the exit code of the
+// process.
+func ProcessExitCode(val int) attribute.KeyValue {
+ return ProcessExitCodeKey.Int(val)
+}
+
+// ProcessExitTime returns an attribute KeyValue conforming to the
+// "process.exit.time" semantic conventions. It represents the date and time
+// the process exited, in ISO 8601 format.
+func ProcessExitTime(val string) attribute.KeyValue {
+ return ProcessExitTimeKey.String(val)
+}
+
+// ProcessGroupLeaderPID returns an attribute KeyValue conforming to the
+// "process.group_leader.pid" semantic conventions. It represents the PID of
+// the process's group leader. This is also the process group ID (PGID) of the
+// process.
+func ProcessGroupLeaderPID(val int) attribute.KeyValue {
+ return ProcessGroupLeaderPIDKey.Int(val)
+}
+
+// ProcessInteractive returns an attribute KeyValue conforming to the
+// "process.interactive" semantic conventions. It represents the whether the
+// process is connected to an interactive shell.
+func ProcessInteractive(val bool) attribute.KeyValue {
+ return ProcessInteractiveKey.Bool(val)
+}
+
+// ProcessOwner returns an attribute KeyValue conforming to the
+// "process.owner" semantic conventions. It represents the username of the user
+// that owns the process.
+func ProcessOwner(val string) attribute.KeyValue {
+ return ProcessOwnerKey.String(val)
+}
+
+// ProcessParentPID returns an attribute KeyValue conforming to the
+// "process.parent_pid" semantic conventions. It represents the parent Process
+// identifier (PPID).
+func ProcessParentPID(val int) attribute.KeyValue {
+ return ProcessParentPIDKey.Int(val)
+}
+
+// ProcessPID returns an attribute KeyValue conforming to the "process.pid"
+// semantic conventions. It represents the process identifier (PID).
+func ProcessPID(val int) attribute.KeyValue {
+ return ProcessPIDKey.Int(val)
+}
+
+// ProcessRealUserID returns an attribute KeyValue conforming to the
+// "process.real_user.id" semantic conventions. It represents the real user ID
+// (RUID) of the process.
+func ProcessRealUserID(val int) attribute.KeyValue {
+ return ProcessRealUserIDKey.Int(val)
+}
+
+// ProcessRealUserName returns an attribute KeyValue conforming to the
+// "process.real_user.name" semantic conventions. It represents the username of
+// the real user of the process.
+func ProcessRealUserName(val string) attribute.KeyValue {
+ return ProcessRealUserNameKey.String(val)
+}
+
+// ProcessRuntimeDescription returns an attribute KeyValue conforming to the
+// "process.runtime.description" semantic conventions. It represents an
+// additional description about the runtime of the process, for example a
+// specific vendor customization of the runtime environment.
+func ProcessRuntimeDescription(val string) attribute.KeyValue {
+ return ProcessRuntimeDescriptionKey.String(val)
+}
+
+// ProcessRuntimeName returns an attribute KeyValue conforming to the
+// "process.runtime.name" semantic conventions. It represents the name of the
+// runtime of this process. For compiled native binaries, this SHOULD be the
+// name of the compiler.
+func ProcessRuntimeName(val string) attribute.KeyValue {
+ return ProcessRuntimeNameKey.String(val)
+}
+
+// ProcessRuntimeVersion returns an attribute KeyValue conforming to the
+// "process.runtime.version" semantic conventions. It represents the version of
+// the runtime of this process, as returned by the runtime without
+// modification.
+func ProcessRuntimeVersion(val string) attribute.KeyValue {
+ return ProcessRuntimeVersionKey.String(val)
+}
+
+// ProcessSavedUserID returns an attribute KeyValue conforming to the
+// "process.saved_user.id" semantic conventions. It represents the saved user
+// ID (SUID) of the process.
+func ProcessSavedUserID(val int) attribute.KeyValue {
+ return ProcessSavedUserIDKey.Int(val)
+}
+
+// ProcessSavedUserName returns an attribute KeyValue conforming to the
+// "process.saved_user.name" semantic conventions. It represents the username
+// of the saved user.
+func ProcessSavedUserName(val string) attribute.KeyValue {
+ return ProcessSavedUserNameKey.String(val)
+}
+
+// ProcessSessionLeaderPID returns an attribute KeyValue conforming to the
+// "process.session_leader.pid" semantic conventions. It represents the PID of
+// the process's session leader. This is also the session ID (SID) of the
+// process.
+func ProcessSessionLeaderPID(val int) attribute.KeyValue {
+ return ProcessSessionLeaderPIDKey.Int(val)
+}
+
+// ProcessUserID returns an attribute KeyValue conforming to the
+// "process.user.id" semantic conventions. It represents the effective user ID
+// (EUID) of the process.
+func ProcessUserID(val int) attribute.KeyValue {
+ return ProcessUserIDKey.Int(val)
+}
+
+// ProcessUserName returns an attribute KeyValue conforming to the
+// "process.user.name" semantic conventions. It represents the username of the
+// effective user of the process.
+func ProcessUserName(val string) attribute.KeyValue {
+ return ProcessUserNameKey.String(val)
+}
+
+// ProcessVpid returns an attribute KeyValue conforming to the
+// "process.vpid" semantic conventions. It represents the virtual process
+// identifier.
+func ProcessVpid(val int) attribute.KeyValue {
+ return ProcessVpidKey.Int(val)
+}
+
+// Attributes for process CPU
+const (
+ // ProcessCPUStateKey is the attribute Key conforming to the
+ // "process.cpu.state" semantic conventions. It represents the CPU state of
+ // the process.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessCPUStateKey = attribute.Key("process.cpu.state")
+)
+
+var (
+ // system
+ ProcessCPUStateSystem = ProcessCPUStateKey.String("system")
+ // user
+ ProcessCPUStateUser = ProcessCPUStateKey.String("user")
+ // wait
+ ProcessCPUStateWait = ProcessCPUStateKey.String("wait")
+)
+
+// Attributes for remote procedure calls.
+const (
+ // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the
+ // "rpc.connect_rpc.error_code" semantic conventions. It represents the
+ // [error codes](https://connect.build/docs/protocol/#error-codes) of the
+ // Connect request. Error codes are always string values.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code")
+
+ // RPCGRPCStatusCodeKey is the attribute Key conforming to the
+ // "rpc.grpc.status_code" semantic conventions. It represents the [numeric
+ // status
+ // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of
+ // the gRPC request.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
+
+ // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_code" semantic conventions. It represents the
+ // `error.code` property of response if it is an error response.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: -32700, 100
+ RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
+
+ // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_message" semantic conventions. It represents the
+ // `error.message` property of response if it is an error response.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Parse error', 'User already exists'
+ RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
+
+ // RPCJsonrpcRequestIDKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+ // property of request or response. Since protocol allows id to be int,
+ // string, `null` or missing (for notifications), value is expected to be
+ // cast to string for simplicity. Use empty string in case of `null` value.
+ // Omit entirely if this is a notification.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '10', 'request-7', ''
+ RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
+
+ // RPCJsonrpcVersionKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+ // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+ // doesn't specify this, the value can be omitted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2.0', '1.0'
+ RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version")
+
+ // RPCMessageCompressedSizeKey is the attribute Key conforming to the
+ // "rpc.message.compressed_size" semantic conventions. It represents the
+ // compressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCMessageCompressedSizeKey = attribute.Key("rpc.message.compressed_size")
+
+ // RPCMessageIDKey is the attribute Key conforming to the "rpc.message.id"
+ // semantic conventions. It represents the mUST be calculated as two
+ // different counters starting from `1` one for sent messages and one for
+ // received message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: This way we guarantee that the values will be consistent between
+ // different implementations.
+ RPCMessageIDKey = attribute.Key("rpc.message.id")
+
+ // RPCMessageTypeKey is the attribute Key conforming to the
+ // "rpc.message.type" semantic conventions. It represents the whether this
+ // is a received or sent message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCMessageTypeKey = attribute.Key("rpc.message.type")
+
+ // RPCMessageUncompressedSizeKey is the attribute Key conforming to the
+ // "rpc.message.uncompressed_size" semantic conventions. It represents the
+ // uncompressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCMessageUncompressedSizeKey = attribute.Key("rpc.message.uncompressed_size")
+
+ // RPCMethodKey is the attribute Key conforming to the "rpc.method"
+ // semantic conventions. It represents the name of the (logical) method
+ // being called, must be equal to the $method part in the span name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'exampleMethod'
+ // Note: This is the logical name of the method from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // method/function. The `code.function` attribute may be used to store the
+ // latter (e.g., method actually executing the call on the server side, RPC
+ // client stub method on the client side).
+ RPCMethodKey = attribute.Key("rpc.method")
+
+ // RPCServiceKey is the attribute Key conforming to the "rpc.service"
+ // semantic conventions. It represents the full (logical) name of the
+ // service being called, including its package name, if applicable.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myservice.EchoService'
+ // Note: This is the logical name of the service from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // class. The `code.namespace` attribute may be used to store the latter
+ // (despite the attribute name, it may include a class name; e.g., class
+ // with method actually executing the call on the server side, RPC client
+ // stub class on the client side).
+ RPCServiceKey = attribute.Key("rpc.service")
+
+ // RPCSystemKey is the attribute Key conforming to the "rpc.system"
+ // semantic conventions. It represents a string identifying the remoting
+ // system. See below for a list of well-known identifiers.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCSystemKey = attribute.Key("rpc.system")
+)
+
+var (
+ // cancelled
+ RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled")
+ // unknown
+ RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown")
+ // invalid_argument
+ RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument")
+ // deadline_exceeded
+ RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded")
+ // not_found
+ RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found")
+ // already_exists
+ RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists")
+ // permission_denied
+ RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied")
+ // resource_exhausted
+ RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted")
+ // failed_precondition
+ RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition")
+ // aborted
+ RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted")
+ // out_of_range
+ RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range")
+ // unimplemented
+ RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented")
+ // internal
+ RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal")
+ // unavailable
+ RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable")
+ // data_loss
+ RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss")
+ // unauthenticated
+ RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated")
+)
+
+var (
+ // OK
+ RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0)
+ // CANCELLED
+ RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1)
+ // UNKNOWN
+ RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2)
+ // INVALID_ARGUMENT
+ RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3)
+ // DEADLINE_EXCEEDED
+ RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4)
+ // NOT_FOUND
+ RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5)
+ // ALREADY_EXISTS
+ RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6)
+ // PERMISSION_DENIED
+ RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7)
+ // RESOURCE_EXHAUSTED
+ RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8)
+ // FAILED_PRECONDITION
+ RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9)
+ // ABORTED
+ RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10)
+ // OUT_OF_RANGE
+ RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11)
+ // UNIMPLEMENTED
+ RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12)
+ // INTERNAL
+ RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13)
+ // UNAVAILABLE
+ RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14)
+ // DATA_LOSS
+ RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15)
+ // UNAUTHENTICATED
+ RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16)
+)
+
+var (
+ // sent
+ RPCMessageTypeSent = RPCMessageTypeKey.String("SENT")
+ // received
+ RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED")
+)
+
+var (
+ // gRPC
+ RPCSystemGRPC = RPCSystemKey.String("grpc")
+ // Java RMI
+ RPCSystemJavaRmi = RPCSystemKey.String("java_rmi")
+ // .NET WCF
+ RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf")
+ // Apache Dubbo
+ RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo")
+ // Connect RPC
+ RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc")
+)
+
+// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_code" semantic conventions. It represents the
+// `error.code` property of response if it is an error response.
+func RPCJsonrpcErrorCode(val int) attribute.KeyValue {
+ return RPCJsonrpcErrorCodeKey.Int(val)
+}
+
+// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_message" semantic conventions. It represents the
+// `error.message` property of response if it is an error response.
+func RPCJsonrpcErrorMessage(val string) attribute.KeyValue {
+ return RPCJsonrpcErrorMessageKey.String(val)
+}
+
+// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+// property of request or response. Since protocol allows id to be int, string,
+// `null` or missing (for notifications), value is expected to be cast to
+// string for simplicity. Use empty string in case of `null` value. Omit
+// entirely if this is a notification.
+func RPCJsonrpcRequestID(val string) attribute.KeyValue {
+ return RPCJsonrpcRequestIDKey.String(val)
+}
+
+// RPCJsonrpcVersion returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+// doesn't specify this, the value can be omitted.
+func RPCJsonrpcVersion(val string) attribute.KeyValue {
+ return RPCJsonrpcVersionKey.String(val)
+}
+
+// RPCMessageCompressedSize returns an attribute KeyValue conforming to the
+// "rpc.message.compressed_size" semantic conventions. It represents the
+// compressed size of the message in bytes.
+func RPCMessageCompressedSize(val int) attribute.KeyValue {
+ return RPCMessageCompressedSizeKey.Int(val)
+}
+
+// RPCMessageID returns an attribute KeyValue conforming to the
+// "rpc.message.id" semantic conventions. It represents the mUST be calculated
+// as two different counters starting from `1` one for sent messages and one
+// for received message.
+func RPCMessageID(val int) attribute.KeyValue {
+ return RPCMessageIDKey.Int(val)
+}
+
+// RPCMessageUncompressedSize returns an attribute KeyValue conforming to
+// the "rpc.message.uncompressed_size" semantic conventions. It represents the
+// uncompressed size of the message in bytes.
+func RPCMessageUncompressedSize(val int) attribute.KeyValue {
+ return RPCMessageUncompressedSizeKey.Int(val)
+}
+
+// RPCMethod returns an attribute KeyValue conforming to the "rpc.method"
+// semantic conventions. It represents the name of the (logical) method being
+// called, must be equal to the $method part in the span name.
+func RPCMethod(val string) attribute.KeyValue {
+ return RPCMethodKey.String(val)
+}
+
+// RPCService returns an attribute KeyValue conforming to the "rpc.service"
+// semantic conventions. It represents the full (logical) name of the service
+// being called, including its package name, if applicable.
+func RPCService(val string) attribute.KeyValue {
+ return RPCServiceKey.String(val)
+}
+
+// These attributes may be used to describe the server in a connection-based
+// network interaction where there is one side that initiates the connection
+// (the client is the side that initiates the connection). This covers all TCP
+// network interactions since TCP is connection-based and one side initiates
+// the connection (an exception is made for peer-to-peer communication over TCP
+// where the "user-facing" surface of the protocol / API doesn't expose a clear
+// notion of client and server). This also covers UDP network interactions
+// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
+const (
+ // ServerAddressKey is the attribute Key conforming to the "server.address"
+ // semantic conventions. It represents the server domain name if available
+ // without reverse DNS lookup; otherwise, IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the client side, and when communicating through
+ // an intermediary, `server.address` SHOULD represent the server address
+ // behind any intermediaries, for example proxies, if it's available.
+ ServerAddressKey = attribute.Key("server.address")
+
+ // ServerPortKey is the attribute Key conforming to the "server.port"
+ // semantic conventions. It represents the server port number.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 80, 8080, 443
+ // Note: When observed from the client side, and when communicating through
+ // an intermediary, `server.port` SHOULD represent the server port behind
+ // any intermediaries, for example proxies, if it's available.
+ ServerPortKey = attribute.Key("server.port")
+)
+
+// ServerAddress returns an attribute KeyValue conforming to the
+// "server.address" semantic conventions. It represents the server domain name
+// if available without reverse DNS lookup; otherwise, IP address or Unix
+// domain socket name.
+func ServerAddress(val string) attribute.KeyValue {
+ return ServerAddressKey.String(val)
+}
+
+// ServerPort returns an attribute KeyValue conforming to the "server.port"
+// semantic conventions. It represents the server port number.
+func ServerPort(val int) attribute.KeyValue {
+ return ServerPortKey.Int(val)
+}
+
+// A service instance.
+const (
+ // ServiceInstanceIDKey is the attribute Key conforming to the
+ // "service.instance.id" semantic conventions. It represents the string ID
+ // of the service instance.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '627cc493-f310-47de-96bd-71410b7dec09'
+ // Note: MUST be unique for each instance of the same
+ // `service.namespace,service.name` pair (in other words
+ // `service.namespace,service.name,service.instance.id` triplet MUST be
+ // globally unique). The ID helps to
+ // distinguish instances of the same service that exist at the same time
+ // (e.g. instances of a horizontally scaled
+ // service).
+ //
+ // Implementations, such as SDKs, are recommended to generate a random
+ // Version 1 or Version 4 [RFC
+ // 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an
+ // inherent unique ID as the source of
+ // this value if stability is desirable. In that case, the ID SHOULD be
+ // used as source of a UUID Version 5 and
+ // SHOULD use the following UUID as the namespace:
+ // `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.
+ //
+ // UUIDs are typically recommended, as only an opaque value for the
+ // purposes of identifying a service instance is
+ // needed. Similar to what can be seen in the man page for the
+ // [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/machine-id.html)
+ // file, the underlying
+ // data, such as pod name and namespace should be treated as confidential,
+ // being the user's choice to expose it
+ // or not via another resource attribute.
+ //
+ // For applications running behind an application server (like unicorn), we
+ // do not recommend using one identifier
+ // for all processes participating in the application. Instead, it's
+ // recommended each division (e.g. a worker
+ // thread in unicorn) to have its own instance.id.
+ //
+ // It's not recommended for a Collector to set `service.instance.id` if it
+ // can't unambiguously determine the
+ // service instance that is generating that telemetry. For instance,
+ // creating an UUID based on `pod.name` will
+ // likely be wrong, as the Collector might not know from which container
+ // within that pod the telemetry originated.
+ // However, Collectors can set the `service.instance.id` if they can
+ // unambiguously determine the service instance
+ // for that telemetry. This is typically the case for scraping receivers,
+ // as they know the target address and
+ // port.
+ ServiceInstanceIDKey = attribute.Key("service.instance.id")
+
+ // ServiceNameKey is the attribute Key conforming to the "service.name"
+ // semantic conventions. It represents the logical name of the service.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'shoppingcart'
+ // Note: MUST be the same for all instances of horizontally scaled
+ // services. If the value was not specified, SDKs MUST fallback to
+ // `unknown_service:` concatenated with
+ // [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If
+ // `process.executable.name` is not available, the value MUST be set to
+ // `unknown_service`.
+ ServiceNameKey = attribute.Key("service.name")
+
+ // ServiceNamespaceKey is the attribute Key conforming to the
+ // "service.namespace" semantic conventions. It represents a namespace for
+ // `service.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Shop'
+ // Note: A string value having a meaning that helps to distinguish a group
+ // of services, for example the team name that owns a group of services.
+ // `service.name` is expected to be unique within the same namespace. If
+ // `service.namespace` is not specified in the Resource then `service.name`
+ // is expected to be unique for all services that have no explicit
+ // namespace defined (so the empty/unspecified namespace is simply one more
+ // valid namespace). Zero-length namespace string is assumed equal to
+ // unspecified namespace.
+ ServiceNamespaceKey = attribute.Key("service.namespace")
+
+ // ServiceVersionKey is the attribute Key conforming to the
+ // "service.version" semantic conventions. It represents the version string
+ // of the service API or implementation. The format is not defined by these
+ // conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '2.0.0', 'a01dbef8a'
+ ServiceVersionKey = attribute.Key("service.version")
+)
+
+// ServiceInstanceID returns an attribute KeyValue conforming to the
+// "service.instance.id" semantic conventions. It represents the string ID of
+// the service instance.
+func ServiceInstanceID(val string) attribute.KeyValue {
+ return ServiceInstanceIDKey.String(val)
+}
+
+// ServiceName returns an attribute KeyValue conforming to the
+// "service.name" semantic conventions. It represents the logical name of the
+// service.
+func ServiceName(val string) attribute.KeyValue {
+ return ServiceNameKey.String(val)
+}
+
+// ServiceNamespace returns an attribute KeyValue conforming to the
+// "service.namespace" semantic conventions. It represents a namespace for
+// `service.name`.
+func ServiceNamespace(val string) attribute.KeyValue {
+ return ServiceNamespaceKey.String(val)
+}
+
+// ServiceVersion returns an attribute KeyValue conforming to the
+// "service.version" semantic conventions. It represents the version string of
+// the service API or implementation. The format is not defined by these
+// conventions.
+func ServiceVersion(val string) attribute.KeyValue {
+ return ServiceVersionKey.String(val)
+}
+
+// Session is defined as the period of time encompassing all activities
+// performed by the application and the actions executed by the end user.
+// Consequently, a Session is represented as a collection of Logs, Events, and
+// Spans emitted by the Client Application throughout the Session's duration.
+// Each Session is assigned a unique identifier, which is included as an
+// attribute in the Logs, Events, and Spans generated during the Session's
+// lifecycle.
+// When a session reaches end of life, typically due to user inactivity or
+// session timeout, a new session identifier will be assigned. The previous
+// session identifier may be provided by the instrumentation so that telemetry
+// backends can link the two sessions.
+const (
+ // SessionIDKey is the attribute Key conforming to the "session.id"
+ // semantic conventions. It represents a unique id to identify a session.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '00112233-4455-6677-8899-aabbccddeeff'
+ SessionIDKey = attribute.Key("session.id")
+
+ // SessionPreviousIDKey is the attribute Key conforming to the
+ // "session.previous_id" semantic conventions. It represents the previous
+ // `session.id` for this user, when known.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '00112233-4455-6677-8899-aabbccddeeff'
+ SessionPreviousIDKey = attribute.Key("session.previous_id")
+)
+
+// SessionID returns an attribute KeyValue conforming to the "session.id"
+// semantic conventions. It represents a unique id to identify a session.
+func SessionID(val string) attribute.KeyValue {
+ return SessionIDKey.String(val)
+}
+
+// SessionPreviousID returns an attribute KeyValue conforming to the
+// "session.previous_id" semantic conventions. It represents the previous
+// `session.id` for this user, when known.
+func SessionPreviousID(val string) attribute.KeyValue {
+ return SessionPreviousIDKey.String(val)
+}
+
+// SignalR attributes
+const (
+ // SignalrConnectionStatusKey is the attribute Key conforming to the
+ // "signalr.connection.status" semantic conventions. It represents the
+ // signalR HTTP connection closure status.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'app_shutdown', 'timeout'
+ SignalrConnectionStatusKey = attribute.Key("signalr.connection.status")
+
+ // SignalrTransportKey is the attribute Key conforming to the
+ // "signalr.transport" semantic conventions. It represents the [SignalR
+ // transport
+ // type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'web_sockets', 'long_polling'
+ SignalrTransportKey = attribute.Key("signalr.transport")
+)
+
+var (
+ // The connection was closed normally
+ SignalrConnectionStatusNormalClosure = SignalrConnectionStatusKey.String("normal_closure")
+ // The connection was closed due to a timeout
+ SignalrConnectionStatusTimeout = SignalrConnectionStatusKey.String("timeout")
+ // The connection was closed because the app is shutting down
+ SignalrConnectionStatusAppShutdown = SignalrConnectionStatusKey.String("app_shutdown")
+)
+
+var (
+ // ServerSentEvents protocol
+ SignalrTransportServerSentEvents = SignalrTransportKey.String("server_sent_events")
+ // LongPolling protocol
+ SignalrTransportLongPolling = SignalrTransportKey.String("long_polling")
+ // WebSockets protocol
+ SignalrTransportWebSockets = SignalrTransportKey.String("web_sockets")
+)
+
+// These attributes may be used to describe the sender of a network
+// exchange/packet. These should be used when there is no client/server
+// relationship between the two sides, or when that relationship is unknown.
+// This covers low-level network interactions (e.g. packet tracing) where you
+// don't know if there was a connection or which side initiated it. This also
+// covers unidirectional UDP flows and peer-to-peer communication where the
+// "user-facing" surface of the protocol / API doesn't expose a clear notion of
+// client and server.
+const (
+ // SourceAddressKey is the attribute Key conforming to the "source.address"
+ // semantic conventions. It represents the source address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix
+ // domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'source.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the destination side, and when communicating
+ // through an intermediary, `source.address` SHOULD represent the source
+ // address behind any intermediaries, for example proxies, if it's
+ // available.
+ SourceAddressKey = attribute.Key("source.address")
+
+ // SourcePortKey is the attribute Key conforming to the "source.port"
+ // semantic conventions. It represents the source port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3389, 2888
+ SourcePortKey = attribute.Key("source.port")
+)
+
+// SourceAddress returns an attribute KeyValue conforming to the
+// "source.address" semantic conventions. It represents the source address -
+// domain name if available without reverse DNS lookup; otherwise, IP address
+// or Unix domain socket name.
+func SourceAddress(val string) attribute.KeyValue {
+ return SourceAddressKey.String(val)
+}
+
+// SourcePort returns an attribute KeyValue conforming to the "source.port"
+// semantic conventions. It represents the source port number
+func SourcePort(val int) attribute.KeyValue {
+ return SourcePortKey.Int(val)
+}
+
+// Describes System attributes
+const (
+ // SystemDeviceKey is the attribute Key conforming to the "system.device"
+ // semantic conventions. It represents the device identifier
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '(identifier)'
+ SystemDeviceKey = attribute.Key("system.device")
+)
+
+// SystemDevice returns an attribute KeyValue conforming to the
+// "system.device" semantic conventions. It represents the device identifier
+func SystemDevice(val string) attribute.KeyValue {
+ return SystemDeviceKey.String(val)
+}
+
+// Describes System CPU attributes
+const (
+ // SystemCPULogicalNumberKey is the attribute Key conforming to the
+ // "system.cpu.logical_number" semantic conventions. It represents the
+ // logical CPU number [0..n-1]
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1
+ SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number")
+
+ // SystemCPUStateKey is the attribute Key conforming to the
+ // "system.cpu.state" semantic conventions. It represents the state of the
+ // CPU
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'idle', 'interrupt'
+ SystemCPUStateKey = attribute.Key("system.cpu.state")
+)
+
+var (
+ // user
+ SystemCPUStateUser = SystemCPUStateKey.String("user")
+ // system
+ SystemCPUStateSystem = SystemCPUStateKey.String("system")
+ // nice
+ SystemCPUStateNice = SystemCPUStateKey.String("nice")
+ // idle
+ SystemCPUStateIdle = SystemCPUStateKey.String("idle")
+ // iowait
+ SystemCPUStateIowait = SystemCPUStateKey.String("iowait")
+ // interrupt
+ SystemCPUStateInterrupt = SystemCPUStateKey.String("interrupt")
+ // steal
+ SystemCPUStateSteal = SystemCPUStateKey.String("steal")
+)
+
+// SystemCPULogicalNumber returns an attribute KeyValue conforming to the
+// "system.cpu.logical_number" semantic conventions. It represents the logical
+// CPU number [0..n-1]
+func SystemCPULogicalNumber(val int) attribute.KeyValue {
+ return SystemCPULogicalNumberKey.Int(val)
+}
+
+// Describes System Memory attributes
+const (
+ // SystemMemoryStateKey is the attribute Key conforming to the
+ // "system.memory.state" semantic conventions. It represents the memory
+ // state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'free', 'cached'
+ SystemMemoryStateKey = attribute.Key("system.memory.state")
+)
+
+var (
+ // used
+ SystemMemoryStateUsed = SystemMemoryStateKey.String("used")
+ // free
+ SystemMemoryStateFree = SystemMemoryStateKey.String("free")
+ // shared
+ SystemMemoryStateShared = SystemMemoryStateKey.String("shared")
+ // buffers
+ SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers")
+ // cached
+ SystemMemoryStateCached = SystemMemoryStateKey.String("cached")
+)
+
+// Describes System Memory Paging attributes
+const (
+ // SystemPagingDirectionKey is the attribute Key conforming to the
+ // "system.paging.direction" semantic conventions. It represents the paging
+ // access direction
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'in'
+ SystemPagingDirectionKey = attribute.Key("system.paging.direction")
+
+ // SystemPagingStateKey is the attribute Key conforming to the
+ // "system.paging.state" semantic conventions. It represents the memory
+ // paging state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'free'
+ SystemPagingStateKey = attribute.Key("system.paging.state")
+
+ // SystemPagingTypeKey is the attribute Key conforming to the
+ // "system.paging.type" semantic conventions. It represents the memory
+ // paging type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'minor'
+ SystemPagingTypeKey = attribute.Key("system.paging.type")
+)
+
+var (
+ // in
+ SystemPagingDirectionIn = SystemPagingDirectionKey.String("in")
+ // out
+ SystemPagingDirectionOut = SystemPagingDirectionKey.String("out")
+)
+
+var (
+ // used
+ SystemPagingStateUsed = SystemPagingStateKey.String("used")
+ // free
+ SystemPagingStateFree = SystemPagingStateKey.String("free")
+)
+
+var (
+ // major
+ SystemPagingTypeMajor = SystemPagingTypeKey.String("major")
+ // minor
+ SystemPagingTypeMinor = SystemPagingTypeKey.String("minor")
+)
+
+// Describes Filesystem attributes
+const (
+ // SystemFilesystemModeKey is the attribute Key conforming to the
+ // "system.filesystem.mode" semantic conventions. It represents the
+ // filesystem mode
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'rw, ro'
+ SystemFilesystemModeKey = attribute.Key("system.filesystem.mode")
+
+ // SystemFilesystemMountpointKey is the attribute Key conforming to the
+ // "system.filesystem.mountpoint" semantic conventions. It represents the
+ // filesystem mount path
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/mnt/data'
+ SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint")
+
+ // SystemFilesystemStateKey is the attribute Key conforming to the
+ // "system.filesystem.state" semantic conventions. It represents the
+ // filesystem state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'used'
+ SystemFilesystemStateKey = attribute.Key("system.filesystem.state")
+
+ // SystemFilesystemTypeKey is the attribute Key conforming to the
+ // "system.filesystem.type" semantic conventions. It represents the
+ // filesystem type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ext4'
+ SystemFilesystemTypeKey = attribute.Key("system.filesystem.type")
+)
+
+var (
+ // used
+ SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used")
+ // free
+ SystemFilesystemStateFree = SystemFilesystemStateKey.String("free")
+ // reserved
+ SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved")
+)
+
+var (
+ // fat32
+ SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32")
+ // exfat
+ SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat")
+ // ntfs
+ SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs")
+ // refs
+ SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs")
+ // hfsplus
+ SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus")
+ // ext4
+ SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4")
+)
+
+// SystemFilesystemMode returns an attribute KeyValue conforming to the
+// "system.filesystem.mode" semantic conventions. It represents the filesystem
+// mode
+func SystemFilesystemMode(val string) attribute.KeyValue {
+ return SystemFilesystemModeKey.String(val)
+}
+
+// SystemFilesystemMountpoint returns an attribute KeyValue conforming to
+// the "system.filesystem.mountpoint" semantic conventions. It represents the
+// filesystem mount path
+func SystemFilesystemMountpoint(val string) attribute.KeyValue {
+ return SystemFilesystemMountpointKey.String(val)
+}
+
+// Describes Network attributes
+const (
+ // SystemNetworkStateKey is the attribute Key conforming to the
+ // "system.network.state" semantic conventions. It represents a stateless
+ // protocol MUST NOT set this attribute
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'close_wait'
+ SystemNetworkStateKey = attribute.Key("system.network.state")
+)
+
+var (
+ // close
+ SystemNetworkStateClose = SystemNetworkStateKey.String("close")
+ // close_wait
+ SystemNetworkStateCloseWait = SystemNetworkStateKey.String("close_wait")
+ // closing
+ SystemNetworkStateClosing = SystemNetworkStateKey.String("closing")
+ // delete
+ SystemNetworkStateDelete = SystemNetworkStateKey.String("delete")
+ // established
+ SystemNetworkStateEstablished = SystemNetworkStateKey.String("established")
+ // fin_wait_1
+ SystemNetworkStateFinWait1 = SystemNetworkStateKey.String("fin_wait_1")
+ // fin_wait_2
+ SystemNetworkStateFinWait2 = SystemNetworkStateKey.String("fin_wait_2")
+ // last_ack
+ SystemNetworkStateLastAck = SystemNetworkStateKey.String("last_ack")
+ // listen
+ SystemNetworkStateListen = SystemNetworkStateKey.String("listen")
+ // syn_recv
+ SystemNetworkStateSynRecv = SystemNetworkStateKey.String("syn_recv")
+ // syn_sent
+ SystemNetworkStateSynSent = SystemNetworkStateKey.String("syn_sent")
+ // time_wait
+ SystemNetworkStateTimeWait = SystemNetworkStateKey.String("time_wait")
+)
+
+// Describes System Process attributes
+const (
+ // SystemProcessStatusKey is the attribute Key conforming to the
+ // "system.process.status" semantic conventions. It represents the process
+ // state, e.g., [Linux Process State
+ // Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'running'
+ SystemProcessStatusKey = attribute.Key("system.process.status")
+)
+
+var (
+ // running
+ SystemProcessStatusRunning = SystemProcessStatusKey.String("running")
+ // sleeping
+ SystemProcessStatusSleeping = SystemProcessStatusKey.String("sleeping")
+ // stopped
+ SystemProcessStatusStopped = SystemProcessStatusKey.String("stopped")
+ // defunct
+ SystemProcessStatusDefunct = SystemProcessStatusKey.String("defunct")
+)
+
+// Attributes for telemetry SDK.
+const (
+ // TelemetrySDKLanguageKey is the attribute Key conforming to the
+ // "telemetry.sdk.language" semantic conventions. It represents the
+ // language of the telemetry SDK.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language")
+
+ // TelemetrySDKNameKey is the attribute Key conforming to the
+ // "telemetry.sdk.name" semantic conventions. It represents the name of the
+ // telemetry SDK as defined above.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'opentelemetry'
+ // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute
+ // to `opentelemetry`.
+ // If another SDK, like a fork or a vendor-provided implementation, is
+ // used, this SDK MUST set the
+ // `telemetry.sdk.name` attribute to the fully-qualified class or module
+ // name of this SDK's main entry point
+ // or another suitable identifier depending on the language.
+ // The identifier `opentelemetry` is reserved and MUST NOT be used in this
+ // case.
+ // All custom identifiers SHOULD be stable across different versions of an
+ // implementation.
+ TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
+
+ // TelemetrySDKVersionKey is the attribute Key conforming to the
+ // "telemetry.sdk.version" semantic conventions. It represents the version
+ // string of the telemetry SDK.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: '1.2.3'
+ TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version")
+
+ // TelemetryDistroNameKey is the attribute Key conforming to the
+ // "telemetry.distro.name" semantic conventions. It represents the name of
+ // the auto instrumentation agent or distribution, if used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'parts-unlimited-java'
+ // Note: Official auto instrumentation agents and distributions SHOULD set
+ // the `telemetry.distro.name` attribute to
+ // a string starting with `opentelemetry-`, e.g.
+ // `opentelemetry-java-instrumentation`.
+ TelemetryDistroNameKey = attribute.Key("telemetry.distro.name")
+
+ // TelemetryDistroVersionKey is the attribute Key conforming to the
+ // "telemetry.distro.version" semantic conventions. It represents the
+ // version string of the auto instrumentation agent or distribution, if
+ // used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.2.3'
+ TelemetryDistroVersionKey = attribute.Key("telemetry.distro.version")
+)
+
+var (
+ // cpp
+ TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp")
+ // dotnet
+ TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet")
+ // erlang
+ TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang")
+ // go
+ TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go")
+ // java
+ TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java")
+ // nodejs
+ TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs")
+ // php
+ TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php")
+ // python
+ TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python")
+ // ruby
+ TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby")
+ // rust
+ TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust")
+ // swift
+ TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift")
+ // webjs
+ TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs")
+)
+
+// TelemetrySDKName returns an attribute KeyValue conforming to the
+// "telemetry.sdk.name" semantic conventions. It represents the name of the
+// telemetry SDK as defined above.
+func TelemetrySDKName(val string) attribute.KeyValue {
+ return TelemetrySDKNameKey.String(val)
+}
+
+// TelemetrySDKVersion returns an attribute KeyValue conforming to the
+// "telemetry.sdk.version" semantic conventions. It represents the version
+// string of the telemetry SDK.
+func TelemetrySDKVersion(val string) attribute.KeyValue {
+ return TelemetrySDKVersionKey.String(val)
+}
+
+// TelemetryDistroName returns an attribute KeyValue conforming to the
+// "telemetry.distro.name" semantic conventions. It represents the name of the
+// auto instrumentation agent or distribution, if used.
+func TelemetryDistroName(val string) attribute.KeyValue {
+ return TelemetryDistroNameKey.String(val)
+}
+
+// TelemetryDistroVersion returns an attribute KeyValue conforming to the
+// "telemetry.distro.version" semantic conventions. It represents the version
+// string of the auto instrumentation agent or distribution, if used.
+func TelemetryDistroVersion(val string) attribute.KeyValue {
+ return TelemetryDistroVersionKey.String(val)
+}
+
+// These attributes may be used for any operation to store information about a
+// thread that started a span.
+const (
+ // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic
+ // conventions. It represents the current "managed" thread ID (as opposed
+ // to OS thread ID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ ThreadIDKey = attribute.Key("thread.id")
+
+ // ThreadNameKey is the attribute Key conforming to the "thread.name"
+ // semantic conventions. It represents the current thread name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'main'
+ ThreadNameKey = attribute.Key("thread.name")
+)
+
+// ThreadID returns an attribute KeyValue conforming to the "thread.id"
+// semantic conventions. It represents the current "managed" thread ID (as
+// opposed to OS thread ID).
+func ThreadID(val int) attribute.KeyValue {
+ return ThreadIDKey.Int(val)
+}
+
+// ThreadName returns an attribute KeyValue conforming to the "thread.name"
+// semantic conventions. It represents the current thread name.
+func ThreadName(val string) attribute.KeyValue {
+ return ThreadNameKey.String(val)
+}
+
+// Semantic convention attributes in the TLS namespace.
+const (
+ // TLSCipherKey is the attribute Key conforming to the "tls.cipher"
+ // semantic conventions. It represents the string indicating the
+ // [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5)
+ // used during the current connection.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'TLS_RSA_WITH_3DES_EDE_CBC_SHA',
+ // 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256'
+ // Note: The values allowed for `tls.cipher` MUST be one of the
+ // `Descriptions` of the [registered TLS Cipher
+ // Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4).
+ TLSCipherKey = attribute.Key("tls.cipher")
+
+ // TLSClientCertificateKey is the attribute Key conforming to the
+ // "tls.client.certificate" semantic conventions. It represents the
+ // pEM-encoded stand-alone certificate offered by the client. This is
+ // usually mutually-exclusive of `client.certificate_chain` since this
+ // value also exists in that list.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...'
+ TLSClientCertificateKey = attribute.Key("tls.client.certificate")
+
+ // TLSClientCertificateChainKey is the attribute Key conforming to the
+ // "tls.client.certificate_chain" semantic conventions. It represents the
+ // array of PEM-encoded certificates that make up the certificate chain
+ // offered by the client. This is usually mutually-exclusive of
+ // `client.certificate` since that value should be the first certificate in
+ // the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...', 'MI...'
+ TLSClientCertificateChainKey = attribute.Key("tls.client.certificate_chain")
+
+ // TLSClientHashMd5Key is the attribute Key conforming to the
+ // "tls.client.hash.md5" semantic conventions. It represents the
+ // certificate fingerprint using the MD5 digest of DER-encoded version of
+ // certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC'
+ TLSClientHashMd5Key = attribute.Key("tls.client.hash.md5")
+
+ // TLSClientHashSha1Key is the attribute Key conforming to the
+ // "tls.client.hash.sha1" semantic conventions. It represents the
+ // certificate fingerprint using the SHA1 digest of DER-encoded version of
+ // certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A'
+ TLSClientHashSha1Key = attribute.Key("tls.client.hash.sha1")
+
+ // TLSClientHashSha256Key is the attribute Key conforming to the
+ // "tls.client.hash.sha256" semantic conventions. It represents the
+ // certificate fingerprint using the SHA256 digest of DER-encoded version
+ // of certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0'
+ TLSClientHashSha256Key = attribute.Key("tls.client.hash.sha256")
+
+ // TLSClientIssuerKey is the attribute Key conforming to the
+ // "tls.client.issuer" semantic conventions. It represents the
+ // distinguished name of
+ // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6)
+ // of the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example,
+ // DC=com'
+ TLSClientIssuerKey = attribute.Key("tls.client.issuer")
+
+ // TLSClientJa3Key is the attribute Key conforming to the "tls.client.ja3"
+ // semantic conventions. It represents a hash that identifies clients based
+ // on how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'd4e5b18d6b55c71272893221c96ba240'
+ TLSClientJa3Key = attribute.Key("tls.client.ja3")
+
+ // TLSClientNotAfterKey is the attribute Key conforming to the
+ // "tls.client.not_after" semantic conventions. It represents the date/Time
+ // indicating when client certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021-01-01T00:00:00.000Z'
+ TLSClientNotAfterKey = attribute.Key("tls.client.not_after")
+
+ // TLSClientNotBeforeKey is the attribute Key conforming to the
+ // "tls.client.not_before" semantic conventions. It represents the
+ // date/Time indicating when client certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1970-01-01T00:00:00.000Z'
+ TLSClientNotBeforeKey = attribute.Key("tls.client.not_before")
+
+ // TLSClientServerNameKey is the attribute Key conforming to the
+ // "tls.client.server_name" semantic conventions. It represents the also
+ // called an SNI, this tells the server which hostname to which the client
+ // is attempting to connect to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry.io'
+ TLSClientServerNameKey = attribute.Key("tls.client.server_name")
+
+ // TLSClientSubjectKey is the attribute Key conforming to the
+ // "tls.client.subject" semantic conventions. It represents the
+ // distinguished name of subject of the x.509 certificate presented by the
+ // client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=myclient, OU=Documentation Team, DC=example, DC=com'
+ TLSClientSubjectKey = attribute.Key("tls.client.subject")
+
+ // TLSClientSupportedCiphersKey is the attribute Key conforming to the
+ // "tls.client.supported_ciphers" semantic conventions. It represents the
+ // array of ciphers offered by the client during the client hello.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
+ // "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "..."'
+ TLSClientSupportedCiphersKey = attribute.Key("tls.client.supported_ciphers")
+
+ // TLSCurveKey is the attribute Key conforming to the "tls.curve" semantic
+ // conventions. It represents the string indicating the curve used for the
+ // given cipher, when applicable
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'secp256r1'
+ TLSCurveKey = attribute.Key("tls.curve")
+
+ // TLSEstablishedKey is the attribute Key conforming to the
+ // "tls.established" semantic conventions. It represents the boolean flag
+ // indicating if the TLS negotiation was successful and transitioned to an
+ // encrypted tunnel.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: True
+ TLSEstablishedKey = attribute.Key("tls.established")
+
+ // TLSNextProtocolKey is the attribute Key conforming to the
+ // "tls.next_protocol" semantic conventions. It represents the string
+ // indicating the protocol being tunneled. Per the values in the [IANA
+ // registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids),
+ // this string should be lower case.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'http/1.1'
+ TLSNextProtocolKey = attribute.Key("tls.next_protocol")
+
+ // TLSProtocolNameKey is the attribute Key conforming to the
+ // "tls.protocol.name" semantic conventions. It represents the normalized
+ // lowercase protocol name parsed from original string of the negotiated
+ // [SSL/TLS protocol
+ // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ TLSProtocolNameKey = attribute.Key("tls.protocol.name")
+
+ // TLSProtocolVersionKey is the attribute Key conforming to the
+ // "tls.protocol.version" semantic conventions. It represents the numeric
+ // part of the version parsed from the original string of the negotiated
+ // [SSL/TLS protocol
+ // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.2', '3'
+ TLSProtocolVersionKey = attribute.Key("tls.protocol.version")
+
+ // TLSResumedKey is the attribute Key conforming to the "tls.resumed"
+ // semantic conventions. It represents the boolean flag indicating if this
+ // TLS connection was resumed from an existing TLS negotiation.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: True
+ TLSResumedKey = attribute.Key("tls.resumed")
+
+ // TLSServerCertificateKey is the attribute Key conforming to the
+ // "tls.server.certificate" semantic conventions. It represents the
+ // pEM-encoded stand-alone certificate offered by the server. This is
+ // usually mutually-exclusive of `server.certificate_chain` since this
+ // value also exists in that list.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...'
+ TLSServerCertificateKey = attribute.Key("tls.server.certificate")
+
+ // TLSServerCertificateChainKey is the attribute Key conforming to the
+ // "tls.server.certificate_chain" semantic conventions. It represents the
+ // array of PEM-encoded certificates that make up the certificate chain
+ // offered by the server. This is usually mutually-exclusive of
+ // `server.certificate` since that value should be the first certificate in
+ // the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...', 'MI...'
+ TLSServerCertificateChainKey = attribute.Key("tls.server.certificate_chain")
+
+ // TLSServerHashMd5Key is the attribute Key conforming to the
+ // "tls.server.hash.md5" semantic conventions. It represents the
+ // certificate fingerprint using the MD5 digest of DER-encoded version of
+ // certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC'
+ TLSServerHashMd5Key = attribute.Key("tls.server.hash.md5")
+
+ // TLSServerHashSha1Key is the attribute Key conforming to the
+ // "tls.server.hash.sha1" semantic conventions. It represents the
+ // certificate fingerprint using the SHA1 digest of DER-encoded version of
+ // certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A'
+ TLSServerHashSha1Key = attribute.Key("tls.server.hash.sha1")
+
+ // TLSServerHashSha256Key is the attribute Key conforming to the
+ // "tls.server.hash.sha256" semantic conventions. It represents the
+ // certificate fingerprint using the SHA256 digest of DER-encoded version
+ // of certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0'
+ TLSServerHashSha256Key = attribute.Key("tls.server.hash.sha256")
+
+ // TLSServerIssuerKey is the attribute Key conforming to the
+ // "tls.server.issuer" semantic conventions. It represents the
+ // distinguished name of
+ // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6)
+ // of the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example,
+ // DC=com'
+ TLSServerIssuerKey = attribute.Key("tls.server.issuer")
+
+ // TLSServerJa3sKey is the attribute Key conforming to the
+ // "tls.server.ja3s" semantic conventions. It represents a hash that
+ // identifies servers based on how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'd4e5b18d6b55c71272893221c96ba240'
+ TLSServerJa3sKey = attribute.Key("tls.server.ja3s")
+
+ // TLSServerNotAfterKey is the attribute Key conforming to the
+ // "tls.server.not_after" semantic conventions. It represents the date/Time
+ // indicating when server certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021-01-01T00:00:00.000Z'
+ TLSServerNotAfterKey = attribute.Key("tls.server.not_after")
+
+ // TLSServerNotBeforeKey is the attribute Key conforming to the
+ // "tls.server.not_before" semantic conventions. It represents the
+ // date/Time indicating when server certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1970-01-01T00:00:00.000Z'
+ TLSServerNotBeforeKey = attribute.Key("tls.server.not_before")
+
+ // TLSServerSubjectKey is the attribute Key conforming to the
+ // "tls.server.subject" semantic conventions. It represents the
+ // distinguished name of subject of the x.509 certificate presented by the
+ // server.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=myserver, OU=Documentation Team, DC=example, DC=com'
+ TLSServerSubjectKey = attribute.Key("tls.server.subject")
+)
+
+var (
+ // ssl
+ TLSProtocolNameSsl = TLSProtocolNameKey.String("ssl")
+ // tls
+ TLSProtocolNameTLS = TLSProtocolNameKey.String("tls")
+)
+
+// TLSCipher returns an attribute KeyValue conforming to the "tls.cipher"
+// semantic conventions. It represents the string indicating the
+// [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used
+// during the current connection.
+func TLSCipher(val string) attribute.KeyValue {
+ return TLSCipherKey.String(val)
+}
+
+// TLSClientCertificate returns an attribute KeyValue conforming to the
+// "tls.client.certificate" semantic conventions. It represents the pEM-encoded
+// stand-alone certificate offered by the client. This is usually
+// mutually-exclusive of `client.certificate_chain` since this value also
+// exists in that list.
+func TLSClientCertificate(val string) attribute.KeyValue {
+ return TLSClientCertificateKey.String(val)
+}
+
+// TLSClientCertificateChain returns an attribute KeyValue conforming to the
+// "tls.client.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by
+// the client. This is usually mutually-exclusive of `client.certificate` since
+// that value should be the first certificate in the chain.
+func TLSClientCertificateChain(val ...string) attribute.KeyValue {
+ return TLSClientCertificateChainKey.StringSlice(val)
+}
+
+// TLSClientHashMd5 returns an attribute KeyValue conforming to the
+// "tls.client.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashMd5(val string) attribute.KeyValue {
+ return TLSClientHashMd5Key.String(val)
+}
+
+// TLSClientHashSha1 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha1(val string) attribute.KeyValue {
+ return TLSClientHashSha1Key.String(val)
+}
+
+// TLSClientHashSha256 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha256(val string) attribute.KeyValue {
+ return TLSClientHashSha256Key.String(val)
+}
+
+// TLSClientIssuer returns an attribute KeyValue conforming to the
+// "tls.client.issuer" semantic conventions. It represents the distinguished
+// name of
+// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of
+// the issuer of the x.509 certificate presented by the client.
+func TLSClientIssuer(val string) attribute.KeyValue {
+ return TLSClientIssuerKey.String(val)
+}
+
+// TLSClientJa3 returns an attribute KeyValue conforming to the
+// "tls.client.ja3" semantic conventions. It represents a hash that identifies
+// clients based on how they perform an SSL/TLS handshake.
+func TLSClientJa3(val string) attribute.KeyValue {
+ return TLSClientJa3Key.String(val)
+}
+
+// TLSClientNotAfter returns an attribute KeyValue conforming to the
+// "tls.client.not_after" semantic conventions. It represents the date/Time
+// indicating when client certificate is no longer considered valid.
+func TLSClientNotAfter(val string) attribute.KeyValue {
+ return TLSClientNotAfterKey.String(val)
+}
+
+// TLSClientNotBefore returns an attribute KeyValue conforming to the
+// "tls.client.not_before" semantic conventions. It represents the date/Time
+// indicating when client certificate is first considered valid.
+func TLSClientNotBefore(val string) attribute.KeyValue {
+ return TLSClientNotBeforeKey.String(val)
+}
+
+// TLSClientServerName returns an attribute KeyValue conforming to the
+// "tls.client.server_name" semantic conventions. It represents the also called
+// an SNI, this tells the server which hostname to which the client is
+// attempting to connect to.
+func TLSClientServerName(val string) attribute.KeyValue {
+ return TLSClientServerNameKey.String(val)
+}
+
+// TLSClientSubject returns an attribute KeyValue conforming to the
+// "tls.client.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the client.
+func TLSClientSubject(val string) attribute.KeyValue {
+ return TLSClientSubjectKey.String(val)
+}
+
+// TLSClientSupportedCiphers returns an attribute KeyValue conforming to the
+// "tls.client.supported_ciphers" semantic conventions. It represents the array
+// of ciphers offered by the client during the client hello.
+func TLSClientSupportedCiphers(val ...string) attribute.KeyValue {
+ return TLSClientSupportedCiphersKey.StringSlice(val)
+}
+
+// TLSCurve returns an attribute KeyValue conforming to the "tls.curve"
+// semantic conventions. It represents the string indicating the curve used for
+// the given cipher, when applicable
+func TLSCurve(val string) attribute.KeyValue {
+ return TLSCurveKey.String(val)
+}
+
+// TLSEstablished returns an attribute KeyValue conforming to the
+// "tls.established" semantic conventions. It represents the boolean flag
+// indicating if the TLS negotiation was successful and transitioned to an
+// encrypted tunnel.
+func TLSEstablished(val bool) attribute.KeyValue {
+ return TLSEstablishedKey.Bool(val)
+}
+
+// TLSNextProtocol returns an attribute KeyValue conforming to the
+// "tls.next_protocol" semantic conventions. It represents the string
+// indicating the protocol being tunneled. Per the values in the [IANA
+// registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids),
+// this string should be lower case.
+func TLSNextProtocol(val string) attribute.KeyValue {
+ return TLSNextProtocolKey.String(val)
+}
+
+// TLSProtocolVersion returns an attribute KeyValue conforming to the
+// "tls.protocol.version" semantic conventions. It represents the numeric part
+// of the version parsed from the original string of the negotiated [SSL/TLS
+// protocol
+// version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+func TLSProtocolVersion(val string) attribute.KeyValue {
+ return TLSProtocolVersionKey.String(val)
+}
+
+// TLSResumed returns an attribute KeyValue conforming to the "tls.resumed"
+// semantic conventions. It represents the boolean flag indicating if this TLS
+// connection was resumed from an existing TLS negotiation.
+func TLSResumed(val bool) attribute.KeyValue {
+ return TLSResumedKey.Bool(val)
+}
+
+// TLSServerCertificate returns an attribute KeyValue conforming to the
+// "tls.server.certificate" semantic conventions. It represents the pEM-encoded
+// stand-alone certificate offered by the server. This is usually
+// mutually-exclusive of `server.certificate_chain` since this value also
+// exists in that list.
+func TLSServerCertificate(val string) attribute.KeyValue {
+ return TLSServerCertificateKey.String(val)
+}
+
+// TLSServerCertificateChain returns an attribute KeyValue conforming to the
+// "tls.server.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by
+// the server. This is usually mutually-exclusive of `server.certificate` since
+// that value should be the first certificate in the chain.
+func TLSServerCertificateChain(val ...string) attribute.KeyValue {
+ return TLSServerCertificateChainKey.StringSlice(val)
+}
+
+// TLSServerHashMd5 returns an attribute KeyValue conforming to the
+// "tls.server.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashMd5(val string) attribute.KeyValue {
+ return TLSServerHashMd5Key.String(val)
+}
+
+// TLSServerHashSha1 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha1(val string) attribute.KeyValue {
+ return TLSServerHashSha1Key.String(val)
+}
+
+// TLSServerHashSha256 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha256(val string) attribute.KeyValue {
+ return TLSServerHashSha256Key.String(val)
+}
+
+// TLSServerIssuer returns an attribute KeyValue conforming to the
+// "tls.server.issuer" semantic conventions. It represents the distinguished
+// name of
+// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of
+// the issuer of the x.509 certificate presented by the client.
+func TLSServerIssuer(val string) attribute.KeyValue {
+ return TLSServerIssuerKey.String(val)
+}
+
+// TLSServerJa3s returns an attribute KeyValue conforming to the
+// "tls.server.ja3s" semantic conventions. It represents a hash that identifies
+// servers based on how they perform an SSL/TLS handshake.
+func TLSServerJa3s(val string) attribute.KeyValue {
+ return TLSServerJa3sKey.String(val)
+}
+
+// TLSServerNotAfter returns an attribute KeyValue conforming to the
+// "tls.server.not_after" semantic conventions. It represents the date/Time
+// indicating when server certificate is no longer considered valid.
+func TLSServerNotAfter(val string) attribute.KeyValue {
+ return TLSServerNotAfterKey.String(val)
+}
+
+// TLSServerNotBefore returns an attribute KeyValue conforming to the
+// "tls.server.not_before" semantic conventions. It represents the date/Time
+// indicating when server certificate is first considered valid.
+func TLSServerNotBefore(val string) attribute.KeyValue {
+ return TLSServerNotBeforeKey.String(val)
+}
+
+// TLSServerSubject returns an attribute KeyValue conforming to the
+// "tls.server.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the server.
+func TLSServerSubject(val string) attribute.KeyValue {
+ return TLSServerSubjectKey.String(val)
+}
+
+// Attributes describing URL.
+const (
+ // URLDomainKey is the attribute Key conforming to the "url.domain"
+ // semantic conventions. It represents the domain extracted from the
+ // `url.full`, such as "opentelemetry.io".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'www.foo.bar', 'opentelemetry.io', '3.12.167.2',
+ // '[1080:0:0:0:8:800:200C:417A]'
+ // Note: In some cases a URL may refer to an IP and/or port directly,
+ // without a domain name. In this case, the IP address would go to the
+ // domain field. If the URL contains a [literal IPv6
+ // address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by
+ // `[` and `]`, the `[` and `]` characters should also be captured in the
+ // domain field.
+ URLDomainKey = attribute.Key("url.domain")
+
+ // URLExtensionKey is the attribute Key conforming to the "url.extension"
+ // semantic conventions. It represents the file extension extracted from
+ // the `url.full`, excluding the leading dot.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'png', 'gz'
+ // Note: The file extension is only set if it exists, as not every url has
+ // a file extension. When the file name has multiple extensions
+ // `example.tar.gz`, only the last one should be captured `gz`, not
+ // `tar.gz`.
+ URLExtensionKey = attribute.Key("url.extension")
+
+ // URLFragmentKey is the attribute Key conforming to the "url.fragment"
+ // semantic conventions. It represents the [URI
+ // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'SemConv'
+ URLFragmentKey = attribute.Key("url.fragment")
+
+ // URLFullKey is the attribute Key conforming to the "url.full" semantic
+ // conventions. It represents the absolute URL describing a network
+ // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
+ // '//localhost'
+ // Note: For network calls, URL usually has
+ // `scheme://host[:port][path][?query][#fragment]` format, where the
+ // fragment is not transmitted over HTTP, but if it is known, it SHOULD be
+ // included nevertheless.
+ // `url.full` MUST NOT contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case username and
+ // password SHOULD be redacted and attribute's value SHOULD be
+ // `https://REDACTED:REDACTED@www.example.com/`.
+ // `url.full` SHOULD capture the absolute URL when it is available (or can
+ // be reconstructed). Sensitive content provided in `url.full` SHOULD be
+ // scrubbed when instrumentations can identify it.
+ URLFullKey = attribute.Key("url.full")
+
+ // URLOriginalKey is the attribute Key conforming to the "url.original"
+ // semantic conventions. It represents the unmodified original URL as seen
+ // in the event source.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
+ // 'search?q=OpenTelemetry'
+ // Note: In network monitoring, the observed URL may be a full URL, whereas
+ // in access logs, the URL is often just represented as a path. This field
+ // is meant to represent the URL as it was observed, complete or not.
+ // `url.original` might contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case password and
+ // username SHOULD NOT be redacted and attribute's value SHOULD remain the
+ // same.
+ URLOriginalKey = attribute.Key("url.original")
+
+ // URLPathKey is the attribute Key conforming to the "url.path" semantic
+ // conventions. It represents the [URI
+ // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/search'
+ // Note: Sensitive content provided in `url.path` SHOULD be scrubbed when
+ // instrumentations can identify it.
+ URLPathKey = attribute.Key("url.path")
+
+ // URLPortKey is the attribute Key conforming to the "url.port" semantic
+ // conventions. It represents the port extracted from the `url.full`
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 443
+ URLPortKey = attribute.Key("url.port")
+
+ // URLQueryKey is the attribute Key conforming to the "url.query" semantic
+ // conventions. It represents the [URI
+ // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'q=OpenTelemetry'
+ // Note: Sensitive content provided in `url.query` SHOULD be scrubbed when
+ // instrumentations can identify it.
+ URLQueryKey = attribute.Key("url.query")
+
+ // URLRegisteredDomainKey is the attribute Key conforming to the
+ // "url.registered_domain" semantic conventions. It represents the highest
+ // registered url domain, stripped of the subdomain.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'example.com', 'foo.co.uk'
+ // Note: This value can be determined precisely with the [public suffix
+ // list](http://publicsuffix.org). For example, the registered domain for
+ // `foo.example.com` is `example.com`. Trying to approximate this by simply
+ // taking the last two labels will not work well for TLDs such as `co.uk`.
+ URLRegisteredDomainKey = attribute.Key("url.registered_domain")
+
+ // URLSchemeKey is the attribute Key conforming to the "url.scheme"
+ // semantic conventions. It represents the [URI
+ // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
+ // identifying the used protocol.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'https', 'ftp', 'telnet'
+ URLSchemeKey = attribute.Key("url.scheme")
+
+ // URLSubdomainKey is the attribute Key conforming to the "url.subdomain"
+ // semantic conventions. It represents the subdomain portion of a fully
+ // qualified domain name includes all of the names except the host name
+ // under the registered_domain. In a partially qualified domain, or if the
+ // qualification level of the full name cannot be determined, subdomain
+ // contains all of the names below the registered domain.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'east', 'sub2.sub1'
+ // Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If
+ // the domain has multiple levels of subdomain, such as
+ // `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`,
+ // with no trailing period.
+ URLSubdomainKey = attribute.Key("url.subdomain")
+
+ // URLTemplateKey is the attribute Key conforming to the "url.template"
+ // semantic conventions. It represents the low-cardinality template of an
+ // [absolute path
+ // reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/users/{id}', '/users/:id', '/users?id={id}'
+ URLTemplateKey = attribute.Key("url.template")
+
+ // URLTopLevelDomainKey is the attribute Key conforming to the
+ // "url.top_level_domain" semantic conventions. It represents the effective
+ // top level domain (eTLD), also known as the domain suffix, is the last
+ // part of the domain name. For example, the top level domain for
+ // example.com is `com`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com', 'co.uk'
+ // Note: This value can be determined precisely with the [public suffix
+ // list](http://publicsuffix.org).
+ URLTopLevelDomainKey = attribute.Key("url.top_level_domain")
+)
+
+// URLDomain returns an attribute KeyValue conforming to the "url.domain"
+// semantic conventions. It represents the domain extracted from the
+// `url.full`, such as "opentelemetry.io".
+func URLDomain(val string) attribute.KeyValue {
+ return URLDomainKey.String(val)
+}
+
+// URLExtension returns an attribute KeyValue conforming to the
+// "url.extension" semantic conventions. It represents the file extension
+// extracted from the `url.full`, excluding the leading dot.
+func URLExtension(val string) attribute.KeyValue {
+ return URLExtensionKey.String(val)
+}
+
+// URLFragment returns an attribute KeyValue conforming to the
+// "url.fragment" semantic conventions. It represents the [URI
+// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
+func URLFragment(val string) attribute.KeyValue {
+ return URLFragmentKey.String(val)
+}
+
+// URLFull returns an attribute KeyValue conforming to the "url.full"
+// semantic conventions. It represents the absolute URL describing a network
+// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
+func URLFull(val string) attribute.KeyValue {
+ return URLFullKey.String(val)
+}
+
+// URLOriginal returns an attribute KeyValue conforming to the
+// "url.original" semantic conventions. It represents the unmodified original
+// URL as seen in the event source.
+func URLOriginal(val string) attribute.KeyValue {
+ return URLOriginalKey.String(val)
+}
+
+// URLPath returns an attribute KeyValue conforming to the "url.path"
+// semantic conventions. It represents the [URI
+// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
+func URLPath(val string) attribute.KeyValue {
+ return URLPathKey.String(val)
+}
+
+// URLPort returns an attribute KeyValue conforming to the "url.port"
+// semantic conventions. It represents the port extracted from the `url.full`
+func URLPort(val int) attribute.KeyValue {
+ return URLPortKey.Int(val)
+}
+
+// URLQuery returns an attribute KeyValue conforming to the "url.query"
+// semantic conventions. It represents the [URI
+// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
+func URLQuery(val string) attribute.KeyValue {
+ return URLQueryKey.String(val)
+}
+
+// URLRegisteredDomain returns an attribute KeyValue conforming to the
+// "url.registered_domain" semantic conventions. It represents the highest
+// registered url domain, stripped of the subdomain.
+func URLRegisteredDomain(val string) attribute.KeyValue {
+ return URLRegisteredDomainKey.String(val)
+}
+
+// URLScheme returns an attribute KeyValue conforming to the "url.scheme"
+// semantic conventions. It represents the [URI
+// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
+// identifying the used protocol.
+func URLScheme(val string) attribute.KeyValue {
+ return URLSchemeKey.String(val)
+}
+
+// URLSubdomain returns an attribute KeyValue conforming to the
+// "url.subdomain" semantic conventions. It represents the subdomain portion of
+// a fully qualified domain name includes all of the names except the host name
+// under the registered_domain. In a partially qualified domain, or if the
+// qualification level of the full name cannot be determined, subdomain
+// contains all of the names below the registered domain.
+func URLSubdomain(val string) attribute.KeyValue {
+ return URLSubdomainKey.String(val)
+}
+
+// URLTemplate returns an attribute KeyValue conforming to the
+// "url.template" semantic conventions. It represents the low-cardinality
+// template of an [absolute path
+// reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2).
+func URLTemplate(val string) attribute.KeyValue {
+ return URLTemplateKey.String(val)
+}
+
+// URLTopLevelDomain returns an attribute KeyValue conforming to the
+// "url.top_level_domain" semantic conventions. It represents the effective top
+// level domain (eTLD), also known as the domain suffix, is the last part of
+// the domain name. For example, the top level domain for example.com is `com`.
+func URLTopLevelDomain(val string) attribute.KeyValue {
+ return URLTopLevelDomainKey.String(val)
+}
+
+// Describes user-agent attributes.
+const (
+ // UserAgentNameKey is the attribute Key conforming to the
+ // "user_agent.name" semantic conventions. It represents the name of the
+ // user-agent extracted from original. Usually refers to the browser's
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Safari', 'YourApp'
+ // Note: [Example](https://www.whatsmyua.info) of extracting browser's name
+ // from original string. In the case of using a user-agent for non-browser
+ // products, such as microservices with multiple names/versions inside the
+ // `user_agent.original`, the most significant name SHOULD be selected. In
+ // such a scenario it should align with `user_agent.version`
+ UserAgentNameKey = attribute.Key("user_agent.name")
+
+ // UserAgentOriginalKey is the attribute Key conforming to the
+ // "user_agent.original" semantic conventions. It represents the value of
+ // the [HTTP
+ // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+ // header sent by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU
+ // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)
+ // Version/14.1.2 Mobile/15E148 Safari/604.1', 'YourApp/1.0.0
+ // grpc-java-okhttp/1.27.2'
+ UserAgentOriginalKey = attribute.Key("user_agent.original")
+
+ // UserAgentVersionKey is the attribute Key conforming to the
+ // "user_agent.version" semantic conventions. It represents the version of
+ // the user-agent extracted from original. Usually refers to the browser's
+ // version
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.1.2', '1.0.0'
+ // Note: [Example](https://www.whatsmyua.info) of extracting browser's
+ // version from original string. In the case of using a user-agent for
+ // non-browser products, such as microservices with multiple names/versions
+ // inside the `user_agent.original`, the most significant version SHOULD be
+ // selected. In such a scenario it should align with `user_agent.name`
+ UserAgentVersionKey = attribute.Key("user_agent.version")
+)
+
+// UserAgentName returns an attribute KeyValue conforming to the
+// "user_agent.name" semantic conventions. It represents the name of the
+// user-agent extracted from original. Usually refers to the browser's name.
+func UserAgentName(val string) attribute.KeyValue {
+ return UserAgentNameKey.String(val)
+}
+
+// UserAgentOriginal returns an attribute KeyValue conforming to the
+// "user_agent.original" semantic conventions. It represents the value of the
+// [HTTP
+// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+// header sent by the client.
+func UserAgentOriginal(val string) attribute.KeyValue {
+ return UserAgentOriginalKey.String(val)
+}
+
+// UserAgentVersion returns an attribute KeyValue conforming to the
+// "user_agent.version" semantic conventions. It represents the version of the
+// user-agent extracted from original. Usually refers to the browser's version
+func UserAgentVersion(val string) attribute.KeyValue {
+ return UserAgentVersionKey.String(val)
+}
+
+// The attributes used to describe the packaged software running the
+// application code.
+const (
+ // WebEngineDescriptionKey is the attribute Key conforming to the
+ // "webengine.description" semantic conventions. It represents the
+ // additional description of the web engine (e.g. detailed version and
+ // edition information).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) -
+ // 2.2.2.Final'
+ WebEngineDescriptionKey = attribute.Key("webengine.description")
+
+ // WebEngineNameKey is the attribute Key conforming to the "webengine.name"
+ // semantic conventions. It represents the name of the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'WildFly'
+ WebEngineNameKey = attribute.Key("webengine.name")
+
+ // WebEngineVersionKey is the attribute Key conforming to the
+ // "webengine.version" semantic conventions. It represents the version of
+ // the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '21.0.0'
+ WebEngineVersionKey = attribute.Key("webengine.version")
+)
+
+// WebEngineDescription returns an attribute KeyValue conforming to the
+// "webengine.description" semantic conventions. It represents the additional
+// description of the web engine (e.g. detailed version and edition
+// information).
+func WebEngineDescription(val string) attribute.KeyValue {
+ return WebEngineDescriptionKey.String(val)
+}
+
+// WebEngineName returns an attribute KeyValue conforming to the
+// "webengine.name" semantic conventions. It represents the name of the web
+// engine.
+func WebEngineName(val string) attribute.KeyValue {
+ return WebEngineNameKey.String(val)
+}
+
+// WebEngineVersion returns an attribute KeyValue conforming to the
+// "webengine.version" semantic conventions. It represents the version of the
+// web engine.
+func WebEngineVersion(val string) attribute.KeyValue {
+ return WebEngineVersionKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go
new file mode 100644
index 0000000000..d031bbea78
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package semconv implements OpenTelemetry semantic conventions.
+//
+// OpenTelemetry semantic conventions are agreed standardized naming
+// patterns for OpenTelemetry things. This package represents the v1.26.0
+// version of the OpenTelemetry semantic conventions.
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go
new file mode 100644
index 0000000000..bfaee0d56e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+const (
+ // ExceptionEventName is the name of the Span event representing an exception.
+ ExceptionEventName = "exception"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go
new file mode 100644
index 0000000000..fcdb9f4859
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go
@@ -0,0 +1,1307 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+const (
+
+ // ContainerCPUTime is the metric conforming to the "container.cpu.time"
+ // semantic conventions. It represents the total CPU time consumed.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ ContainerCPUTimeName = "container.cpu.time"
+ ContainerCPUTimeUnit = "s"
+ ContainerCPUTimeDescription = "Total CPU time consumed"
+
+ // ContainerMemoryUsage is the metric conforming to the
+ // "container.memory.usage" semantic conventions. It represents the memory
+ // usage of the container.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ContainerMemoryUsageName = "container.memory.usage"
+ ContainerMemoryUsageUnit = "By"
+ ContainerMemoryUsageDescription = "Memory usage of the container."
+
+ // ContainerDiskIo is the metric conforming to the "container.disk.io" semantic
+ // conventions. It represents the disk bytes for the container.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ContainerDiskIoName = "container.disk.io"
+ ContainerDiskIoUnit = "By"
+ ContainerDiskIoDescription = "Disk bytes for the container."
+
+ // ContainerNetworkIo is the metric conforming to the "container.network.io"
+ // semantic conventions. It represents the network bytes for the container.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ContainerNetworkIoName = "container.network.io"
+ ContainerNetworkIoUnit = "By"
+ ContainerNetworkIoDescription = "Network bytes for the container."
+
+ // DBClientOperationDuration is the metric conforming to the
+ // "db.client.operation.duration" semantic conventions. It represents the
+ // duration of database client operations.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientOperationDurationName = "db.client.operation.duration"
+ DBClientOperationDurationUnit = "s"
+ DBClientOperationDurationDescription = "Duration of database client operations."
+
+ // DBClientConnectionCount is the metric conforming to the
+ // "db.client.connection.count" semantic conventions. It represents the number
+ // of connections that are currently in state described by the `state`
+ // attribute.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionCountName = "db.client.connection.count"
+ DBClientConnectionCountUnit = "{connection}"
+ DBClientConnectionCountDescription = "The number of connections that are currently in state described by the `state` attribute"
+
+ // DBClientConnectionIdleMax is the metric conforming to the
+ // "db.client.connection.idle.max" semantic conventions. It represents the
+ // maximum number of idle open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionIdleMaxName = "db.client.connection.idle.max"
+ DBClientConnectionIdleMaxUnit = "{connection}"
+ DBClientConnectionIdleMaxDescription = "The maximum number of idle open connections allowed"
+
+ // DBClientConnectionIdleMin is the metric conforming to the
+ // "db.client.connection.idle.min" semantic conventions. It represents the
+ // minimum number of idle open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionIdleMinName = "db.client.connection.idle.min"
+ DBClientConnectionIdleMinUnit = "{connection}"
+ DBClientConnectionIdleMinDescription = "The minimum number of idle open connections allowed"
+
+ // DBClientConnectionMax is the metric conforming to the
+ // "db.client.connection.max" semantic conventions. It represents the maximum
+ // number of open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionMaxName = "db.client.connection.max"
+ DBClientConnectionMaxUnit = "{connection}"
+ DBClientConnectionMaxDescription = "The maximum number of open connections allowed"
+
+ // DBClientConnectionPendingRequests is the metric conforming to the
+ // "db.client.connection.pending_requests" semantic conventions. It represents
+ // the number of pending requests for an open connection, cumulative for the
+ // entire pool.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ DBClientConnectionPendingRequestsName = "db.client.connection.pending_requests"
+ DBClientConnectionPendingRequestsUnit = "{request}"
+ DBClientConnectionPendingRequestsDescription = "The number of pending requests for an open connection, cumulative for the entire pool"
+
+ // DBClientConnectionTimeouts is the metric conforming to the
+ // "db.client.connection.timeouts" semantic conventions. It represents the
+ // number of connection timeouts that have occurred trying to obtain a
+ // connection from the pool.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ DBClientConnectionTimeoutsName = "db.client.connection.timeouts"
+ DBClientConnectionTimeoutsUnit = "{timeout}"
+ DBClientConnectionTimeoutsDescription = "The number of connection timeouts that have occurred trying to obtain a connection from the pool"
+
+ // DBClientConnectionCreateTime is the metric conforming to the
+ // "db.client.connection.create_time" semantic conventions. It represents the
+ // time it took to create a new connection.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientConnectionCreateTimeName = "db.client.connection.create_time"
+ DBClientConnectionCreateTimeUnit = "s"
+ DBClientConnectionCreateTimeDescription = "The time it took to create a new connection"
+
+ // DBClientConnectionWaitTime is the metric conforming to the
+ // "db.client.connection.wait_time" semantic conventions. It represents the
+ // time it took to obtain an open connection from the pool.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientConnectionWaitTimeName = "db.client.connection.wait_time"
+ DBClientConnectionWaitTimeUnit = "s"
+ DBClientConnectionWaitTimeDescription = "The time it took to obtain an open connection from the pool"
+
+ // DBClientConnectionUseTime is the metric conforming to the
+ // "db.client.connection.use_time" semantic conventions. It represents the time
+ // between borrowing a connection and returning it to the pool.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientConnectionUseTimeName = "db.client.connection.use_time"
+ DBClientConnectionUseTimeUnit = "s"
+ DBClientConnectionUseTimeDescription = "The time between borrowing a connection and returning it to the pool"
+
+ // DBClientConnectionsUsage is the metric conforming to the
+ // "db.client.connections.usage" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.count` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsUsageName = "db.client.connections.usage"
+ DBClientConnectionsUsageUnit = "{connection}"
+ DBClientConnectionsUsageDescription = "Deprecated, use `db.client.connection.count` instead."
+
+ // DBClientConnectionsIdleMax is the metric conforming to the
+ // "db.client.connections.idle.max" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.idle.max` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsIdleMaxName = "db.client.connections.idle.max"
+ DBClientConnectionsIdleMaxUnit = "{connection}"
+ DBClientConnectionsIdleMaxDescription = "Deprecated, use `db.client.connection.idle.max` instead."
+
+ // DBClientConnectionsIdleMin is the metric conforming to the
+ // "db.client.connections.idle.min" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.idle.min` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsIdleMinName = "db.client.connections.idle.min"
+ DBClientConnectionsIdleMinUnit = "{connection}"
+ DBClientConnectionsIdleMinDescription = "Deprecated, use `db.client.connection.idle.min` instead."
+
+ // DBClientConnectionsMax is the metric conforming to the
+ // "db.client.connections.max" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.max` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsMaxName = "db.client.connections.max"
+ DBClientConnectionsMaxUnit = "{connection}"
+ DBClientConnectionsMaxDescription = "Deprecated, use `db.client.connection.max` instead."
+
+ // DBClientConnectionsPendingRequests is the metric conforming to the
+ // "db.client.connections.pending_requests" semantic conventions. It represents
+ // the deprecated, use `db.client.connection.pending_requests` instead.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ DBClientConnectionsPendingRequestsName = "db.client.connections.pending_requests"
+ DBClientConnectionsPendingRequestsUnit = "{request}"
+ DBClientConnectionsPendingRequestsDescription = "Deprecated, use `db.client.connection.pending_requests` instead."
+
+ // DBClientConnectionsTimeouts is the metric conforming to the
+ // "db.client.connections.timeouts" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.timeouts` instead.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ DBClientConnectionsTimeoutsName = "db.client.connections.timeouts"
+ DBClientConnectionsTimeoutsUnit = "{timeout}"
+ DBClientConnectionsTimeoutsDescription = "Deprecated, use `db.client.connection.timeouts` instead."
+
+ // DBClientConnectionsCreateTime is the metric conforming to the
+ // "db.client.connections.create_time" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.create_time` instead. Note: the unit
+ // also changed from `ms` to `s`.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsCreateTimeName = "db.client.connections.create_time"
+ DBClientConnectionsCreateTimeUnit = "ms"
+ DBClientConnectionsCreateTimeDescription = "Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`."
+
+ // DBClientConnectionsWaitTime is the metric conforming to the
+ // "db.client.connections.wait_time" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.wait_time` instead. Note: the unit
+ // also changed from `ms` to `s`.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsWaitTimeName = "db.client.connections.wait_time"
+ DBClientConnectionsWaitTimeUnit = "ms"
+ DBClientConnectionsWaitTimeDescription = "Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`."
+
+ // DBClientConnectionsUseTime is the metric conforming to the
+ // "db.client.connections.use_time" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.use_time` instead. Note: the unit also
+ // changed from `ms` to `s`.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsUseTimeName = "db.client.connections.use_time"
+ DBClientConnectionsUseTimeUnit = "ms"
+ DBClientConnectionsUseTimeDescription = "Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`."
+
+ // DNSLookupDuration is the metric conforming to the "dns.lookup.duration"
+ // semantic conventions. It represents the measures the time taken to perform a
+ // DNS lookup.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DNSLookupDurationName = "dns.lookup.duration"
+ DNSLookupDurationUnit = "s"
+ DNSLookupDurationDescription = "Measures the time taken to perform a DNS lookup."
+
+ // AspnetcoreRoutingMatchAttempts is the metric conforming to the
+ // "aspnetcore.routing.match_attempts" semantic conventions. It represents the
+ // number of requests that were attempted to be matched to an endpoint.
+ // Instrument: counter
+ // Unit: {match_attempt}
+ // Stability: Stable
+ AspnetcoreRoutingMatchAttemptsName = "aspnetcore.routing.match_attempts"
+ AspnetcoreRoutingMatchAttemptsUnit = "{match_attempt}"
+ AspnetcoreRoutingMatchAttemptsDescription = "Number of requests that were attempted to be matched to an endpoint."
+
+ // AspnetcoreDiagnosticsExceptions is the metric conforming to the
+ // "aspnetcore.diagnostics.exceptions" semantic conventions. It represents the
+ // number of exceptions caught by exception handling middleware.
+ // Instrument: counter
+ // Unit: {exception}
+ // Stability: Stable
+ AspnetcoreDiagnosticsExceptionsName = "aspnetcore.diagnostics.exceptions"
+ AspnetcoreDiagnosticsExceptionsUnit = "{exception}"
+ AspnetcoreDiagnosticsExceptionsDescription = "Number of exceptions caught by exception handling middleware."
+
+ // AspnetcoreRateLimitingActiveRequestLeases is the metric conforming to the
+ // "aspnetcore.rate_limiting.active_request_leases" semantic conventions. It
+ // represents the number of requests that are currently active on the server
+ // that hold a rate limiting lease.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Stable
+ AspnetcoreRateLimitingActiveRequestLeasesName = "aspnetcore.rate_limiting.active_request_leases"
+ AspnetcoreRateLimitingActiveRequestLeasesUnit = "{request}"
+ AspnetcoreRateLimitingActiveRequestLeasesDescription = "Number of requests that are currently active on the server that hold a rate limiting lease."
+
+ // AspnetcoreRateLimitingRequestLeaseDuration is the metric conforming to the
+ // "aspnetcore.rate_limiting.request_lease.duration" semantic conventions. It
+ // represents the duration of rate limiting lease held by requests on the
+ // server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ AspnetcoreRateLimitingRequestLeaseDurationName = "aspnetcore.rate_limiting.request_lease.duration"
+ AspnetcoreRateLimitingRequestLeaseDurationUnit = "s"
+ AspnetcoreRateLimitingRequestLeaseDurationDescription = "The duration of rate limiting lease held by requests on the server."
+
+ // AspnetcoreRateLimitingRequestTimeInQueue is the metric conforming to the
+ // "aspnetcore.rate_limiting.request.time_in_queue" semantic conventions. It
+ // represents the time the request spent in a queue waiting to acquire a rate
+ // limiting lease.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ AspnetcoreRateLimitingRequestTimeInQueueName = "aspnetcore.rate_limiting.request.time_in_queue"
+ AspnetcoreRateLimitingRequestTimeInQueueUnit = "s"
+ AspnetcoreRateLimitingRequestTimeInQueueDescription = "The time the request spent in a queue waiting to acquire a rate limiting lease."
+
+ // AspnetcoreRateLimitingQueuedRequests is the metric conforming to the
+ // "aspnetcore.rate_limiting.queued_requests" semantic conventions. It
+ // represents the number of requests that are currently queued, waiting to
+ // acquire a rate limiting lease.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Stable
+ AspnetcoreRateLimitingQueuedRequestsName = "aspnetcore.rate_limiting.queued_requests"
+ AspnetcoreRateLimitingQueuedRequestsUnit = "{request}"
+ AspnetcoreRateLimitingQueuedRequestsDescription = "Number of requests that are currently queued, waiting to acquire a rate limiting lease."
+
+ // AspnetcoreRateLimitingRequests is the metric conforming to the
+ // "aspnetcore.rate_limiting.requests" semantic conventions. It represents the
+ // number of requests that tried to acquire a rate limiting lease.
+ // Instrument: counter
+ // Unit: {request}
+ // Stability: Stable
+ AspnetcoreRateLimitingRequestsName = "aspnetcore.rate_limiting.requests"
+ AspnetcoreRateLimitingRequestsUnit = "{request}"
+ AspnetcoreRateLimitingRequestsDescription = "Number of requests that tried to acquire a rate limiting lease."
+
+ // KestrelActiveConnections is the metric conforming to the
+ // "kestrel.active_connections" semantic conventions. It represents the number
+ // of connections that are currently active on the server.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelActiveConnectionsName = "kestrel.active_connections"
+ KestrelActiveConnectionsUnit = "{connection}"
+ KestrelActiveConnectionsDescription = "Number of connections that are currently active on the server."
+
+ // KestrelConnectionDuration is the metric conforming to the
+ // "kestrel.connection.duration" semantic conventions. It represents the
+ // duration of connections on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ KestrelConnectionDurationName = "kestrel.connection.duration"
+ KestrelConnectionDurationUnit = "s"
+ KestrelConnectionDurationDescription = "The duration of connections on the server."
+
+ // KestrelRejectedConnections is the metric conforming to the
+ // "kestrel.rejected_connections" semantic conventions. It represents the
+ // number of connections rejected by the server.
+ // Instrument: counter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelRejectedConnectionsName = "kestrel.rejected_connections"
+ KestrelRejectedConnectionsUnit = "{connection}"
+ KestrelRejectedConnectionsDescription = "Number of connections rejected by the server."
+
+ // KestrelQueuedConnections is the metric conforming to the
+ // "kestrel.queued_connections" semantic conventions. It represents the number
+ // of connections that are currently queued and are waiting to start.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelQueuedConnectionsName = "kestrel.queued_connections"
+ KestrelQueuedConnectionsUnit = "{connection}"
+ KestrelQueuedConnectionsDescription = "Number of connections that are currently queued and are waiting to start."
+
+ // KestrelQueuedRequests is the metric conforming to the
+ // "kestrel.queued_requests" semantic conventions. It represents the number of
+ // HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are
+ // currently queued and are waiting to start.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Stable
+ KestrelQueuedRequestsName = "kestrel.queued_requests"
+ KestrelQueuedRequestsUnit = "{request}"
+ KestrelQueuedRequestsDescription = "Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start."
+
+ // KestrelUpgradedConnections is the metric conforming to the
+ // "kestrel.upgraded_connections" semantic conventions. It represents the
+ // number of connections that are currently upgraded (WebSockets). .
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelUpgradedConnectionsName = "kestrel.upgraded_connections"
+ KestrelUpgradedConnectionsUnit = "{connection}"
+ KestrelUpgradedConnectionsDescription = "Number of connections that are currently upgraded (WebSockets). ."
+
+ // KestrelTLSHandshakeDuration is the metric conforming to the
+ // "kestrel.tls_handshake.duration" semantic conventions. It represents the
+ // duration of TLS handshakes on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ KestrelTLSHandshakeDurationName = "kestrel.tls_handshake.duration"
+ KestrelTLSHandshakeDurationUnit = "s"
+ KestrelTLSHandshakeDurationDescription = "The duration of TLS handshakes on the server."
+
+ // KestrelActiveTLSHandshakes is the metric conforming to the
+ // "kestrel.active_tls_handshakes" semantic conventions. It represents the
+ // number of TLS handshakes that are currently in progress on the server.
+ // Instrument: updowncounter
+ // Unit: {handshake}
+ // Stability: Stable
+ KestrelActiveTLSHandshakesName = "kestrel.active_tls_handshakes"
+ KestrelActiveTLSHandshakesUnit = "{handshake}"
+ KestrelActiveTLSHandshakesDescription = "Number of TLS handshakes that are currently in progress on the server."
+
+ // SignalrServerConnectionDuration is the metric conforming to the
+ // "signalr.server.connection.duration" semantic conventions. It represents the
+ // duration of connections on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ SignalrServerConnectionDurationName = "signalr.server.connection.duration"
+ SignalrServerConnectionDurationUnit = "s"
+ SignalrServerConnectionDurationDescription = "The duration of connections on the server."
+
+ // SignalrServerActiveConnections is the metric conforming to the
+ // "signalr.server.active_connections" semantic conventions. It represents the
+ // number of connections that are currently active on the server.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ SignalrServerActiveConnectionsName = "signalr.server.active_connections"
+ SignalrServerActiveConnectionsUnit = "{connection}"
+ SignalrServerActiveConnectionsDescription = "Number of connections that are currently active on the server."
+
+ // FaaSInvokeDuration is the metric conforming to the "faas.invoke_duration"
+ // semantic conventions. It represents the measures the duration of the
+ // function's logic execution.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSInvokeDurationName = "faas.invoke_duration"
+ FaaSInvokeDurationUnit = "s"
+ FaaSInvokeDurationDescription = "Measures the duration of the function's logic execution"
+
+ // FaaSInitDuration is the metric conforming to the "faas.init_duration"
+ // semantic conventions. It represents the measures the duration of the
+ // function's initialization, such as a cold start.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSInitDurationName = "faas.init_duration"
+ FaaSInitDurationUnit = "s"
+ FaaSInitDurationDescription = "Measures the duration of the function's initialization, such as a cold start"
+
+ // FaaSColdstarts is the metric conforming to the "faas.coldstarts" semantic
+ // conventions. It represents the number of invocation cold starts.
+ // Instrument: counter
+ // Unit: {coldstart}
+ // Stability: Experimental
+ FaaSColdstartsName = "faas.coldstarts"
+ FaaSColdstartsUnit = "{coldstart}"
+ FaaSColdstartsDescription = "Number of invocation cold starts"
+
+ // FaaSErrors is the metric conforming to the "faas.errors" semantic
+ // conventions. It represents the number of invocation errors.
+ // Instrument: counter
+ // Unit: {error}
+ // Stability: Experimental
+ FaaSErrorsName = "faas.errors"
+ FaaSErrorsUnit = "{error}"
+ FaaSErrorsDescription = "Number of invocation errors"
+
+ // FaaSInvocations is the metric conforming to the "faas.invocations" semantic
+ // conventions. It represents the number of successful invocations.
+ // Instrument: counter
+ // Unit: {invocation}
+ // Stability: Experimental
+ FaaSInvocationsName = "faas.invocations"
+ FaaSInvocationsUnit = "{invocation}"
+ FaaSInvocationsDescription = "Number of successful invocations"
+
+ // FaaSTimeouts is the metric conforming to the "faas.timeouts" semantic
+ // conventions. It represents the number of invocation timeouts.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ FaaSTimeoutsName = "faas.timeouts"
+ FaaSTimeoutsUnit = "{timeout}"
+ FaaSTimeoutsDescription = "Number of invocation timeouts"
+
+ // FaaSMemUsage is the metric conforming to the "faas.mem_usage" semantic
+ // conventions. It represents the distribution of max memory usage per
+ // invocation.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ FaaSMemUsageName = "faas.mem_usage"
+ FaaSMemUsageUnit = "By"
+ FaaSMemUsageDescription = "Distribution of max memory usage per invocation"
+
+ // FaaSCPUUsage is the metric conforming to the "faas.cpu_usage" semantic
+ // conventions. It represents the distribution of CPU usage per invocation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSCPUUsageName = "faas.cpu_usage"
+ FaaSCPUUsageUnit = "s"
+ FaaSCPUUsageDescription = "Distribution of CPU usage per invocation"
+
+ // FaaSNetIo is the metric conforming to the "faas.net_io" semantic
+ // conventions. It represents the distribution of net I/O usage per invocation.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ FaaSNetIoName = "faas.net_io"
+ FaaSNetIoUnit = "By"
+ FaaSNetIoDescription = "Distribution of net I/O usage per invocation"
+
+ // HTTPServerRequestDuration is the metric conforming to the
+ // "http.server.request.duration" semantic conventions. It represents the
+ // duration of HTTP server requests.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ HTTPServerRequestDurationName = "http.server.request.duration"
+ HTTPServerRequestDurationUnit = "s"
+ HTTPServerRequestDurationDescription = "Duration of HTTP server requests."
+
+ // HTTPServerActiveRequests is the metric conforming to the
+ // "http.server.active_requests" semantic conventions. It represents the number
+ // of active HTTP server requests.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ HTTPServerActiveRequestsName = "http.server.active_requests"
+ HTTPServerActiveRequestsUnit = "{request}"
+ HTTPServerActiveRequestsDescription = "Number of active HTTP server requests."
+
+ // HTTPServerRequestBodySize is the metric conforming to the
+ // "http.server.request.body.size" semantic conventions. It represents the size
+ // of HTTP server request bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPServerRequestBodySizeName = "http.server.request.body.size"
+ HTTPServerRequestBodySizeUnit = "By"
+ HTTPServerRequestBodySizeDescription = "Size of HTTP server request bodies."
+
+ // HTTPServerResponseBodySize is the metric conforming to the
+ // "http.server.response.body.size" semantic conventions. It represents the
+ // size of HTTP server response bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPServerResponseBodySizeName = "http.server.response.body.size"
+ HTTPServerResponseBodySizeUnit = "By"
+ HTTPServerResponseBodySizeDescription = "Size of HTTP server response bodies."
+
+ // HTTPClientRequestDuration is the metric conforming to the
+ // "http.client.request.duration" semantic conventions. It represents the
+ // duration of HTTP client requests.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ HTTPClientRequestDurationName = "http.client.request.duration"
+ HTTPClientRequestDurationUnit = "s"
+ HTTPClientRequestDurationDescription = "Duration of HTTP client requests."
+
+ // HTTPClientRequestBodySize is the metric conforming to the
+ // "http.client.request.body.size" semantic conventions. It represents the size
+ // of HTTP client request bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPClientRequestBodySizeName = "http.client.request.body.size"
+ HTTPClientRequestBodySizeUnit = "By"
+ HTTPClientRequestBodySizeDescription = "Size of HTTP client request bodies."
+
+ // HTTPClientResponseBodySize is the metric conforming to the
+ // "http.client.response.body.size" semantic conventions. It represents the
+ // size of HTTP client response bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPClientResponseBodySizeName = "http.client.response.body.size"
+ HTTPClientResponseBodySizeUnit = "By"
+ HTTPClientResponseBodySizeDescription = "Size of HTTP client response bodies."
+
+ // HTTPClientOpenConnections is the metric conforming to the
+ // "http.client.open_connections" semantic conventions. It represents the
+ // number of outbound HTTP connections that are currently active or idle on the
+ // client.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ HTTPClientOpenConnectionsName = "http.client.open_connections"
+ HTTPClientOpenConnectionsUnit = "{connection}"
+ HTTPClientOpenConnectionsDescription = "Number of outbound HTTP connections that are currently active or idle on the client."
+
+ // HTTPClientConnectionDuration is the metric conforming to the
+ // "http.client.connection.duration" semantic conventions. It represents the
+ // duration of the successfully established outbound HTTP connections.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ HTTPClientConnectionDurationName = "http.client.connection.duration"
+ HTTPClientConnectionDurationUnit = "s"
+ HTTPClientConnectionDurationDescription = "The duration of the successfully established outbound HTTP connections."
+
+ // HTTPClientActiveRequests is the metric conforming to the
+ // "http.client.active_requests" semantic conventions. It represents the number
+ // of active HTTP requests.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ HTTPClientActiveRequestsName = "http.client.active_requests"
+ HTTPClientActiveRequestsUnit = "{request}"
+ HTTPClientActiveRequestsDescription = "Number of active HTTP requests."
+
+ // JvmMemoryInit is the metric conforming to the "jvm.memory.init" semantic
+ // conventions. It represents the measure of initial memory requested.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmMemoryInitName = "jvm.memory.init"
+ JvmMemoryInitUnit = "By"
+ JvmMemoryInitDescription = "Measure of initial memory requested."
+
+ // JvmSystemCPUUtilization is the metric conforming to the
+ // "jvm.system.cpu.utilization" semantic conventions. It represents the recent
+ // CPU utilization for the whole system as reported by the JVM.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ JvmSystemCPUUtilizationName = "jvm.system.cpu.utilization"
+ JvmSystemCPUUtilizationUnit = "1"
+ JvmSystemCPUUtilizationDescription = "Recent CPU utilization for the whole system as reported by the JVM."
+
+ // JvmSystemCPULoad1m is the metric conforming to the "jvm.system.cpu.load_1m"
+ // semantic conventions. It represents the average CPU load of the whole system
+ // for the last minute as reported by the JVM.
+ // Instrument: gauge
+ // Unit: {run_queue_item}
+ // Stability: Experimental
+ JvmSystemCPULoad1mName = "jvm.system.cpu.load_1m"
+ JvmSystemCPULoad1mUnit = "{run_queue_item}"
+ JvmSystemCPULoad1mDescription = "Average CPU load of the whole system for the last minute as reported by the JVM."
+
+ // JvmBufferMemoryUsage is the metric conforming to the
+ // "jvm.buffer.memory.usage" semantic conventions. It represents the measure of
+ // memory used by buffers.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmBufferMemoryUsageName = "jvm.buffer.memory.usage"
+ JvmBufferMemoryUsageUnit = "By"
+ JvmBufferMemoryUsageDescription = "Measure of memory used by buffers."
+
+ // JvmBufferMemoryLimit is the metric conforming to the
+ // "jvm.buffer.memory.limit" semantic conventions. It represents the measure of
+ // total memory capacity of buffers.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmBufferMemoryLimitName = "jvm.buffer.memory.limit"
+ JvmBufferMemoryLimitUnit = "By"
+ JvmBufferMemoryLimitDescription = "Measure of total memory capacity of buffers."
+
+ // JvmBufferCount is the metric conforming to the "jvm.buffer.count" semantic
+ // conventions. It represents the number of buffers in the pool.
+ // Instrument: updowncounter
+ // Unit: {buffer}
+ // Stability: Experimental
+ JvmBufferCountName = "jvm.buffer.count"
+ JvmBufferCountUnit = "{buffer}"
+ JvmBufferCountDescription = "Number of buffers in the pool."
+
+ // JvmMemoryUsed is the metric conforming to the "jvm.memory.used" semantic
+ // conventions. It represents the measure of memory used.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryUsedName = "jvm.memory.used"
+ JvmMemoryUsedUnit = "By"
+ JvmMemoryUsedDescription = "Measure of memory used."
+
+ // JvmMemoryCommitted is the metric conforming to the "jvm.memory.committed"
+ // semantic conventions. It represents the measure of memory committed.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryCommittedName = "jvm.memory.committed"
+ JvmMemoryCommittedUnit = "By"
+ JvmMemoryCommittedDescription = "Measure of memory committed."
+
+ // JvmMemoryLimit is the metric conforming to the "jvm.memory.limit" semantic
+ // conventions. It represents the measure of max obtainable memory.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryLimitName = "jvm.memory.limit"
+ JvmMemoryLimitUnit = "By"
+ JvmMemoryLimitDescription = "Measure of max obtainable memory."
+
+ // JvmMemoryUsedAfterLastGc is the metric conforming to the
+ // "jvm.memory.used_after_last_gc" semantic conventions. It represents the
+ // measure of memory used, as measured after the most recent garbage collection
+ // event on this pool.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryUsedAfterLastGcName = "jvm.memory.used_after_last_gc"
+ JvmMemoryUsedAfterLastGcUnit = "By"
+ JvmMemoryUsedAfterLastGcDescription = "Measure of memory used, as measured after the most recent garbage collection event on this pool."
+
+ // JvmGcDuration is the metric conforming to the "jvm.gc.duration" semantic
+ // conventions. It represents the duration of JVM garbage collection actions.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ JvmGcDurationName = "jvm.gc.duration"
+ JvmGcDurationUnit = "s"
+ JvmGcDurationDescription = "Duration of JVM garbage collection actions."
+
+ // JvmThreadCount is the metric conforming to the "jvm.thread.count" semantic
+ // conventions. It represents the number of executing platform threads.
+ // Instrument: updowncounter
+ // Unit: {thread}
+ // Stability: Stable
+ JvmThreadCountName = "jvm.thread.count"
+ JvmThreadCountUnit = "{thread}"
+ JvmThreadCountDescription = "Number of executing platform threads."
+
+ // JvmClassLoaded is the metric conforming to the "jvm.class.loaded" semantic
+ // conventions. It represents the number of classes loaded since JVM start.
+ // Instrument: counter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassLoadedName = "jvm.class.loaded"
+ JvmClassLoadedUnit = "{class}"
+ JvmClassLoadedDescription = "Number of classes loaded since JVM start."
+
+ // JvmClassUnloaded is the metric conforming to the "jvm.class.unloaded"
+ // semantic conventions. It represents the number of classes unloaded since JVM
+ // start.
+ // Instrument: counter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassUnloadedName = "jvm.class.unloaded"
+ JvmClassUnloadedUnit = "{class}"
+ JvmClassUnloadedDescription = "Number of classes unloaded since JVM start."
+
+ // JvmClassCount is the metric conforming to the "jvm.class.count" semantic
+ // conventions. It represents the number of classes currently loaded.
+ // Instrument: updowncounter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassCountName = "jvm.class.count"
+ JvmClassCountUnit = "{class}"
+ JvmClassCountDescription = "Number of classes currently loaded."
+
+ // JvmCPUCount is the metric conforming to the "jvm.cpu.count" semantic
+ // conventions. It represents the number of processors available to the Java
+ // virtual machine.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Stable
+ JvmCPUCountName = "jvm.cpu.count"
+ JvmCPUCountUnit = "{cpu}"
+ JvmCPUCountDescription = "Number of processors available to the Java virtual machine."
+
+ // JvmCPUTime is the metric conforming to the "jvm.cpu.time" semantic
+ // conventions. It represents the cPU time used by the process as reported by
+ // the JVM.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Stable
+ JvmCPUTimeName = "jvm.cpu.time"
+ JvmCPUTimeUnit = "s"
+ JvmCPUTimeDescription = "CPU time used by the process as reported by the JVM."
+
+ // JvmCPURecentUtilization is the metric conforming to the
+ // "jvm.cpu.recent_utilization" semantic conventions. It represents the recent
+ // CPU utilization for the process as reported by the JVM.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Stable
+ JvmCPURecentUtilizationName = "jvm.cpu.recent_utilization"
+ JvmCPURecentUtilizationUnit = "1"
+ JvmCPURecentUtilizationDescription = "Recent CPU utilization for the process as reported by the JVM."
+
+ // MessagingPublishDuration is the metric conforming to the
+ // "messaging.publish.duration" semantic conventions. It represents the
+ // measures the duration of publish operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingPublishDurationName = "messaging.publish.duration"
+ MessagingPublishDurationUnit = "s"
+ MessagingPublishDurationDescription = "Measures the duration of publish operation."
+
+ // MessagingReceiveDuration is the metric conforming to the
+ // "messaging.receive.duration" semantic conventions. It represents the
+ // measures the duration of receive operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingReceiveDurationName = "messaging.receive.duration"
+ MessagingReceiveDurationUnit = "s"
+ MessagingReceiveDurationDescription = "Measures the duration of receive operation."
+
+ // MessagingProcessDuration is the metric conforming to the
+ // "messaging.process.duration" semantic conventions. It represents the
+ // measures the duration of process operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingProcessDurationName = "messaging.process.duration"
+ MessagingProcessDurationUnit = "s"
+ MessagingProcessDurationDescription = "Measures the duration of process operation."
+
+ // MessagingPublishMessages is the metric conforming to the
+ // "messaging.publish.messages" semantic conventions. It represents the
+ // measures the number of published messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingPublishMessagesName = "messaging.publish.messages"
+ MessagingPublishMessagesUnit = "{message}"
+ MessagingPublishMessagesDescription = "Measures the number of published messages."
+
+ // MessagingReceiveMessages is the metric conforming to the
+ // "messaging.receive.messages" semantic conventions. It represents the
+ // measures the number of received messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingReceiveMessagesName = "messaging.receive.messages"
+ MessagingReceiveMessagesUnit = "{message}"
+ MessagingReceiveMessagesDescription = "Measures the number of received messages."
+
+ // MessagingProcessMessages is the metric conforming to the
+ // "messaging.process.messages" semantic conventions. It represents the
+ // measures the number of processed messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingProcessMessagesName = "messaging.process.messages"
+ MessagingProcessMessagesUnit = "{message}"
+ MessagingProcessMessagesDescription = "Measures the number of processed messages."
+
+ // ProcessCPUTime is the metric conforming to the "process.cpu.time" semantic
+ // conventions. It represents the total CPU seconds broken down by different
+ // states.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ ProcessCPUTimeName = "process.cpu.time"
+ ProcessCPUTimeUnit = "s"
+ ProcessCPUTimeDescription = "Total CPU seconds broken down by different states."
+
+ // ProcessCPUUtilization is the metric conforming to the
+ // "process.cpu.utilization" semantic conventions. It represents the difference
+ // in process.cpu.time since the last measurement, divided by the elapsed time
+ // and number of CPUs available to the process.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ ProcessCPUUtilizationName = "process.cpu.utilization"
+ ProcessCPUUtilizationUnit = "1"
+ ProcessCPUUtilizationDescription = "Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process."
+
+ // ProcessMemoryUsage is the metric conforming to the "process.memory.usage"
+ // semantic conventions. It represents the amount of physical memory in use.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ ProcessMemoryUsageName = "process.memory.usage"
+ ProcessMemoryUsageUnit = "By"
+ ProcessMemoryUsageDescription = "The amount of physical memory in use."
+
+ // ProcessMemoryVirtual is the metric conforming to the
+ // "process.memory.virtual" semantic conventions. It represents the amount of
+ // committed virtual memory.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ ProcessMemoryVirtualName = "process.memory.virtual"
+ ProcessMemoryVirtualUnit = "By"
+ ProcessMemoryVirtualDescription = "The amount of committed virtual memory."
+
+ // ProcessDiskIo is the metric conforming to the "process.disk.io" semantic
+ // conventions. It represents the disk bytes transferred.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ProcessDiskIoName = "process.disk.io"
+ ProcessDiskIoUnit = "By"
+ ProcessDiskIoDescription = "Disk bytes transferred."
+
+ // ProcessNetworkIo is the metric conforming to the "process.network.io"
+ // semantic conventions. It represents the network bytes transferred.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ProcessNetworkIoName = "process.network.io"
+ ProcessNetworkIoUnit = "By"
+ ProcessNetworkIoDescription = "Network bytes transferred."
+
+ // ProcessThreadCount is the metric conforming to the "process.thread.count"
+ // semantic conventions. It represents the process threads count.
+ // Instrument: updowncounter
+ // Unit: {thread}
+ // Stability: Experimental
+ ProcessThreadCountName = "process.thread.count"
+ ProcessThreadCountUnit = "{thread}"
+ ProcessThreadCountDescription = "Process threads count."
+
+ // ProcessOpenFileDescriptorCount is the metric conforming to the
+ // "process.open_file_descriptor.count" semantic conventions. It represents the
+ // number of file descriptors in use by the process.
+ // Instrument: updowncounter
+ // Unit: {count}
+ // Stability: Experimental
+ ProcessOpenFileDescriptorCountName = "process.open_file_descriptor.count"
+ ProcessOpenFileDescriptorCountUnit = "{count}"
+ ProcessOpenFileDescriptorCountDescription = "Number of file descriptors in use by the process."
+
+ // ProcessContextSwitches is the metric conforming to the
+ // "process.context_switches" semantic conventions. It represents the number of
+ // times the process has been context switched.
+ // Instrument: counter
+ // Unit: {count}
+ // Stability: Experimental
+ ProcessContextSwitchesName = "process.context_switches"
+ ProcessContextSwitchesUnit = "{count}"
+ ProcessContextSwitchesDescription = "Number of times the process has been context switched."
+
+ // ProcessPagingFaults is the metric conforming to the "process.paging.faults"
+ // semantic conventions. It represents the number of page faults the process
+ // has made.
+ // Instrument: counter
+ // Unit: {fault}
+ // Stability: Experimental
+ ProcessPagingFaultsName = "process.paging.faults"
+ ProcessPagingFaultsUnit = "{fault}"
+ ProcessPagingFaultsDescription = "Number of page faults the process has made."
+
+ // RPCServerDuration is the metric conforming to the "rpc.server.duration"
+ // semantic conventions. It represents the measures the duration of inbound
+ // RPC.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ RPCServerDurationName = "rpc.server.duration"
+ RPCServerDurationUnit = "ms"
+ RPCServerDurationDescription = "Measures the duration of inbound RPC."
+
+ // RPCServerRequestSize is the metric conforming to the
+ // "rpc.server.request.size" semantic conventions. It represents the measures
+ // the size of RPC request messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCServerRequestSizeName = "rpc.server.request.size"
+ RPCServerRequestSizeUnit = "By"
+ RPCServerRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)."
+
+ // RPCServerResponseSize is the metric conforming to the
+ // "rpc.server.response.size" semantic conventions. It represents the measures
+ // the size of RPC response messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCServerResponseSizeName = "rpc.server.response.size"
+ RPCServerResponseSizeUnit = "By"
+ RPCServerResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)."
+
+ // RPCServerRequestsPerRPC is the metric conforming to the
+ // "rpc.server.requests_per_rpc" semantic conventions. It represents the
+ // measures the number of messages received per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCServerRequestsPerRPCName = "rpc.server.requests_per_rpc"
+ RPCServerRequestsPerRPCUnit = "{count}"
+ RPCServerRequestsPerRPCDescription = "Measures the number of messages received per RPC."
+
+ // RPCServerResponsesPerRPC is the metric conforming to the
+ // "rpc.server.responses_per_rpc" semantic conventions. It represents the
+ // measures the number of messages sent per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCServerResponsesPerRPCName = "rpc.server.responses_per_rpc"
+ RPCServerResponsesPerRPCUnit = "{count}"
+ RPCServerResponsesPerRPCDescription = "Measures the number of messages sent per RPC."
+
+ // RPCClientDuration is the metric conforming to the "rpc.client.duration"
+ // semantic conventions. It represents the measures the duration of outbound
+ // RPC.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ RPCClientDurationName = "rpc.client.duration"
+ RPCClientDurationUnit = "ms"
+ RPCClientDurationDescription = "Measures the duration of outbound RPC."
+
+ // RPCClientRequestSize is the metric conforming to the
+ // "rpc.client.request.size" semantic conventions. It represents the measures
+ // the size of RPC request messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCClientRequestSizeName = "rpc.client.request.size"
+ RPCClientRequestSizeUnit = "By"
+ RPCClientRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)."
+
+ // RPCClientResponseSize is the metric conforming to the
+ // "rpc.client.response.size" semantic conventions. It represents the measures
+ // the size of RPC response messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCClientResponseSizeName = "rpc.client.response.size"
+ RPCClientResponseSizeUnit = "By"
+ RPCClientResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)."
+
+ // RPCClientRequestsPerRPC is the metric conforming to the
+ // "rpc.client.requests_per_rpc" semantic conventions. It represents the
+ // measures the number of messages received per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCClientRequestsPerRPCName = "rpc.client.requests_per_rpc"
+ RPCClientRequestsPerRPCUnit = "{count}"
+ RPCClientRequestsPerRPCDescription = "Measures the number of messages received per RPC."
+
+ // RPCClientResponsesPerRPC is the metric conforming to the
+ // "rpc.client.responses_per_rpc" semantic conventions. It represents the
+ // measures the number of messages sent per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCClientResponsesPerRPCName = "rpc.client.responses_per_rpc"
+ RPCClientResponsesPerRPCUnit = "{count}"
+ RPCClientResponsesPerRPCDescription = "Measures the number of messages sent per RPC."
+
+ // SystemCPUTime is the metric conforming to the "system.cpu.time" semantic
+ // conventions. It represents the seconds each logical CPU spent on each mode.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemCPUTimeName = "system.cpu.time"
+ SystemCPUTimeUnit = "s"
+ SystemCPUTimeDescription = "Seconds each logical CPU spent on each mode"
+
+ // SystemCPUUtilization is the metric conforming to the
+ // "system.cpu.utilization" semantic conventions. It represents the difference
+ // in system.cpu.time since the last measurement, divided by the elapsed time
+ // and number of logical CPUs.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ SystemCPUUtilizationName = "system.cpu.utilization"
+ SystemCPUUtilizationUnit = "1"
+ SystemCPUUtilizationDescription = "Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs"
+
+ // SystemCPUFrequency is the metric conforming to the "system.cpu.frequency"
+ // semantic conventions. It represents the reports the current frequency of the
+ // CPU in Hz.
+ // Instrument: gauge
+ // Unit: {Hz}
+ // Stability: Experimental
+ SystemCPUFrequencyName = "system.cpu.frequency"
+ SystemCPUFrequencyUnit = "{Hz}"
+ SystemCPUFrequencyDescription = "Reports the current frequency of the CPU in Hz"
+
+ // SystemCPUPhysicalCount is the metric conforming to the
+ // "system.cpu.physical.count" semantic conventions. It represents the reports
+ // the number of actual physical processor cores on the hardware.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Experimental
+ SystemCPUPhysicalCountName = "system.cpu.physical.count"
+ SystemCPUPhysicalCountUnit = "{cpu}"
+ SystemCPUPhysicalCountDescription = "Reports the number of actual physical processor cores on the hardware"
+
+ // SystemCPULogicalCount is the metric conforming to the
+ // "system.cpu.logical.count" semantic conventions. It represents the reports
+ // the number of logical (virtual) processor cores created by the operating
+ // system to manage multitasking.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Experimental
+ SystemCPULogicalCountName = "system.cpu.logical.count"
+ SystemCPULogicalCountUnit = "{cpu}"
+ SystemCPULogicalCountDescription = "Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking"
+
+ // SystemMemoryUsage is the metric conforming to the "system.memory.usage"
+ // semantic conventions. It represents the reports memory in use by state.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemoryUsageName = "system.memory.usage"
+ SystemMemoryUsageUnit = "By"
+ SystemMemoryUsageDescription = "Reports memory in use by state."
+
+ // SystemMemoryLimit is the metric conforming to the "system.memory.limit"
+ // semantic conventions. It represents the total memory available in the
+ // system.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemoryLimitName = "system.memory.limit"
+ SystemMemoryLimitUnit = "By"
+ SystemMemoryLimitDescription = "Total memory available in the system."
+
+ // SystemMemoryShared is the metric conforming to the "system.memory.shared"
+ // semantic conventions. It represents the shared memory used (mostly by
+ // tmpfs).
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemorySharedName = "system.memory.shared"
+ SystemMemorySharedUnit = "By"
+ SystemMemorySharedDescription = "Shared memory used (mostly by tmpfs)."
+
+ // SystemMemoryUtilization is the metric conforming to the
+ // "system.memory.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemMemoryUtilizationName = "system.memory.utilization"
+ SystemMemoryUtilizationUnit = "1"
+
+ // SystemPagingUsage is the metric conforming to the "system.paging.usage"
+ // semantic conventions. It represents the unix swap or windows pagefile usage.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemPagingUsageName = "system.paging.usage"
+ SystemPagingUsageUnit = "By"
+ SystemPagingUsageDescription = "Unix swap or windows pagefile usage"
+
+ // SystemPagingUtilization is the metric conforming to the
+ // "system.paging.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingUtilizationName = "system.paging.utilization"
+ SystemPagingUtilizationUnit = "1"
+
+ // SystemPagingFaults is the metric conforming to the "system.paging.faults"
+ // semantic conventions.
+ // Instrument: counter
+ // Unit: {fault}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingFaultsName = "system.paging.faults"
+ SystemPagingFaultsUnit = "{fault}"
+
+ // SystemPagingOperations is the metric conforming to the
+ // "system.paging.operations" semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingOperationsName = "system.paging.operations"
+ SystemPagingOperationsUnit = "{operation}"
+
+ // SystemDiskIo is the metric conforming to the "system.disk.io" semantic
+ // conventions.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskIoName = "system.disk.io"
+ SystemDiskIoUnit = "By"
+
+ // SystemDiskOperations is the metric conforming to the
+ // "system.disk.operations" semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskOperationsName = "system.disk.operations"
+ SystemDiskOperationsUnit = "{operation}"
+
+ // SystemDiskIoTime is the metric conforming to the "system.disk.io_time"
+ // semantic conventions. It represents the time disk spent activated.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemDiskIoTimeName = "system.disk.io_time"
+ SystemDiskIoTimeUnit = "s"
+ SystemDiskIoTimeDescription = "Time disk spent activated"
+
+ // SystemDiskOperationTime is the metric conforming to the
+ // "system.disk.operation_time" semantic conventions. It represents the sum of
+ // the time each operation took to complete.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemDiskOperationTimeName = "system.disk.operation_time"
+ SystemDiskOperationTimeUnit = "s"
+ SystemDiskOperationTimeDescription = "Sum of the time each operation took to complete"
+
+ // SystemDiskMerged is the metric conforming to the "system.disk.merged"
+ // semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskMergedName = "system.disk.merged"
+ SystemDiskMergedUnit = "{operation}"
+
+ // SystemFilesystemUsage is the metric conforming to the
+ // "system.filesystem.usage" semantic conventions.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemFilesystemUsageName = "system.filesystem.usage"
+ SystemFilesystemUsageUnit = "By"
+
+ // SystemFilesystemUtilization is the metric conforming to the
+ // "system.filesystem.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemFilesystemUtilizationName = "system.filesystem.utilization"
+ SystemFilesystemUtilizationUnit = "1"
+
+ // SystemNetworkDropped is the metric conforming to the
+ // "system.network.dropped" semantic conventions. It represents the count of
+ // packets that are dropped or discarded even though there was no error.
+ // Instrument: counter
+ // Unit: {packet}
+ // Stability: Experimental
+ SystemNetworkDroppedName = "system.network.dropped"
+ SystemNetworkDroppedUnit = "{packet}"
+ SystemNetworkDroppedDescription = "Count of packets that are dropped or discarded even though there was no error"
+
+ // SystemNetworkPackets is the metric conforming to the
+ // "system.network.packets" semantic conventions.
+ // Instrument: counter
+ // Unit: {packet}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkPacketsName = "system.network.packets"
+ SystemNetworkPacketsUnit = "{packet}"
+
+ // SystemNetworkErrors is the metric conforming to the "system.network.errors"
+ // semantic conventions. It represents the count of network errors detected.
+ // Instrument: counter
+ // Unit: {error}
+ // Stability: Experimental
+ SystemNetworkErrorsName = "system.network.errors"
+ SystemNetworkErrorsUnit = "{error}"
+ SystemNetworkErrorsDescription = "Count of network errors detected"
+
+ // SystemNetworkIo is the metric conforming to the "system.network.io" semantic
+ // conventions.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkIoName = "system.network.io"
+ SystemNetworkIoUnit = "By"
+
+ // SystemNetworkConnections is the metric conforming to the
+ // "system.network.connections" semantic conventions.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkConnectionsName = "system.network.connections"
+ SystemNetworkConnectionsUnit = "{connection}"
+
+ // SystemProcessCount is the metric conforming to the "system.process.count"
+ // semantic conventions. It represents the total number of processes in each
+ // state.
+ // Instrument: updowncounter
+ // Unit: {process}
+ // Stability: Experimental
+ SystemProcessCountName = "system.process.count"
+ SystemProcessCountUnit = "{process}"
+ SystemProcessCountDescription = "Total number of processes in each state"
+
+ // SystemProcessCreated is the metric conforming to the
+ // "system.process.created" semantic conventions. It represents the total
+ // number of processes created over uptime of the host.
+ // Instrument: counter
+ // Unit: {process}
+ // Stability: Experimental
+ SystemProcessCreatedName = "system.process.created"
+ SystemProcessCreatedUnit = "{process}"
+ SystemProcessCreatedDescription = "Total number of processes created over uptime of the host"
+
+ // SystemLinuxMemoryAvailable is the metric conforming to the
+ // "system.linux.memory.available" semantic conventions. It represents an
+ // estimate of how much memory is available for starting new applications,
+ // without causing swapping.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemLinuxMemoryAvailableName = "system.linux.memory.available"
+ SystemLinuxMemoryAvailableUnit = "By"
+ SystemLinuxMemoryAvailableDescription = "An estimate of how much memory is available for starting new applications, without causing swapping"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go
new file mode 100644
index 0000000000..4c87c7adcc
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+// SchemaURL is the schema URL that matches the version of the semantic conventions
+// that this package defines. Semconv packages starting from v1.4.0 must declare
+// non-empty schema URL in the form https://opentelemetry.io/schemas/
+const SchemaURL = "https://opentelemetry.io/schemas/1.26.0"
diff --git a/vendor/go.opentelemetry.io/otel/trace.go b/vendor/go.opentelemetry.io/otel/trace.go
index caf7249de8..6836c65478 100644
--- a/vendor/go.opentelemetry.io/otel/trace.go
+++ b/vendor/go.opentelemetry.io/otel/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/trace/README.md b/vendor/go.opentelemetry.io/otel/trace/README.md
new file mode 100644
index 0000000000..58ccaba69b
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/README.md
@@ -0,0 +1,3 @@
+# Trace API
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/trace)
diff --git a/vendor/go.opentelemetry.io/otel/trace/config.go b/vendor/go.opentelemetry.io/otel/trace/config.go
index cb3efbb9ad..273d58e001 100644
--- a/vendor/go.opentelemetry.io/otel/trace/config.go
+++ b/vendor/go.opentelemetry.io/otel/trace/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -268,6 +257,7 @@ func (o stackTraceOption) applyEvent(c EventConfig) EventConfig {
c.stackTrace = bool(o)
return c
}
+
func (o stackTraceOption) applySpan(c SpanConfig) SpanConfig {
c.stackTrace = bool(o)
return c
diff --git a/vendor/go.opentelemetry.io/otel/trace/context.go b/vendor/go.opentelemetry.io/otel/trace/context.go
index 76f9a083c4..5650a174b4 100644
--- a/vendor/go.opentelemetry.io/otel/trace/context.go
+++ b/vendor/go.opentelemetry.io/otel/trace/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -47,12 +36,12 @@ func ContextWithRemoteSpanContext(parent context.Context, rsc SpanContext) conte
// performs no operations is returned.
func SpanFromContext(ctx context.Context) Span {
if ctx == nil {
- return noopSpan{}
+ return noopSpanInstance
}
if span, ok := ctx.Value(currentSpanKey).(Span); ok {
return span
}
- return noopSpan{}
+ return noopSpanInstance
}
// SpanContextFromContext returns the current Span's SpanContext.
diff --git a/vendor/go.opentelemetry.io/otel/trace/doc.go b/vendor/go.opentelemetry.io/otel/trace/doc.go
index ab0346f966..d661c5d100 100644
--- a/vendor/go.opentelemetry.io/otel/trace/doc.go
+++ b/vendor/go.opentelemetry.io/otel/trace/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
/*
Package trace provides an implementation of the tracing part of the
@@ -62,5 +51,69 @@ a default.
defer span.End()
// ...
}
+
+# API Implementations
+
+This package does not conform to the standard Go versioning policy; all of its
+interfaces may have methods added to them without a package major version bump.
+This non-standard API evolution could surprise an uninformed implementation
+author. They could unknowingly build their implementation in a way that would
+result in a runtime panic for their users that update to the new API.
+
+The API is designed to help inform an instrumentation author about this
+non-standard API evolution. It requires them to choose a default behavior for
+unimplemented interface methods. There are three behavior choices they can
+make:
+
+ - Compilation failure
+ - Panic
+ - Default to another implementation
+
+All interfaces in this API embed a corresponding interface from
+[go.opentelemetry.io/otel/trace/embedded]. If an author wants the default
+behavior of their implementations to be a compilation failure, signaling to
+their users they need to update to the latest version of that implementation,
+they need to embed the corresponding interface from
+[go.opentelemetry.io/otel/trace/embedded] in their implementation. For
+example,
+
+ import "go.opentelemetry.io/otel/trace/embedded"
+
+ type TracerProvider struct {
+ embedded.TracerProvider
+ // ...
+ }
+
+If an author wants the default behavior of their implementations to panic, they
+can embed the API interface directly.
+
+ import "go.opentelemetry.io/otel/trace"
+
+ type TracerProvider struct {
+ trace.TracerProvider
+ // ...
+ }
+
+This option is not recommended. It will lead to publishing packages that
+contain runtime panics when users update to newer versions of
+[go.opentelemetry.io/otel/trace], which may be done with a trasitive
+dependency.
+
+Finally, an author can embed another implementation in theirs. The embedded
+implementation will be used for methods not defined by the author. For example,
+an author who wants to default to silently dropping the call can use
+[go.opentelemetry.io/otel/trace/noop]:
+
+ import "go.opentelemetry.io/otel/trace/noop"
+
+ type TracerProvider struct {
+ noop.TracerProvider
+ // ...
+ }
+
+It is strongly recommended that authors only embed
+[go.opentelemetry.io/otel/trace/noop] if they choose this default behavior.
+That implementation is the only one OpenTelemetry authors can guarantee will
+fully implement all the API interfaces when a user updates their API.
*/
package trace // import "go.opentelemetry.io/otel/trace"
diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/README.md b/vendor/go.opentelemetry.io/otel/trace/embedded/README.md
new file mode 100644
index 0000000000..7754a239ee
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/embedded/README.md
@@ -0,0 +1,3 @@
+# Trace Embedded
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/trace/embedded)
diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
new file mode 100644
index 0000000000..3e359a00bf
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
@@ -0,0 +1,45 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package embedded provides interfaces embedded within the [OpenTelemetry
+// trace API].
+//
+// Implementers of the [OpenTelemetry trace API] can embed the relevant type
+// from this package into their implementation directly. Doing so will result
+// in a compilation error for users when the [OpenTelemetry trace API] is
+// extended (which is something that can happen without a major version bump of
+// the API package).
+//
+// [OpenTelemetry trace API]: https://pkg.go.dev/go.opentelemetry.io/otel/trace
+package embedded // import "go.opentelemetry.io/otel/trace/embedded"
+
+// TracerProvider is embedded in
+// [go.opentelemetry.io/otel/trace.TracerProvider].
+//
+// Embed this interface in your implementation of the
+// [go.opentelemetry.io/otel/trace.TracerProvider] if you want users to
+// experience a compilation error, signaling they need to update to your latest
+// implementation, when the [go.opentelemetry.io/otel/trace.TracerProvider]
+// interface is extended (which is something that can happen without a major
+// version bump of the API package).
+type TracerProvider interface{ tracerProvider() }
+
+// Tracer is embedded in [go.opentelemetry.io/otel/trace.Tracer].
+//
+// Embed this interface in your implementation of the
+// [go.opentelemetry.io/otel/trace.Tracer] if you want users to experience a
+// compilation error, signaling they need to update to your latest
+// implementation, when the [go.opentelemetry.io/otel/trace.Tracer] interface
+// is extended (which is something that can happen without a major version bump
+// of the API package).
+type Tracer interface{ tracer() }
+
+// Span is embedded in [go.opentelemetry.io/otel/trace.Span].
+//
+// Embed this interface in your implementation of the
+// [go.opentelemetry.io/otel/trace.Span] if you want users to experience a
+// compilation error, signaling they need to update to your latest
+// implementation, when the [go.opentelemetry.io/otel/trace.Span] interface is
+// extended (which is something that can happen without a major version bump of
+// the API package).
+type Span interface{ span() }
diff --git a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
index 88fcb81611..c00221e7be 100644
--- a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
+++ b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
diff --git a/vendor/go.opentelemetry.io/otel/trace/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop.go
index 7cf6c7f3ef..ca20e9997a 100644
--- a/vendor/go.opentelemetry.io/otel/trace/noop.go
+++ b/vendor/go.opentelemetry.io/otel/trace/noop.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -19,16 +8,20 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/trace/embedded"
)
// NewNoopTracerProvider returns an implementation of TracerProvider that
// performs no operations. The Tracer and Spans created from the returned
// TracerProvider also perform no operations.
+//
+// Deprecated: Use [go.opentelemetry.io/otel/trace/noop.NewTracerProvider]
+// instead.
func NewNoopTracerProvider() TracerProvider {
return noopTracerProvider{}
}
-type noopTracerProvider struct{}
+type noopTracerProvider struct{ embedded.TracerProvider }
var _ TracerProvider = noopTracerProvider{}
@@ -38,7 +31,7 @@ func (p noopTracerProvider) Tracer(string, ...TracerOption) Tracer {
}
// noopTracer is an implementation of Tracer that performs no operations.
-type noopTracer struct{}
+type noopTracer struct{ embedded.Tracer }
var _ Tracer = noopTracer{}
@@ -48,15 +41,15 @@ func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption
span := SpanFromContext(ctx)
if _, ok := span.(nonRecordingSpan); !ok {
// span is likely already a noopSpan, but let's be sure
- span = noopSpan{}
+ span = noopSpanInstance
}
return ContextWithSpan(ctx, span), span
}
// noopSpan is an implementation of Span that performs no operations.
-type noopSpan struct{}
+type noopSpan struct{ embedded.Span }
-var _ Span = noopSpan{}
+var noopSpanInstance Span = noopSpan{}
// SpanContext returns an empty span context.
func (noopSpan) SpanContext() SpanContext { return SpanContext{} }
@@ -82,6 +75,9 @@ func (noopSpan) RecordError(error, ...EventOption) {}
// AddEvent does nothing.
func (noopSpan) AddEvent(string, ...EventOption) {}
+// AddLink does nothing.
+func (noopSpan) AddLink(Link) {}
+
// SetName does nothing.
func (noopSpan) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/trace/noop/README.md b/vendor/go.opentelemetry.io/otel/trace/noop/README.md
new file mode 100644
index 0000000000..cd382c82a1
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/noop/README.md
@@ -0,0 +1,3 @@
+# Trace Noop
+
+[](https://pkg.go.dev/go.opentelemetry.io/otel/trace/noop)
diff --git a/vendor/go.opentelemetry.io/otel/trace/noop/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop/noop.go
new file mode 100644
index 0000000000..64a4f1b362
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/noop/noop.go
@@ -0,0 +1,112 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package noop provides an implementation of the OpenTelemetry trace API that
+// produces no telemetry and minimizes used computation resources.
+//
+// Using this package to implement the OpenTelemetry trace API will effectively
+// disable OpenTelemetry.
+//
+// This implementation can be embedded in other implementations of the
+// OpenTelemetry trace API. Doing so will mean the implementation defaults to
+// no operation for methods it does not implement.
+package noop // import "go.opentelemetry.io/otel/trace/noop"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/trace"
+ "go.opentelemetry.io/otel/trace/embedded"
+)
+
+var (
+ // Compile-time check this implements the OpenTelemetry API.
+
+ _ trace.TracerProvider = TracerProvider{}
+ _ trace.Tracer = Tracer{}
+ _ trace.Span = Span{}
+)
+
+// TracerProvider is an OpenTelemetry No-Op TracerProvider.
+type TracerProvider struct{ embedded.TracerProvider }
+
+// NewTracerProvider returns a TracerProvider that does not record any telemetry.
+func NewTracerProvider() TracerProvider {
+ return TracerProvider{}
+}
+
+// Tracer returns an OpenTelemetry Tracer that does not record any telemetry.
+func (TracerProvider) Tracer(string, ...trace.TracerOption) trace.Tracer {
+ return Tracer{}
+}
+
+// Tracer is an OpenTelemetry No-Op Tracer.
+type Tracer struct{ embedded.Tracer }
+
+// Start creates a span. The created span will be set in a child context of ctx
+// and returned with the span.
+//
+// If ctx contains a span context, the returned span will also contain that
+// span context. If the span context in ctx is for a non-recording span, that
+// span instance will be returned directly.
+func (t Tracer) Start(ctx context.Context, _ string, _ ...trace.SpanStartOption) (context.Context, trace.Span) {
+ span := trace.SpanFromContext(ctx)
+
+ // If the parent context contains a non-zero span context, that span
+ // context needs to be returned as a non-recording span
+ // (https://github.com/open-telemetry/opentelemetry-specification/blob/3a1dde966a4ce87cce5adf464359fe369741bbea/specification/trace/api.md#behavior-of-the-api-in-the-absence-of-an-installed-sdk).
+ var zeroSC trace.SpanContext
+ if sc := span.SpanContext(); !sc.Equal(zeroSC) {
+ if !span.IsRecording() {
+ // If the span is not recording return it directly.
+ return ctx, span
+ }
+ // Otherwise, return the span context needs in a non-recording span.
+ span = Span{sc: sc}
+ } else {
+ // No parent, return a No-Op span with an empty span context.
+ span = noopSpanInstance
+ }
+ return trace.ContextWithSpan(ctx, span), span
+}
+
+var noopSpanInstance trace.Span = Span{}
+
+// Span is an OpenTelemetry No-Op Span.
+type Span struct {
+ embedded.Span
+
+ sc trace.SpanContext
+}
+
+// SpanContext returns an empty span context.
+func (s Span) SpanContext() trace.SpanContext { return s.sc }
+
+// IsRecording always returns false.
+func (Span) IsRecording() bool { return false }
+
+// SetStatus does nothing.
+func (Span) SetStatus(codes.Code, string) {}
+
+// SetAttributes does nothing.
+func (Span) SetAttributes(...attribute.KeyValue) {}
+
+// End does nothing.
+func (Span) End(...trace.SpanEndOption) {}
+
+// RecordError does nothing.
+func (Span) RecordError(error, ...trace.EventOption) {}
+
+// AddEvent does nothing.
+func (Span) AddEvent(string, ...trace.EventOption) {}
+
+// AddLink does nothing.
+func (Span) AddLink(trace.Link) {}
+
+// SetName does nothing.
+func (Span) SetName(string) {}
+
+// TracerProvider returns a No-Op TracerProvider.
+func (Span) TracerProvider() trace.TracerProvider { return TracerProvider{} }
diff --git a/vendor/go.opentelemetry.io/otel/trace/trace.go b/vendor/go.opentelemetry.io/otel/trace/trace.go
index 4aa94f79f4..28877d4ab4 100644
--- a/vendor/go.opentelemetry.io/otel/trace/trace.go
+++ b/vendor/go.opentelemetry.io/otel/trace/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -22,6 +11,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/trace/embedded"
)
const (
@@ -48,8 +38,10 @@ func (e errorConst) Error() string {
// nolint:revive // revive complains about stutter of `trace.TraceID`.
type TraceID [16]byte
-var nilTraceID TraceID
-var _ json.Marshaler = nilTraceID
+var (
+ nilTraceID TraceID
+ _ json.Marshaler = nilTraceID
+)
// IsValid checks whether the trace TraceID is valid. A valid trace ID does
// not consist of zeros only.
@@ -71,8 +63,10 @@ func (t TraceID) String() string {
// SpanID is a unique identity of a span in a trace.
type SpanID [8]byte
-var nilSpanID SpanID
-var _ json.Marshaler = nilSpanID
+var (
+ nilSpanID SpanID
+ _ json.Marshaler = nilSpanID
+)
// IsValid checks whether the SpanID is valid. A valid SpanID does not consist
// of zeros only.
@@ -338,8 +332,15 @@ func (sc SpanContext) MarshalJSON() ([]byte, error) {
// create a Span and it is then up to the operation the Span represents to
// properly end the Span when the operation itself ends.
//
-// Warning: methods may be added to this interface in minor releases.
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
type Span interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.Span
+
// End completes the Span. The Span is considered complete and ready to be
// delivered through the rest of the telemetry pipeline after this method
// is called. Therefore, updates to the Span are not allowed after this
@@ -349,6 +350,12 @@ type Span interface {
// AddEvent adds an event with the provided name and options.
AddEvent(name string, options ...EventOption)
+ // AddLink adds a link.
+ // Adding links at span creation using WithLinks is preferred to calling AddLink
+ // later, for contexts that are available during span creation, because head
+ // sampling decisions can only consider information present during span creation.
+ AddLink(link Link)
+
// IsRecording returns the recording state of the Span. It will return
// true if the Span is active and events can be recorded.
IsRecording() bool
@@ -486,8 +493,15 @@ func (sk SpanKind) String() string {
// Tracer is the creator of Spans.
//
-// Warning: methods may be added to this interface in minor releases.
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
type Tracer interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.Tracer
+
// Start creates a span and a context.Context containing the newly-created span.
//
// If the context.Context provided in `ctx` contains a Span then the newly-created
@@ -518,8 +532,15 @@ type Tracer interface {
// at runtime from its users or it can simply use the globally registered one
// (see https://pkg.go.dev/go.opentelemetry.io/otel#GetTracerProvider).
//
-// Warning: methods may be added to this interface in minor releases.
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
type TracerProvider interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.TracerProvider
+
// Tracer returns a unique Tracer scoped to be used by instrumentation code
// to trace computational workflows. The scope and identity of that
// instrumentation code is uniquely defined by the name and options passed.
diff --git a/vendor/go.opentelemetry.io/otel/trace/tracestate.go b/vendor/go.opentelemetry.io/otel/trace/tracestate.go
index ca68a82e5f..20b5cf2433 100644
--- a/vendor/go.opentelemetry.io/otel/trace/tracestate.go
+++ b/vendor/go.opentelemetry.io/otel/trace/tracestate.go
@@ -1,36 +1,19 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
import (
"encoding/json"
"fmt"
- "regexp"
"strings"
)
const (
maxListMembers = 32
- listDelimiter = ","
-
- // based on the W3C Trace Context specification, see
- // https://www.w3.org/TR/trace-context-1/#tracestate-header
- noTenantKeyFormat = `[a-z][_0-9a-z\-\*\/]{0,255}`
- withTenantKeyFormat = `[a-z0-9][_0-9a-z\-\*\/]{0,240}@[a-z][_0-9a-z\-\*\/]{0,13}`
- valueFormat = `[\x20-\x2b\x2d-\x3c\x3e-\x7e]{0,255}[\x21-\x2b\x2d-\x3c\x3e-\x7e]`
+ listDelimiters = ","
+ memberDelimiter = "="
errInvalidKey errorConst = "invalid tracestate key"
errInvalidValue errorConst = "invalid tracestate value"
@@ -39,43 +22,138 @@ const (
errDuplicate errorConst = "duplicate list-member in tracestate"
)
-var (
- keyRe = regexp.MustCompile(`^((` + noTenantKeyFormat + `)|(` + withTenantKeyFormat + `))$`)
- valueRe = regexp.MustCompile(`^(` + valueFormat + `)$`)
- memberRe = regexp.MustCompile(`^\s*((` + noTenantKeyFormat + `)|(` + withTenantKeyFormat + `))=(` + valueFormat + `)\s*$`)
-)
-
type member struct {
Key string
Value string
}
+// according to (chr = %x20 / (nblk-char = %x21-2B / %x2D-3C / %x3E-7E) )
+// means (chr = %x20-2B / %x2D-3C / %x3E-7E) .
+func checkValueChar(v byte) bool {
+ return v >= '\x20' && v <= '\x7e' && v != '\x2c' && v != '\x3d'
+}
+
+// according to (nblk-chr = %x21-2B / %x2D-3C / %x3E-7E) .
+func checkValueLast(v byte) bool {
+ return v >= '\x21' && v <= '\x7e' && v != '\x2c' && v != '\x3d'
+}
+
+// based on the W3C Trace Context specification
+//
+// value = (0*255(chr)) nblk-chr
+// nblk-chr = %x21-2B / %x2D-3C / %x3E-7E
+// chr = %x20 / nblk-chr
+//
+// see https://www.w3.org/TR/trace-context-1/#value
+func checkValue(val string) bool {
+ n := len(val)
+ if n == 0 || n > 256 {
+ return false
+ }
+ for i := 0; i < n-1; i++ {
+ if !checkValueChar(val[i]) {
+ return false
+ }
+ }
+ return checkValueLast(val[n-1])
+}
+
+func checkKeyRemain(key string) bool {
+ // ( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
+ for _, v := range key {
+ if isAlphaNum(byte(v)) {
+ continue
+ }
+ switch v {
+ case '_', '-', '*', '/':
+ continue
+ }
+ return false
+ }
+ return true
+}
+
+// according to
+//
+// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+//
+// param n is remain part length, should be 255 in simple-key or 13 in system-id.
+func checkKeyPart(key string, n int) bool {
+ if len(key) == 0 {
+ return false
+ }
+ first := key[0] // key's first char
+ ret := len(key[1:]) <= n
+ ret = ret && first >= 'a' && first <= 'z'
+ return ret && checkKeyRemain(key[1:])
+}
+
+func isAlphaNum(c byte) bool {
+ if c >= 'a' && c <= 'z' {
+ return true
+ }
+ return c >= '0' && c <= '9'
+}
+
+// according to
+//
+// tenant-id = ( lcalpha / DIGIT ) 0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
+//
+// param n is remain part length, should be 240 exactly.
+func checkKeyTenant(key string, n int) bool {
+ if len(key) == 0 {
+ return false
+ }
+ return isAlphaNum(key[0]) && len(key[1:]) <= n && checkKeyRemain(key[1:])
+}
+
+// based on the W3C Trace Context specification
+//
+// key = simple-key / multi-tenant-key
+// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// multi-tenant-key = tenant-id "@" system-id
+// tenant-id = ( lcalpha / DIGIT ) (0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// lcalpha = %x61-7A ; a-z
+//
+// see https://www.w3.org/TR/trace-context-1/#tracestate-header.
+func checkKey(key string) bool {
+ tenant, system, ok := strings.Cut(key, "@")
+ if !ok {
+ return checkKeyPart(key, 255)
+ }
+ return checkKeyTenant(tenant, 240) && checkKeyPart(system, 13)
+}
+
func newMember(key, value string) (member, error) {
- if !keyRe.MatchString(key) {
- return member{}, fmt.Errorf("%w: %s", errInvalidKey, key)
+ if !checkKey(key) {
+ return member{}, errInvalidKey
}
- if !valueRe.MatchString(value) {
- return member{}, fmt.Errorf("%w: %s", errInvalidValue, value)
+ if !checkValue(value) {
+ return member{}, errInvalidValue
}
return member{Key: key, Value: value}, nil
}
func parseMember(m string) (member, error) {
- matches := memberRe.FindStringSubmatch(m)
- if len(matches) != 5 {
+ key, val, ok := strings.Cut(m, memberDelimiter)
+ if !ok {
return member{}, fmt.Errorf("%w: %s", errInvalidMember, m)
}
-
- return member{
- Key: matches[1],
- Value: matches[4],
- }, nil
+ key = strings.TrimLeft(key, " \t")
+ val = strings.TrimRight(val, " \t")
+ result, e := newMember(key, val)
+ if e != nil {
+ return member{}, fmt.Errorf("%w: %s", errInvalidMember, m)
+ }
+ return result, nil
}
// String encodes member into a string compliant with the W3C Trace Context
// specification.
func (m member) String() string {
- return fmt.Sprintf("%s=%s", m.Key, m.Value)
+ return m.Key + "=" + m.Value
}
// TraceState provides additional vendor-specific trace identification
@@ -99,8 +177,8 @@ var _ json.Marshaler = TraceState{}
// ParseTraceState attempts to decode a TraceState from the passed
// string. It returns an error if the input is invalid according to the W3C
// Trace Context specification.
-func ParseTraceState(tracestate string) (TraceState, error) {
- if tracestate == "" {
+func ParseTraceState(ts string) (TraceState, error) {
+ if ts == "" {
return TraceState{}, nil
}
@@ -110,7 +188,9 @@ func ParseTraceState(tracestate string) (TraceState, error) {
var members []member
found := make(map[string]struct{})
- for _, memberStr := range strings.Split(tracestate, listDelimiter) {
+ for ts != "" {
+ var memberStr string
+ memberStr, ts, _ = strings.Cut(ts, listDelimiters)
if len(memberStr) == 0 {
continue
}
@@ -143,11 +223,29 @@ func (ts TraceState) MarshalJSON() ([]byte, error) {
// Trace Context specification. The returned string will be invalid if the
// TraceState contains any invalid members.
func (ts TraceState) String() string {
- members := make([]string, len(ts.list))
- for i, m := range ts.list {
- members[i] = m.String()
+ if len(ts.list) == 0 {
+ return ""
+ }
+ var n int
+ n += len(ts.list) // member delimiters: '='
+ n += len(ts.list) - 1 // list delimiters: ','
+ for _, mem := range ts.list {
+ n += len(mem.Key)
+ n += len(mem.Value)
}
- return strings.Join(members, listDelimiter)
+
+ var sb strings.Builder
+ sb.Grow(n)
+ _, _ = sb.WriteString(ts.list[0].Key)
+ _ = sb.WriteByte('=')
+ _, _ = sb.WriteString(ts.list[0].Value)
+ for i := 1; i < len(ts.list); i++ {
+ _ = sb.WriteByte(listDelimiters[0])
+ _, _ = sb.WriteString(ts.list[i].Key)
+ _ = sb.WriteByte('=')
+ _, _ = sb.WriteString(ts.list[i].Value)
+ }
+ return sb.String()
}
// Get returns the value paired with key from the corresponding TraceState
@@ -179,15 +277,25 @@ func (ts TraceState) Insert(key, value string) (TraceState, error) {
if err != nil {
return ts, err
}
-
- cTS := ts.Delete(key)
- if cTS.Len()+1 <= maxListMembers {
- cTS.list = append(cTS.list, member{})
+ n := len(ts.list)
+ found := n
+ for i := range ts.list {
+ if ts.list[i].Key == key {
+ found = i
+ }
+ }
+ cTS := TraceState{}
+ if found == n && n < maxListMembers {
+ cTS.list = make([]member, n+1)
+ } else {
+ cTS.list = make([]member, n)
}
- // When the number of members exceeds capacity, drop the "right-most".
- copy(cTS.list[1:], cTS.list)
cTS.list[0] = m
-
+ // When the number of members exceeds capacity, drop the "right-most".
+ copy(cTS.list[1:], ts.list[0:found])
+ if found < n {
+ copy(cTS.list[1+found:], ts.list[found+1:])
+ }
return cTS, nil
}
diff --git a/vendor/go.opentelemetry.io/otel/verify_examples.sh b/vendor/go.opentelemetry.io/otel/verify_examples.sh
index dbb61a4227..e57bf57fce 100644
--- a/vendor/go.opentelemetry.io/otel/verify_examples.sh
+++ b/vendor/go.opentelemetry.io/otel/verify_examples.sh
@@ -1,18 +1,7 @@
#!/bin/bash
# Copyright The OpenTelemetry Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
diff --git a/vendor/go.opentelemetry.io/otel/verify_readmes.sh b/vendor/go.opentelemetry.io/otel/verify_readmes.sh
new file mode 100644
index 0000000000..1e87855eea
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/verify_readmes.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+set -euo pipefail
+
+dirs=$(find . -type d -not -path "*/internal*" -not -path "*/test*" -not -path "*/example*" -not -path "*/.*" | sort)
+
+missingReadme=false
+for dir in $dirs; do
+ if [ ! -f "$dir/README.md" ]; then
+ echo "couldn't find README.md for $dir"
+ missingReadme=true
+ fi
+done
+
+if [ "$missingReadme" = true ] ; then
+ echo "Error: some READMEs couldn't be found."
+ exit 1
+fi
diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go
index ad64e19967..ab28960524 100644
--- a/vendor/go.opentelemetry.io/otel/version.go
+++ b/vendor/go.opentelemetry.io/otel/version.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
// Version is the current release version of OpenTelemetry in use.
func Version() string {
- return "1.19.0"
+ return "1.28.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml
index 7d21276924..241cfc82a8 100644
--- a/vendor/go.opentelemetry.io/otel/versions.yaml
+++ b/vendor/go.opentelemetry.io/otel/versions.yaml
@@ -1,33 +1,27 @@
# Copyright The OpenTelemetry Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
module-sets:
stable-v1:
- version: v1.19.0
+ version: v1.28.0
modules:
- go.opentelemetry.io/otel
+ - go.opentelemetry.io/otel/bridge/opencensus
+ - go.opentelemetry.io/otel/bridge/opencensus/test
- go.opentelemetry.io/otel/bridge/opentracing
- go.opentelemetry.io/otel/bridge/opentracing/test
- go.opentelemetry.io/otel/example/dice
- - go.opentelemetry.io/otel/example/fib
- go.opentelemetry.io/otel/example/namedtracer
+ - go.opentelemetry.io/otel/example/opencensus
- go.opentelemetry.io/otel/example/otel-collector
- go.opentelemetry.io/otel/example/passthrough
- go.opentelemetry.io/otel/example/zipkin
+ - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
+ - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
- go.opentelemetry.io/otel/exporters/otlp/otlptrace
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
+ - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric
- go.opentelemetry.io/otel/exporters/stdout/stdouttrace
- go.opentelemetry.io/otel/exporters/zipkin
- go.opentelemetry.io/otel/metric
@@ -35,21 +29,21 @@ module-sets:
- go.opentelemetry.io/otel/sdk/metric
- go.opentelemetry.io/otel/trace
experimental-metrics:
- version: v0.42.0
+ version: v0.50.0
modules:
- - go.opentelemetry.io/otel/bridge/opencensus
- - go.opentelemetry.io/otel/bridge/opencensus/test
- - go.opentelemetry.io/otel/example/opencensus
- go.opentelemetry.io/otel/example/prometheus
- - go.opentelemetry.io/otel/example/view
- - go.opentelemetry.io/otel/exporters/otlp/otlpmetric
- - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
- - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
- go.opentelemetry.io/otel/exporters/prometheus
- - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric
+ experimental-logs:
+ version: v0.4.0
+ modules:
+ - go.opentelemetry.io/otel/log
+ - go.opentelemetry.io/otel/sdk/log
+ - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp
+ - go.opentelemetry.io/otel/exporters/stdout/stdoutlog
experimental-schema:
- version: v0.0.7
+ version: v0.0.8
modules:
- go.opentelemetry.io/otel/schema
excluded-modules:
- go.opentelemetry.io/otel/internal/tools
+ - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc
diff --git a/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go b/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go
index 51a499816a..d7099c35bc 100644
--- a/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go
+++ b/vendor/go.opentelemetry.io/proto/otlp/trace/v1/trace.pb.go
@@ -36,6 +36,78 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
+// SpanFlags represents constants used to interpret the
+// Span.flags field, which is protobuf 'fixed32' type and is to
+// be used as bit-fields. Each non-zero value defined in this enum is
+// a bit-mask. To extract the bit-field, for example, use an
+// expression like:
+//
+// (span.flags & SPAN_FLAGS_TRACE_FLAGS_MASK)
+//
+// See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
+//
+// Note that Span flags were introduced in version 1.1 of the
+// OpenTelemetry protocol. Older Span producers do not set this
+// field, consequently consumers should not rely on the absence of a
+// particular flag bit to indicate the presence of a particular feature.
+type SpanFlags int32
+
+const (
+ // The zero value for the enum. Should not be used for comparisons.
+ // Instead use bitwise "and" with the appropriate mask as shown above.
+ SpanFlags_SPAN_FLAGS_DO_NOT_USE SpanFlags = 0
+ // Bits 0-7 are used for trace flags.
+ SpanFlags_SPAN_FLAGS_TRACE_FLAGS_MASK SpanFlags = 255
+ // Bits 8 and 9 are used to indicate that the parent span or link span is remote.
+ // Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known.
+ // Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote.
+ SpanFlags_SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK SpanFlags = 256
+ SpanFlags_SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK SpanFlags = 512
+)
+
+// Enum value maps for SpanFlags.
+var (
+ SpanFlags_name = map[int32]string{
+ 0: "SPAN_FLAGS_DO_NOT_USE",
+ 255: "SPAN_FLAGS_TRACE_FLAGS_MASK",
+ 256: "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK",
+ 512: "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK",
+ }
+ SpanFlags_value = map[string]int32{
+ "SPAN_FLAGS_DO_NOT_USE": 0,
+ "SPAN_FLAGS_TRACE_FLAGS_MASK": 255,
+ "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK": 256,
+ "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK": 512,
+ }
+)
+
+func (x SpanFlags) Enum() *SpanFlags {
+ p := new(SpanFlags)
+ *p = x
+ return p
+}
+
+func (x SpanFlags) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (SpanFlags) Descriptor() protoreflect.EnumDescriptor {
+ return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[0].Descriptor()
+}
+
+func (SpanFlags) Type() protoreflect.EnumType {
+ return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[0]
+}
+
+func (x SpanFlags) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use SpanFlags.Descriptor instead.
+func (SpanFlags) EnumDescriptor() ([]byte, []int) {
+ return file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP(), []int{0}
+}
+
// SpanKind is the type of span. Can be used to specify additional relationships between spans
// in addition to a parent/child relationship.
type Span_SpanKind int32
@@ -94,11 +166,11 @@ func (x Span_SpanKind) String() string {
}
func (Span_SpanKind) Descriptor() protoreflect.EnumDescriptor {
- return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[0].Descriptor()
+ return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[1].Descriptor()
}
func (Span_SpanKind) Type() protoreflect.EnumType {
- return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[0]
+ return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[1]
}
func (x Span_SpanKind) Number() protoreflect.EnumNumber {
@@ -149,11 +221,11 @@ func (x Status_StatusCode) String() string {
}
func (Status_StatusCode) Descriptor() protoreflect.EnumDescriptor {
- return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[1].Descriptor()
+ return file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[2].Descriptor()
}
func (Status_StatusCode) Type() protoreflect.EnumType {
- return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[1]
+ return &file_opentelemetry_proto_trace_v1_trace_proto_enumTypes[2]
}
func (x Status_StatusCode) Number() protoreflect.EnumNumber {
@@ -238,6 +310,9 @@ type ResourceSpans struct {
Resource *v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
// A list of ScopeSpans that originate from a resource.
ScopeSpans []*ScopeSpans `protobuf:"bytes,2,rep,name=scope_spans,json=scopeSpans,proto3" json:"scope_spans,omitempty"`
+ // The Schema URL, if known. This is the identifier of the Schema that the resource data
+ // is recorded in. To learn more about Schema URL see
+ // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
// This schema_url applies to the data in the "resource" field. It does not apply
// to the data in the "scope_spans" field which have their own schema_url field.
SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"`
@@ -308,6 +383,9 @@ type ScopeSpans struct {
Scope *v11.InstrumentationScope `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"`
// A list of Spans that originate from an instrumentation scope.
Spans []*Span `protobuf:"bytes,2,rep,name=spans,proto3" json:"spans,omitempty"`
+ // The Schema URL, if known. This is the identifier of the Schema that the span data
+ // is recorded in. To learn more about Schema URL see
+ // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
// This schema_url applies to all spans and span events in the "spans" field.
SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"`
}
@@ -394,6 +472,28 @@ type Span struct {
// The `span_id` of this span's parent span. If this is a root span, then this
// field must be empty. The ID is an 8-byte array.
ParentSpanId []byte `protobuf:"bytes,4,opt,name=parent_span_id,json=parentSpanId,proto3" json:"parent_span_id,omitempty"`
+ // Flags, a bit field.
+ //
+ // Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace
+ // Context specification. To read the 8-bit W3C trace flag, use
+ // `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
+ //
+ // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
+ //
+ // Bits 8 and 9 represent the 3 states of whether a span's parent
+ // is remote. The states are (unknown, is not remote, is remote).
+ // To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`.
+ // To read whether the span is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`.
+ //
+ // When creating span messages, if the message is logically forwarded from another source
+ // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD
+ // be copied as-is. If creating from a source that does not have an equivalent flags field
+ // (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST
+ // be set to zero.
+ // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero.
+ //
+ // [Optional].
+ Flags uint32 `protobuf:"fixed32,16,opt,name=flags,proto3" json:"flags,omitempty"`
// A description of the span's operation.
//
// For example, the name can be a qualified method name or a file name
@@ -517,6 +617,13 @@ func (x *Span) GetParentSpanId() []byte {
return nil
}
+func (x *Span) GetFlags() uint32 {
+ if x != nil {
+ return x.Flags
+ }
+ return 0
+}
+
func (x *Span) GetName() string {
if x != nil {
return x.Name
@@ -757,6 +864,24 @@ type Span_Link struct {
// dropped_attributes_count is the number of dropped attributes. If the value is 0,
// then no attributes were dropped.
DroppedAttributesCount uint32 `protobuf:"varint,5,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"`
+ // Flags, a bit field.
+ //
+ // Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace
+ // Context specification. To read the 8-bit W3C trace flag, use
+ // `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
+ //
+ // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
+ //
+ // Bits 8 and 9 represent the 3 states of whether the link is remote.
+ // The states are (unknown, is not remote, is remote).
+ // To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`.
+ // To read whether the link is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`.
+ //
+ // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero.
+ // When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero.
+ //
+ // [Optional].
+ Flags uint32 `protobuf:"fixed32,6,opt,name=flags,proto3" json:"flags,omitempty"`
}
func (x *Span_Link) Reset() {
@@ -826,6 +951,13 @@ func (x *Span_Link) GetDroppedAttributesCount() uint32 {
return 0
}
+func (x *Span_Link) GetFlags() uint32 {
+ if x != nil {
+ return x.Flags
+ }
+ return 0
+}
+
var File_opentelemetry_proto_trace_v1_trace_proto protoreflect.FileDescriptor
var file_opentelemetry_proto_trace_v1_trace_proto_rawDesc = []byte{
@@ -869,7 +1001,7 @@ var file_opentelemetry_proto_trace_v1_trace_proto_rawDesc = []byte{
0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x05,
0x73, 0x70, 0x61, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f,
0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x6d,
- 0x61, 0x55, 0x72, 0x6c, 0x22, 0x9c, 0x0a, 0x0a, 0x04, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x19, 0x0a,
+ 0x61, 0x55, 0x72, 0x6c, 0x22, 0xc8, 0x0a, 0x0a, 0x04, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x19, 0x0a,
0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x61, 0x6e,
0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x70, 0x61, 0x6e, 0x49,
@@ -877,101 +1009,113 @@ var file_opentelemetry_proto_trace_v1_trace_proto_rawDesc = []byte{
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61,
0x74, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x70, 0x61,
0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x65,
- 0x6e, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
- 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x04,
- 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x6f, 0x70, 0x65,
- 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x53,
- 0x70, 0x61, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x2f, 0x0a,
- 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78,
- 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x06, 0x52, 0x11, 0x73, 0x74, 0x61,
- 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x2b,
- 0x0a, 0x12, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f,
- 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0f, 0x65, 0x6e, 0x64, 0x54,
- 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x47, 0x0a, 0x0a, 0x61,
- 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32,
- 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
- 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62,
- 0x75, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f,
- 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74,
- 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41,
- 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x40,
- 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28,
- 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70,
- 0x61, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
- 0x12, 0x30, 0x0a, 0x14, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e,
- 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12,
- 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75,
- 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72,
- 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x6b,
- 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6e,
- 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11,
- 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x43, 0x6f, 0x75, 0x6e,
- 0x74, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72,
- 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a,
- 0xc4, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x69, 0x6d,
- 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12,
- 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
- 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65,
- 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f,
- 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65,
- 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18,
- 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
- 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16,
- 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
- 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xde, 0x01, 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12,
- 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70,
- 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x70, 0x61,
- 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61,
- 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x65, 0x53,
- 0x74, 0x61, 0x74, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
- 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74,
- 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63,
- 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75,
- 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a,
- 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
- 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52,
- 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
- 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x99, 0x01, 0x0a, 0x08, 0x53, 0x70, 0x61, 0x6e,
- 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e,
- 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x16, 0x0a, 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4e, 0x54,
- 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x50, 0x41, 0x4e, 0x5f,
- 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, 0x14, 0x0a,
- 0x10, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e,
- 0x54, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44,
- 0x5f, 0x50, 0x52, 0x4f, 0x44, 0x55, 0x43, 0x45, 0x52, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x53,
- 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x55, 0x4d, 0x45,
- 0x52, 0x10, 0x05, 0x22, 0xbd, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18,
- 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65,
- 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c,
- 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61,
- 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61,
- 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x4e, 0x0a,
- 0x0a, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53,
- 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x45, 0x54,
- 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44,
- 0x45, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53,
- 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x4a, 0x04, 0x08,
- 0x01, 0x10, 0x02, 0x42, 0x77, 0x0a, 0x1f, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65,
+ 0x6e, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67,
+ 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x12,
+ 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e,
+ 0x32, 0x2b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b,
+ 0x69, 0x6e, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d,
+ 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28,
+ 0x06, 0x52, 0x11, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78,
+ 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x2b, 0x0a, 0x12, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65,
+ 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x06,
+ 0x52, 0x0f, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x78, 0x4e, 0x61, 0x6e,
+ 0x6f, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18,
+ 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65,
+ 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
+ 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a,
+ 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72,
+ 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
+ 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72,
+ 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43,
+ 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0b,
+ 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65,
+ 0x64, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c,
+ 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x45, 0x76, 0x65,
+ 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b,
+ 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65,
0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72,
- 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x72, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f,
- 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c,
- 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
- 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x1c,
- 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x33,
+ 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x4c, 0x69, 0x6e, 0x6b,
+ 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x72, 0x6f, 0x70, 0x70,
+ 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e,
+ 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x4c, 0x69, 0x6e,
+ 0x6b, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65,
+ 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72,
+ 0x61, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0xc4, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12,
+ 0x24, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x6e, 0x61, 0x6e,
+ 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69,
+ 0x78, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e,
+ 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65,
+ 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04,
+ 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xf4, 0x01, 0x0a,
+ 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69,
+ 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64,
+ 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x0c, 0x52, 0x06, 0x73, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x61,
+ 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
+ 0x74, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27,
+ 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4b,
+ 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
+ 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61,
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a,
+ 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x66, 0x6c,
+ 0x61, 0x67, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x08, 0x53, 0x70, 0x61, 0x6e, 0x4b, 0x69, 0x6e, 0x64,
+ 0x12, 0x19, 0x0a, 0x15, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e,
+ 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x53,
+ 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41,
+ 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44,
+ 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x50, 0x41,
+ 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12,
+ 0x16, 0x0a, 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x50, 0x52, 0x4f,
+ 0x44, 0x55, 0x43, 0x45, 0x52, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x50, 0x41, 0x4e, 0x5f,
+ 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x55, 0x4d, 0x45, 0x52, 0x10, 0x05, 0x22,
+ 0xbd, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65,
+ 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01,
+ 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
+ 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43,
+ 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x4e, 0x0a, 0x0a, 0x53, 0x74, 0x61,
+ 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x55,
+ 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x45, 0x54, 0x10, 0x00, 0x12, 0x12,
+ 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x4b,
+ 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x44,
+ 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x2a,
+ 0x9c, 0x01, 0x0a, 0x09, 0x53, 0x70, 0x61, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x19, 0x0a,
+ 0x15, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x5f, 0x44, 0x4f, 0x5f, 0x4e,
+ 0x4f, 0x54, 0x5f, 0x55, 0x53, 0x45, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1b, 0x53, 0x50, 0x41, 0x4e,
+ 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x45, 0x5f, 0x46, 0x4c, 0x41,
+ 0x47, 0x53, 0x5f, 0x4d, 0x41, 0x53, 0x4b, 0x10, 0xff, 0x01, 0x12, 0x2a, 0x0a, 0x25, 0x53, 0x50,
+ 0x41, 0x4e, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x53, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x58, 0x54,
+ 0x5f, 0x48, 0x41, 0x53, 0x5f, 0x49, 0x53, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x4d,
+ 0x41, 0x53, 0x4b, 0x10, 0x80, 0x02, 0x12, 0x26, 0x0a, 0x21, 0x53, 0x50, 0x41, 0x4e, 0x5f, 0x46,
+ 0x4c, 0x41, 0x47, 0x53, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x58, 0x54, 0x5f, 0x49, 0x53, 0x5f,
+ 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x4d, 0x41, 0x53, 0x4b, 0x10, 0x80, 0x04, 0x42, 0x77,
+ 0x0a, 0x1f, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
+ 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x76,
+ 0x31, 0x42, 0x0a, 0x54, 0x72, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a,
+ 0x27, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72,
+ 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f,
+ 0x74, 0x72, 0x61, 0x63, 0x65, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x1c, 0x4f, 0x70, 0x65, 0x6e, 0x54,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54,
+ 0x72, 0x61, 0x63, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -986,36 +1130,37 @@ func file_opentelemetry_proto_trace_v1_trace_proto_rawDescGZIP() []byte {
return file_opentelemetry_proto_trace_v1_trace_proto_rawDescData
}
-var file_opentelemetry_proto_trace_v1_trace_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_opentelemetry_proto_trace_v1_trace_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_opentelemetry_proto_trace_v1_trace_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_opentelemetry_proto_trace_v1_trace_proto_goTypes = []interface{}{
- (Span_SpanKind)(0), // 0: opentelemetry.proto.trace.v1.Span.SpanKind
- (Status_StatusCode)(0), // 1: opentelemetry.proto.trace.v1.Status.StatusCode
- (*TracesData)(nil), // 2: opentelemetry.proto.trace.v1.TracesData
- (*ResourceSpans)(nil), // 3: opentelemetry.proto.trace.v1.ResourceSpans
- (*ScopeSpans)(nil), // 4: opentelemetry.proto.trace.v1.ScopeSpans
- (*Span)(nil), // 5: opentelemetry.proto.trace.v1.Span
- (*Status)(nil), // 6: opentelemetry.proto.trace.v1.Status
- (*Span_Event)(nil), // 7: opentelemetry.proto.trace.v1.Span.Event
- (*Span_Link)(nil), // 8: opentelemetry.proto.trace.v1.Span.Link
- (*v1.Resource)(nil), // 9: opentelemetry.proto.resource.v1.Resource
- (*v11.InstrumentationScope)(nil), // 10: opentelemetry.proto.common.v1.InstrumentationScope
- (*v11.KeyValue)(nil), // 11: opentelemetry.proto.common.v1.KeyValue
+ (SpanFlags)(0), // 0: opentelemetry.proto.trace.v1.SpanFlags
+ (Span_SpanKind)(0), // 1: opentelemetry.proto.trace.v1.Span.SpanKind
+ (Status_StatusCode)(0), // 2: opentelemetry.proto.trace.v1.Status.StatusCode
+ (*TracesData)(nil), // 3: opentelemetry.proto.trace.v1.TracesData
+ (*ResourceSpans)(nil), // 4: opentelemetry.proto.trace.v1.ResourceSpans
+ (*ScopeSpans)(nil), // 5: opentelemetry.proto.trace.v1.ScopeSpans
+ (*Span)(nil), // 6: opentelemetry.proto.trace.v1.Span
+ (*Status)(nil), // 7: opentelemetry.proto.trace.v1.Status
+ (*Span_Event)(nil), // 8: opentelemetry.proto.trace.v1.Span.Event
+ (*Span_Link)(nil), // 9: opentelemetry.proto.trace.v1.Span.Link
+ (*v1.Resource)(nil), // 10: opentelemetry.proto.resource.v1.Resource
+ (*v11.InstrumentationScope)(nil), // 11: opentelemetry.proto.common.v1.InstrumentationScope
+ (*v11.KeyValue)(nil), // 12: opentelemetry.proto.common.v1.KeyValue
}
var file_opentelemetry_proto_trace_v1_trace_proto_depIdxs = []int32{
- 3, // 0: opentelemetry.proto.trace.v1.TracesData.resource_spans:type_name -> opentelemetry.proto.trace.v1.ResourceSpans
- 9, // 1: opentelemetry.proto.trace.v1.ResourceSpans.resource:type_name -> opentelemetry.proto.resource.v1.Resource
- 4, // 2: opentelemetry.proto.trace.v1.ResourceSpans.scope_spans:type_name -> opentelemetry.proto.trace.v1.ScopeSpans
- 10, // 3: opentelemetry.proto.trace.v1.ScopeSpans.scope:type_name -> opentelemetry.proto.common.v1.InstrumentationScope
- 5, // 4: opentelemetry.proto.trace.v1.ScopeSpans.spans:type_name -> opentelemetry.proto.trace.v1.Span
- 0, // 5: opentelemetry.proto.trace.v1.Span.kind:type_name -> opentelemetry.proto.trace.v1.Span.SpanKind
- 11, // 6: opentelemetry.proto.trace.v1.Span.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
- 7, // 7: opentelemetry.proto.trace.v1.Span.events:type_name -> opentelemetry.proto.trace.v1.Span.Event
- 8, // 8: opentelemetry.proto.trace.v1.Span.links:type_name -> opentelemetry.proto.trace.v1.Span.Link
- 6, // 9: opentelemetry.proto.trace.v1.Span.status:type_name -> opentelemetry.proto.trace.v1.Status
- 1, // 10: opentelemetry.proto.trace.v1.Status.code:type_name -> opentelemetry.proto.trace.v1.Status.StatusCode
- 11, // 11: opentelemetry.proto.trace.v1.Span.Event.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
- 11, // 12: opentelemetry.proto.trace.v1.Span.Link.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
+ 4, // 0: opentelemetry.proto.trace.v1.TracesData.resource_spans:type_name -> opentelemetry.proto.trace.v1.ResourceSpans
+ 10, // 1: opentelemetry.proto.trace.v1.ResourceSpans.resource:type_name -> opentelemetry.proto.resource.v1.Resource
+ 5, // 2: opentelemetry.proto.trace.v1.ResourceSpans.scope_spans:type_name -> opentelemetry.proto.trace.v1.ScopeSpans
+ 11, // 3: opentelemetry.proto.trace.v1.ScopeSpans.scope:type_name -> opentelemetry.proto.common.v1.InstrumentationScope
+ 6, // 4: opentelemetry.proto.trace.v1.ScopeSpans.spans:type_name -> opentelemetry.proto.trace.v1.Span
+ 1, // 5: opentelemetry.proto.trace.v1.Span.kind:type_name -> opentelemetry.proto.trace.v1.Span.SpanKind
+ 12, // 6: opentelemetry.proto.trace.v1.Span.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
+ 8, // 7: opentelemetry.proto.trace.v1.Span.events:type_name -> opentelemetry.proto.trace.v1.Span.Event
+ 9, // 8: opentelemetry.proto.trace.v1.Span.links:type_name -> opentelemetry.proto.trace.v1.Span.Link
+ 7, // 9: opentelemetry.proto.trace.v1.Span.status:type_name -> opentelemetry.proto.trace.v1.Status
+ 2, // 10: opentelemetry.proto.trace.v1.Status.code:type_name -> opentelemetry.proto.trace.v1.Status.StatusCode
+ 12, // 11: opentelemetry.proto.trace.v1.Span.Event.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
+ 12, // 12: opentelemetry.proto.trace.v1.Span.Link.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
13, // [13:13] is the sub-list for method output_type
13, // [13:13] is the sub-list for method input_type
13, // [13:13] is the sub-list for extension type_name
@@ -1119,7 +1264,7 @@ func file_opentelemetry_proto_trace_v1_trace_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_opentelemetry_proto_trace_v1_trace_proto_rawDesc,
- NumEnums: 2,
+ NumEnums: 3,
NumMessages: 7,
NumExtensions: 0,
NumServices: 0,
diff --git a/vendor/golang.org/x/crypto/LICENSE b/vendor/golang.org/x/crypto/LICENSE
index 6a66aea5ea..2a7cf70da6 100644
--- a/vendor/golang.org/x/crypto/LICENSE
+++ b/vendor/golang.org/x/crypto/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
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
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/crypto/cast5/cast5.go b/vendor/golang.org/x/crypto/cast5/cast5.go
index 425e8eecb0..016e90215c 100644
--- a/vendor/golang.org/x/crypto/cast5/cast5.go
+++ b/vendor/golang.org/x/crypto/cast5/cast5.go
@@ -11,7 +11,7 @@
// Deprecated: any new system should use AES (from crypto/aes, if necessary in
// an AEAD mode like crypto/cipher.NewGCM) or XChaCha20-Poly1305 (from
// golang.org/x/crypto/chacha20poly1305).
-package cast5 // import "golang.org/x/crypto/cast5"
+package cast5
import (
"errors"
diff --git a/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go b/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go
index cda8e3edfd..90ef6a241d 100644
--- a/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go
+++ b/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go
@@ -4,7 +4,7 @@
// Package asn1 contains supporting types for parsing and building ASN.1
// messages with the cryptobyte package.
-package asn1 // import "golang.org/x/crypto/cryptobyte/asn1"
+package asn1
// Tag represents an ASN.1 identifier octet, consisting of a tag number
// (indicating a type) and class (such as context-specific or constructed).
diff --git a/vendor/golang.org/x/crypto/cryptobyte/string.go b/vendor/golang.org/x/crypto/cryptobyte/string.go
index 10692a8a31..4b0f8097f9 100644
--- a/vendor/golang.org/x/crypto/cryptobyte/string.go
+++ b/vendor/golang.org/x/crypto/cryptobyte/string.go
@@ -15,7 +15,7 @@
//
// See the documentation and examples for the Builder and String types to get
// started.
-package cryptobyte // import "golang.org/x/crypto/cryptobyte"
+package cryptobyte
// String represents a string of bytes. It provides methods for parsing
// fixed-length and length-prefixed values from it.
diff --git a/vendor/golang.org/x/crypto/hkdf/hkdf.go b/vendor/golang.org/x/crypto/hkdf/hkdf.go
index f4ded5fee2..3bee66294e 100644
--- a/vendor/golang.org/x/crypto/hkdf/hkdf.go
+++ b/vendor/golang.org/x/crypto/hkdf/hkdf.go
@@ -8,7 +8,7 @@
// HKDF is a cryptographic key derivation function (KDF) with the goal of
// expanding limited input keying material into one or more cryptographically
// strong secret keys.
-package hkdf // import "golang.org/x/crypto/hkdf"
+package hkdf
import (
"crypto/hmac"
diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s b/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s
index e0d3c64756..133757384b 100644
--- a/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s
+++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s
@@ -1,108 +1,93 @@
-// Copyright 2012 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.
+// Code generated by command: go run sum_amd64_asm.go -out ../sum_amd64.s -pkg poly1305. DO NOT EDIT.
//go:build gc && !purego
-#include "textflag.h"
-
-#define POLY1305_ADD(msg, h0, h1, h2) \
- ADDQ 0(msg), h0; \
- ADCQ 8(msg), h1; \
- ADCQ $1, h2; \
- LEAQ 16(msg), msg
-
-#define POLY1305_MUL(h0, h1, h2, r0, r1, t0, t1, t2, t3) \
- MOVQ r0, AX; \
- MULQ h0; \
- MOVQ AX, t0; \
- MOVQ DX, t1; \
- MOVQ r0, AX; \
- MULQ h1; \
- ADDQ AX, t1; \
- ADCQ $0, DX; \
- MOVQ r0, t2; \
- IMULQ h2, t2; \
- ADDQ DX, t2; \
- \
- MOVQ r1, AX; \
- MULQ h0; \
- ADDQ AX, t1; \
- ADCQ $0, DX; \
- MOVQ DX, h0; \
- MOVQ r1, t3; \
- IMULQ h2, t3; \
- MOVQ r1, AX; \
- MULQ h1; \
- ADDQ AX, t2; \
- ADCQ DX, t3; \
- ADDQ h0, t2; \
- ADCQ $0, t3; \
- \
- MOVQ t0, h0; \
- MOVQ t1, h1; \
- MOVQ t2, h2; \
- ANDQ $3, h2; \
- MOVQ t2, t0; \
- ANDQ $0xFFFFFFFFFFFFFFFC, t0; \
- ADDQ t0, h0; \
- ADCQ t3, h1; \
- ADCQ $0, h2; \
- SHRQ $2, t3, t2; \
- SHRQ $2, t3; \
- ADDQ t2, h0; \
- ADCQ t3, h1; \
- ADCQ $0, h2
-
-// func update(state *[7]uint64, msg []byte)
+// func update(state *macState, msg []byte)
TEXT ·update(SB), $0-32
MOVQ state+0(FP), DI
MOVQ msg_base+8(FP), SI
MOVQ msg_len+16(FP), R15
-
- MOVQ 0(DI), R8 // h0
- MOVQ 8(DI), R9 // h1
- MOVQ 16(DI), R10 // h2
- MOVQ 24(DI), R11 // r0
- MOVQ 32(DI), R12 // r1
-
- CMPQ R15, $16
+ MOVQ (DI), R8
+ MOVQ 8(DI), R9
+ MOVQ 16(DI), R10
+ MOVQ 24(DI), R11
+ MOVQ 32(DI), R12
+ CMPQ R15, $0x10
JB bytes_between_0_and_15
loop:
- POLY1305_ADD(SI, R8, R9, R10)
+ ADDQ (SI), R8
+ ADCQ 8(SI), R9
+ ADCQ $0x01, R10
+ LEAQ 16(SI), SI
multiply:
- POLY1305_MUL(R8, R9, R10, R11, R12, BX, CX, R13, R14)
- SUBQ $16, R15
- CMPQ R15, $16
- JAE loop
+ MOVQ R11, AX
+ MULQ R8
+ MOVQ AX, BX
+ MOVQ DX, CX
+ MOVQ R11, AX
+ MULQ R9
+ ADDQ AX, CX
+ ADCQ $0x00, DX
+ MOVQ R11, R13
+ IMULQ R10, R13
+ ADDQ DX, R13
+ MOVQ R12, AX
+ MULQ R8
+ ADDQ AX, CX
+ ADCQ $0x00, DX
+ MOVQ DX, R8
+ MOVQ R12, R14
+ IMULQ R10, R14
+ MOVQ R12, AX
+ MULQ R9
+ ADDQ AX, R13
+ ADCQ DX, R14
+ ADDQ R8, R13
+ ADCQ $0x00, R14
+ MOVQ BX, R8
+ MOVQ CX, R9
+ MOVQ R13, R10
+ ANDQ $0x03, R10
+ MOVQ R13, BX
+ ANDQ $-4, BX
+ ADDQ BX, R8
+ ADCQ R14, R9
+ ADCQ $0x00, R10
+ SHRQ $0x02, R14, R13
+ SHRQ $0x02, R14
+ ADDQ R13, R8
+ ADCQ R14, R9
+ ADCQ $0x00, R10
+ SUBQ $0x10, R15
+ CMPQ R15, $0x10
+ JAE loop
bytes_between_0_and_15:
TESTQ R15, R15
JZ done
- MOVQ $1, BX
+ MOVQ $0x00000001, BX
XORQ CX, CX
XORQ R13, R13
ADDQ R15, SI
flush_buffer:
- SHLQ $8, BX, CX
- SHLQ $8, BX
+ SHLQ $0x08, BX, CX
+ SHLQ $0x08, BX
MOVB -1(SI), R13
XORQ R13, BX
DECQ SI
DECQ R15
JNZ flush_buffer
-
ADDQ BX, R8
ADCQ CX, R9
- ADCQ $0, R10
- MOVQ $16, R15
+ ADCQ $0x00, R10
+ MOVQ $0x00000010, R15
JMP multiply
done:
- MOVQ R8, 0(DI)
+ MOVQ R8, (DI)
MOVQ R9, 8(DI)
MOVQ R10, 16(DI)
RET
diff --git a/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go b/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go
index f3c3242a04..1fe600ad03 100644
--- a/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go
+++ b/vendor/golang.org/x/crypto/nacl/secretbox/secretbox.go
@@ -32,7 +32,7 @@ chunk size.
This package is interoperable with NaCl: https://nacl.cr.yp.to/secretbox.html.
*/
-package secretbox // import "golang.org/x/crypto/nacl/secretbox"
+package secretbox
import (
"golang.org/x/crypto/internal/alias"
diff --git a/vendor/golang.org/x/crypto/openpgp/armor/armor.go b/vendor/golang.org/x/crypto/openpgp/armor/armor.go
index 8907183ec0..e664d127cb 100644
--- a/vendor/golang.org/x/crypto/openpgp/armor/armor.go
+++ b/vendor/golang.org/x/crypto/openpgp/armor/armor.go
@@ -10,14 +10,15 @@
// for their specific task. If you are required to interoperate with OpenPGP
// systems and need a maintained package, consider a community fork.
// See https://golang.org/issue/44226.
-package armor // import "golang.org/x/crypto/openpgp/armor"
+package armor
import (
"bufio"
"bytes"
"encoding/base64"
- "golang.org/x/crypto/openpgp/errors"
"io"
+
+ "golang.org/x/crypto/openpgp/errors"
)
// A Block represents an OpenPGP armored structure.
diff --git a/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go b/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go
index 743b35a120..f922bdbcaa 100644
--- a/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go
+++ b/vendor/golang.org/x/crypto/openpgp/elgamal/elgamal.go
@@ -16,7 +16,7 @@
// https://golang.org/issue/44226), and ElGamal in the OpenPGP ecosystem has
// compatibility and security issues (see https://eprint.iacr.org/2021/923).
// Moreover, this package doesn't protect against side-channel attacks.
-package elgamal // import "golang.org/x/crypto/openpgp/elgamal"
+package elgamal
import (
"crypto/rand"
diff --git a/vendor/golang.org/x/crypto/openpgp/errors/errors.go b/vendor/golang.org/x/crypto/openpgp/errors/errors.go
index 1d7a0ea05a..a328749471 100644
--- a/vendor/golang.org/x/crypto/openpgp/errors/errors.go
+++ b/vendor/golang.org/x/crypto/openpgp/errors/errors.go
@@ -9,7 +9,7 @@
// for their specific task. If you are required to interoperate with OpenPGP
// systems and need a maintained package, consider a community fork.
// See https://golang.org/issue/44226.
-package errors // import "golang.org/x/crypto/openpgp/errors"
+package errors
import (
"strconv"
diff --git a/vendor/golang.org/x/crypto/openpgp/packet/packet.go b/vendor/golang.org/x/crypto/openpgp/packet/packet.go
index 0a19794a8e..a84a1a214e 100644
--- a/vendor/golang.org/x/crypto/openpgp/packet/packet.go
+++ b/vendor/golang.org/x/crypto/openpgp/packet/packet.go
@@ -10,7 +10,7 @@
// for their specific task. If you are required to interoperate with OpenPGP
// systems and need a maintained package, consider a community fork.
// See https://golang.org/issue/44226.
-package packet // import "golang.org/x/crypto/openpgp/packet"
+package packet
import (
"bufio"
diff --git a/vendor/golang.org/x/crypto/openpgp/read.go b/vendor/golang.org/x/crypto/openpgp/read.go
index 48a8931468..cff3db9196 100644
--- a/vendor/golang.org/x/crypto/openpgp/read.go
+++ b/vendor/golang.org/x/crypto/openpgp/read.go
@@ -9,7 +9,7 @@
// for their specific task. If you are required to interoperate with OpenPGP
// systems and need a maintained package, consider a community fork.
// See https://golang.org/issue/44226.
-package openpgp // import "golang.org/x/crypto/openpgp"
+package openpgp
import (
"crypto"
diff --git a/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go b/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go
index f53244a1c7..fa1a919079 100644
--- a/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go
+++ b/vendor/golang.org/x/crypto/openpgp/s2k/s2k.go
@@ -10,7 +10,7 @@
// for their specific task. If you are required to interoperate with OpenPGP
// systems and need a maintained package, consider a community fork.
// See https://golang.org/issue/44226.
-package s2k // import "golang.org/x/crypto/openpgp/s2k"
+package s2k
import (
"crypto"
diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go b/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go
index 3fd05b2751..3685b34458 100644
--- a/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go
+++ b/vendor/golang.org/x/crypto/salsa20/salsa/hsalsa20.go
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
// Package salsa provides low-level access to functions in the Salsa family.
-package salsa // import "golang.org/x/crypto/salsa20/salsa"
+package salsa
import "math/bits"
diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s
index fcce0234b6..3883e0ec22 100644
--- a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s
+++ b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s
@@ -1,880 +1,880 @@
-// Copyright 2012 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.
+// Code generated by command: go run salsa20_amd64_asm.go -out ../salsa20_amd64.s -pkg salsa. DO NOT EDIT.
//go:build amd64 && !purego && gc
-// This code was translated into a form compatible with 6a from the public
-// domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html
+// func salsa2020XORKeyStream(out *byte, in *byte, n uint64, nonce *byte, key *byte)
+// Requires: SSE2
+TEXT ·salsa2020XORKeyStream(SB), $456-40
+ // This needs up to 64 bytes at 360(R12); hence the non-obvious frame size.
+ MOVQ out+0(FP), DI
+ MOVQ in+8(FP), SI
+ MOVQ n+16(FP), DX
+ MOVQ nonce+24(FP), CX
+ MOVQ key+32(FP), R8
+ MOVQ SP, R12
+ ADDQ $0x1f, R12
+ ANDQ $-32, R12
+ MOVQ DX, R9
+ MOVQ CX, DX
+ MOVQ R8, R10
+ CMPQ R9, $0x00
+ JBE DONE
+ MOVL 20(R10), CX
+ MOVL (R10), R8
+ MOVL (DX), AX
+ MOVL 16(R10), R11
+ MOVL CX, (R12)
+ MOVL R8, 4(R12)
+ MOVL AX, 8(R12)
+ MOVL R11, 12(R12)
+ MOVL 8(DX), CX
+ MOVL 24(R10), R8
+ MOVL 4(R10), AX
+ MOVL 4(DX), R11
+ MOVL CX, 16(R12)
+ MOVL R8, 20(R12)
+ MOVL AX, 24(R12)
+ MOVL R11, 28(R12)
+ MOVL 12(DX), CX
+ MOVL 12(R10), DX
+ MOVL 28(R10), R8
+ MOVL 8(R10), AX
+ MOVL DX, 32(R12)
+ MOVL CX, 36(R12)
+ MOVL R8, 40(R12)
+ MOVL AX, 44(R12)
+ MOVQ $0x61707865, DX
+ MOVQ $0x3320646e, CX
+ MOVQ $0x79622d32, R8
+ MOVQ $0x6b206574, AX
+ MOVL DX, 48(R12)
+ MOVL CX, 52(R12)
+ MOVL R8, 56(R12)
+ MOVL AX, 60(R12)
+ CMPQ R9, $0x00000100
+ JB BYTESBETWEEN1AND255
+ MOVOA 48(R12), X0
+ PSHUFL $0x55, X0, X1
+ PSHUFL $0xaa, X0, X2
+ PSHUFL $0xff, X0, X3
+ PSHUFL $0x00, X0, X0
+ MOVOA X1, 64(R12)
+ MOVOA X2, 80(R12)
+ MOVOA X3, 96(R12)
+ MOVOA X0, 112(R12)
+ MOVOA (R12), X0
+ PSHUFL $0xaa, X0, X1
+ PSHUFL $0xff, X0, X2
+ PSHUFL $0x00, X0, X3
+ PSHUFL $0x55, X0, X0
+ MOVOA X1, 128(R12)
+ MOVOA X2, 144(R12)
+ MOVOA X3, 160(R12)
+ MOVOA X0, 176(R12)
+ MOVOA 16(R12), X0
+ PSHUFL $0xff, X0, X1
+ PSHUFL $0x55, X0, X2
+ PSHUFL $0xaa, X0, X0
+ MOVOA X1, 192(R12)
+ MOVOA X2, 208(R12)
+ MOVOA X0, 224(R12)
+ MOVOA 32(R12), X0
+ PSHUFL $0x00, X0, X1
+ PSHUFL $0xaa, X0, X2
+ PSHUFL $0xff, X0, X0
+ MOVOA X1, 240(R12)
+ MOVOA X2, 256(R12)
+ MOVOA X0, 272(R12)
-// func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte)
-// This needs up to 64 bytes at 360(R12); hence the non-obvious frame size.
-TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment
- MOVQ out+0(FP),DI
- MOVQ in+8(FP),SI
- MOVQ n+16(FP),DX
- MOVQ nonce+24(FP),CX
- MOVQ key+32(FP),R8
+BYTESATLEAST256:
+ MOVL 16(R12), DX
+ MOVL 36(R12), CX
+ MOVL DX, 288(R12)
+ MOVL CX, 304(R12)
+ SHLQ $0x20, CX
+ ADDQ CX, DX
+ ADDQ $0x01, DX
+ MOVQ DX, CX
+ SHRQ $0x20, CX
+ MOVL DX, 292(R12)
+ MOVL CX, 308(R12)
+ ADDQ $0x01, DX
+ MOVQ DX, CX
+ SHRQ $0x20, CX
+ MOVL DX, 296(R12)
+ MOVL CX, 312(R12)
+ ADDQ $0x01, DX
+ MOVQ DX, CX
+ SHRQ $0x20, CX
+ MOVL DX, 300(R12)
+ MOVL CX, 316(R12)
+ ADDQ $0x01, DX
+ MOVQ DX, CX
+ SHRQ $0x20, CX
+ MOVL DX, 16(R12)
+ MOVL CX, 36(R12)
+ MOVQ R9, 352(R12)
+ MOVQ $0x00000014, DX
+ MOVOA 64(R12), X0
+ MOVOA 80(R12), X1
+ MOVOA 96(R12), X2
+ MOVOA 256(R12), X3
+ MOVOA 272(R12), X4
+ MOVOA 128(R12), X5
+ MOVOA 144(R12), X6
+ MOVOA 176(R12), X7
+ MOVOA 192(R12), X8
+ MOVOA 208(R12), X9
+ MOVOA 224(R12), X10
+ MOVOA 304(R12), X11
+ MOVOA 112(R12), X12
+ MOVOA 160(R12), X13
+ MOVOA 240(R12), X14
+ MOVOA 288(R12), X15
- MOVQ SP,R12
- ADDQ $31, R12
- ANDQ $~31, R12
+MAINLOOP1:
+ MOVOA X1, 320(R12)
+ MOVOA X2, 336(R12)
+ MOVOA X13, X1
+ PADDL X12, X1
+ MOVOA X1, X2
+ PSLLL $0x07, X1
+ PXOR X1, X14
+ PSRLL $0x19, X2
+ PXOR X2, X14
+ MOVOA X7, X1
+ PADDL X0, X1
+ MOVOA X1, X2
+ PSLLL $0x07, X1
+ PXOR X1, X11
+ PSRLL $0x19, X2
+ PXOR X2, X11
+ MOVOA X12, X1
+ PADDL X14, X1
+ MOVOA X1, X2
+ PSLLL $0x09, X1
+ PXOR X1, X15
+ PSRLL $0x17, X2
+ PXOR X2, X15
+ MOVOA X0, X1
+ PADDL X11, X1
+ MOVOA X1, X2
+ PSLLL $0x09, X1
+ PXOR X1, X9
+ PSRLL $0x17, X2
+ PXOR X2, X9
+ MOVOA X14, X1
+ PADDL X15, X1
+ MOVOA X1, X2
+ PSLLL $0x0d, X1
+ PXOR X1, X13
+ PSRLL $0x13, X2
+ PXOR X2, X13
+ MOVOA X11, X1
+ PADDL X9, X1
+ MOVOA X1, X2
+ PSLLL $0x0d, X1
+ PXOR X1, X7
+ PSRLL $0x13, X2
+ PXOR X2, X7
+ MOVOA X15, X1
+ PADDL X13, X1
+ MOVOA X1, X2
+ PSLLL $0x12, X1
+ PXOR X1, X12
+ PSRLL $0x0e, X2
+ PXOR X2, X12
+ MOVOA 320(R12), X1
+ MOVOA X12, 320(R12)
+ MOVOA X9, X2
+ PADDL X7, X2
+ MOVOA X2, X12
+ PSLLL $0x12, X2
+ PXOR X2, X0
+ PSRLL $0x0e, X12
+ PXOR X12, X0
+ MOVOA X5, X2
+ PADDL X1, X2
+ MOVOA X2, X12
+ PSLLL $0x07, X2
+ PXOR X2, X3
+ PSRLL $0x19, X12
+ PXOR X12, X3
+ MOVOA 336(R12), X2
+ MOVOA X0, 336(R12)
+ MOVOA X6, X0
+ PADDL X2, X0
+ MOVOA X0, X12
+ PSLLL $0x07, X0
+ PXOR X0, X4
+ PSRLL $0x19, X12
+ PXOR X12, X4
+ MOVOA X1, X0
+ PADDL X3, X0
+ MOVOA X0, X12
+ PSLLL $0x09, X0
+ PXOR X0, X10
+ PSRLL $0x17, X12
+ PXOR X12, X10
+ MOVOA X2, X0
+ PADDL X4, X0
+ MOVOA X0, X12
+ PSLLL $0x09, X0
+ PXOR X0, X8
+ PSRLL $0x17, X12
+ PXOR X12, X8
+ MOVOA X3, X0
+ PADDL X10, X0
+ MOVOA X0, X12
+ PSLLL $0x0d, X0
+ PXOR X0, X5
+ PSRLL $0x13, X12
+ PXOR X12, X5
+ MOVOA X4, X0
+ PADDL X8, X0
+ MOVOA X0, X12
+ PSLLL $0x0d, X0
+ PXOR X0, X6
+ PSRLL $0x13, X12
+ PXOR X12, X6
+ MOVOA X10, X0
+ PADDL X5, X0
+ MOVOA X0, X12
+ PSLLL $0x12, X0
+ PXOR X0, X1
+ PSRLL $0x0e, X12
+ PXOR X12, X1
+ MOVOA 320(R12), X0
+ MOVOA X1, 320(R12)
+ MOVOA X4, X1
+ PADDL X0, X1
+ MOVOA X1, X12
+ PSLLL $0x07, X1
+ PXOR X1, X7
+ PSRLL $0x19, X12
+ PXOR X12, X7
+ MOVOA X8, X1
+ PADDL X6, X1
+ MOVOA X1, X12
+ PSLLL $0x12, X1
+ PXOR X1, X2
+ PSRLL $0x0e, X12
+ PXOR X12, X2
+ MOVOA 336(R12), X12
+ MOVOA X2, 336(R12)
+ MOVOA X14, X1
+ PADDL X12, X1
+ MOVOA X1, X2
+ PSLLL $0x07, X1
+ PXOR X1, X5
+ PSRLL $0x19, X2
+ PXOR X2, X5
+ MOVOA X0, X1
+ PADDL X7, X1
+ MOVOA X1, X2
+ PSLLL $0x09, X1
+ PXOR X1, X10
+ PSRLL $0x17, X2
+ PXOR X2, X10
+ MOVOA X12, X1
+ PADDL X5, X1
+ MOVOA X1, X2
+ PSLLL $0x09, X1
+ PXOR X1, X8
+ PSRLL $0x17, X2
+ PXOR X2, X8
+ MOVOA X7, X1
+ PADDL X10, X1
+ MOVOA X1, X2
+ PSLLL $0x0d, X1
+ PXOR X1, X4
+ PSRLL $0x13, X2
+ PXOR X2, X4
+ MOVOA X5, X1
+ PADDL X8, X1
+ MOVOA X1, X2
+ PSLLL $0x0d, X1
+ PXOR X1, X14
+ PSRLL $0x13, X2
+ PXOR X2, X14
+ MOVOA X10, X1
+ PADDL X4, X1
+ MOVOA X1, X2
+ PSLLL $0x12, X1
+ PXOR X1, X0
+ PSRLL $0x0e, X2
+ PXOR X2, X0
+ MOVOA 320(R12), X1
+ MOVOA X0, 320(R12)
+ MOVOA X8, X0
+ PADDL X14, X0
+ MOVOA X0, X2
+ PSLLL $0x12, X0
+ PXOR X0, X12
+ PSRLL $0x0e, X2
+ PXOR X2, X12
+ MOVOA X11, X0
+ PADDL X1, X0
+ MOVOA X0, X2
+ PSLLL $0x07, X0
+ PXOR X0, X6
+ PSRLL $0x19, X2
+ PXOR X2, X6
+ MOVOA 336(R12), X2
+ MOVOA X12, 336(R12)
+ MOVOA X3, X0
+ PADDL X2, X0
+ MOVOA X0, X12
+ PSLLL $0x07, X0
+ PXOR X0, X13
+ PSRLL $0x19, X12
+ PXOR X12, X13
+ MOVOA X1, X0
+ PADDL X6, X0
+ MOVOA X0, X12
+ PSLLL $0x09, X0
+ PXOR X0, X15
+ PSRLL $0x17, X12
+ PXOR X12, X15
+ MOVOA X2, X0
+ PADDL X13, X0
+ MOVOA X0, X12
+ PSLLL $0x09, X0
+ PXOR X0, X9
+ PSRLL $0x17, X12
+ PXOR X12, X9
+ MOVOA X6, X0
+ PADDL X15, X0
+ MOVOA X0, X12
+ PSLLL $0x0d, X0
+ PXOR X0, X11
+ PSRLL $0x13, X12
+ PXOR X12, X11
+ MOVOA X13, X0
+ PADDL X9, X0
+ MOVOA X0, X12
+ PSLLL $0x0d, X0
+ PXOR X0, X3
+ PSRLL $0x13, X12
+ PXOR X12, X3
+ MOVOA X15, X0
+ PADDL X11, X0
+ MOVOA X0, X12
+ PSLLL $0x12, X0
+ PXOR X0, X1
+ PSRLL $0x0e, X12
+ PXOR X12, X1
+ MOVOA X9, X0
+ PADDL X3, X0
+ MOVOA X0, X12
+ PSLLL $0x12, X0
+ PXOR X0, X2
+ PSRLL $0x0e, X12
+ PXOR X12, X2
+ MOVOA 320(R12), X12
+ MOVOA 336(R12), X0
+ SUBQ $0x02, DX
+ JA MAINLOOP1
+ PADDL 112(R12), X12
+ PADDL 176(R12), X7
+ PADDL 224(R12), X10
+ PADDL 272(R12), X4
+ MOVD X12, DX
+ MOVD X7, CX
+ MOVD X10, R8
+ MOVD X4, R9
+ PSHUFL $0x39, X12, X12
+ PSHUFL $0x39, X7, X7
+ PSHUFL $0x39, X10, X10
+ PSHUFL $0x39, X4, X4
+ XORL (SI), DX
+ XORL 4(SI), CX
+ XORL 8(SI), R8
+ XORL 12(SI), R9
+ MOVL DX, (DI)
+ MOVL CX, 4(DI)
+ MOVL R8, 8(DI)
+ MOVL R9, 12(DI)
+ MOVD X12, DX
+ MOVD X7, CX
+ MOVD X10, R8
+ MOVD X4, R9
+ PSHUFL $0x39, X12, X12
+ PSHUFL $0x39, X7, X7
+ PSHUFL $0x39, X10, X10
+ PSHUFL $0x39, X4, X4
+ XORL 64(SI), DX
+ XORL 68(SI), CX
+ XORL 72(SI), R8
+ XORL 76(SI), R9
+ MOVL DX, 64(DI)
+ MOVL CX, 68(DI)
+ MOVL R8, 72(DI)
+ MOVL R9, 76(DI)
+ MOVD X12, DX
+ MOVD X7, CX
+ MOVD X10, R8
+ MOVD X4, R9
+ PSHUFL $0x39, X12, X12
+ PSHUFL $0x39, X7, X7
+ PSHUFL $0x39, X10, X10
+ PSHUFL $0x39, X4, X4
+ XORL 128(SI), DX
+ XORL 132(SI), CX
+ XORL 136(SI), R8
+ XORL 140(SI), R9
+ MOVL DX, 128(DI)
+ MOVL CX, 132(DI)
+ MOVL R8, 136(DI)
+ MOVL R9, 140(DI)
+ MOVD X12, DX
+ MOVD X7, CX
+ MOVD X10, R8
+ MOVD X4, R9
+ XORL 192(SI), DX
+ XORL 196(SI), CX
+ XORL 200(SI), R8
+ XORL 204(SI), R9
+ MOVL DX, 192(DI)
+ MOVL CX, 196(DI)
+ MOVL R8, 200(DI)
+ MOVL R9, 204(DI)
+ PADDL 240(R12), X14
+ PADDL 64(R12), X0
+ PADDL 128(R12), X5
+ PADDL 192(R12), X8
+ MOVD X14, DX
+ MOVD X0, CX
+ MOVD X5, R8
+ MOVD X8, R9
+ PSHUFL $0x39, X14, X14
+ PSHUFL $0x39, X0, X0
+ PSHUFL $0x39, X5, X5
+ PSHUFL $0x39, X8, X8
+ XORL 16(SI), DX
+ XORL 20(SI), CX
+ XORL 24(SI), R8
+ XORL 28(SI), R9
+ MOVL DX, 16(DI)
+ MOVL CX, 20(DI)
+ MOVL R8, 24(DI)
+ MOVL R9, 28(DI)
+ MOVD X14, DX
+ MOVD X0, CX
+ MOVD X5, R8
+ MOVD X8, R9
+ PSHUFL $0x39, X14, X14
+ PSHUFL $0x39, X0, X0
+ PSHUFL $0x39, X5, X5
+ PSHUFL $0x39, X8, X8
+ XORL 80(SI), DX
+ XORL 84(SI), CX
+ XORL 88(SI), R8
+ XORL 92(SI), R9
+ MOVL DX, 80(DI)
+ MOVL CX, 84(DI)
+ MOVL R8, 88(DI)
+ MOVL R9, 92(DI)
+ MOVD X14, DX
+ MOVD X0, CX
+ MOVD X5, R8
+ MOVD X8, R9
+ PSHUFL $0x39, X14, X14
+ PSHUFL $0x39, X0, X0
+ PSHUFL $0x39, X5, X5
+ PSHUFL $0x39, X8, X8
+ XORL 144(SI), DX
+ XORL 148(SI), CX
+ XORL 152(SI), R8
+ XORL 156(SI), R9
+ MOVL DX, 144(DI)
+ MOVL CX, 148(DI)
+ MOVL R8, 152(DI)
+ MOVL R9, 156(DI)
+ MOVD X14, DX
+ MOVD X0, CX
+ MOVD X5, R8
+ MOVD X8, R9
+ XORL 208(SI), DX
+ XORL 212(SI), CX
+ XORL 216(SI), R8
+ XORL 220(SI), R9
+ MOVL DX, 208(DI)
+ MOVL CX, 212(DI)
+ MOVL R8, 216(DI)
+ MOVL R9, 220(DI)
+ PADDL 288(R12), X15
+ PADDL 304(R12), X11
+ PADDL 80(R12), X1
+ PADDL 144(R12), X6
+ MOVD X15, DX
+ MOVD X11, CX
+ MOVD X1, R8
+ MOVD X6, R9
+ PSHUFL $0x39, X15, X15
+ PSHUFL $0x39, X11, X11
+ PSHUFL $0x39, X1, X1
+ PSHUFL $0x39, X6, X6
+ XORL 32(SI), DX
+ XORL 36(SI), CX
+ XORL 40(SI), R8
+ XORL 44(SI), R9
+ MOVL DX, 32(DI)
+ MOVL CX, 36(DI)
+ MOVL R8, 40(DI)
+ MOVL R9, 44(DI)
+ MOVD X15, DX
+ MOVD X11, CX
+ MOVD X1, R8
+ MOVD X6, R9
+ PSHUFL $0x39, X15, X15
+ PSHUFL $0x39, X11, X11
+ PSHUFL $0x39, X1, X1
+ PSHUFL $0x39, X6, X6
+ XORL 96(SI), DX
+ XORL 100(SI), CX
+ XORL 104(SI), R8
+ XORL 108(SI), R9
+ MOVL DX, 96(DI)
+ MOVL CX, 100(DI)
+ MOVL R8, 104(DI)
+ MOVL R9, 108(DI)
+ MOVD X15, DX
+ MOVD X11, CX
+ MOVD X1, R8
+ MOVD X6, R9
+ PSHUFL $0x39, X15, X15
+ PSHUFL $0x39, X11, X11
+ PSHUFL $0x39, X1, X1
+ PSHUFL $0x39, X6, X6
+ XORL 160(SI), DX
+ XORL 164(SI), CX
+ XORL 168(SI), R8
+ XORL 172(SI), R9
+ MOVL DX, 160(DI)
+ MOVL CX, 164(DI)
+ MOVL R8, 168(DI)
+ MOVL R9, 172(DI)
+ MOVD X15, DX
+ MOVD X11, CX
+ MOVD X1, R8
+ MOVD X6, R9
+ XORL 224(SI), DX
+ XORL 228(SI), CX
+ XORL 232(SI), R8
+ XORL 236(SI), R9
+ MOVL DX, 224(DI)
+ MOVL CX, 228(DI)
+ MOVL R8, 232(DI)
+ MOVL R9, 236(DI)
+ PADDL 160(R12), X13
+ PADDL 208(R12), X9
+ PADDL 256(R12), X3
+ PADDL 96(R12), X2
+ MOVD X13, DX
+ MOVD X9, CX
+ MOVD X3, R8
+ MOVD X2, R9
+ PSHUFL $0x39, X13, X13
+ PSHUFL $0x39, X9, X9
+ PSHUFL $0x39, X3, X3
+ PSHUFL $0x39, X2, X2
+ XORL 48(SI), DX
+ XORL 52(SI), CX
+ XORL 56(SI), R8
+ XORL 60(SI), R9
+ MOVL DX, 48(DI)
+ MOVL CX, 52(DI)
+ MOVL R8, 56(DI)
+ MOVL R9, 60(DI)
+ MOVD X13, DX
+ MOVD X9, CX
+ MOVD X3, R8
+ MOVD X2, R9
+ PSHUFL $0x39, X13, X13
+ PSHUFL $0x39, X9, X9
+ PSHUFL $0x39, X3, X3
+ PSHUFL $0x39, X2, X2
+ XORL 112(SI), DX
+ XORL 116(SI), CX
+ XORL 120(SI), R8
+ XORL 124(SI), R9
+ MOVL DX, 112(DI)
+ MOVL CX, 116(DI)
+ MOVL R8, 120(DI)
+ MOVL R9, 124(DI)
+ MOVD X13, DX
+ MOVD X9, CX
+ MOVD X3, R8
+ MOVD X2, R9
+ PSHUFL $0x39, X13, X13
+ PSHUFL $0x39, X9, X9
+ PSHUFL $0x39, X3, X3
+ PSHUFL $0x39, X2, X2
+ XORL 176(SI), DX
+ XORL 180(SI), CX
+ XORL 184(SI), R8
+ XORL 188(SI), R9
+ MOVL DX, 176(DI)
+ MOVL CX, 180(DI)
+ MOVL R8, 184(DI)
+ MOVL R9, 188(DI)
+ MOVD X13, DX
+ MOVD X9, CX
+ MOVD X3, R8
+ MOVD X2, R9
+ XORL 240(SI), DX
+ XORL 244(SI), CX
+ XORL 248(SI), R8
+ XORL 252(SI), R9
+ MOVL DX, 240(DI)
+ MOVL CX, 244(DI)
+ MOVL R8, 248(DI)
+ MOVL R9, 252(DI)
+ MOVQ 352(R12), R9
+ SUBQ $0x00000100, R9
+ ADDQ $0x00000100, SI
+ ADDQ $0x00000100, DI
+ CMPQ R9, $0x00000100
+ JAE BYTESATLEAST256
+ CMPQ R9, $0x00
+ JBE DONE
- MOVQ DX,R9
- MOVQ CX,DX
- MOVQ R8,R10
- CMPQ R9,$0
- JBE DONE
- START:
- MOVL 20(R10),CX
- MOVL 0(R10),R8
- MOVL 0(DX),AX
- MOVL 16(R10),R11
- MOVL CX,0(R12)
- MOVL R8, 4 (R12)
- MOVL AX, 8 (R12)
- MOVL R11, 12 (R12)
- MOVL 8(DX),CX
- MOVL 24(R10),R8
- MOVL 4(R10),AX
- MOVL 4(DX),R11
- MOVL CX,16(R12)
- MOVL R8, 20 (R12)
- MOVL AX, 24 (R12)
- MOVL R11, 28 (R12)
- MOVL 12(DX),CX
- MOVL 12(R10),DX
- MOVL 28(R10),R8
- MOVL 8(R10),AX
- MOVL DX,32(R12)
- MOVL CX, 36 (R12)
- MOVL R8, 40 (R12)
- MOVL AX, 44 (R12)
- MOVQ $1634760805,DX
- MOVQ $857760878,CX
- MOVQ $2036477234,R8
- MOVQ $1797285236,AX
- MOVL DX,48(R12)
- MOVL CX, 52 (R12)
- MOVL R8, 56 (R12)
- MOVL AX, 60 (R12)
- CMPQ R9,$256
- JB BYTESBETWEEN1AND255
- MOVOA 48(R12),X0
- PSHUFL $0X55,X0,X1
- PSHUFL $0XAA,X0,X2
- PSHUFL $0XFF,X0,X3
- PSHUFL $0X00,X0,X0
- MOVOA X1,64(R12)
- MOVOA X2,80(R12)
- MOVOA X3,96(R12)
- MOVOA X0,112(R12)
- MOVOA 0(R12),X0
- PSHUFL $0XAA,X0,X1
- PSHUFL $0XFF,X0,X2
- PSHUFL $0X00,X0,X3
- PSHUFL $0X55,X0,X0
- MOVOA X1,128(R12)
- MOVOA X2,144(R12)
- MOVOA X3,160(R12)
- MOVOA X0,176(R12)
- MOVOA 16(R12),X0
- PSHUFL $0XFF,X0,X1
- PSHUFL $0X55,X0,X2
- PSHUFL $0XAA,X0,X0
- MOVOA X1,192(R12)
- MOVOA X2,208(R12)
- MOVOA X0,224(R12)
- MOVOA 32(R12),X0
- PSHUFL $0X00,X0,X1
- PSHUFL $0XAA,X0,X2
- PSHUFL $0XFF,X0,X0
- MOVOA X1,240(R12)
- MOVOA X2,256(R12)
- MOVOA X0,272(R12)
- BYTESATLEAST256:
- MOVL 16(R12),DX
- MOVL 36 (R12),CX
- MOVL DX,288(R12)
- MOVL CX,304(R12)
- SHLQ $32,CX
- ADDQ CX,DX
- ADDQ $1,DX
- MOVQ DX,CX
- SHRQ $32,CX
- MOVL DX, 292 (R12)
- MOVL CX, 308 (R12)
- ADDQ $1,DX
- MOVQ DX,CX
- SHRQ $32,CX
- MOVL DX, 296 (R12)
- MOVL CX, 312 (R12)
- ADDQ $1,DX
- MOVQ DX,CX
- SHRQ $32,CX
- MOVL DX, 300 (R12)
- MOVL CX, 316 (R12)
- ADDQ $1,DX
- MOVQ DX,CX
- SHRQ $32,CX
- MOVL DX,16(R12)
- MOVL CX, 36 (R12)
- MOVQ R9,352(R12)
- MOVQ $20,DX
- MOVOA 64(R12),X0
- MOVOA 80(R12),X1
- MOVOA 96(R12),X2
- MOVOA 256(R12),X3
- MOVOA 272(R12),X4
- MOVOA 128(R12),X5
- MOVOA 144(R12),X6
- MOVOA 176(R12),X7
- MOVOA 192(R12),X8
- MOVOA 208(R12),X9
- MOVOA 224(R12),X10
- MOVOA 304(R12),X11
- MOVOA 112(R12),X12
- MOVOA 160(R12),X13
- MOVOA 240(R12),X14
- MOVOA 288(R12),X15
- MAINLOOP1:
- MOVOA X1,320(R12)
- MOVOA X2,336(R12)
- MOVOA X13,X1
- PADDL X12,X1
- MOVOA X1,X2
- PSLLL $7,X1
- PXOR X1,X14
- PSRLL $25,X2
- PXOR X2,X14
- MOVOA X7,X1
- PADDL X0,X1
- MOVOA X1,X2
- PSLLL $7,X1
- PXOR X1,X11
- PSRLL $25,X2
- PXOR X2,X11
- MOVOA X12,X1
- PADDL X14,X1
- MOVOA X1,X2
- PSLLL $9,X1
- PXOR X1,X15
- PSRLL $23,X2
- PXOR X2,X15
- MOVOA X0,X1
- PADDL X11,X1
- MOVOA X1,X2
- PSLLL $9,X1
- PXOR X1,X9
- PSRLL $23,X2
- PXOR X2,X9
- MOVOA X14,X1
- PADDL X15,X1
- MOVOA X1,X2
- PSLLL $13,X1
- PXOR X1,X13
- PSRLL $19,X2
- PXOR X2,X13
- MOVOA X11,X1
- PADDL X9,X1
- MOVOA X1,X2
- PSLLL $13,X1
- PXOR X1,X7
- PSRLL $19,X2
- PXOR X2,X7
- MOVOA X15,X1
- PADDL X13,X1
- MOVOA X1,X2
- PSLLL $18,X1
- PXOR X1,X12
- PSRLL $14,X2
- PXOR X2,X12
- MOVOA 320(R12),X1
- MOVOA X12,320(R12)
- MOVOA X9,X2
- PADDL X7,X2
- MOVOA X2,X12
- PSLLL $18,X2
- PXOR X2,X0
- PSRLL $14,X12
- PXOR X12,X0
- MOVOA X5,X2
- PADDL X1,X2
- MOVOA X2,X12
- PSLLL $7,X2
- PXOR X2,X3
- PSRLL $25,X12
- PXOR X12,X3
- MOVOA 336(R12),X2
- MOVOA X0,336(R12)
- MOVOA X6,X0
- PADDL X2,X0
- MOVOA X0,X12
- PSLLL $7,X0
- PXOR X0,X4
- PSRLL $25,X12
- PXOR X12,X4
- MOVOA X1,X0
- PADDL X3,X0
- MOVOA X0,X12
- PSLLL $9,X0
- PXOR X0,X10
- PSRLL $23,X12
- PXOR X12,X10
- MOVOA X2,X0
- PADDL X4,X0
- MOVOA X0,X12
- PSLLL $9,X0
- PXOR X0,X8
- PSRLL $23,X12
- PXOR X12,X8
- MOVOA X3,X0
- PADDL X10,X0
- MOVOA X0,X12
- PSLLL $13,X0
- PXOR X0,X5
- PSRLL $19,X12
- PXOR X12,X5
- MOVOA X4,X0
- PADDL X8,X0
- MOVOA X0,X12
- PSLLL $13,X0
- PXOR X0,X6
- PSRLL $19,X12
- PXOR X12,X6
- MOVOA X10,X0
- PADDL X5,X0
- MOVOA X0,X12
- PSLLL $18,X0
- PXOR X0,X1
- PSRLL $14,X12
- PXOR X12,X1
- MOVOA 320(R12),X0
- MOVOA X1,320(R12)
- MOVOA X4,X1
- PADDL X0,X1
- MOVOA X1,X12
- PSLLL $7,X1
- PXOR X1,X7
- PSRLL $25,X12
- PXOR X12,X7
- MOVOA X8,X1
- PADDL X6,X1
- MOVOA X1,X12
- PSLLL $18,X1
- PXOR X1,X2
- PSRLL $14,X12
- PXOR X12,X2
- MOVOA 336(R12),X12
- MOVOA X2,336(R12)
- MOVOA X14,X1
- PADDL X12,X1
- MOVOA X1,X2
- PSLLL $7,X1
- PXOR X1,X5
- PSRLL $25,X2
- PXOR X2,X5
- MOVOA X0,X1
- PADDL X7,X1
- MOVOA X1,X2
- PSLLL $9,X1
- PXOR X1,X10
- PSRLL $23,X2
- PXOR X2,X10
- MOVOA X12,X1
- PADDL X5,X1
- MOVOA X1,X2
- PSLLL $9,X1
- PXOR X1,X8
- PSRLL $23,X2
- PXOR X2,X8
- MOVOA X7,X1
- PADDL X10,X1
- MOVOA X1,X2
- PSLLL $13,X1
- PXOR X1,X4
- PSRLL $19,X2
- PXOR X2,X4
- MOVOA X5,X1
- PADDL X8,X1
- MOVOA X1,X2
- PSLLL $13,X1
- PXOR X1,X14
- PSRLL $19,X2
- PXOR X2,X14
- MOVOA X10,X1
- PADDL X4,X1
- MOVOA X1,X2
- PSLLL $18,X1
- PXOR X1,X0
- PSRLL $14,X2
- PXOR X2,X0
- MOVOA 320(R12),X1
- MOVOA X0,320(R12)
- MOVOA X8,X0
- PADDL X14,X0
- MOVOA X0,X2
- PSLLL $18,X0
- PXOR X0,X12
- PSRLL $14,X2
- PXOR X2,X12
- MOVOA X11,X0
- PADDL X1,X0
- MOVOA X0,X2
- PSLLL $7,X0
- PXOR X0,X6
- PSRLL $25,X2
- PXOR X2,X6
- MOVOA 336(R12),X2
- MOVOA X12,336(R12)
- MOVOA X3,X0
- PADDL X2,X0
- MOVOA X0,X12
- PSLLL $7,X0
- PXOR X0,X13
- PSRLL $25,X12
- PXOR X12,X13
- MOVOA X1,X0
- PADDL X6,X0
- MOVOA X0,X12
- PSLLL $9,X0
- PXOR X0,X15
- PSRLL $23,X12
- PXOR X12,X15
- MOVOA X2,X0
- PADDL X13,X0
- MOVOA X0,X12
- PSLLL $9,X0
- PXOR X0,X9
- PSRLL $23,X12
- PXOR X12,X9
- MOVOA X6,X0
- PADDL X15,X0
- MOVOA X0,X12
- PSLLL $13,X0
- PXOR X0,X11
- PSRLL $19,X12
- PXOR X12,X11
- MOVOA X13,X0
- PADDL X9,X0
- MOVOA X0,X12
- PSLLL $13,X0
- PXOR X0,X3
- PSRLL $19,X12
- PXOR X12,X3
- MOVOA X15,X0
- PADDL X11,X0
- MOVOA X0,X12
- PSLLL $18,X0
- PXOR X0,X1
- PSRLL $14,X12
- PXOR X12,X1
- MOVOA X9,X0
- PADDL X3,X0
- MOVOA X0,X12
- PSLLL $18,X0
- PXOR X0,X2
- PSRLL $14,X12
- PXOR X12,X2
- MOVOA 320(R12),X12
- MOVOA 336(R12),X0
- SUBQ $2,DX
- JA MAINLOOP1
- PADDL 112(R12),X12
- PADDL 176(R12),X7
- PADDL 224(R12),X10
- PADDL 272(R12),X4
- MOVD X12,DX
- MOVD X7,CX
- MOVD X10,R8
- MOVD X4,R9
- PSHUFL $0X39,X12,X12
- PSHUFL $0X39,X7,X7
- PSHUFL $0X39,X10,X10
- PSHUFL $0X39,X4,X4
- XORL 0(SI),DX
- XORL 4(SI),CX
- XORL 8(SI),R8
- XORL 12(SI),R9
- MOVL DX,0(DI)
- MOVL CX,4(DI)
- MOVL R8,8(DI)
- MOVL R9,12(DI)
- MOVD X12,DX
- MOVD X7,CX
- MOVD X10,R8
- MOVD X4,R9
- PSHUFL $0X39,X12,X12
- PSHUFL $0X39,X7,X7
- PSHUFL $0X39,X10,X10
- PSHUFL $0X39,X4,X4
- XORL 64(SI),DX
- XORL 68(SI),CX
- XORL 72(SI),R8
- XORL 76(SI),R9
- MOVL DX,64(DI)
- MOVL CX,68(DI)
- MOVL R8,72(DI)
- MOVL R9,76(DI)
- MOVD X12,DX
- MOVD X7,CX
- MOVD X10,R8
- MOVD X4,R9
- PSHUFL $0X39,X12,X12
- PSHUFL $0X39,X7,X7
- PSHUFL $0X39,X10,X10
- PSHUFL $0X39,X4,X4
- XORL 128(SI),DX
- XORL 132(SI),CX
- XORL 136(SI),R8
- XORL 140(SI),R9
- MOVL DX,128(DI)
- MOVL CX,132(DI)
- MOVL R8,136(DI)
- MOVL R9,140(DI)
- MOVD X12,DX
- MOVD X7,CX
- MOVD X10,R8
- MOVD X4,R9
- XORL 192(SI),DX
- XORL 196(SI),CX
- XORL 200(SI),R8
- XORL 204(SI),R9
- MOVL DX,192(DI)
- MOVL CX,196(DI)
- MOVL R8,200(DI)
- MOVL R9,204(DI)
- PADDL 240(R12),X14
- PADDL 64(R12),X0
- PADDL 128(R12),X5
- PADDL 192(R12),X8
- MOVD X14,DX
- MOVD X0,CX
- MOVD X5,R8
- MOVD X8,R9
- PSHUFL $0X39,X14,X14
- PSHUFL $0X39,X0,X0
- PSHUFL $0X39,X5,X5
- PSHUFL $0X39,X8,X8
- XORL 16(SI),DX
- XORL 20(SI),CX
- XORL 24(SI),R8
- XORL 28(SI),R9
- MOVL DX,16(DI)
- MOVL CX,20(DI)
- MOVL R8,24(DI)
- MOVL R9,28(DI)
- MOVD X14,DX
- MOVD X0,CX
- MOVD X5,R8
- MOVD X8,R9
- PSHUFL $0X39,X14,X14
- PSHUFL $0X39,X0,X0
- PSHUFL $0X39,X5,X5
- PSHUFL $0X39,X8,X8
- XORL 80(SI),DX
- XORL 84(SI),CX
- XORL 88(SI),R8
- XORL 92(SI),R9
- MOVL DX,80(DI)
- MOVL CX,84(DI)
- MOVL R8,88(DI)
- MOVL R9,92(DI)
- MOVD X14,DX
- MOVD X0,CX
- MOVD X5,R8
- MOVD X8,R9
- PSHUFL $0X39,X14,X14
- PSHUFL $0X39,X0,X0
- PSHUFL $0X39,X5,X5
- PSHUFL $0X39,X8,X8
- XORL 144(SI),DX
- XORL 148(SI),CX
- XORL 152(SI),R8
- XORL 156(SI),R9
- MOVL DX,144(DI)
- MOVL CX,148(DI)
- MOVL R8,152(DI)
- MOVL R9,156(DI)
- MOVD X14,DX
- MOVD X0,CX
- MOVD X5,R8
- MOVD X8,R9
- XORL 208(SI),DX
- XORL 212(SI),CX
- XORL 216(SI),R8
- XORL 220(SI),R9
- MOVL DX,208(DI)
- MOVL CX,212(DI)
- MOVL R8,216(DI)
- MOVL R9,220(DI)
- PADDL 288(R12),X15
- PADDL 304(R12),X11
- PADDL 80(R12),X1
- PADDL 144(R12),X6
- MOVD X15,DX
- MOVD X11,CX
- MOVD X1,R8
- MOVD X6,R9
- PSHUFL $0X39,X15,X15
- PSHUFL $0X39,X11,X11
- PSHUFL $0X39,X1,X1
- PSHUFL $0X39,X6,X6
- XORL 32(SI),DX
- XORL 36(SI),CX
- XORL 40(SI),R8
- XORL 44(SI),R9
- MOVL DX,32(DI)
- MOVL CX,36(DI)
- MOVL R8,40(DI)
- MOVL R9,44(DI)
- MOVD X15,DX
- MOVD X11,CX
- MOVD X1,R8
- MOVD X6,R9
- PSHUFL $0X39,X15,X15
- PSHUFL $0X39,X11,X11
- PSHUFL $0X39,X1,X1
- PSHUFL $0X39,X6,X6
- XORL 96(SI),DX
- XORL 100(SI),CX
- XORL 104(SI),R8
- XORL 108(SI),R9
- MOVL DX,96(DI)
- MOVL CX,100(DI)
- MOVL R8,104(DI)
- MOVL R9,108(DI)
- MOVD X15,DX
- MOVD X11,CX
- MOVD X1,R8
- MOVD X6,R9
- PSHUFL $0X39,X15,X15
- PSHUFL $0X39,X11,X11
- PSHUFL $0X39,X1,X1
- PSHUFL $0X39,X6,X6
- XORL 160(SI),DX
- XORL 164(SI),CX
- XORL 168(SI),R8
- XORL 172(SI),R9
- MOVL DX,160(DI)
- MOVL CX,164(DI)
- MOVL R8,168(DI)
- MOVL R9,172(DI)
- MOVD X15,DX
- MOVD X11,CX
- MOVD X1,R8
- MOVD X6,R9
- XORL 224(SI),DX
- XORL 228(SI),CX
- XORL 232(SI),R8
- XORL 236(SI),R9
- MOVL DX,224(DI)
- MOVL CX,228(DI)
- MOVL R8,232(DI)
- MOVL R9,236(DI)
- PADDL 160(R12),X13
- PADDL 208(R12),X9
- PADDL 256(R12),X3
- PADDL 96(R12),X2
- MOVD X13,DX
- MOVD X9,CX
- MOVD X3,R8
- MOVD X2,R9
- PSHUFL $0X39,X13,X13
- PSHUFL $0X39,X9,X9
- PSHUFL $0X39,X3,X3
- PSHUFL $0X39,X2,X2
- XORL 48(SI),DX
- XORL 52(SI),CX
- XORL 56(SI),R8
- XORL 60(SI),R9
- MOVL DX,48(DI)
- MOVL CX,52(DI)
- MOVL R8,56(DI)
- MOVL R9,60(DI)
- MOVD X13,DX
- MOVD X9,CX
- MOVD X3,R8
- MOVD X2,R9
- PSHUFL $0X39,X13,X13
- PSHUFL $0X39,X9,X9
- PSHUFL $0X39,X3,X3
- PSHUFL $0X39,X2,X2
- XORL 112(SI),DX
- XORL 116(SI),CX
- XORL 120(SI),R8
- XORL 124(SI),R9
- MOVL DX,112(DI)
- MOVL CX,116(DI)
- MOVL R8,120(DI)
- MOVL R9,124(DI)
- MOVD X13,DX
- MOVD X9,CX
- MOVD X3,R8
- MOVD X2,R9
- PSHUFL $0X39,X13,X13
- PSHUFL $0X39,X9,X9
- PSHUFL $0X39,X3,X3
- PSHUFL $0X39,X2,X2
- XORL 176(SI),DX
- XORL 180(SI),CX
- XORL 184(SI),R8
- XORL 188(SI),R9
- MOVL DX,176(DI)
- MOVL CX,180(DI)
- MOVL R8,184(DI)
- MOVL R9,188(DI)
- MOVD X13,DX
- MOVD X9,CX
- MOVD X3,R8
- MOVD X2,R9
- XORL 240(SI),DX
- XORL 244(SI),CX
- XORL 248(SI),R8
- XORL 252(SI),R9
- MOVL DX,240(DI)
- MOVL CX,244(DI)
- MOVL R8,248(DI)
- MOVL R9,252(DI)
- MOVQ 352(R12),R9
- SUBQ $256,R9
- ADDQ $256,SI
- ADDQ $256,DI
- CMPQ R9,$256
- JAE BYTESATLEAST256
- CMPQ R9,$0
- JBE DONE
- BYTESBETWEEN1AND255:
- CMPQ R9,$64
- JAE NOCOPY
- MOVQ DI,DX
- LEAQ 360(R12),DI
- MOVQ R9,CX
+BYTESBETWEEN1AND255:
+ CMPQ R9, $0x40
+ JAE NOCOPY
+ MOVQ DI, DX
+ LEAQ 360(R12), DI
+ MOVQ R9, CX
REP; MOVSB
- LEAQ 360(R12),DI
- LEAQ 360(R12),SI
- NOCOPY:
- MOVQ R9,352(R12)
- MOVOA 48(R12),X0
- MOVOA 0(R12),X1
- MOVOA 16(R12),X2
- MOVOA 32(R12),X3
- MOVOA X1,X4
- MOVQ $20,CX
- MAINLOOP2:
- PADDL X0,X4
- MOVOA X0,X5
- MOVOA X4,X6
- PSLLL $7,X4
- PSRLL $25,X6
- PXOR X4,X3
- PXOR X6,X3
- PADDL X3,X5
- MOVOA X3,X4
- MOVOA X5,X6
- PSLLL $9,X5
- PSRLL $23,X6
- PXOR X5,X2
- PSHUFL $0X93,X3,X3
- PXOR X6,X2
- PADDL X2,X4
- MOVOA X2,X5
- MOVOA X4,X6
- PSLLL $13,X4
- PSRLL $19,X6
- PXOR X4,X1
- PSHUFL $0X4E,X2,X2
- PXOR X6,X1
- PADDL X1,X5
- MOVOA X3,X4
- MOVOA X5,X6
- PSLLL $18,X5
- PSRLL $14,X6
- PXOR X5,X0
- PSHUFL $0X39,X1,X1
- PXOR X6,X0
- PADDL X0,X4
- MOVOA X0,X5
- MOVOA X4,X6
- PSLLL $7,X4
- PSRLL $25,X6
- PXOR X4,X1
- PXOR X6,X1
- PADDL X1,X5
- MOVOA X1,X4
- MOVOA X5,X6
- PSLLL $9,X5
- PSRLL $23,X6
- PXOR X5,X2
- PSHUFL $0X93,X1,X1
- PXOR X6,X2
- PADDL X2,X4
- MOVOA X2,X5
- MOVOA X4,X6
- PSLLL $13,X4
- PSRLL $19,X6
- PXOR X4,X3
- PSHUFL $0X4E,X2,X2
- PXOR X6,X3
- PADDL X3,X5
- MOVOA X1,X4
- MOVOA X5,X6
- PSLLL $18,X5
- PSRLL $14,X6
- PXOR X5,X0
- PSHUFL $0X39,X3,X3
- PXOR X6,X0
- PADDL X0,X4
- MOVOA X0,X5
- MOVOA X4,X6
- PSLLL $7,X4
- PSRLL $25,X6
- PXOR X4,X3
- PXOR X6,X3
- PADDL X3,X5
- MOVOA X3,X4
- MOVOA X5,X6
- PSLLL $9,X5
- PSRLL $23,X6
- PXOR X5,X2
- PSHUFL $0X93,X3,X3
- PXOR X6,X2
- PADDL X2,X4
- MOVOA X2,X5
- MOVOA X4,X6
- PSLLL $13,X4
- PSRLL $19,X6
- PXOR X4,X1
- PSHUFL $0X4E,X2,X2
- PXOR X6,X1
- PADDL X1,X5
- MOVOA X3,X4
- MOVOA X5,X6
- PSLLL $18,X5
- PSRLL $14,X6
- PXOR X5,X0
- PSHUFL $0X39,X1,X1
- PXOR X6,X0
- PADDL X0,X4
- MOVOA X0,X5
- MOVOA X4,X6
- PSLLL $7,X4
- PSRLL $25,X6
- PXOR X4,X1
- PXOR X6,X1
- PADDL X1,X5
- MOVOA X1,X4
- MOVOA X5,X6
- PSLLL $9,X5
- PSRLL $23,X6
- PXOR X5,X2
- PSHUFL $0X93,X1,X1
- PXOR X6,X2
- PADDL X2,X4
- MOVOA X2,X5
- MOVOA X4,X6
- PSLLL $13,X4
- PSRLL $19,X6
- PXOR X4,X3
- PSHUFL $0X4E,X2,X2
- PXOR X6,X3
- SUBQ $4,CX
- PADDL X3,X5
- MOVOA X1,X4
- MOVOA X5,X6
- PSLLL $18,X5
- PXOR X7,X7
- PSRLL $14,X6
- PXOR X5,X0
- PSHUFL $0X39,X3,X3
- PXOR X6,X0
- JA MAINLOOP2
- PADDL 48(R12),X0
- PADDL 0(R12),X1
- PADDL 16(R12),X2
- PADDL 32(R12),X3
- MOVD X0,CX
- MOVD X1,R8
- MOVD X2,R9
- MOVD X3,AX
- PSHUFL $0X39,X0,X0
- PSHUFL $0X39,X1,X1
- PSHUFL $0X39,X2,X2
- PSHUFL $0X39,X3,X3
- XORL 0(SI),CX
- XORL 48(SI),R8
- XORL 32(SI),R9
- XORL 16(SI),AX
- MOVL CX,0(DI)
- MOVL R8,48(DI)
- MOVL R9,32(DI)
- MOVL AX,16(DI)
- MOVD X0,CX
- MOVD X1,R8
- MOVD X2,R9
- MOVD X3,AX
- PSHUFL $0X39,X0,X0
- PSHUFL $0X39,X1,X1
- PSHUFL $0X39,X2,X2
- PSHUFL $0X39,X3,X3
- XORL 20(SI),CX
- XORL 4(SI),R8
- XORL 52(SI),R9
- XORL 36(SI),AX
- MOVL CX,20(DI)
- MOVL R8,4(DI)
- MOVL R9,52(DI)
- MOVL AX,36(DI)
- MOVD X0,CX
- MOVD X1,R8
- MOVD X2,R9
- MOVD X3,AX
- PSHUFL $0X39,X0,X0
- PSHUFL $0X39,X1,X1
- PSHUFL $0X39,X2,X2
- PSHUFL $0X39,X3,X3
- XORL 40(SI),CX
- XORL 24(SI),R8
- XORL 8(SI),R9
- XORL 56(SI),AX
- MOVL CX,40(DI)
- MOVL R8,24(DI)
- MOVL R9,8(DI)
- MOVL AX,56(DI)
- MOVD X0,CX
- MOVD X1,R8
- MOVD X2,R9
- MOVD X3,AX
- XORL 60(SI),CX
- XORL 44(SI),R8
- XORL 28(SI),R9
- XORL 12(SI),AX
- MOVL CX,60(DI)
- MOVL R8,44(DI)
- MOVL R9,28(DI)
- MOVL AX,12(DI)
- MOVQ 352(R12),R9
- MOVL 16(R12),CX
- MOVL 36 (R12),R8
- ADDQ $1,CX
- SHLQ $32,R8
- ADDQ R8,CX
- MOVQ CX,R8
- SHRQ $32,R8
- MOVL CX,16(R12)
- MOVL R8, 36 (R12)
- CMPQ R9,$64
- JA BYTESATLEAST65
- JAE BYTESATLEAST64
- MOVQ DI,SI
- MOVQ DX,DI
- MOVQ R9,CX
+ LEAQ 360(R12), DI
+ LEAQ 360(R12), SI
+
+NOCOPY:
+ MOVQ R9, 352(R12)
+ MOVOA 48(R12), X0
+ MOVOA (R12), X1
+ MOVOA 16(R12), X2
+ MOVOA 32(R12), X3
+ MOVOA X1, X4
+ MOVQ $0x00000014, CX
+
+MAINLOOP2:
+ PADDL X0, X4
+ MOVOA X0, X5
+ MOVOA X4, X6
+ PSLLL $0x07, X4
+ PSRLL $0x19, X6
+ PXOR X4, X3
+ PXOR X6, X3
+ PADDL X3, X5
+ MOVOA X3, X4
+ MOVOA X5, X6
+ PSLLL $0x09, X5
+ PSRLL $0x17, X6
+ PXOR X5, X2
+ PSHUFL $0x93, X3, X3
+ PXOR X6, X2
+ PADDL X2, X4
+ MOVOA X2, X5
+ MOVOA X4, X6
+ PSLLL $0x0d, X4
+ PSRLL $0x13, X6
+ PXOR X4, X1
+ PSHUFL $0x4e, X2, X2
+ PXOR X6, X1
+ PADDL X1, X5
+ MOVOA X3, X4
+ MOVOA X5, X6
+ PSLLL $0x12, X5
+ PSRLL $0x0e, X6
+ PXOR X5, X0
+ PSHUFL $0x39, X1, X1
+ PXOR X6, X0
+ PADDL X0, X4
+ MOVOA X0, X5
+ MOVOA X4, X6
+ PSLLL $0x07, X4
+ PSRLL $0x19, X6
+ PXOR X4, X1
+ PXOR X6, X1
+ PADDL X1, X5
+ MOVOA X1, X4
+ MOVOA X5, X6
+ PSLLL $0x09, X5
+ PSRLL $0x17, X6
+ PXOR X5, X2
+ PSHUFL $0x93, X1, X1
+ PXOR X6, X2
+ PADDL X2, X4
+ MOVOA X2, X5
+ MOVOA X4, X6
+ PSLLL $0x0d, X4
+ PSRLL $0x13, X6
+ PXOR X4, X3
+ PSHUFL $0x4e, X2, X2
+ PXOR X6, X3
+ PADDL X3, X5
+ MOVOA X1, X4
+ MOVOA X5, X6
+ PSLLL $0x12, X5
+ PSRLL $0x0e, X6
+ PXOR X5, X0
+ PSHUFL $0x39, X3, X3
+ PXOR X6, X0
+ PADDL X0, X4
+ MOVOA X0, X5
+ MOVOA X4, X6
+ PSLLL $0x07, X4
+ PSRLL $0x19, X6
+ PXOR X4, X3
+ PXOR X6, X3
+ PADDL X3, X5
+ MOVOA X3, X4
+ MOVOA X5, X6
+ PSLLL $0x09, X5
+ PSRLL $0x17, X6
+ PXOR X5, X2
+ PSHUFL $0x93, X3, X3
+ PXOR X6, X2
+ PADDL X2, X4
+ MOVOA X2, X5
+ MOVOA X4, X6
+ PSLLL $0x0d, X4
+ PSRLL $0x13, X6
+ PXOR X4, X1
+ PSHUFL $0x4e, X2, X2
+ PXOR X6, X1
+ PADDL X1, X5
+ MOVOA X3, X4
+ MOVOA X5, X6
+ PSLLL $0x12, X5
+ PSRLL $0x0e, X6
+ PXOR X5, X0
+ PSHUFL $0x39, X1, X1
+ PXOR X6, X0
+ PADDL X0, X4
+ MOVOA X0, X5
+ MOVOA X4, X6
+ PSLLL $0x07, X4
+ PSRLL $0x19, X6
+ PXOR X4, X1
+ PXOR X6, X1
+ PADDL X1, X5
+ MOVOA X1, X4
+ MOVOA X5, X6
+ PSLLL $0x09, X5
+ PSRLL $0x17, X6
+ PXOR X5, X2
+ PSHUFL $0x93, X1, X1
+ PXOR X6, X2
+ PADDL X2, X4
+ MOVOA X2, X5
+ MOVOA X4, X6
+ PSLLL $0x0d, X4
+ PSRLL $0x13, X6
+ PXOR X4, X3
+ PSHUFL $0x4e, X2, X2
+ PXOR X6, X3
+ SUBQ $0x04, CX
+ PADDL X3, X5
+ MOVOA X1, X4
+ MOVOA X5, X6
+ PSLLL $0x12, X5
+ PXOR X7, X7
+ PSRLL $0x0e, X6
+ PXOR X5, X0
+ PSHUFL $0x39, X3, X3
+ PXOR X6, X0
+ JA MAINLOOP2
+ PADDL 48(R12), X0
+ PADDL (R12), X1
+ PADDL 16(R12), X2
+ PADDL 32(R12), X3
+ MOVD X0, CX
+ MOVD X1, R8
+ MOVD X2, R9
+ MOVD X3, AX
+ PSHUFL $0x39, X0, X0
+ PSHUFL $0x39, X1, X1
+ PSHUFL $0x39, X2, X2
+ PSHUFL $0x39, X3, X3
+ XORL (SI), CX
+ XORL 48(SI), R8
+ XORL 32(SI), R9
+ XORL 16(SI), AX
+ MOVL CX, (DI)
+ MOVL R8, 48(DI)
+ MOVL R9, 32(DI)
+ MOVL AX, 16(DI)
+ MOVD X0, CX
+ MOVD X1, R8
+ MOVD X2, R9
+ MOVD X3, AX
+ PSHUFL $0x39, X0, X0
+ PSHUFL $0x39, X1, X1
+ PSHUFL $0x39, X2, X2
+ PSHUFL $0x39, X3, X3
+ XORL 20(SI), CX
+ XORL 4(SI), R8
+ XORL 52(SI), R9
+ XORL 36(SI), AX
+ MOVL CX, 20(DI)
+ MOVL R8, 4(DI)
+ MOVL R9, 52(DI)
+ MOVL AX, 36(DI)
+ MOVD X0, CX
+ MOVD X1, R8
+ MOVD X2, R9
+ MOVD X3, AX
+ PSHUFL $0x39, X0, X0
+ PSHUFL $0x39, X1, X1
+ PSHUFL $0x39, X2, X2
+ PSHUFL $0x39, X3, X3
+ XORL 40(SI), CX
+ XORL 24(SI), R8
+ XORL 8(SI), R9
+ XORL 56(SI), AX
+ MOVL CX, 40(DI)
+ MOVL R8, 24(DI)
+ MOVL R9, 8(DI)
+ MOVL AX, 56(DI)
+ MOVD X0, CX
+ MOVD X1, R8
+ MOVD X2, R9
+ MOVD X3, AX
+ XORL 60(SI), CX
+ XORL 44(SI), R8
+ XORL 28(SI), R9
+ XORL 12(SI), AX
+ MOVL CX, 60(DI)
+ MOVL R8, 44(DI)
+ MOVL R9, 28(DI)
+ MOVL AX, 12(DI)
+ MOVQ 352(R12), R9
+ MOVL 16(R12), CX
+ MOVL 36(R12), R8
+ ADDQ $0x01, CX
+ SHLQ $0x20, R8
+ ADDQ R8, CX
+ MOVQ CX, R8
+ SHRQ $0x20, R8
+ MOVL CX, 16(R12)
+ MOVL R8, 36(R12)
+ CMPQ R9, $0x40
+ JA BYTESATLEAST65
+ JAE BYTESATLEAST64
+ MOVQ DI, SI
+ MOVQ DX, DI
+ MOVQ R9, CX
REP; MOVSB
- BYTESATLEAST64:
- DONE:
+
+BYTESATLEAST64:
+DONE:
RET
- BYTESATLEAST65:
- SUBQ $64,R9
- ADDQ $64,DI
- ADDQ $64,SI
- JMP BYTESBETWEEN1AND255
+
+BYTESATLEAST65:
+ SUBQ $0x40, R9
+ ADDQ $0x40, DI
+ ADDQ $0x40, SI
+ JMP BYTESBETWEEN1AND255
diff --git a/vendor/golang.org/x/exp/slices/slices.go b/vendor/golang.org/x/exp/slices/slices.go
index 8a237c5d61..2540bd6825 100644
--- a/vendor/golang.org/x/exp/slices/slices.go
+++ b/vendor/golang.org/x/exp/slices/slices.go
@@ -104,8 +104,8 @@ func CompareFunc[E1, E2 any](s1 []E1, s2 []E2, cmp func(E1, E2) int) int {
// Index returns the index of the first occurrence of v in s,
// or -1 if not present.
func Index[E comparable](s []E, v E) int {
- for i, vs := range s {
- if v == vs {
+ for i := range s {
+ if v == s[i] {
return i
}
}
@@ -115,8 +115,8 @@ func Index[E comparable](s []E, v E) int {
// IndexFunc returns the first index i satisfying f(s[i]),
// or -1 if none do.
func IndexFunc[E any](s []E, f func(E) bool) int {
- for i, v := range s {
- if f(v) {
+ for i := range s {
+ if f(s[i]) {
return i
}
}
@@ -128,6 +128,12 @@ func Contains[E comparable](s []E, v E) bool {
return Index(s, v) >= 0
}
+// ContainsFunc reports whether at least one
+// element e of s satisfies f(e).
+func ContainsFunc[E any](s []E, f func(E) bool) bool {
+ return IndexFunc(s, f) >= 0
+}
+
// Insert inserts the values v... into s at index i,
// returning the modified slice.
// In the returned slice r, r[i] == v[0].
@@ -151,12 +157,35 @@ func Insert[S ~[]E, E any](s S, i int, v ...E) S {
// Delete removes the elements s[i:j] from s, returning the modified slice.
// Delete panics if s[i:j] is not a valid slice of s.
// Delete modifies the contents of the slice s; it does not create a new slice.
-// Delete is O(len(s)-(j-i)), so if many items must be deleted, it is better to
+// Delete is O(len(s)-j), so if many items must be deleted, it is better to
// make a single call deleting them all together than to delete one at a time.
+// Delete might not modify the elements s[len(s)-(j-i):len(s)]. If those
+// elements contain pointers you might consider zeroing those elements so that
+// objects they reference can be garbage collected.
func Delete[S ~[]E, E any](s S, i, j int) S {
+ _ = s[i:j] // bounds check
+
return append(s[:i], s[j:]...)
}
+// Replace replaces the elements s[i:j] by the given v, and returns the
+// modified slice. Replace panics if s[i:j] is not a valid slice of s.
+func Replace[S ~[]E, E any](s S, i, j int, v ...E) S {
+ _ = s[i:j] // verify that i:j is a valid subslice
+ tot := len(s[:i]) + len(v) + len(s[j:])
+ if tot <= cap(s) {
+ s2 := s[:tot]
+ copy(s2[i+len(v):], s[j:])
+ copy(s2[i:], v)
+ return s2
+ }
+ s2 := make(S, tot)
+ copy(s2, s[:i])
+ copy(s2[i:], v)
+ copy(s2[i+len(v):], s[j:])
+ return s2
+}
+
// Clone returns a copy of the slice.
// The elements are copied using assignment, so this is a shallow clone.
func Clone[S ~[]E, E any](s S) S {
@@ -170,17 +199,20 @@ func Clone[S ~[]E, E any](s S) S {
// Compact replaces consecutive runs of equal elements with a single copy.
// This is like the uniq command found on Unix.
// Compact modifies the contents of the slice s; it does not create a new slice.
+// When Compact discards m elements in total, it might not modify the elements
+// s[len(s)-m:len(s)]. If those elements contain pointers you might consider
+// zeroing those elements so that objects they reference can be garbage collected.
func Compact[S ~[]E, E comparable](s S) S {
- if len(s) == 0 {
+ if len(s) < 2 {
return s
}
i := 1
- last := s[0]
- for _, v := range s[1:] {
- if v != last {
- s[i] = v
+ for k := 1; k < len(s); k++ {
+ if s[k] != s[k-1] {
+ if i != k {
+ s[i] = s[k]
+ }
i++
- last = v
}
}
return s[:i]
@@ -188,16 +220,16 @@ func Compact[S ~[]E, E comparable](s S) S {
// CompactFunc is like Compact but uses a comparison function.
func CompactFunc[S ~[]E, E any](s S, eq func(E, E) bool) S {
- if len(s) == 0 {
+ if len(s) < 2 {
return s
}
i := 1
- last := s[0]
- for _, v := range s[1:] {
- if !eq(v, last) {
- s[i] = v
+ for k := 1; k < len(s); k++ {
+ if !eq(s[k], s[k-1]) {
+ if i != k {
+ s[i] = s[k]
+ }
i++
- last = v
}
}
return s[:i]
@@ -205,11 +237,19 @@ func CompactFunc[S ~[]E, E any](s S, eq func(E, E) bool) S {
// Grow increases the slice's capacity, if necessary, to guarantee space for
// another n elements. After Grow(n), at least n elements can be appended
-// to the slice without another allocation. Grow may modify elements of the
-// slice between the length and the capacity. If n is negative or too large to
+// to the slice without another allocation. If n is negative or too large to
// allocate the memory, Grow panics.
func Grow[S ~[]E, E any](s S, n int) S {
- return append(s, make(S, n)...)[:len(s)]
+ if n < 0 {
+ panic("cannot be negative")
+ }
+ if n -= cap(s) - len(s); n > 0 {
+ // TODO(https://go.dev/issue/53888): Make using []E instead of S
+ // to workaround a compiler bug where the runtime.growslice optimization
+ // does not take effect. Revert when the compiler is fixed.
+ s = append([]E(s)[:cap(s)], make([]E, n)...)[:len(s)]
+ }
+ return s
}
// Clip removes unused capacity from the slice, returning s[:len(s):len(s)].
diff --git a/vendor/golang.org/x/exp/slices/sort.go b/vendor/golang.org/x/exp/slices/sort.go
index c22e74bd10..231b6448ac 100644
--- a/vendor/golang.org/x/exp/slices/sort.go
+++ b/vendor/golang.org/x/exp/slices/sort.go
@@ -30,7 +30,7 @@ func SortFunc[E any](x []E, less func(a, b E) bool) {
pdqsortLessFunc(x, 0, n, bits.Len(uint(n)), less)
}
-// SortStable sorts the slice x while keeping the original order of equal
+// SortStableFunc sorts the slice x while keeping the original order of equal
// elements, using less to compare elements.
func SortStableFunc[E any](x []E, less func(a, b E) bool) {
stableLessFunc(x, len(x), less)
@@ -62,46 +62,47 @@ func IsSortedFunc[E any](x []E, less func(a, b E) bool) bool {
// sort order; it also returns a bool saying whether the target is really found
// in the slice. The slice must be sorted in increasing order.
func BinarySearch[E constraints.Ordered](x []E, target E) (int, bool) {
- // search returns the leftmost position where f returns true, or len(x) if f
- // returns false for all x. This is the insertion position for target in x,
- // and could point to an element that's either == target or not.
- pos := search(len(x), func(i int) bool { return x[i] >= target })
- if pos >= len(x) || x[pos] != target {
- return pos, false
- } else {
- return pos, true
+ // Inlining is faster than calling BinarySearchFunc with a lambda.
+ n := len(x)
+ // Define x[-1] < target and x[n] >= target.
+ // Invariant: x[i-1] < target, x[j] >= target.
+ i, j := 0, n
+ for i < j {
+ h := int(uint(i+j) >> 1) // avoid overflow when computing h
+ // i ≤ h < j
+ if x[h] < target {
+ i = h + 1 // preserves x[i-1] < target
+ } else {
+ j = h // preserves x[j] >= target
+ }
}
+ // i == j, x[i-1] < target, and x[j] (= x[i]) >= target => answer is i.
+ return i, i < n && x[i] == target
}
// BinarySearchFunc works like BinarySearch, but uses a custom comparison
-// function. The slice must be sorted in increasing order, where "increasing" is
-// defined by cmp. cmp(a, b) is expected to return an integer comparing the two
-// parameters: 0 if a == b, a negative number if a < b and a positive number if
-// a > b.
-func BinarySearchFunc[E any](x []E, target E, cmp func(E, E) int) (int, bool) {
- pos := search(len(x), func(i int) bool { return cmp(x[i], target) >= 0 })
- if pos >= len(x) || cmp(x[pos], target) != 0 {
- return pos, false
- } else {
- return pos, true
- }
-}
-
-func search(n int, f func(int) bool) int {
- // Define f(-1) == false and f(n) == true.
- // Invariant: f(i-1) == false, f(j) == true.
+// function. The slice must be sorted in increasing order, where "increasing"
+// is defined by cmp. cmp should return 0 if the slice element matches
+// the target, a negative number if the slice element precedes the target,
+// or a positive number if the slice element follows the target.
+// cmp must implement the same ordering as the slice, such that if
+// cmp(a, t) < 0 and cmp(b, t) >= 0, then a must precede b in the slice.
+func BinarySearchFunc[E, T any](x []E, target T, cmp func(E, T) int) (int, bool) {
+ n := len(x)
+ // Define cmp(x[-1], target) < 0 and cmp(x[n], target) >= 0 .
+ // Invariant: cmp(x[i - 1], target) < 0, cmp(x[j], target) >= 0.
i, j := 0, n
for i < j {
h := int(uint(i+j) >> 1) // avoid overflow when computing h
// i ≤ h < j
- if !f(h) {
- i = h + 1 // preserves f(i-1) == false
+ if cmp(x[h], target) < 0 {
+ i = h + 1 // preserves cmp(x[i - 1], target) < 0
} else {
- j = h // preserves f(j) == true
+ j = h // preserves cmp(x[j], target) >= 0
}
}
- // i == j, f(i-1) == false, and f(j) (= f(i)) == true => answer is i.
- return i
+ // i == j, cmp(x[i-1], target) < 0, and cmp(x[j], target) (= cmp(x[i], target)) >= 0 => answer is i.
+ return i, i < n && cmp(x[i], target) == 0
}
type sortedHint int // hint for pdqsort when choosing the pivot
diff --git a/vendor/golang.org/x/net/LICENSE b/vendor/golang.org/x/net/LICENSE
index 6a66aea5ea..2a7cf70da6 100644
--- a/vendor/golang.org/x/net/LICENSE
+++ b/vendor/golang.org/x/net/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
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
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/net/http/httpguts/httplex.go b/vendor/golang.org/x/net/http/httpguts/httplex.go
index 6e071e8524..9b4de94019 100644
--- a/vendor/golang.org/x/net/http/httpguts/httplex.go
+++ b/vendor/golang.org/x/net/http/httpguts/httplex.go
@@ -12,7 +12,7 @@ import (
"golang.org/x/net/idna"
)
-var isTokenTable = [127]bool{
+var isTokenTable = [256]bool{
'!': true,
'#': true,
'$': true,
@@ -93,12 +93,7 @@ var isTokenTable = [127]bool{
}
func IsTokenRune(r rune) bool {
- i := int(r)
- return i < len(isTokenTable) && isTokenTable[i]
-}
-
-func isNotToken(r rune) bool {
- return !IsTokenRune(r)
+ return r < utf8.RuneSelf && isTokenTable[byte(r)]
}
// HeaderValuesContainsToken reports whether any string in values
@@ -202,8 +197,8 @@ func ValidHeaderFieldName(v string) bool {
if len(v) == 0 {
return false
}
- for _, r := range v {
- if !IsTokenRune(r) {
+ for i := 0; i < len(v); i++ {
+ if !isTokenTable[v[i]] {
return false
}
}
diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go
index 43557ab7e9..105c3b279c 100644
--- a/vendor/golang.org/x/net/http2/frame.go
+++ b/vendor/golang.org/x/net/http2/frame.go
@@ -490,6 +490,9 @@ func terminalReadFrameError(err error) bool {
// returned error is ErrFrameTooLarge. Other errors may be of type
// ConnectionError, StreamError, or anything else from the underlying
// reader.
+//
+// If ReadFrame returns an error and a non-nil Frame, the Frame's StreamID
+// indicates the stream responsible for the error.
func (fr *Framer) ReadFrame() (Frame, error) {
fr.errDetail = nil
if fr.lastFrame != nil {
@@ -1521,7 +1524,7 @@ func (fr *Framer) maxHeaderStringLen() int {
// readMetaFrame returns 0 or more CONTINUATION frames from fr and
// merge them into the provided hf and returns a MetaHeadersFrame
// with the decoded hpack values.
-func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) {
+func (fr *Framer) readMetaFrame(hf *HeadersFrame) (Frame, error) {
if fr.AllowIllegalReads {
return nil, errors.New("illegal use of AllowIllegalReads with ReadMetaHeaders")
}
@@ -1592,7 +1595,7 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) {
}
// It would be nice to send a RST_STREAM before sending the GOAWAY,
// but the structure of the server's frame writer makes this difficult.
- return nil, ConnectionError(ErrCodeProtocol)
+ return mh, ConnectionError(ErrCodeProtocol)
}
// Also close the connection after any CONTINUATION frame following an
@@ -1604,11 +1607,11 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) {
}
// It would be nice to send a RST_STREAM before sending the GOAWAY,
// but the structure of the server's frame writer makes this difficult.
- return nil, ConnectionError(ErrCodeProtocol)
+ return mh, ConnectionError(ErrCodeProtocol)
}
if _, err := hdec.Write(frag); err != nil {
- return nil, ConnectionError(ErrCodeCompression)
+ return mh, ConnectionError(ErrCodeCompression)
}
if hc.HeadersEnded() {
@@ -1625,7 +1628,7 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) {
mh.HeadersFrame.invalidate()
if err := hdec.Close(); err != nil {
- return nil, ConnectionError(ErrCodeCompression)
+ return mh, ConnectionError(ErrCodeCompression)
}
if invalid != nil {
fr.errDetail = invalid
diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go
index 6f2df28187..003e649f30 100644
--- a/vendor/golang.org/x/net/http2/http2.go
+++ b/vendor/golang.org/x/net/http2/http2.go
@@ -17,6 +17,7 @@ package http2 // import "golang.org/x/net/http2"
import (
"bufio"
+ "context"
"crypto/tls"
"fmt"
"io"
@@ -26,6 +27,7 @@ import (
"strconv"
"strings"
"sync"
+ "time"
"golang.org/x/net/http/httpguts"
)
@@ -210,12 +212,6 @@ type stringWriter interface {
WriteString(s string) (n int, err error)
}
-// A gate lets two goroutines coordinate their activities.
-type gate chan struct{}
-
-func (g gate) Done() { g <- struct{}{} }
-func (g gate) Wait() { <-g }
-
// A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed).
type closeWaiter chan struct{}
@@ -383,3 +379,14 @@ func validPseudoPath(v string) bool {
// makes that struct also non-comparable, and generally doesn't add
// any size (as long as it's first).
type incomparable [0]func()
+
+// synctestGroupInterface is the methods of synctestGroup used by Server and Transport.
+// It's defined as an interface here to let us keep synctestGroup entirely test-only
+// and not a part of non-test builds.
+type synctestGroupInterface interface {
+ Join()
+ Now() time.Time
+ NewTimer(d time.Duration) timer
+ AfterFunc(d time.Duration, f func()) timer
+ ContextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc)
+}
diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go
index ce2e8b40ee..6c349f3ec6 100644
--- a/vendor/golang.org/x/net/http2/server.go
+++ b/vendor/golang.org/x/net/http2/server.go
@@ -154,6 +154,39 @@ type Server struct {
// so that we don't embed a Mutex in this struct, which will make the
// struct non-copyable, which might break some callers.
state *serverInternalState
+
+ // Synchronization group used for testing.
+ // Outside of tests, this is nil.
+ group synctestGroupInterface
+}
+
+func (s *Server) markNewGoroutine() {
+ if s.group != nil {
+ s.group.Join()
+ }
+}
+
+func (s *Server) now() time.Time {
+ if s.group != nil {
+ return s.group.Now()
+ }
+ return time.Now()
+}
+
+// newTimer creates a new time.Timer, or a synthetic timer in tests.
+func (s *Server) newTimer(d time.Duration) timer {
+ if s.group != nil {
+ return s.group.NewTimer(d)
+ }
+ return timeTimer{time.NewTimer(d)}
+}
+
+// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests.
+func (s *Server) afterFunc(d time.Duration, f func()) timer {
+ if s.group != nil {
+ return s.group.AfterFunc(d, f)
+ }
+ return timeTimer{time.AfterFunc(d, f)}
}
func (s *Server) initialConnRecvWindowSize() int32 {
@@ -400,6 +433,10 @@ func (o *ServeConnOpts) handler() http.Handler {
//
// The opts parameter is optional. If nil, default values are used.
func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) {
+ s.serveConn(c, opts, nil)
+}
+
+func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverConn)) {
baseCtx, cancel := serverConnBaseContext(c, opts)
defer cancel()
@@ -426,6 +463,9 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) {
pushEnabled: true,
sawClientPreface: opts.SawClientPreface,
}
+ if newf != nil {
+ newf(sc)
+ }
s.state.registerConn(sc)
defer s.state.unregisterConn(sc)
@@ -599,8 +639,8 @@ type serverConn struct {
inFrameScheduleLoop bool // whether we're in the scheduleFrameWrite loop
needToSendGoAway bool // we need to schedule a GOAWAY frame write
goAwayCode ErrCode
- shutdownTimer *time.Timer // nil until used
- idleTimer *time.Timer // nil if unused
+ shutdownTimer timer // nil until used
+ idleTimer timer // nil if unused
// Owned by the writeFrameAsync goroutine:
headerWriteBuf bytes.Buffer
@@ -649,12 +689,12 @@ type stream struct {
flow outflow // limits writing from Handler to client
inflow inflow // what the client is allowed to POST/etc to us
state streamState
- resetQueued bool // RST_STREAM queued for write; set by sc.resetStream
- gotTrailerHeader bool // HEADER frame for trailers was seen
- wroteHeaders bool // whether we wrote headers (not status 100)
- readDeadline *time.Timer // nil if unused
- writeDeadline *time.Timer // nil if unused
- closeErr error // set before cw is closed
+ resetQueued bool // RST_STREAM queued for write; set by sc.resetStream
+ gotTrailerHeader bool // HEADER frame for trailers was seen
+ wroteHeaders bool // whether we wrote headers (not status 100)
+ readDeadline timer // nil if unused
+ writeDeadline timer // nil if unused
+ closeErr error // set before cw is closed
trailer http.Header // accumulated trailers
reqTrailer http.Header // handler's Request.Trailer
@@ -732,11 +772,7 @@ func isClosedConnError(err error) bool {
return false
}
- // TODO: remove this string search and be more like the Windows
- // case below. That might involve modifying the standard library
- // to return better error types.
- str := err.Error()
- if strings.Contains(str, "use of closed network connection") {
+ if errors.Is(err, net.ErrClosed) {
return true
}
@@ -815,8 +851,9 @@ type readFrameResult struct {
// consumer is done with the frame.
// It's run on its own goroutine.
func (sc *serverConn) readFrames() {
- gate := make(gate)
- gateDone := gate.Done
+ sc.srv.markNewGoroutine()
+ gate := make(chan struct{})
+ gateDone := func() { gate <- struct{}{} }
for {
f, err := sc.framer.ReadFrame()
select {
@@ -847,6 +884,7 @@ type frameWriteResult struct {
// At most one goroutine can be running writeFrameAsync at a time per
// serverConn.
func (sc *serverConn) writeFrameAsync(wr FrameWriteRequest, wd *writeData) {
+ sc.srv.markNewGoroutine()
var err error
if wd == nil {
err = wr.write.writeFrame(sc)
@@ -926,13 +964,13 @@ func (sc *serverConn) serve() {
sc.setConnState(http.StateIdle)
if sc.srv.IdleTimeout > 0 {
- sc.idleTimer = time.AfterFunc(sc.srv.IdleTimeout, sc.onIdleTimer)
+ sc.idleTimer = sc.srv.afterFunc(sc.srv.IdleTimeout, sc.onIdleTimer)
defer sc.idleTimer.Stop()
}
go sc.readFrames() // closed by defer sc.conn.Close above
- settingsTimer := time.AfterFunc(firstSettingsTimeout, sc.onSettingsTimer)
+ settingsTimer := sc.srv.afterFunc(firstSettingsTimeout, sc.onSettingsTimer)
defer settingsTimer.Stop()
loopNum := 0
@@ -1061,10 +1099,10 @@ func (sc *serverConn) readPreface() error {
errc <- nil
}
}()
- timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server?
+ timer := sc.srv.newTimer(prefaceTimeout) // TODO: configurable on *Server?
defer timer.Stop()
select {
- case <-timer.C:
+ case <-timer.C():
return errPrefaceTimeout
case err := <-errc:
if err == nil {
@@ -1429,7 +1467,7 @@ func (sc *serverConn) goAway(code ErrCode) {
func (sc *serverConn) shutDownIn(d time.Duration) {
sc.serveG.check()
- sc.shutdownTimer = time.AfterFunc(d, sc.onShutdownTimer)
+ sc.shutdownTimer = sc.srv.afterFunc(d, sc.onShutdownTimer)
}
func (sc *serverConn) resetStream(se StreamError) {
@@ -1482,6 +1520,11 @@ func (sc *serverConn) processFrameFromReader(res readFrameResult) bool {
sc.goAway(ErrCodeFlowControl)
return true
case ConnectionError:
+ if res.f != nil {
+ if id := res.f.Header().StreamID; id > sc.maxClientStreamID {
+ sc.maxClientStreamID = id
+ }
+ }
sc.logf("http2: server connection error from %v: %v", sc.conn.RemoteAddr(), ev)
sc.goAway(ErrCode(ev))
return true // goAway will handle shutdown
@@ -1638,7 +1681,7 @@ func (sc *serverConn) closeStream(st *stream, err error) {
delete(sc.streams, st.id)
if len(sc.streams) == 0 {
sc.setConnState(http.StateIdle)
- if sc.srv.IdleTimeout > 0 {
+ if sc.srv.IdleTimeout > 0 && sc.idleTimer != nil {
sc.idleTimer.Reset(sc.srv.IdleTimeout)
}
if h1ServerKeepAlivesDisabled(sc.hs) {
@@ -1660,6 +1703,7 @@ func (sc *serverConn) closeStream(st *stream, err error) {
}
}
st.closeErr = err
+ st.cancelCtx()
st.cw.Close() // signals Handler's CloseNotifier, unblocks writes, etc
sc.writeSched.CloseStream(st.id)
}
@@ -2020,7 +2064,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error {
// (in Go 1.8), though. That's a more sane option anyway.
if sc.hs.ReadTimeout > 0 {
sc.conn.SetReadDeadline(time.Time{})
- st.readDeadline = time.AfterFunc(sc.hs.ReadTimeout, st.onReadTimeout)
+ st.readDeadline = sc.srv.afterFunc(sc.hs.ReadTimeout, st.onReadTimeout)
}
return sc.scheduleHandler(id, rw, req, handler)
@@ -2118,7 +2162,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream
st.flow.add(sc.initialStreamSendWindowSize)
st.inflow.init(sc.srv.initialStreamRecvWindowSize())
if sc.hs.WriteTimeout > 0 {
- st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout)
+ st.writeDeadline = sc.srv.afterFunc(sc.hs.WriteTimeout, st.onWriteTimeout)
}
sc.streams[id] = st
@@ -2342,6 +2386,7 @@ func (sc *serverConn) handlerDone() {
// Run on its own goroutine.
func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) {
+ sc.srv.markNewGoroutine()
defer sc.sendServeMsg(handlerDoneMsg)
didPanic := true
defer func() {
@@ -2638,7 +2683,7 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
var date string
if _, ok := rws.snapHeader["Date"]; !ok {
// TODO(bradfitz): be faster here, like net/http? measure.
- date = time.Now().UTC().Format(http.TimeFormat)
+ date = rws.conn.srv.now().UTC().Format(http.TimeFormat)
}
for _, v := range rws.snapHeader["Trailer"] {
@@ -2760,7 +2805,7 @@ func (rws *responseWriterState) promoteUndeclaredTrailers() {
func (w *responseWriter) SetReadDeadline(deadline time.Time) error {
st := w.rws.stream
- if !deadline.IsZero() && deadline.Before(time.Now()) {
+ if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) {
// If we're setting a deadline in the past, reset the stream immediately
// so writes after SetWriteDeadline returns will fail.
st.onReadTimeout()
@@ -2776,9 +2821,9 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error {
if deadline.IsZero() {
st.readDeadline = nil
} else if st.readDeadline == nil {
- st.readDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onReadTimeout)
+ st.readDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onReadTimeout)
} else {
- st.readDeadline.Reset(deadline.Sub(time.Now()))
+ st.readDeadline.Reset(deadline.Sub(sc.srv.now()))
}
})
return nil
@@ -2786,7 +2831,7 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error {
func (w *responseWriter) SetWriteDeadline(deadline time.Time) error {
st := w.rws.stream
- if !deadline.IsZero() && deadline.Before(time.Now()) {
+ if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) {
// If we're setting a deadline in the past, reset the stream immediately
// so writes after SetWriteDeadline returns will fail.
st.onWriteTimeout()
@@ -2802,9 +2847,9 @@ func (w *responseWriter) SetWriteDeadline(deadline time.Time) error {
if deadline.IsZero() {
st.writeDeadline = nil
} else if st.writeDeadline == nil {
- st.writeDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onWriteTimeout)
+ st.writeDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onWriteTimeout)
} else {
- st.writeDeadline.Reset(deadline.Sub(time.Now()))
+ st.writeDeadline.Reset(deadline.Sub(sc.srv.now()))
}
})
return nil
diff --git a/vendor/golang.org/x/net/http2/testsync.go b/vendor/golang.org/x/net/http2/testsync.go
deleted file mode 100644
index 61075bd16d..0000000000
--- a/vendor/golang.org/x/net/http2/testsync.go
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright 2024 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 http2
-
-import (
- "context"
- "sync"
- "time"
-)
-
-// testSyncHooks coordinates goroutines in tests.
-//
-// For example, a call to ClientConn.RoundTrip involves several goroutines, including:
-// - the goroutine running RoundTrip;
-// - the clientStream.doRequest goroutine, which writes the request; and
-// - the clientStream.readLoop goroutine, which reads the response.
-//
-// Using testSyncHooks, a test can start a RoundTrip and identify when all these goroutines
-// are blocked waiting for some condition such as reading the Request.Body or waiting for
-// flow control to become available.
-//
-// The testSyncHooks also manage timers and synthetic time in tests.
-// This permits us to, for example, start a request and cause it to time out waiting for
-// response headers without resorting to time.Sleep calls.
-type testSyncHooks struct {
- // active/inactive act as a mutex and condition variable.
- //
- // - neither chan contains a value: testSyncHooks is locked.
- // - active contains a value: unlocked, and at least one goroutine is not blocked
- // - inactive contains a value: unlocked, and all goroutines are blocked
- active chan struct{}
- inactive chan struct{}
-
- // goroutine counts
- total int // total goroutines
- condwait map[*sync.Cond]int // blocked in sync.Cond.Wait
- blocked []*testBlockedGoroutine // otherwise blocked
-
- // fake time
- now time.Time
- timers []*fakeTimer
-
- // Transport testing: Report various events.
- newclientconn func(*ClientConn)
- newstream func(*clientStream)
-}
-
-// testBlockedGoroutine is a blocked goroutine.
-type testBlockedGoroutine struct {
- f func() bool // blocked until f returns true
- ch chan struct{} // closed when unblocked
-}
-
-func newTestSyncHooks() *testSyncHooks {
- h := &testSyncHooks{
- active: make(chan struct{}, 1),
- inactive: make(chan struct{}, 1),
- condwait: map[*sync.Cond]int{},
- }
- h.inactive <- struct{}{}
- h.now = time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)
- return h
-}
-
-// lock acquires the testSyncHooks mutex.
-func (h *testSyncHooks) lock() {
- select {
- case <-h.active:
- case <-h.inactive:
- }
-}
-
-// waitInactive waits for all goroutines to become inactive.
-func (h *testSyncHooks) waitInactive() {
- for {
- <-h.inactive
- if !h.unlock() {
- break
- }
- }
-}
-
-// unlock releases the testSyncHooks mutex.
-// It reports whether any goroutines are active.
-func (h *testSyncHooks) unlock() (active bool) {
- // Look for a blocked goroutine which can be unblocked.
- blocked := h.blocked[:0]
- unblocked := false
- for _, b := range h.blocked {
- if !unblocked && b.f() {
- unblocked = true
- close(b.ch)
- } else {
- blocked = append(blocked, b)
- }
- }
- h.blocked = blocked
-
- // Count goroutines blocked on condition variables.
- condwait := 0
- for _, count := range h.condwait {
- condwait += count
- }
-
- if h.total > condwait+len(blocked) {
- h.active <- struct{}{}
- return true
- } else {
- h.inactive <- struct{}{}
- return false
- }
-}
-
-// goRun starts a new goroutine.
-func (h *testSyncHooks) goRun(f func()) {
- h.lock()
- h.total++
- h.unlock()
- go func() {
- defer func() {
- h.lock()
- h.total--
- h.unlock()
- }()
- f()
- }()
-}
-
-// blockUntil indicates that a goroutine is blocked waiting for some condition to become true.
-// It waits until f returns true before proceeding.
-//
-// Example usage:
-//
-// h.blockUntil(func() bool {
-// // Is the context done yet?
-// select {
-// case <-ctx.Done():
-// default:
-// return false
-// }
-// return true
-// })
-// // Wait for the context to become done.
-// <-ctx.Done()
-//
-// The function f passed to blockUntil must be non-blocking and idempotent.
-func (h *testSyncHooks) blockUntil(f func() bool) {
- if f() {
- return
- }
- ch := make(chan struct{})
- h.lock()
- h.blocked = append(h.blocked, &testBlockedGoroutine{
- f: f,
- ch: ch,
- })
- h.unlock()
- <-ch
-}
-
-// broadcast is sync.Cond.Broadcast.
-func (h *testSyncHooks) condBroadcast(cond *sync.Cond) {
- h.lock()
- delete(h.condwait, cond)
- h.unlock()
- cond.Broadcast()
-}
-
-// broadcast is sync.Cond.Wait.
-func (h *testSyncHooks) condWait(cond *sync.Cond) {
- h.lock()
- h.condwait[cond]++
- h.unlock()
-}
-
-// newTimer creates a new fake timer.
-func (h *testSyncHooks) newTimer(d time.Duration) timer {
- h.lock()
- defer h.unlock()
- t := &fakeTimer{
- hooks: h,
- when: h.now.Add(d),
- c: make(chan time.Time),
- }
- h.timers = append(h.timers, t)
- return t
-}
-
-// afterFunc creates a new fake AfterFunc timer.
-func (h *testSyncHooks) afterFunc(d time.Duration, f func()) timer {
- h.lock()
- defer h.unlock()
- t := &fakeTimer{
- hooks: h,
- when: h.now.Add(d),
- f: f,
- }
- h.timers = append(h.timers, t)
- return t
-}
-
-func (h *testSyncHooks) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) {
- ctx, cancel := context.WithCancel(ctx)
- t := h.afterFunc(d, cancel)
- return ctx, func() {
- t.Stop()
- cancel()
- }
-}
-
-func (h *testSyncHooks) timeUntilEvent() time.Duration {
- h.lock()
- defer h.unlock()
- var next time.Time
- for _, t := range h.timers {
- if next.IsZero() || t.when.Before(next) {
- next = t.when
- }
- }
- if d := next.Sub(h.now); d > 0 {
- return d
- }
- return 0
-}
-
-// advance advances time and causes synthetic timers to fire.
-func (h *testSyncHooks) advance(d time.Duration) {
- h.lock()
- defer h.unlock()
- h.now = h.now.Add(d)
- timers := h.timers[:0]
- for _, t := range h.timers {
- t := t // remove after go.mod depends on go1.22
- t.mu.Lock()
- switch {
- case t.when.After(h.now):
- timers = append(timers, t)
- case t.when.IsZero():
- // stopped timer
- default:
- t.when = time.Time{}
- if t.c != nil {
- close(t.c)
- }
- if t.f != nil {
- h.total++
- go func() {
- defer func() {
- h.lock()
- h.total--
- h.unlock()
- }()
- t.f()
- }()
- }
- }
- t.mu.Unlock()
- }
- h.timers = timers
-}
-
-// A timer wraps a time.Timer, or a synthetic equivalent in tests.
-// Unlike time.Timer, timer is single-use: The timer channel is closed when the timer expires.
-type timer interface {
- C() <-chan time.Time
- Stop() bool
- Reset(d time.Duration) bool
-}
-
-// timeTimer implements timer using real time.
-type timeTimer struct {
- t *time.Timer
- c chan time.Time
-}
-
-// newTimeTimer creates a new timer using real time.
-func newTimeTimer(d time.Duration) timer {
- ch := make(chan time.Time)
- t := time.AfterFunc(d, func() {
- close(ch)
- })
- return &timeTimer{t, ch}
-}
-
-// newTimeAfterFunc creates an AfterFunc timer using real time.
-func newTimeAfterFunc(d time.Duration, f func()) timer {
- return &timeTimer{
- t: time.AfterFunc(d, f),
- }
-}
-
-func (t timeTimer) C() <-chan time.Time { return t.c }
-func (t timeTimer) Stop() bool { return t.t.Stop() }
-func (t timeTimer) Reset(d time.Duration) bool { return t.t.Reset(d) }
-
-// fakeTimer implements timer using fake time.
-type fakeTimer struct {
- hooks *testSyncHooks
-
- mu sync.Mutex
- when time.Time // when the timer will fire
- c chan time.Time // closed when the timer fires; mutually exclusive with f
- f func() // called when the timer fires; mutually exclusive with c
-}
-
-func (t *fakeTimer) C() <-chan time.Time { return t.c }
-
-func (t *fakeTimer) Stop() bool {
- t.mu.Lock()
- defer t.mu.Unlock()
- stopped := t.when.IsZero()
- t.when = time.Time{}
- return stopped
-}
-
-func (t *fakeTimer) Reset(d time.Duration) bool {
- if t.c != nil || t.f == nil {
- panic("fakeTimer only supports Reset on AfterFunc timers")
- }
- t.mu.Lock()
- defer t.mu.Unlock()
- t.hooks.lock()
- defer t.hooks.unlock()
- active := !t.when.IsZero()
- t.when = t.hooks.now.Add(d)
- if !active {
- t.hooks.timers = append(t.hooks.timers, t)
- }
- return active
-}
diff --git a/vendor/golang.org/x/net/http2/timer.go b/vendor/golang.org/x/net/http2/timer.go
new file mode 100644
index 0000000000..0b1c17b812
--- /dev/null
+++ b/vendor/golang.org/x/net/http2/timer.go
@@ -0,0 +1,20 @@
+// Copyright 2024 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 http2
+
+import "time"
+
+// A timer is a time.Timer, as an interface which can be replaced in tests.
+type timer = interface {
+ C() <-chan time.Time
+ Reset(d time.Duration) bool
+ Stop() bool
+}
+
+// timeTimer adapts a time.Timer to the timer interface.
+type timeTimer struct {
+ *time.Timer
+}
+
+func (t timeTimer) C() <-chan time.Time { return t.Timer.C }
diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go
index ce375c8c75..61f511f97a 100644
--- a/vendor/golang.org/x/net/http2/transport.go
+++ b/vendor/golang.org/x/net/http2/transport.go
@@ -185,7 +185,45 @@ type Transport struct {
connPoolOnce sync.Once
connPoolOrDef ClientConnPool // non-nil version of ConnPool
- syncHooks *testSyncHooks
+ *transportTestHooks
+}
+
+// Hook points used for testing.
+// Outside of tests, t.transportTestHooks is nil and these all have minimal implementations.
+// Inside tests, see the testSyncHooks function docs.
+
+type transportTestHooks struct {
+ newclientconn func(*ClientConn)
+ group synctestGroupInterface
+}
+
+func (t *Transport) markNewGoroutine() {
+ if t != nil && t.transportTestHooks != nil {
+ t.transportTestHooks.group.Join()
+ }
+}
+
+// newTimer creates a new time.Timer, or a synthetic timer in tests.
+func (t *Transport) newTimer(d time.Duration) timer {
+ if t.transportTestHooks != nil {
+ return t.transportTestHooks.group.NewTimer(d)
+ }
+ return timeTimer{time.NewTimer(d)}
+}
+
+// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests.
+func (t *Transport) afterFunc(d time.Duration, f func()) timer {
+ if t.transportTestHooks != nil {
+ return t.transportTestHooks.group.AfterFunc(d, f)
+ }
+ return timeTimer{time.AfterFunc(d, f)}
+}
+
+func (t *Transport) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) {
+ if t.transportTestHooks != nil {
+ return t.transportTestHooks.group.ContextWithTimeout(ctx, d)
+ }
+ return context.WithTimeout(ctx, d)
}
func (t *Transport) maxHeaderListSize() uint32 {
@@ -352,60 +390,6 @@ type ClientConn struct {
werr error // first write error that has occurred
hbuf bytes.Buffer // HPACK encoder writes into this
henc *hpack.Encoder
-
- syncHooks *testSyncHooks // can be nil
-}
-
-// Hook points used for testing.
-// Outside of tests, cc.syncHooks is nil and these all have minimal implementations.
-// Inside tests, see the testSyncHooks function docs.
-
-// goRun starts a new goroutine.
-func (cc *ClientConn) goRun(f func()) {
- if cc.syncHooks != nil {
- cc.syncHooks.goRun(f)
- return
- }
- go f()
-}
-
-// condBroadcast is cc.cond.Broadcast.
-func (cc *ClientConn) condBroadcast() {
- if cc.syncHooks != nil {
- cc.syncHooks.condBroadcast(cc.cond)
- }
- cc.cond.Broadcast()
-}
-
-// condWait is cc.cond.Wait.
-func (cc *ClientConn) condWait() {
- if cc.syncHooks != nil {
- cc.syncHooks.condWait(cc.cond)
- }
- cc.cond.Wait()
-}
-
-// newTimer creates a new time.Timer, or a synthetic timer in tests.
-func (cc *ClientConn) newTimer(d time.Duration) timer {
- if cc.syncHooks != nil {
- return cc.syncHooks.newTimer(d)
- }
- return newTimeTimer(d)
-}
-
-// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests.
-func (cc *ClientConn) afterFunc(d time.Duration, f func()) timer {
- if cc.syncHooks != nil {
- return cc.syncHooks.afterFunc(d, f)
- }
- return newTimeAfterFunc(d, f)
-}
-
-func (cc *ClientConn) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) {
- if cc.syncHooks != nil {
- return cc.syncHooks.contextWithTimeout(ctx, d)
- }
- return context.WithTimeout(ctx, d)
}
// clientStream is the state for a single HTTP/2 stream. One of these
@@ -487,7 +471,7 @@ func (cs *clientStream) abortStreamLocked(err error) {
// TODO(dneil): Clean up tests where cs.cc.cond is nil.
if cs.cc.cond != nil {
// Wake up writeRequestBody if it is waiting on flow control.
- cs.cc.condBroadcast()
+ cs.cc.cond.Broadcast()
}
}
@@ -497,7 +481,7 @@ func (cs *clientStream) abortRequestBodyWrite() {
defer cc.mu.Unlock()
if cs.reqBody != nil && cs.reqBodyClosed == nil {
cs.closeReqBodyLocked()
- cc.condBroadcast()
+ cc.cond.Broadcast()
}
}
@@ -507,10 +491,11 @@ func (cs *clientStream) closeReqBodyLocked() {
}
cs.reqBodyClosed = make(chan struct{})
reqBodyClosed := cs.reqBodyClosed
- cs.cc.goRun(func() {
+ go func() {
+ cs.cc.t.markNewGoroutine()
cs.reqBody.Close()
close(reqBodyClosed)
- })
+ }()
}
type stickyErrWriter struct {
@@ -626,21 +611,7 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res
backoff := float64(uint(1) << (uint(retry) - 1))
backoff += backoff * (0.1 * mathrand.Float64())
d := time.Second * time.Duration(backoff)
- var tm timer
- if t.syncHooks != nil {
- tm = t.syncHooks.newTimer(d)
- t.syncHooks.blockUntil(func() bool {
- select {
- case <-tm.C():
- case <-req.Context().Done():
- default:
- return false
- }
- return true
- })
- } else {
- tm = newTimeTimer(d)
- }
+ tm := t.newTimer(d)
select {
case <-tm.C():
t.vlogf("RoundTrip retrying after failure: %v", roundTripErr)
@@ -725,8 +696,8 @@ func canRetryError(err error) bool {
}
func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) {
- if t.syncHooks != nil {
- return t.newClientConn(nil, singleUse, t.syncHooks)
+ if t.transportTestHooks != nil {
+ return t.newClientConn(nil, singleUse)
}
host, _, err := net.SplitHostPort(addr)
if err != nil {
@@ -736,7 +707,7 @@ func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse b
if err != nil {
return nil, err
}
- return t.newClientConn(tconn, singleUse, nil)
+ return t.newClientConn(tconn, singleUse)
}
func (t *Transport) newTLSConfig(host string) *tls.Config {
@@ -802,10 +773,10 @@ func (t *Transport) maxEncoderHeaderTableSize() uint32 {
}
func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) {
- return t.newClientConn(c, t.disableKeepAlives(), nil)
+ return t.newClientConn(c, t.disableKeepAlives())
}
-func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHooks) (*ClientConn, error) {
+func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) {
cc := &ClientConn{
t: t,
tconn: c,
@@ -820,16 +791,12 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo
wantSettingsAck: true,
pings: make(map[[8]byte]chan struct{}),
reqHeaderMu: make(chan struct{}, 1),
- syncHooks: hooks,
}
- if hooks != nil {
- hooks.newclientconn(cc)
+ if t.transportTestHooks != nil {
+ t.markNewGoroutine()
+ t.transportTestHooks.newclientconn(cc)
c = cc.tconn
}
- if d := t.idleConnTimeout(); d != 0 {
- cc.idleTimeout = d
- cc.idleTimer = cc.afterFunc(d, cc.onIdleTimeout)
- }
if VerboseLogs {
t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr())
}
@@ -860,10 +827,6 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo
cc.henc.SetMaxDynamicTableSizeLimit(t.maxEncoderHeaderTableSize())
cc.peerMaxHeaderTableSize = initialHeaderTableSize
- if t.AllowHTTP {
- cc.nextStreamID = 3
- }
-
if cs, ok := c.(connectionStater); ok {
state := cs.ConnectionState()
cc.tlsState = &state
@@ -893,7 +856,13 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo
return nil, cc.werr
}
- cc.goRun(cc.readLoop)
+ // Start the idle timer after the connection is fully initialized.
+ if d := t.idleConnTimeout(); d != 0 {
+ cc.idleTimeout = d
+ cc.idleTimer = t.afterFunc(d, cc.onIdleTimeout)
+ }
+
+ go cc.readLoop()
return cc, nil
}
@@ -901,7 +870,7 @@ func (cc *ClientConn) healthCheck() {
pingTimeout := cc.t.pingTimeout()
// We don't need to periodically ping in the health check, because the readLoop of ClientConn will
// trigger the healthCheck again if there is no frame received.
- ctx, cancel := cc.contextWithTimeout(context.Background(), pingTimeout)
+ ctx, cancel := cc.t.contextWithTimeout(context.Background(), pingTimeout)
defer cancel()
cc.vlogf("http2: Transport sending health check")
err := cc.Ping(ctx)
@@ -936,7 +905,20 @@ func (cc *ClientConn) setGoAway(f *GoAwayFrame) {
}
last := f.LastStreamID
for streamID, cs := range cc.streams {
- if streamID > last {
+ if streamID <= last {
+ // The server's GOAWAY indicates that it received this stream.
+ // It will either finish processing it, or close the connection
+ // without doing so. Either way, leave the stream alone for now.
+ continue
+ }
+ if streamID == 1 && cc.goAway.ErrCode != ErrCodeNo {
+ // Don't retry the first stream on a connection if we get a non-NO error.
+ // If the server is sending an error on a new connection,
+ // retrying the request on a new one probably isn't going to work.
+ cs.abortStreamLocked(fmt.Errorf("http2: Transport received GOAWAY from server ErrCode:%v", cc.goAway.ErrCode))
+ } else {
+ // Aborting the stream with errClentConnGotGoAway indicates that
+ // the request should be retried on a new connection.
cs.abortStreamLocked(errClientConnGotGoAway)
}
}
@@ -1131,7 +1113,8 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error {
// Wait for all in-flight streams to complete or connection to close
done := make(chan struct{})
cancelled := false // guarded by cc.mu
- cc.goRun(func() {
+ go func() {
+ cc.t.markNewGoroutine()
cc.mu.Lock()
defer cc.mu.Unlock()
for {
@@ -1143,9 +1126,9 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error {
if cancelled {
break
}
- cc.condWait()
+ cc.cond.Wait()
}
- })
+ }()
shutdownEnterWaitStateHook()
select {
case <-done:
@@ -1155,7 +1138,7 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error {
cc.mu.Lock()
// Free the goroutine above
cancelled = true
- cc.condBroadcast()
+ cc.cond.Broadcast()
cc.mu.Unlock()
return ctx.Err()
}
@@ -1193,7 +1176,7 @@ func (cc *ClientConn) closeForError(err error) {
for _, cs := range cc.streams {
cs.abortStreamLocked(err)
}
- cc.condBroadcast()
+ cc.cond.Broadcast()
cc.mu.Unlock()
cc.closeConn()
}
@@ -1308,23 +1291,30 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream))
respHeaderRecv: make(chan struct{}),
donec: make(chan struct{}),
}
- cc.goRun(func() {
- cs.doRequest(req)
- })
+
+ // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere?
+ if !cc.t.disableCompression() &&
+ req.Header.Get("Accept-Encoding") == "" &&
+ req.Header.Get("Range") == "" &&
+ !cs.isHead {
+ // Request gzip only, not deflate. Deflate is ambiguous and
+ // not as universally supported anyway.
+ // See: https://zlib.net/zlib_faq.html#faq39
+ //
+ // Note that we don't request this for HEAD requests,
+ // due to a bug in nginx:
+ // http://trac.nginx.org/nginx/ticket/358
+ // https://golang.org/issue/5522
+ //
+ // We don't request gzip if the request is for a range, since
+ // auto-decoding a portion of a gzipped document will just fail
+ // anyway. See https://golang.org/issue/8923
+ cs.requestedGzip = true
+ }
+
+ go cs.doRequest(req, streamf)
waitDone := func() error {
- if cc.syncHooks != nil {
- cc.syncHooks.blockUntil(func() bool {
- select {
- case <-cs.donec:
- case <-ctx.Done():
- case <-cs.reqCancel:
- default:
- return false
- }
- return true
- })
- }
select {
case <-cs.donec:
return nil
@@ -1385,24 +1375,7 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream))
return err
}
- if streamf != nil {
- streamf(cs)
- }
-
for {
- if cc.syncHooks != nil {
- cc.syncHooks.blockUntil(func() bool {
- select {
- case <-cs.respHeaderRecv:
- case <-cs.abort:
- case <-ctx.Done():
- case <-cs.reqCancel:
- default:
- return false
- }
- return true
- })
- }
select {
case <-cs.respHeaderRecv:
return handleResponseHeaders()
@@ -1432,8 +1405,9 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream))
// doRequest runs for the duration of the request lifetime.
//
// It sends the request and performs post-request cleanup (closing Request.Body, etc.).
-func (cs *clientStream) doRequest(req *http.Request) {
- err := cs.writeRequest(req)
+func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream)) {
+ cs.cc.t.markNewGoroutine()
+ err := cs.writeRequest(req, streamf)
cs.cleanupWriteRequest(err)
}
@@ -1444,7 +1418,7 @@ func (cs *clientStream) doRequest(req *http.Request) {
//
// It returns non-nil if the request ends otherwise.
// If the returned error is StreamError, the error Code may be used in resetting the stream.
-func (cs *clientStream) writeRequest(req *http.Request) (err error) {
+func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStream)) (err error) {
cc := cs.cc
ctx := cs.ctx
@@ -1458,21 +1432,6 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) {
if cc.reqHeaderMu == nil {
panic("RoundTrip on uninitialized ClientConn") // for tests
}
- var newStreamHook func(*clientStream)
- if cc.syncHooks != nil {
- newStreamHook = cc.syncHooks.newstream
- cc.syncHooks.blockUntil(func() bool {
- select {
- case cc.reqHeaderMu <- struct{}{}:
- <-cc.reqHeaderMu
- case <-cs.reqCancel:
- case <-ctx.Done():
- default:
- return false
- }
- return true
- })
- }
select {
case cc.reqHeaderMu <- struct{}{}:
case <-cs.reqCancel:
@@ -1497,28 +1456,8 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) {
}
cc.mu.Unlock()
- if newStreamHook != nil {
- newStreamHook(cs)
- }
-
- // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere?
- if !cc.t.disableCompression() &&
- req.Header.Get("Accept-Encoding") == "" &&
- req.Header.Get("Range") == "" &&
- !cs.isHead {
- // Request gzip only, not deflate. Deflate is ambiguous and
- // not as universally supported anyway.
- // See: https://zlib.net/zlib_faq.html#faq39
- //
- // Note that we don't request this for HEAD requests,
- // due to a bug in nginx:
- // http://trac.nginx.org/nginx/ticket/358
- // https://golang.org/issue/5522
- //
- // We don't request gzip if the request is for a range, since
- // auto-decoding a portion of a gzipped document will just fail
- // anyway. See https://golang.org/issue/8923
- cs.requestedGzip = true
+ if streamf != nil {
+ streamf(cs)
}
continueTimeout := cc.t.expectContinueTimeout()
@@ -1581,7 +1520,7 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) {
var respHeaderTimer <-chan time.Time
var respHeaderRecv chan struct{}
if d := cc.responseHeaderTimeout(); d != 0 {
- timer := cc.newTimer(d)
+ timer := cc.t.newTimer(d)
defer timer.Stop()
respHeaderTimer = timer.C()
respHeaderRecv = cs.respHeaderRecv
@@ -1590,21 +1529,6 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) {
// or until the request is aborted (via context, error, or otherwise),
// whichever comes first.
for {
- if cc.syncHooks != nil {
- cc.syncHooks.blockUntil(func() bool {
- select {
- case <-cs.peerClosed:
- case <-respHeaderTimer:
- case <-respHeaderRecv:
- case <-cs.abort:
- case <-ctx.Done():
- case <-cs.reqCancel:
- default:
- return false
- }
- return true
- })
- }
select {
case <-cs.peerClosed:
return nil
@@ -1753,7 +1677,7 @@ func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error {
return nil
}
cc.pendingRequests++
- cc.condWait()
+ cc.cond.Wait()
cc.pendingRequests--
select {
case <-cs.abort:
@@ -2015,7 +1939,7 @@ func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error)
cs.flow.take(take)
return take, nil
}
- cc.condWait()
+ cc.cond.Wait()
}
}
@@ -2298,7 +2222,7 @@ func (cc *ClientConn) forgetStreamID(id uint32) {
}
// Wake up writeRequestBody via clientStream.awaitFlowControl and
// wake up RoundTrip if there is a pending request.
- cc.condBroadcast()
+ cc.cond.Broadcast()
closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil
if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 {
@@ -2320,6 +2244,7 @@ type clientConnReadLoop struct {
// readLoop runs in its own goroutine and reads and dispatches frames.
func (cc *ClientConn) readLoop() {
+ cc.t.markNewGoroutine()
rl := &clientConnReadLoop{cc: cc}
defer rl.cleanup()
cc.readerErr = rl.run()
@@ -2386,7 +2311,7 @@ func (rl *clientConnReadLoop) cleanup() {
cs.abortStreamLocked(err)
}
}
- cc.condBroadcast()
+ cc.cond.Broadcast()
cc.mu.Unlock()
}
@@ -2423,7 +2348,7 @@ func (rl *clientConnReadLoop) run() error {
readIdleTimeout := cc.t.ReadIdleTimeout
var t timer
if readIdleTimeout != 0 {
- t = cc.afterFunc(readIdleTimeout, cc.healthCheck)
+ t = cc.t.afterFunc(readIdleTimeout, cc.healthCheck)
}
for {
f, err := cc.fr.ReadFrame()
@@ -3021,7 +2946,7 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error {
for _, cs := range cc.streams {
cs.flow.add(delta)
}
- cc.condBroadcast()
+ cc.cond.Broadcast()
cc.initialWindowSize = s.Val
case SettingHeaderTableSize:
@@ -3076,7 +3001,7 @@ func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error {
return ConnectionError(ErrCodeFlowControl)
}
- cc.condBroadcast()
+ cc.cond.Broadcast()
return nil
}
@@ -3120,7 +3045,8 @@ func (cc *ClientConn) Ping(ctx context.Context) error {
}
var pingError error
errc := make(chan struct{})
- cc.goRun(func() {
+ go func() {
+ cc.t.markNewGoroutine()
cc.wmu.Lock()
defer cc.wmu.Unlock()
if pingError = cc.fr.WritePing(false, p); pingError != nil {
@@ -3131,20 +3057,7 @@ func (cc *ClientConn) Ping(ctx context.Context) error {
close(errc)
return
}
- })
- if cc.syncHooks != nil {
- cc.syncHooks.blockUntil(func() bool {
- select {
- case <-c:
- case <-errc:
- case <-ctx.Done():
- case <-cc.readerDone:
- default:
- return false
- }
- return true
- })
- }
+ }()
select {
case <-c:
return nil
diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/vendor/golang.org/x/net/http2/writesched_priority.go
index 0a242c669e..f6783339d1 100644
--- a/vendor/golang.org/x/net/http2/writesched_priority.go
+++ b/vendor/golang.org/x/net/http2/writesched_priority.go
@@ -443,8 +443,8 @@ func (ws *priorityWriteScheduler) addClosedOrIdleNode(list *[]*priorityNode, max
}
func (ws *priorityWriteScheduler) removeNode(n *priorityNode) {
- for k := n.kids; k != nil; k = k.next {
- k.setParent(n.parent)
+ for n.kids != nil {
+ n.kids.setParent(n.parent)
}
n.setParent(nil)
delete(ws.nodes, n.id)
diff --git a/vendor/golang.org/x/net/websocket/hybi.go b/vendor/golang.org/x/net/websocket/hybi.go
index 48a069e190..dda7434666 100644
--- a/vendor/golang.org/x/net/websocket/hybi.go
+++ b/vendor/golang.org/x/net/websocket/hybi.go
@@ -16,7 +16,6 @@ import (
"encoding/binary"
"fmt"
"io"
- "io/ioutil"
"net/http"
"net/url"
"strings"
@@ -279,7 +278,7 @@ func (handler *hybiFrameHandler) HandleFrame(frame frameReader) (frameReader, er
}
}
if header := frame.HeaderReader(); header != nil {
- io.Copy(ioutil.Discard, header)
+ io.Copy(io.Discard, header)
}
switch frame.PayloadType() {
case ContinuationFrame:
@@ -294,7 +293,7 @@ func (handler *hybiFrameHandler) HandleFrame(frame frameReader) (frameReader, er
if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF {
return nil, err
}
- io.Copy(ioutil.Discard, frame)
+ io.Copy(io.Discard, frame)
if frame.PayloadType() == PingFrame {
if _, err := handler.WritePong(b[:n]); err != nil {
return nil, err
diff --git a/vendor/golang.org/x/net/websocket/websocket.go b/vendor/golang.org/x/net/websocket/websocket.go
index 90a2257cd5..923a5780ec 100644
--- a/vendor/golang.org/x/net/websocket/websocket.go
+++ b/vendor/golang.org/x/net/websocket/websocket.go
@@ -17,7 +17,6 @@ import (
"encoding/json"
"errors"
"io"
- "io/ioutil"
"net"
"net/http"
"net/url"
@@ -208,7 +207,7 @@ again:
n, err = ws.frameReader.Read(msg)
if err == io.EOF {
if trailer := ws.frameReader.TrailerReader(); trailer != nil {
- io.Copy(ioutil.Discard, trailer)
+ io.Copy(io.Discard, trailer)
}
ws.frameReader = nil
goto again
@@ -330,7 +329,7 @@ func (cd Codec) Receive(ws *Conn, v interface{}) (err error) {
ws.rio.Lock()
defer ws.rio.Unlock()
if ws.frameReader != nil {
- _, err = io.Copy(ioutil.Discard, ws.frameReader)
+ _, err = io.Copy(io.Discard, ws.frameReader)
if err != nil {
return err
}
@@ -362,7 +361,7 @@ again:
return ErrFrameTooLarge
}
payloadType := frame.PayloadType()
- data, err := ioutil.ReadAll(frame)
+ data, err := io.ReadAll(frame)
if err != nil {
return err
}
diff --git a/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go b/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go
index 7a0b9ed102..2459d069f7 100644
--- a/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go
+++ b/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go
@@ -47,6 +47,10 @@ type Config struct {
// client ID & client secret sent. The zero value means to
// auto-detect.
AuthStyle oauth2.AuthStyle
+
+ // authStyleCache caches which auth style to use when Endpoint.AuthStyle is
+ // the zero value (AuthStyleAutoDetect).
+ authStyleCache internal.LazyAuthStyleCache
}
// Token uses client credentials to retrieve a token.
@@ -103,7 +107,7 @@ func (c *tokenSource) Token() (*oauth2.Token, error) {
v[k] = p
}
- tk, err := internal.RetrieveToken(c.ctx, c.conf.ClientID, c.conf.ClientSecret, c.conf.TokenURL, v, internal.AuthStyle(c.conf.AuthStyle))
+ tk, err := internal.RetrieveToken(c.ctx, c.conf.ClientID, c.conf.ClientSecret, c.conf.TokenURL, v, internal.AuthStyle(c.conf.AuthStyle), c.conf.authStyleCache.Get())
if err != nil {
if rErr, ok := err.(*internal.RetrieveError); ok {
return nil, (*oauth2.RetrieveError)(rErr)
diff --git a/vendor/golang.org/x/oauth2/deviceauth.go b/vendor/golang.org/x/oauth2/deviceauth.go
new file mode 100644
index 0000000000..e99c92f39c
--- /dev/null
+++ b/vendor/golang.org/x/oauth2/deviceauth.go
@@ -0,0 +1,198 @@
+package oauth2
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "strings"
+ "time"
+
+ "golang.org/x/oauth2/internal"
+)
+
+// https://datatracker.ietf.org/doc/html/rfc8628#section-3.5
+const (
+ errAuthorizationPending = "authorization_pending"
+ errSlowDown = "slow_down"
+ errAccessDenied = "access_denied"
+ errExpiredToken = "expired_token"
+)
+
+// DeviceAuthResponse describes a successful RFC 8628 Device Authorization Response
+// https://datatracker.ietf.org/doc/html/rfc8628#section-3.2
+type DeviceAuthResponse struct {
+ // DeviceCode
+ DeviceCode string `json:"device_code"`
+ // UserCode is the code the user should enter at the verification uri
+ UserCode string `json:"user_code"`
+ // VerificationURI is where user should enter the user code
+ VerificationURI string `json:"verification_uri"`
+ // VerificationURIComplete (if populated) includes the user code in the verification URI. This is typically shown to the user in non-textual form, such as a QR code.
+ VerificationURIComplete string `json:"verification_uri_complete,omitempty"`
+ // Expiry is when the device code and user code expire
+ Expiry time.Time `json:"expires_in,omitempty"`
+ // Interval is the duration in seconds that Poll should wait between requests
+ Interval int64 `json:"interval,omitempty"`
+}
+
+func (d DeviceAuthResponse) MarshalJSON() ([]byte, error) {
+ type Alias DeviceAuthResponse
+ var expiresIn int64
+ if !d.Expiry.IsZero() {
+ expiresIn = int64(time.Until(d.Expiry).Seconds())
+ }
+ return json.Marshal(&struct {
+ ExpiresIn int64 `json:"expires_in,omitempty"`
+ *Alias
+ }{
+ ExpiresIn: expiresIn,
+ Alias: (*Alias)(&d),
+ })
+
+}
+
+func (c *DeviceAuthResponse) UnmarshalJSON(data []byte) error {
+ type Alias DeviceAuthResponse
+ aux := &struct {
+ ExpiresIn int64 `json:"expires_in"`
+ // workaround misspelling of verification_uri
+ VerificationURL string `json:"verification_url"`
+ *Alias
+ }{
+ Alias: (*Alias)(c),
+ }
+ if err := json.Unmarshal(data, &aux); err != nil {
+ return err
+ }
+ if aux.ExpiresIn != 0 {
+ c.Expiry = time.Now().UTC().Add(time.Second * time.Duration(aux.ExpiresIn))
+ }
+ if c.VerificationURI == "" {
+ c.VerificationURI = aux.VerificationURL
+ }
+ return nil
+}
+
+// DeviceAuth returns a device auth struct which contains a device code
+// and authorization information provided for users to enter on another device.
+func (c *Config) DeviceAuth(ctx context.Context, opts ...AuthCodeOption) (*DeviceAuthResponse, error) {
+ // https://datatracker.ietf.org/doc/html/rfc8628#section-3.1
+ v := url.Values{
+ "client_id": {c.ClientID},
+ }
+ if len(c.Scopes) > 0 {
+ v.Set("scope", strings.Join(c.Scopes, " "))
+ }
+ for _, opt := range opts {
+ opt.setValue(v)
+ }
+ return retrieveDeviceAuth(ctx, c, v)
+}
+
+func retrieveDeviceAuth(ctx context.Context, c *Config, v url.Values) (*DeviceAuthResponse, error) {
+ if c.Endpoint.DeviceAuthURL == "" {
+ return nil, errors.New("endpoint missing DeviceAuthURL")
+ }
+
+ req, err := http.NewRequest("POST", c.Endpoint.DeviceAuthURL, strings.NewReader(v.Encode()))
+ if err != nil {
+ return nil, err
+ }
+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+ req.Header.Set("Accept", "application/json")
+
+ t := time.Now()
+ r, err := internal.ContextClient(ctx).Do(req)
+ if err != nil {
+ return nil, err
+ }
+
+ body, err := io.ReadAll(io.LimitReader(r.Body, 1<<20))
+ if err != nil {
+ return nil, fmt.Errorf("oauth2: cannot auth device: %v", err)
+ }
+ if code := r.StatusCode; code < 200 || code > 299 {
+ return nil, &RetrieveError{
+ Response: r,
+ Body: body,
+ }
+ }
+
+ da := &DeviceAuthResponse{}
+ err = json.Unmarshal(body, &da)
+ if err != nil {
+ return nil, fmt.Errorf("unmarshal %s", err)
+ }
+
+ if !da.Expiry.IsZero() {
+ // Make a small adjustment to account for time taken by the request
+ da.Expiry = da.Expiry.Add(-time.Since(t))
+ }
+
+ return da, nil
+}
+
+// DeviceAccessToken polls the server to exchange a device code for a token.
+func (c *Config) DeviceAccessToken(ctx context.Context, da *DeviceAuthResponse, opts ...AuthCodeOption) (*Token, error) {
+ if !da.Expiry.IsZero() {
+ var cancel context.CancelFunc
+ ctx, cancel = context.WithDeadline(ctx, da.Expiry)
+ defer cancel()
+ }
+
+ // https://datatracker.ietf.org/doc/html/rfc8628#section-3.4
+ v := url.Values{
+ "client_id": {c.ClientID},
+ "grant_type": {"urn:ietf:params:oauth:grant-type:device_code"},
+ "device_code": {da.DeviceCode},
+ }
+ if len(c.Scopes) > 0 {
+ v.Set("scope", strings.Join(c.Scopes, " "))
+ }
+ for _, opt := range opts {
+ opt.setValue(v)
+ }
+
+ // "If no value is provided, clients MUST use 5 as the default."
+ // https://datatracker.ietf.org/doc/html/rfc8628#section-3.2
+ interval := da.Interval
+ if interval == 0 {
+ interval = 5
+ }
+
+ ticker := time.NewTicker(time.Duration(interval) * time.Second)
+ defer ticker.Stop()
+ for {
+ select {
+ case <-ctx.Done():
+ return nil, ctx.Err()
+ case <-ticker.C:
+ tok, err := retrieveToken(ctx, c, v)
+ if err == nil {
+ return tok, nil
+ }
+
+ e, ok := err.(*RetrieveError)
+ if !ok {
+ return nil, err
+ }
+ switch e.ErrorCode {
+ case errSlowDown:
+ // https://datatracker.ietf.org/doc/html/rfc8628#section-3.5
+ // "the interval MUST be increased by 5 seconds for this and all subsequent requests"
+ interval += 5
+ ticker.Reset(time.Duration(interval) * time.Second)
+ case errAuthorizationPending:
+ // Do nothing.
+ case errAccessDenied, errExpiredToken:
+ fallthrough
+ default:
+ return tok, err
+ }
+ }
+ }
+}
diff --git a/vendor/golang.org/x/oauth2/internal/client_appengine.go b/vendor/golang.org/x/oauth2/internal/client_appengine.go
deleted file mode 100644
index e1755d1d9a..0000000000
--- a/vendor/golang.org/x/oauth2/internal/client_appengine.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build appengine
-// +build appengine
-
-package internal
-
-import "google.golang.org/appengine/urlfetch"
-
-func init() {
- appengineClientHook = urlfetch.Client
-}
diff --git a/vendor/golang.org/x/oauth2/internal/token.go b/vendor/golang.org/x/oauth2/internal/token.go
index 58901bda53..e83ddeef0f 100644
--- a/vendor/golang.org/x/oauth2/internal/token.go
+++ b/vendor/golang.org/x/oauth2/internal/token.go
@@ -18,6 +18,7 @@ import (
"strconv"
"strings"
"sync"
+ "sync/atomic"
"time"
)
@@ -115,41 +116,60 @@ const (
AuthStyleInHeader AuthStyle = 2
)
-// authStyleCache is the set of tokenURLs we've successfully used via
+// LazyAuthStyleCache is a backwards compatibility compromise to let Configs
+// have a lazily-initialized AuthStyleCache.
+//
+// The two users of this, oauth2.Config and oauth2/clientcredentials.Config,
+// both would ideally just embed an unexported AuthStyleCache but because both
+// were historically allowed to be copied by value we can't retroactively add an
+// uncopyable Mutex to them.
+//
+// We could use an atomic.Pointer, but that was added recently enough (in Go
+// 1.18) that we'd break Go 1.17 users where the tests as of 2023-08-03
+// still pass. By using an atomic.Value, it supports both Go 1.17 and
+// copying by value, even if that's not ideal.
+type LazyAuthStyleCache struct {
+ v atomic.Value // of *AuthStyleCache
+}
+
+func (lc *LazyAuthStyleCache) Get() *AuthStyleCache {
+ if c, ok := lc.v.Load().(*AuthStyleCache); ok {
+ return c
+ }
+ c := new(AuthStyleCache)
+ if !lc.v.CompareAndSwap(nil, c) {
+ c = lc.v.Load().(*AuthStyleCache)
+ }
+ return c
+}
+
+// AuthStyleCache is the set of tokenURLs we've successfully used via
// RetrieveToken and which style auth we ended up using.
// It's called a cache, but it doesn't (yet?) shrink. It's expected that
// the set of OAuth2 servers a program contacts over time is fixed and
// small.
-var authStyleCache struct {
- sync.Mutex
- m map[string]AuthStyle // keyed by tokenURL
-}
-
-// ResetAuthCache resets the global authentication style cache used
-// for AuthStyleUnknown token requests.
-func ResetAuthCache() {
- authStyleCache.Lock()
- defer authStyleCache.Unlock()
- authStyleCache.m = nil
+type AuthStyleCache struct {
+ mu sync.Mutex
+ m map[string]AuthStyle // keyed by tokenURL
}
// lookupAuthStyle reports which auth style we last used with tokenURL
// when calling RetrieveToken and whether we have ever done so.
-func lookupAuthStyle(tokenURL string) (style AuthStyle, ok bool) {
- authStyleCache.Lock()
- defer authStyleCache.Unlock()
- style, ok = authStyleCache.m[tokenURL]
+func (c *AuthStyleCache) lookupAuthStyle(tokenURL string) (style AuthStyle, ok bool) {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ style, ok = c.m[tokenURL]
return
}
// setAuthStyle adds an entry to authStyleCache, documented above.
-func setAuthStyle(tokenURL string, v AuthStyle) {
- authStyleCache.Lock()
- defer authStyleCache.Unlock()
- if authStyleCache.m == nil {
- authStyleCache.m = make(map[string]AuthStyle)
+func (c *AuthStyleCache) setAuthStyle(tokenURL string, v AuthStyle) {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ if c.m == nil {
+ c.m = make(map[string]AuthStyle)
}
- authStyleCache.m[tokenURL] = v
+ c.m[tokenURL] = v
}
// newTokenRequest returns a new *http.Request to retrieve a new token
@@ -189,10 +209,10 @@ func cloneURLValues(v url.Values) url.Values {
return v2
}
-func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values, authStyle AuthStyle) (*Token, error) {
+func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values, authStyle AuthStyle, styleCache *AuthStyleCache) (*Token, error) {
needsAuthStyleProbe := authStyle == 0
if needsAuthStyleProbe {
- if style, ok := lookupAuthStyle(tokenURL); ok {
+ if style, ok := styleCache.lookupAuthStyle(tokenURL); ok {
authStyle = style
needsAuthStyleProbe = false
} else {
@@ -222,7 +242,7 @@ func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string,
token, err = doTokenRoundTrip(ctx, req)
}
if needsAuthStyleProbe && err == nil {
- setAuthStyle(tokenURL, authStyle)
+ styleCache.setAuthStyle(tokenURL, authStyle)
}
// Don't overwrite `RefreshToken` with an empty value
// if this was a token refreshing request.
diff --git a/vendor/golang.org/x/oauth2/internal/transport.go b/vendor/golang.org/x/oauth2/internal/transport.go
index 572074a637..b9db01ddfd 100644
--- a/vendor/golang.org/x/oauth2/internal/transport.go
+++ b/vendor/golang.org/x/oauth2/internal/transport.go
@@ -18,16 +18,11 @@ var HTTPClient ContextKey
// because nobody else can create a ContextKey, being unexported.
type ContextKey struct{}
-var appengineClientHook func(context.Context) *http.Client
-
func ContextClient(ctx context.Context) *http.Client {
if ctx != nil {
if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok {
return hc
}
}
- if appengineClientHook != nil {
- return appengineClientHook(ctx)
- }
return http.DefaultClient
}
diff --git a/vendor/golang.org/x/oauth2/oauth2.go b/vendor/golang.org/x/oauth2/oauth2.go
index 9085fabe34..09f6a49b80 100644
--- a/vendor/golang.org/x/oauth2/oauth2.go
+++ b/vendor/golang.org/x/oauth2/oauth2.go
@@ -58,6 +58,10 @@ type Config struct {
// Scope specifies optional requested permissions.
Scopes []string
+
+ // authStyleCache caches which auth style to use when Endpoint.AuthStyle is
+ // the zero value (AuthStyleAutoDetect).
+ authStyleCache internal.LazyAuthStyleCache
}
// A TokenSource is anything that can return a token.
@@ -71,8 +75,9 @@ type TokenSource interface {
// Endpoint represents an OAuth 2.0 provider's authorization and token
// endpoint URLs.
type Endpoint struct {
- AuthURL string
- TokenURL string
+ AuthURL string
+ DeviceAuthURL string
+ TokenURL string
// AuthStyle optionally specifies how the endpoint wants the
// client ID & client secret sent. The zero value means to
@@ -139,15 +144,19 @@ func SetAuthURLParam(key, value string) AuthCodeOption {
// AuthCodeURL returns a URL to OAuth 2.0 provider's consent page
// that asks for permissions for the required scopes explicitly.
//
-// State is a token to protect the user from CSRF attacks. You must
-// always provide a non-empty string and validate that it matches the
-// state query parameter on your redirect callback.
-// See http://tools.ietf.org/html/rfc6749#section-10.12 for more info.
+// State is an opaque value used by the client to maintain state between the
+// request and callback. The authorization server includes this value when
+// redirecting the user agent back to the client.
//
// Opts may include AccessTypeOnline or AccessTypeOffline, as well
// as ApprovalForce.
-// It can also be used to pass the PKCE challenge.
-// See https://www.oauth.com/oauth2-servers/pkce/ for more info.
+//
+// To protect against CSRF attacks, opts should include a PKCE challenge
+// (S256ChallengeOption). Not all servers support PKCE. An alternative is to
+// generate a random state parameter and verify it after exchange.
+// See https://datatracker.ietf.org/doc/html/rfc6749#section-10.12 (predating
+// PKCE), https://www.oauth.com/oauth2-servers/pkce/ and
+// https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-09.html#name-cross-site-request-forgery (describing both approaches)
func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string {
var buf bytes.Buffer
buf.WriteString(c.Endpoint.AuthURL)
@@ -162,7 +171,6 @@ func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string {
v.Set("scope", strings.Join(c.Scopes, " "))
}
if state != "" {
- // TODO(light): Docs say never to omit state; don't allow empty.
v.Set("state", state)
}
for _, opt := range opts {
@@ -207,10 +215,11 @@ func (c *Config) PasswordCredentialsToken(ctx context.Context, username, passwor
// The provided context optionally controls which HTTP client is used. See the HTTPClient variable.
//
// The code will be in the *http.Request.FormValue("code"). Before
-// calling Exchange, be sure to validate FormValue("state").
+// calling Exchange, be sure to validate FormValue("state") if you are
+// using it to protect against CSRF attacks.
//
-// Opts may include the PKCE verifier code if previously used in AuthCodeURL.
-// See https://www.oauth.com/oauth2-servers/pkce/ for more info.
+// If using PKCE to protect against CSRF attacks, opts should include a
+// VerifierOption.
func (c *Config) Exchange(ctx context.Context, code string, opts ...AuthCodeOption) (*Token, error) {
v := url.Values{
"grant_type": {"authorization_code"},
@@ -384,7 +393,7 @@ func ReuseTokenSource(t *Token, src TokenSource) TokenSource {
}
}
-// ReuseTokenSource returns a TokenSource that acts in the same manner as the
+// ReuseTokenSourceWithExpiry returns a TokenSource that acts in the same manner as the
// TokenSource returned by ReuseTokenSource, except the expiry buffer is
// configurable. The expiration time of a token is calculated as
// t.Expiry.Add(-earlyExpiry).
diff --git a/vendor/golang.org/x/oauth2/pkce.go b/vendor/golang.org/x/oauth2/pkce.go
new file mode 100644
index 0000000000..50593b6dfe
--- /dev/null
+++ b/vendor/golang.org/x/oauth2/pkce.go
@@ -0,0 +1,68 @@
+// Copyright 2023 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 oauth2
+
+import (
+ "crypto/rand"
+ "crypto/sha256"
+ "encoding/base64"
+ "net/url"
+)
+
+const (
+ codeChallengeKey = "code_challenge"
+ codeChallengeMethodKey = "code_challenge_method"
+ codeVerifierKey = "code_verifier"
+)
+
+// GenerateVerifier generates a PKCE code verifier with 32 octets of randomness.
+// This follows recommendations in RFC 7636.
+//
+// A fresh verifier should be generated for each authorization.
+// S256ChallengeOption(verifier) should then be passed to Config.AuthCodeURL
+// (or Config.DeviceAccess) and VerifierOption(verifier) to Config.Exchange
+// (or Config.DeviceAccessToken).
+func GenerateVerifier() string {
+ // "RECOMMENDED that the output of a suitable random number generator be
+ // used to create a 32-octet sequence. The octet sequence is then
+ // base64url-encoded to produce a 43-octet URL-safe string to use as the
+ // code verifier."
+ // https://datatracker.ietf.org/doc/html/rfc7636#section-4.1
+ data := make([]byte, 32)
+ if _, err := rand.Read(data); err != nil {
+ panic(err)
+ }
+ return base64.RawURLEncoding.EncodeToString(data)
+}
+
+// VerifierOption returns a PKCE code verifier AuthCodeOption. It should be
+// passed to Config.Exchange or Config.DeviceAccessToken only.
+func VerifierOption(verifier string) AuthCodeOption {
+ return setParam{k: codeVerifierKey, v: verifier}
+}
+
+// S256ChallengeFromVerifier returns a PKCE code challenge derived from verifier with method S256.
+//
+// Prefer to use S256ChallengeOption where possible.
+func S256ChallengeFromVerifier(verifier string) string {
+ sha := sha256.Sum256([]byte(verifier))
+ return base64.RawURLEncoding.EncodeToString(sha[:])
+}
+
+// S256ChallengeOption derives a PKCE code challenge derived from verifier with
+// method S256. It should be passed to Config.AuthCodeURL or Config.DeviceAccess
+// only.
+func S256ChallengeOption(verifier string) AuthCodeOption {
+ return challengeOption{
+ challenge_method: "S256",
+ challenge: S256ChallengeFromVerifier(verifier),
+ }
+}
+
+type challengeOption struct{ challenge_method, challenge string }
+
+func (p challengeOption) setValue(m url.Values) {
+ m.Set(codeChallengeMethodKey, p.challenge_method)
+ m.Set(codeChallengeKey, p.challenge)
+}
diff --git a/vendor/golang.org/x/oauth2/token.go b/vendor/golang.org/x/oauth2/token.go
index 5ffce9764b..5bbb332174 100644
--- a/vendor/golang.org/x/oauth2/token.go
+++ b/vendor/golang.org/x/oauth2/token.go
@@ -164,7 +164,7 @@ func tokenFromInternal(t *internal.Token) *Token {
// This token is then mapped from *internal.Token into an *oauth2.Token which is returned along
// with an error..
func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) {
- tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v, internal.AuthStyle(c.Endpoint.AuthStyle))
+ tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v, internal.AuthStyle(c.Endpoint.AuthStyle), c.authStyleCache.Get())
if err != nil {
if rErr, ok := err.(*internal.RetrieveError); ok {
return nil, (*RetrieveError)(rErr)
diff --git a/vendor/golang.org/x/sync/LICENSE b/vendor/golang.org/x/sync/LICENSE
index 6a66aea5ea..2a7cf70da6 100644
--- a/vendor/golang.org/x/sync/LICENSE
+++ b/vendor/golang.org/x/sync/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
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
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/sys/LICENSE b/vendor/golang.org/x/sys/LICENSE
index 6a66aea5ea..2a7cf70da6 100644
--- a/vendor/golang.org/x/sys/LICENSE
+++ b/vendor/golang.org/x/sys/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
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
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go
index 4756ad5f79..02609d5b21 100644
--- a/vendor/golang.org/x/sys/cpu/cpu.go
+++ b/vendor/golang.org/x/sys/cpu/cpu.go
@@ -103,7 +103,10 @@ var ARM64 struct {
HasASIMDDP bool // Advanced SIMD double precision instruction set
HasSHA512 bool // SHA512 hardware implementation
HasSVE bool // Scalable Vector Extensions
+ HasSVE2 bool // Scalable Vector Extensions 2
HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32
+ HasDIT bool // Data Independent Timing support
+ HasI8MM bool // Advanced SIMD Int8 matrix multiplication instructions
_ CacheLinePad
}
@@ -198,6 +201,25 @@ var S390X struct {
_ CacheLinePad
}
+// RISCV64 contains the supported CPU features and performance characteristics for riscv64
+// platforms. The booleans in RISCV64, with the exception of HasFastMisaligned, indicate
+// the presence of RISC-V extensions.
+//
+// It is safe to assume that all the RV64G extensions are supported and so they are omitted from
+// this structure. As riscv64 Go programs require at least RV64G, the code that populates
+// this structure cannot run successfully if some of the RV64G extensions are missing.
+// The struct is padded to avoid false sharing.
+var RISCV64 struct {
+ _ CacheLinePad
+ HasFastMisaligned bool // Fast misaligned accesses
+ HasC bool // Compressed instruction-set extension
+ HasV bool // Vector extension compatible with RVV 1.0
+ HasZba bool // Address generation instructions extension
+ HasZbb bool // Basic bit-manipulation extension
+ HasZbs bool // Single-bit instructions extension
+ _ CacheLinePad
+}
+
func init() {
archInit()
initOptions()
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
index f3eb993bf2..af2aa99f9f 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
@@ -28,6 +28,7 @@ func initOptions() {
{Name: "sm3", Feature: &ARM64.HasSM3},
{Name: "sm4", Feature: &ARM64.HasSM4},
{Name: "sve", Feature: &ARM64.HasSVE},
+ {Name: "sve2", Feature: &ARM64.HasSVE2},
{Name: "crc32", Feature: &ARM64.HasCRC32},
{Name: "atomics", Feature: &ARM64.HasATOMICS},
{Name: "asimdhp", Feature: &ARM64.HasASIMDHP},
@@ -37,6 +38,8 @@ func initOptions() {
{Name: "dcpop", Feature: &ARM64.HasDCPOP},
{Name: "asimddp", Feature: &ARM64.HasASIMDDP},
{Name: "asimdfhm", Feature: &ARM64.HasASIMDFHM},
+ {Name: "dit", Feature: &ARM64.HasDIT},
+ {Name: "i8mm", Feature: &ARM64.HasI8MM},
}
}
@@ -144,6 +147,11 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {
ARM64.HasLRCPC = true
}
+ switch extractBits(isar1, 52, 55) {
+ case 1:
+ ARM64.HasI8MM = true
+ }
+
// ID_AA64PFR0_EL1
switch extractBits(pfr0, 16, 19) {
case 0:
@@ -164,6 +172,20 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {
switch extractBits(pfr0, 32, 35) {
case 1:
ARM64.HasSVE = true
+
+ parseARM64SVERegister(getzfr0())
+ }
+
+ switch extractBits(pfr0, 48, 51) {
+ case 1:
+ ARM64.HasDIT = true
+ }
+}
+
+func parseARM64SVERegister(zfr0 uint64) {
+ switch extractBits(zfr0, 0, 3) {
+ case 1:
+ ARM64.HasSVE2 = true
}
}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/vendor/golang.org/x/sys/cpu/cpu_arm64.s
index fcb9a38882..22cc99844a 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_arm64.s
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.s
@@ -29,3 +29,11 @@ TEXT ·getpfr0(SB),NOSPLIT,$0-8
WORD $0xd5380400
MOVD R0, ret+0(FP)
RET
+
+// func getzfr0() uint64
+TEXT ·getzfr0(SB),NOSPLIT,$0-8
+ // get SVE Feature Register 0 into x0
+ // mrs x0, ID_AA64ZFR0_EL1 = d5380480
+ WORD $0xd5380480
+ MOVD R0, ret+0(FP)
+ RET
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
index a8acd3e328..6ac6e1efb2 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
@@ -9,3 +9,4 @@ package cpu
func getisar0() uint64
func getisar1() uint64
func getpfr0() uint64
+func getzfr0() uint64
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
index a968b80fa6..08f35ea177 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
@@ -35,6 +35,10 @@ const (
hwcap_SHA512 = 1 << 21
hwcap_SVE = 1 << 22
hwcap_ASIMDFHM = 1 << 23
+ hwcap_DIT = 1 << 24
+
+ hwcap2_SVE2 = 1 << 1
+ hwcap2_I8MM = 1 << 13
)
// linuxKernelCanEmulateCPUID reports whether we're running
@@ -104,6 +108,12 @@ func doinit() {
ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512)
ARM64.HasSVE = isSet(hwCap, hwcap_SVE)
ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM)
+ ARM64.HasDIT = isSet(hwCap, hwcap_DIT)
+
+
+ // HWCAP2 feature bits
+ ARM64.HasSVE2 = isSet(hwCap2, hwcap2_SVE2)
+ ARM64.HasI8MM = isSet(hwCap2, hwcap2_I8MM)
}
func isSet(hwc uint, value uint) bool {
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
index cd63e73355..7d902b6847 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.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.
-//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x
+//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64
package cpu
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go
new file mode 100644
index 0000000000..cb4a0c5728
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go
@@ -0,0 +1,137 @@
+// Copyright 2024 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 cpu
+
+import (
+ "syscall"
+ "unsafe"
+)
+
+// RISC-V extension discovery code for Linux. The approach here is to first try the riscv_hwprobe
+// syscall falling back to HWCAP to check for the C extension if riscv_hwprobe is not available.
+//
+// A note on detection of the Vector extension using HWCAP.
+//
+// Support for the Vector extension version 1.0 was added to the Linux kernel in release 6.5.
+// Support for the riscv_hwprobe syscall was added in 6.4. It follows that if the riscv_hwprobe
+// syscall is not available then neither is the Vector extension (which needs kernel support).
+// The riscv_hwprobe syscall should then be all we need to detect the Vector extension.
+// However, some RISC-V board manufacturers ship boards with an older kernel on top of which
+// they have back-ported various versions of the Vector extension patches but not the riscv_hwprobe
+// patches. These kernels advertise support for the Vector extension using HWCAP. Falling
+// back to HWCAP to detect the Vector extension, if riscv_hwprobe is not available, or simply not
+// bothering with riscv_hwprobe at all and just using HWCAP may then seem like an attractive option.
+//
+// Unfortunately, simply checking the 'V' bit in AT_HWCAP will not work as this bit is used by
+// RISC-V board and cloud instance providers to mean different things. The Lichee Pi 4A board
+// and the Scaleway RV1 cloud instances use the 'V' bit to advertise their support for the unratified
+// 0.7.1 version of the Vector Specification. The Banana Pi BPI-F3 and the CanMV-K230 board use
+// it to advertise support for 1.0 of the Vector extension. Versions 0.7.1 and 1.0 of the Vector
+// extension are binary incompatible. HWCAP can then not be used in isolation to populate the
+// HasV field as this field indicates that the underlying CPU is compatible with RVV 1.0.
+//
+// There is a way at runtime to distinguish between versions 0.7.1 and 1.0 of the Vector
+// specification by issuing a RVV 1.0 vsetvli instruction and checking the vill bit of the vtype
+// register. This check would allow us to safely detect version 1.0 of the Vector extension
+// with HWCAP, if riscv_hwprobe were not available. However, the check cannot
+// be added until the assembler supports the Vector instructions.
+//
+// Note the riscv_hwprobe syscall does not suffer from these ambiguities by design as all of the
+// extensions it advertises support for are explicitly versioned. It's also worth noting that
+// the riscv_hwprobe syscall is the only way to detect multi-letter RISC-V extensions, e.g., Zba.
+// These cannot be detected using HWCAP and so riscv_hwprobe must be used to detect the majority
+// of RISC-V extensions.
+//
+// Please see https://docs.kernel.org/arch/riscv/hwprobe.html for more information.
+
+// golang.org/x/sys/cpu is not allowed to depend on golang.org/x/sys/unix so we must
+// reproduce the constants, types and functions needed to make the riscv_hwprobe syscall
+// here.
+
+const (
+ // Copied from golang.org/x/sys/unix/ztypes_linux_riscv64.go.
+ riscv_HWPROBE_KEY_IMA_EXT_0 = 0x4
+ riscv_HWPROBE_IMA_C = 0x2
+ riscv_HWPROBE_IMA_V = 0x4
+ riscv_HWPROBE_EXT_ZBA = 0x8
+ riscv_HWPROBE_EXT_ZBB = 0x10
+ riscv_HWPROBE_EXT_ZBS = 0x20
+ riscv_HWPROBE_KEY_CPUPERF_0 = 0x5
+ riscv_HWPROBE_MISALIGNED_FAST = 0x3
+ riscv_HWPROBE_MISALIGNED_MASK = 0x7
+)
+
+const (
+ // sys_RISCV_HWPROBE is copied from golang.org/x/sys/unix/zsysnum_linux_riscv64.go.
+ sys_RISCV_HWPROBE = 258
+)
+
+// riscvHWProbePairs is copied from golang.org/x/sys/unix/ztypes_linux_riscv64.go.
+type riscvHWProbePairs struct {
+ key int64
+ value uint64
+}
+
+const (
+ // CPU features
+ hwcap_RISCV_ISA_C = 1 << ('C' - 'A')
+)
+
+func doinit() {
+ // A slice of key/value pair structures is passed to the RISCVHWProbe syscall. The key
+ // field should be initialised with one of the key constants defined above, e.g.,
+ // RISCV_HWPROBE_KEY_IMA_EXT_0. The syscall will set the value field to the appropriate value.
+ // If the kernel does not recognise a key it will set the key field to -1 and the value field to 0.
+
+ pairs := []riscvHWProbePairs{
+ {riscv_HWPROBE_KEY_IMA_EXT_0, 0},
+ {riscv_HWPROBE_KEY_CPUPERF_0, 0},
+ }
+
+ // This call only indicates that extensions are supported if they are implemented on all cores.
+ if riscvHWProbe(pairs, 0) {
+ if pairs[0].key != -1 {
+ v := uint(pairs[0].value)
+ RISCV64.HasC = isSet(v, riscv_HWPROBE_IMA_C)
+ RISCV64.HasV = isSet(v, riscv_HWPROBE_IMA_V)
+ RISCV64.HasZba = isSet(v, riscv_HWPROBE_EXT_ZBA)
+ RISCV64.HasZbb = isSet(v, riscv_HWPROBE_EXT_ZBB)
+ RISCV64.HasZbs = isSet(v, riscv_HWPROBE_EXT_ZBS)
+ }
+ if pairs[1].key != -1 {
+ v := pairs[1].value & riscv_HWPROBE_MISALIGNED_MASK
+ RISCV64.HasFastMisaligned = v == riscv_HWPROBE_MISALIGNED_FAST
+ }
+ }
+
+ // Let's double check with HWCAP if the C extension does not appear to be supported.
+ // This may happen if we're running on a kernel older than 6.4.
+
+ if !RISCV64.HasC {
+ RISCV64.HasC = isSet(hwCap, hwcap_RISCV_ISA_C)
+ }
+}
+
+func isSet(hwc uint, value uint) bool {
+ return hwc&value != 0
+}
+
+// riscvHWProbe is a simplified version of the generated wrapper function found in
+// golang.org/x/sys/unix/zsyscall_linux_riscv64.go. We simplify it by removing the
+// cpuCount and cpus parameters which we do not need. We always want to pass 0 for
+// these parameters here so the kernel only reports the extensions that are present
+// on all cores.
+func riscvHWProbe(pairs []riscvHWProbePairs, flags uint) bool {
+ var _zero uintptr
+ var p0 unsafe.Pointer
+ if len(pairs) > 0 {
+ p0 = unsafe.Pointer(&pairs[0])
+ } else {
+ p0 = unsafe.Pointer(&_zero)
+ }
+
+ _, _, e1 := syscall.Syscall6(sys_RISCV_HWPROBE, uintptr(p0), uintptr(len(pairs)), uintptr(0), uintptr(0), uintptr(flags), 0)
+ return e1 == 0
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
index 7f0c79c004..aca3199c91 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
@@ -8,4 +8,13 @@ package cpu
const cacheLineSize = 64
-func initOptions() {}
+func initOptions() {
+ options = []option{
+ {Name: "fastmisaligned", Feature: &RISCV64.HasFastMisaligned},
+ {Name: "c", Feature: &RISCV64.HasC},
+ {Name: "v", Feature: &RISCV64.HasV},
+ {Name: "zba", Feature: &RISCV64.HasZba},
+ {Name: "zbb", Feature: &RISCV64.HasZbb},
+ {Name: "zbs", Feature: &RISCV64.HasZbs},
+ }
+}
diff --git a/vendor/golang.org/x/sys/unix/asm_zos_s390x.s b/vendor/golang.org/x/sys/unix/asm_zos_s390x.s
index 2f67ba86d5..813dfad7d2 100644
--- a/vendor/golang.org/x/sys/unix/asm_zos_s390x.s
+++ b/vendor/golang.org/x/sys/unix/asm_zos_s390x.s
@@ -9,9 +9,11 @@
#define PSALAA 1208(R0)
#define GTAB64(x) 80(x)
#define LCA64(x) 88(x)
+#define SAVSTACK_ASYNC(x) 336(x) // in the LCA
#define CAA(x) 8(x)
-#define EDCHPXV(x) 1016(x) // in the CAA
-#define SAVSTACK_ASYNC(x) 336(x) // in the LCA
+#define CEECAATHDID(x) 976(x) // in the CAA
+#define EDCHPXV(x) 1016(x) // in the CAA
+#define GOCB(x) 1104(x) // in the CAA
// SS_*, where x=SAVSTACK_ASYNC
#define SS_LE(x) 0(x)
@@ -19,405 +21,362 @@
#define SS_ERRNO(x) 16(x)
#define SS_ERRNOJR(x) 20(x)
-#define LE_CALL BYTE $0x0D; BYTE $0x76; // BL R7, R6
+// Function Descriptor Offsets
+#define __errno 0x156*16
+#define __err2ad 0x16C*16
-TEXT ·clearErrno(SB),NOSPLIT,$0-0
- BL addrerrno<>(SB)
- MOVD $0, 0(R3)
+// Call Instructions
+#define LE_CALL BYTE $0x0D; BYTE $0x76 // BL R7, R6
+#define SVC_LOAD BYTE $0x0A; BYTE $0x08 // SVC 08 LOAD
+#define SVC_DELETE BYTE $0x0A; BYTE $0x09 // SVC 09 DELETE
+
+DATA zosLibVec<>(SB)/8, $0
+GLOBL zosLibVec<>(SB), NOPTR, $8
+
+TEXT ·initZosLibVec(SB), NOSPLIT|NOFRAME, $0-0
+ MOVW PSALAA, R8
+ MOVD LCA64(R8), R8
+ MOVD CAA(R8), R8
+ MOVD EDCHPXV(R8), R8
+ MOVD R8, zosLibVec<>(SB)
+ RET
+
+TEXT ·GetZosLibVec(SB), NOSPLIT|NOFRAME, $0-0
+ MOVD zosLibVec<>(SB), R8
+ MOVD R8, ret+0(FP)
+ RET
+
+TEXT ·clearErrno(SB), NOSPLIT, $0-0
+ BL addrerrno<>(SB)
+ MOVD $0, 0(R3)
RET
// Returns the address of errno in R3.
-TEXT addrerrno<>(SB),NOSPLIT|NOFRAME,$0-0
+TEXT addrerrno<>(SB), NOSPLIT|NOFRAME, $0-0
// Get library control area (LCA).
- MOVW PSALAA, R8
- MOVD LCA64(R8), R8
+ MOVW PSALAA, R8
+ MOVD LCA64(R8), R8
// Get __errno FuncDesc.
- MOVD CAA(R8), R9
- MOVD EDCHPXV(R9), R9
- ADD $(0x156*16), R9
- LMG 0(R9), R5, R6
+ MOVD CAA(R8), R9
+ MOVD EDCHPXV(R9), R9
+ ADD $(__errno), R9
+ LMG 0(R9), R5, R6
// Switch to saved LE stack.
- MOVD SAVSTACK_ASYNC(R8), R9
- MOVD 0(R9), R4
- MOVD $0, 0(R9)
+ MOVD SAVSTACK_ASYNC(R8), R9
+ MOVD 0(R9), R4
+ MOVD $0, 0(R9)
// Call __errno function.
LE_CALL
NOPH
// Switch back to Go stack.
- XOR R0, R0 // Restore R0 to $0.
- MOVD R4, 0(R9) // Save stack pointer.
+ XOR R0, R0 // Restore R0 to $0.
+ MOVD R4, 0(R9) // Save stack pointer.
RET
-TEXT ·syscall_syscall(SB),NOSPLIT,$0-56
- BL runtime·entersyscall(SB)
- MOVD a1+8(FP), R1
- MOVD a2+16(FP), R2
- MOVD a3+24(FP), R3
+// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64)
+TEXT ·svcCall(SB), NOSPLIT, $0
+ BL runtime·save_g(SB) // Save g and stack pointer
+ MOVW PSALAA, R8
+ MOVD LCA64(R8), R8
+ MOVD SAVSTACK_ASYNC(R8), R9
+ MOVD R15, 0(R9)
- // Get library control area (LCA).
- MOVW PSALAA, R8
- MOVD LCA64(R8), R8
+ MOVD argv+8(FP), R1 // Move function arguments into registers
+ MOVD dsa+16(FP), g
+ MOVD fnptr+0(FP), R15
- // Get function.
- MOVD CAA(R8), R9
- MOVD EDCHPXV(R9), R9
- MOVD trap+0(FP), R5
- SLD $4, R5
- ADD R5, R9
- LMG 0(R9), R5, R6
+ BYTE $0x0D // Branch to function
+ BYTE $0xEF
- // Restore LE stack.
- MOVD SAVSTACK_ASYNC(R8), R9
- MOVD 0(R9), R4
- MOVD $0, 0(R9)
+ BL runtime·load_g(SB) // Restore g and stack pointer
+ MOVW PSALAA, R8
+ MOVD LCA64(R8), R8
+ MOVD SAVSTACK_ASYNC(R8), R9
+ MOVD 0(R9), R15
- // Call function.
- LE_CALL
- NOPH
- XOR R0, R0 // Restore R0 to $0.
- MOVD R4, 0(R9) // Save stack pointer.
-
- MOVD R3, r1+32(FP)
- MOVD R0, r2+40(FP)
- MOVD R0, err+48(FP)
- MOVW R3, R4
- CMP R4, $-1
- BNE done
- BL addrerrno<>(SB)
- MOVWZ 0(R3), R3
- MOVD R3, err+48(FP)
-done:
- BL runtime·exitsyscall(SB)
RET
-TEXT ·syscall_rawsyscall(SB),NOSPLIT,$0-56
- MOVD a1+8(FP), R1
- MOVD a2+16(FP), R2
- MOVD a3+24(FP), R3
-
- // Get library control area (LCA).
- MOVW PSALAA, R8
- MOVD LCA64(R8), R8
-
- // Get function.
- MOVD CAA(R8), R9
- MOVD EDCHPXV(R9), R9
- MOVD trap+0(FP), R5
- SLD $4, R5
- ADD R5, R9
- LMG 0(R9), R5, R6
+// func svcLoad(name *byte) unsafe.Pointer
+TEXT ·svcLoad(SB), NOSPLIT, $0
+ MOVD R15, R2 // Save go stack pointer
+ MOVD name+0(FP), R0 // Move SVC args into registers
+ MOVD $0x80000000, R1
+ MOVD $0, R15
+ SVC_LOAD
+ MOVW R15, R3 // Save return code from SVC
+ MOVD R2, R15 // Restore go stack pointer
+ CMP R3, $0 // Check SVC return code
+ BNE error
+
+ MOVD $-2, R3 // Reset last bit of entry point to zero
+ AND R0, R3
+ MOVD R3, ret+8(FP) // Return entry point returned by SVC
+ CMP R0, R3 // Check if last bit of entry point was set
+ BNE done
+
+ MOVD R15, R2 // Save go stack pointer
+ MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08)
+ SVC_DELETE
+ MOVD R2, R15 // Restore go stack pointer
- // Restore LE stack.
- MOVD SAVSTACK_ASYNC(R8), R9
- MOVD 0(R9), R4
- MOVD $0, 0(R9)
+error:
+ MOVD $0, ret+8(FP) // Return 0 on failure
- // Call function.
- LE_CALL
- NOPH
- XOR R0, R0 // Restore R0 to $0.
- MOVD R4, 0(R9) // Save stack pointer.
-
- MOVD R3, r1+32(FP)
- MOVD R0, r2+40(FP)
- MOVD R0, err+48(FP)
- MOVW R3, R4
- CMP R4, $-1
- BNE done
- BL addrerrno<>(SB)
- MOVWZ 0(R3), R3
- MOVD R3, err+48(FP)
done:
+ XOR R0, R0 // Reset r0 to 0
RET
-TEXT ·syscall_syscall6(SB),NOSPLIT,$0-80
- BL runtime·entersyscall(SB)
- MOVD a1+8(FP), R1
- MOVD a2+16(FP), R2
- MOVD a3+24(FP), R3
+// func svcUnload(name *byte, fnptr unsafe.Pointer) int64
+TEXT ·svcUnload(SB), NOSPLIT, $0
+ MOVD R15, R2 // Save go stack pointer
+ MOVD name+0(FP), R0 // Move SVC args into registers
+ MOVD fnptr+8(FP), R15
+ SVC_DELETE
+ XOR R0, R0 // Reset r0 to 0
+ MOVD R15, R1 // Save SVC return code
+ MOVD R2, R15 // Restore go stack pointer
+ MOVD R1, ret+16(FP) // Return SVC return code
+ RET
+// func gettid() uint64
+TEXT ·gettid(SB), NOSPLIT, $0
// Get library control area (LCA).
- MOVW PSALAA, R8
- MOVD LCA64(R8), R8
+ MOVW PSALAA, R8
+ MOVD LCA64(R8), R8
- // Get function.
- MOVD CAA(R8), R9
- MOVD EDCHPXV(R9), R9
- MOVD trap+0(FP), R5
- SLD $4, R5
- ADD R5, R9
- LMG 0(R9), R5, R6
+ // Get CEECAATHDID
+ MOVD CAA(R8), R9
+ MOVD CEECAATHDID(R9), R9
+ MOVD R9, ret+0(FP)
- // Restore LE stack.
- MOVD SAVSTACK_ASYNC(R8), R9
- MOVD 0(R9), R4
- MOVD $0, 0(R9)
-
- // Fill in parameter list.
- MOVD a4+32(FP), R12
- MOVD R12, (2176+24)(R4)
- MOVD a5+40(FP), R12
- MOVD R12, (2176+32)(R4)
- MOVD a6+48(FP), R12
- MOVD R12, (2176+40)(R4)
-
- // Call function.
- LE_CALL
- NOPH
- XOR R0, R0 // Restore R0 to $0.
- MOVD R4, 0(R9) // Save stack pointer.
-
- MOVD R3, r1+56(FP)
- MOVD R0, r2+64(FP)
- MOVD R0, err+72(FP)
- MOVW R3, R4
- CMP R4, $-1
- BNE done
- BL addrerrno<>(SB)
- MOVWZ 0(R3), R3
- MOVD R3, err+72(FP)
-done:
- BL runtime·exitsyscall(SB)
RET
-TEXT ·syscall_rawsyscall6(SB),NOSPLIT,$0-80
- MOVD a1+8(FP), R1
- MOVD a2+16(FP), R2
- MOVD a3+24(FP), R3
-
- // Get library control area (LCA).
- MOVW PSALAA, R8
- MOVD LCA64(R8), R8
-
- // Get function.
- MOVD CAA(R8), R9
- MOVD EDCHPXV(R9), R9
- MOVD trap+0(FP), R5
- SLD $4, R5
- ADD R5, R9
- LMG 0(R9), R5, R6
+//
+// Call LE function, if the return is -1
+// errno and errno2 is retrieved
+//
+TEXT ·CallLeFuncWithErr(SB), NOSPLIT, $0
+ MOVW PSALAA, R8
+ MOVD LCA64(R8), R8
+ MOVD CAA(R8), R9
+ MOVD g, GOCB(R9)
// Restore LE stack.
- MOVD SAVSTACK_ASYNC(R8), R9
- MOVD 0(R9), R4
- MOVD $0, 0(R9)
-
- // Fill in parameter list.
- MOVD a4+32(FP), R12
- MOVD R12, (2176+24)(R4)
- MOVD a5+40(FP), R12
- MOVD R12, (2176+32)(R4)
- MOVD a6+48(FP), R12
- MOVD R12, (2176+40)(R4)
-
- // Call function.
- LE_CALL
+ MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address
+ MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer
+
+ MOVD parms_base+8(FP), R7 // R7 -> argument array
+ MOVD parms_len+16(FP), R8 // R8 number of arguments
+
+ // arg 1 ---> R1
+ CMP R8, $0
+ BEQ docall
+ SUB $1, R8
+ MOVD 0(R7), R1
+
+ // arg 2 ---> R2
+ CMP R8, $0
+ BEQ docall
+ SUB $1, R8
+ ADD $8, R7
+ MOVD 0(R7), R2
+
+ // arg 3 --> R3
+ CMP R8, $0
+ BEQ docall
+ SUB $1, R8
+ ADD $8, R7
+ MOVD 0(R7), R3
+
+ CMP R8, $0
+ BEQ docall
+ MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument
+
+repeat:
+ ADD $8, R7
+ MOVD 0(R7), R0 // advance arg pointer by 8 byte
+ ADD $8, R6 // advance LE argument address by 8 byte
+ MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame
+ SUB $1, R8
+ CMP R8, $0
+ BNE repeat
+
+docall:
+ MOVD funcdesc+0(FP), R8 // R8-> function descriptor
+ LMG 0(R8), R5, R6
+ MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC
+ LE_CALL // balr R7, R6 (return #1)
+ NOPH
+ MOVD R3, ret+32(FP)
+ CMP R3, $-1 // compare result to -1
+ BNE done
+
+ // retrieve errno and errno2
+ MOVD zosLibVec<>(SB), R8
+ ADD $(__errno), R8
+ LMG 0(R8), R5, R6
+ LE_CALL // balr R7, R6 __errno (return #3)
NOPH
- XOR R0, R0 // Restore R0 to $0.
- MOVD R4, 0(R9) // Save stack pointer.
-
- MOVD R3, r1+56(FP)
- MOVD R0, r2+64(FP)
- MOVD R0, err+72(FP)
- MOVW R3, R4
- CMP R4, $-1
- BNE done
- BL ·rrno<>(SB)
- MOVWZ 0(R3), R3
- MOVD R3, err+72(FP)
+ MOVWZ 0(R3), R3
+ MOVD R3, err+48(FP)
+ MOVD zosLibVec<>(SB), R8
+ ADD $(__err2ad), R8
+ LMG 0(R8), R5, R6
+ LE_CALL // balr R7, R6 __err2ad (return #2)
+ NOPH
+ MOVW (R3), R2 // retrieve errno2
+ MOVD R2, errno2+40(FP) // store in return area
+
done:
+ MOVD R4, 0(R9) // Save stack pointer.
RET
-TEXT ·syscall_syscall9(SB),NOSPLIT,$0
- BL runtime·entersyscall(SB)
- MOVD a1+8(FP), R1
- MOVD a2+16(FP), R2
- MOVD a3+24(FP), R3
-
- // Get library control area (LCA).
- MOVW PSALAA, R8
- MOVD LCA64(R8), R8
-
- // Get function.
- MOVD CAA(R8), R9
- MOVD EDCHPXV(R9), R9
- MOVD trap+0(FP), R5
- SLD $4, R5
- ADD R5, R9
- LMG 0(R9), R5, R6
+//
+// Call LE function, if the return is 0
+// errno and errno2 is retrieved
+//
+TEXT ·CallLeFuncWithPtrReturn(SB), NOSPLIT, $0
+ MOVW PSALAA, R8
+ MOVD LCA64(R8), R8
+ MOVD CAA(R8), R9
+ MOVD g, GOCB(R9)
// Restore LE stack.
- MOVD SAVSTACK_ASYNC(R8), R9
- MOVD 0(R9), R4
- MOVD $0, 0(R9)
-
- // Fill in parameter list.
- MOVD a4+32(FP), R12
- MOVD R12, (2176+24)(R4)
- MOVD a5+40(FP), R12
- MOVD R12, (2176+32)(R4)
- MOVD a6+48(FP), R12
- MOVD R12, (2176+40)(R4)
- MOVD a7+56(FP), R12
- MOVD R12, (2176+48)(R4)
- MOVD a8+64(FP), R12
- MOVD R12, (2176+56)(R4)
- MOVD a9+72(FP), R12
- MOVD R12, (2176+64)(R4)
-
- // Call function.
- LE_CALL
+ MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address
+ MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer
+
+ MOVD parms_base+8(FP), R7 // R7 -> argument array
+ MOVD parms_len+16(FP), R8 // R8 number of arguments
+
+ // arg 1 ---> R1
+ CMP R8, $0
+ BEQ docall
+ SUB $1, R8
+ MOVD 0(R7), R1
+
+ // arg 2 ---> R2
+ CMP R8, $0
+ BEQ docall
+ SUB $1, R8
+ ADD $8, R7
+ MOVD 0(R7), R2
+
+ // arg 3 --> R3
+ CMP R8, $0
+ BEQ docall
+ SUB $1, R8
+ ADD $8, R7
+ MOVD 0(R7), R3
+
+ CMP R8, $0
+ BEQ docall
+ MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument
+
+repeat:
+ ADD $8, R7
+ MOVD 0(R7), R0 // advance arg pointer by 8 byte
+ ADD $8, R6 // advance LE argument address by 8 byte
+ MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame
+ SUB $1, R8
+ CMP R8, $0
+ BNE repeat
+
+docall:
+ MOVD funcdesc+0(FP), R8 // R8-> function descriptor
+ LMG 0(R8), R5, R6
+ MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC
+ LE_CALL // balr R7, R6 (return #1)
NOPH
- XOR R0, R0 // Restore R0 to $0.
- MOVD R4, 0(R9) // Save stack pointer.
-
- MOVD R3, r1+80(FP)
- MOVD R0, r2+88(FP)
- MOVD R0, err+96(FP)
- MOVW R3, R4
- CMP R4, $-1
- BNE done
- BL addrerrno<>(SB)
- MOVWZ 0(R3), R3
- MOVD R3, err+96(FP)
-done:
- BL runtime·exitsyscall(SB)
- RET
-
-TEXT ·syscall_rawsyscall9(SB),NOSPLIT,$0
- MOVD a1+8(FP), R1
- MOVD a2+16(FP), R2
- MOVD a3+24(FP), R3
-
- // Get library control area (LCA).
- MOVW PSALAA, R8
- MOVD LCA64(R8), R8
-
- // Get function.
- MOVD CAA(R8), R9
- MOVD EDCHPXV(R9), R9
- MOVD trap+0(FP), R5
- SLD $4, R5
- ADD R5, R9
- LMG 0(R9), R5, R6
-
- // Restore LE stack.
- MOVD SAVSTACK_ASYNC(R8), R9
- MOVD 0(R9), R4
- MOVD $0, 0(R9)
-
- // Fill in parameter list.
- MOVD a4+32(FP), R12
- MOVD R12, (2176+24)(R4)
- MOVD a5+40(FP), R12
- MOVD R12, (2176+32)(R4)
- MOVD a6+48(FP), R12
- MOVD R12, (2176+40)(R4)
- MOVD a7+56(FP), R12
- MOVD R12, (2176+48)(R4)
- MOVD a8+64(FP), R12
- MOVD R12, (2176+56)(R4)
- MOVD a9+72(FP), R12
- MOVD R12, (2176+64)(R4)
-
- // Call function.
- LE_CALL
+ MOVD R3, ret+32(FP)
+ CMP R3, $0 // compare result to 0
+ BNE done
+
+ // retrieve errno and errno2
+ MOVD zosLibVec<>(SB), R8
+ ADD $(__errno), R8
+ LMG 0(R8), R5, R6
+ LE_CALL // balr R7, R6 __errno (return #3)
NOPH
- XOR R0, R0 // Restore R0 to $0.
- MOVD R4, 0(R9) // Save stack pointer.
-
- MOVD R3, r1+80(FP)
- MOVD R0, r2+88(FP)
- MOVD R0, err+96(FP)
- MOVW R3, R4
- CMP R4, $-1
- BNE done
- BL addrerrno<>(SB)
- MOVWZ 0(R3), R3
- MOVD R3, err+96(FP)
-done:
- RET
-
-// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64)
-TEXT ·svcCall(SB),NOSPLIT,$0
- BL runtime·save_g(SB) // Save g and stack pointer
- MOVW PSALAA, R8
- MOVD LCA64(R8), R8
- MOVD SAVSTACK_ASYNC(R8), R9
- MOVD R15, 0(R9)
-
- MOVD argv+8(FP), R1 // Move function arguments into registers
- MOVD dsa+16(FP), g
- MOVD fnptr+0(FP), R15
-
- BYTE $0x0D // Branch to function
- BYTE $0xEF
-
- BL runtime·load_g(SB) // Restore g and stack pointer
- MOVW PSALAA, R8
- MOVD LCA64(R8), R8
- MOVD SAVSTACK_ASYNC(R8), R9
- MOVD 0(R9), R15
-
- RET
-
-// func svcLoad(name *byte) unsafe.Pointer
-TEXT ·svcLoad(SB),NOSPLIT,$0
- MOVD R15, R2 // Save go stack pointer
- MOVD name+0(FP), R0 // Move SVC args into registers
- MOVD $0x80000000, R1
- MOVD $0, R15
- BYTE $0x0A // SVC 08 LOAD
- BYTE $0x08
- MOVW R15, R3 // Save return code from SVC
- MOVD R2, R15 // Restore go stack pointer
- CMP R3, $0 // Check SVC return code
- BNE error
-
- MOVD $-2, R3 // Reset last bit of entry point to zero
- AND R0, R3
- MOVD R3, addr+8(FP) // Return entry point returned by SVC
- CMP R0, R3 // Check if last bit of entry point was set
- BNE done
-
- MOVD R15, R2 // Save go stack pointer
- MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08)
- BYTE $0x0A // SVC 09 DELETE
- BYTE $0x09
- MOVD R2, R15 // Restore go stack pointer
+ MOVWZ 0(R3), R3
+ MOVD R3, err+48(FP)
+ MOVD zosLibVec<>(SB), R8
+ ADD $(__err2ad), R8
+ LMG 0(R8), R5, R6
+ LE_CALL // balr R7, R6 __err2ad (return #2)
+ NOPH
+ MOVW (R3), R2 // retrieve errno2
+ MOVD R2, errno2+40(FP) // store in return area
+ XOR R2, R2
+ MOVWZ R2, (R3) // clear errno2
-error:
- MOVD $0, addr+8(FP) // Return 0 on failure
done:
- XOR R0, R0 // Reset r0 to 0
+ MOVD R4, 0(R9) // Save stack pointer.
RET
-// func svcUnload(name *byte, fnptr unsafe.Pointer) int64
-TEXT ·svcUnload(SB),NOSPLIT,$0
- MOVD R15, R2 // Save go stack pointer
- MOVD name+0(FP), R0 // Move SVC args into registers
- MOVD addr+8(FP), R15
- BYTE $0x0A // SVC 09
- BYTE $0x09
- XOR R0, R0 // Reset r0 to 0
- MOVD R15, R1 // Save SVC return code
- MOVD R2, R15 // Restore go stack pointer
- MOVD R1, rc+0(FP) // Return SVC return code
+//
+// function to test if a pointer can be safely dereferenced (content read)
+// return 0 for succces
+//
+TEXT ·ptrtest(SB), NOSPLIT, $0-16
+ MOVD arg+0(FP), R10 // test pointer in R10
+
+ // set up R2 to point to CEECAADMC
+ BYTE $0xE3; BYTE $0x20; BYTE $0x04; BYTE $0xB8; BYTE $0x00; BYTE $0x17 // llgt 2,1208
+ BYTE $0xB9; BYTE $0x17; BYTE $0x00; BYTE $0x22 // llgtr 2,2
+ BYTE $0xA5; BYTE $0x26; BYTE $0x7F; BYTE $0xFF // nilh 2,32767
+ BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x58; BYTE $0x00; BYTE $0x04 // lg 2,88(2)
+ BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x08; BYTE $0x00; BYTE $0x04 // lg 2,8(2)
+ BYTE $0x41; BYTE $0x22; BYTE $0x03; BYTE $0x68 // la 2,872(2)
+
+ // set up R5 to point to the "shunt" path which set 1 to R3 (failure)
+ BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x33 // xgr 3,3
+ BYTE $0xA7; BYTE $0x55; BYTE $0x00; BYTE $0x04 // bras 5,lbl1
+ BYTE $0xA7; BYTE $0x39; BYTE $0x00; BYTE $0x01 // lghi 3,1
+
+ // if r3 is not zero (failed) then branch to finish
+ BYTE $0xB9; BYTE $0x02; BYTE $0x00; BYTE $0x33 // lbl1 ltgr 3,3
+ BYTE $0xA7; BYTE $0x74; BYTE $0x00; BYTE $0x08 // brc b'0111',lbl2
+
+ // stomic store shunt address in R5 into CEECAADMC
+ BYTE $0xE3; BYTE $0x52; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 5,0(2)
+
+ // now try reading from the test pointer in R10, if it fails it branches to the "lghi" instruction above
+ BYTE $0xE3; BYTE $0x9A; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x04 // lg 9,0(10)
+
+ // finish here, restore 0 into CEECAADMC
+ BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9
+ BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2)
+ MOVD R3, ret+8(FP) // result in R3
RET
-// func gettid() uint64
-TEXT ·gettid(SB), NOSPLIT, $0
- // Get library control area (LCA).
- MOVW PSALAA, R8
- MOVD LCA64(R8), R8
-
- // Get CEECAATHDID
- MOVD CAA(R8), R9
- MOVD 0x3D0(R9), R9
- MOVD R9, ret+0(FP)
-
+//
+// function to test if a untptr can be loaded from a pointer
+// return 1: the 8-byte content
+// 2: 0 for success, 1 for failure
+//
+// func safeload(ptr uintptr) ( value uintptr, error uintptr)
+TEXT ·safeload(SB), NOSPLIT, $0-24
+ MOVD ptr+0(FP), R10 // test pointer in R10
+ MOVD $0x0, R6
+ BYTE $0xE3; BYTE $0x20; BYTE $0x04; BYTE $0xB8; BYTE $0x00; BYTE $0x17 // llgt 2,1208
+ BYTE $0xB9; BYTE $0x17; BYTE $0x00; BYTE $0x22 // llgtr 2,2
+ BYTE $0xA5; BYTE $0x26; BYTE $0x7F; BYTE $0xFF // nilh 2,32767
+ BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x58; BYTE $0x00; BYTE $0x04 // lg 2,88(2)
+ BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x08; BYTE $0x00; BYTE $0x04 // lg 2,8(2)
+ BYTE $0x41; BYTE $0x22; BYTE $0x03; BYTE $0x68 // la 2,872(2)
+ BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x33 // xgr 3,3
+ BYTE $0xA7; BYTE $0x55; BYTE $0x00; BYTE $0x04 // bras 5,lbl1
+ BYTE $0xA7; BYTE $0x39; BYTE $0x00; BYTE $0x01 // lghi 3,1
+ BYTE $0xB9; BYTE $0x02; BYTE $0x00; BYTE $0x33 // lbl1 ltgr 3,3
+ BYTE $0xA7; BYTE $0x74; BYTE $0x00; BYTE $0x08 // brc b'0111',lbl2
+ BYTE $0xE3; BYTE $0x52; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 5,0(2)
+ BYTE $0xE3; BYTE $0x6A; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x04 // lg 6,0(10)
+ BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9
+ BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2)
+ MOVD R6, value+8(FP) // result in R6
+ MOVD R3, error+16(FP) // error in R3
RET
diff --git a/vendor/golang.org/x/sys/unix/bpxsvc_zos.go b/vendor/golang.org/x/sys/unix/bpxsvc_zos.go
new file mode 100644
index 0000000000..39d647d863
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/bpxsvc_zos.go
@@ -0,0 +1,657 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build zos
+
+package unix
+
+import (
+ "bytes"
+ "fmt"
+ "unsafe"
+)
+
+//go:noescape
+func bpxcall(plist []unsafe.Pointer, bpx_offset int64)
+
+//go:noescape
+func A2e([]byte)
+
+//go:noescape
+func E2a([]byte)
+
+const (
+ BPX4STA = 192 // stat
+ BPX4FST = 104 // fstat
+ BPX4LST = 132 // lstat
+ BPX4OPN = 156 // open
+ BPX4CLO = 72 // close
+ BPX4CHR = 500 // chattr
+ BPX4FCR = 504 // fchattr
+ BPX4LCR = 1180 // lchattr
+ BPX4CTW = 492 // cond_timed_wait
+ BPX4GTH = 1056 // __getthent
+ BPX4PTQ = 412 // pthread_quiesc
+ BPX4PTR = 320 // ptrace
+)
+
+const (
+ //options
+ //byte1
+ BPX_OPNFHIGH = 0x80
+ //byte2
+ BPX_OPNFEXEC = 0x80
+ //byte3
+ BPX_O_NOLARGEFILE = 0x08
+ BPX_O_LARGEFILE = 0x04
+ BPX_O_ASYNCSIG = 0x02
+ BPX_O_SYNC = 0x01
+ //byte4
+ BPX_O_CREXCL = 0xc0
+ BPX_O_CREAT = 0x80
+ BPX_O_EXCL = 0x40
+ BPX_O_NOCTTY = 0x20
+ BPX_O_TRUNC = 0x10
+ BPX_O_APPEND = 0x08
+ BPX_O_NONBLOCK = 0x04
+ BPX_FNDELAY = 0x04
+ BPX_O_RDWR = 0x03
+ BPX_O_RDONLY = 0x02
+ BPX_O_WRONLY = 0x01
+ BPX_O_ACCMODE = 0x03
+ BPX_O_GETFL = 0x0f
+
+ //mode
+ // byte1 (file type)
+ BPX_FT_DIR = 1
+ BPX_FT_CHARSPEC = 2
+ BPX_FT_REGFILE = 3
+ BPX_FT_FIFO = 4
+ BPX_FT_SYMLINK = 5
+ BPX_FT_SOCKET = 6
+ //byte3
+ BPX_S_ISUID = 0x08
+ BPX_S_ISGID = 0x04
+ BPX_S_ISVTX = 0x02
+ BPX_S_IRWXU1 = 0x01
+ BPX_S_IRUSR = 0x01
+ //byte4
+ BPX_S_IRWXU2 = 0xc0
+ BPX_S_IWUSR = 0x80
+ BPX_S_IXUSR = 0x40
+ BPX_S_IRWXG = 0x38
+ BPX_S_IRGRP = 0x20
+ BPX_S_IWGRP = 0x10
+ BPX_S_IXGRP = 0x08
+ BPX_S_IRWXOX = 0x07
+ BPX_S_IROTH = 0x04
+ BPX_S_IWOTH = 0x02
+ BPX_S_IXOTH = 0x01
+
+ CW_INTRPT = 1
+ CW_CONDVAR = 32
+ CW_TIMEOUT = 64
+
+ PGTHA_NEXT = 2
+ PGTHA_CURRENT = 1
+ PGTHA_FIRST = 0
+ PGTHA_LAST = 3
+ PGTHA_PROCESS = 0x80
+ PGTHA_CONTTY = 0x40
+ PGTHA_PATH = 0x20
+ PGTHA_COMMAND = 0x10
+ PGTHA_FILEDATA = 0x08
+ PGTHA_THREAD = 0x04
+ PGTHA_PTAG = 0x02
+ PGTHA_COMMANDLONG = 0x01
+ PGTHA_THREADFAST = 0x80
+ PGTHA_FILEPATH = 0x40
+ PGTHA_THDSIGMASK = 0x20
+ // thread quiece mode
+ QUIESCE_TERM int32 = 1
+ QUIESCE_FORCE int32 = 2
+ QUIESCE_QUERY int32 = 3
+ QUIESCE_FREEZE int32 = 4
+ QUIESCE_UNFREEZE int32 = 5
+ FREEZE_THIS_THREAD int32 = 6
+ FREEZE_EXIT int32 = 8
+ QUIESCE_SRB int32 = 9
+)
+
+type Pgtha struct {
+ Pid uint32 // 0
+ Tid0 uint32 // 4
+ Tid1 uint32
+ Accesspid byte // C
+ Accesstid byte // D
+ Accessasid uint16 // E
+ Loginname [8]byte // 10
+ Flag1 byte // 18
+ Flag1b2 byte // 19
+}
+
+type Bpxystat_t struct { // DSECT BPXYSTAT
+ St_id [4]uint8 // 0
+ St_length uint16 // 0x4
+ St_version uint16 // 0x6
+ St_mode uint32 // 0x8
+ St_ino uint32 // 0xc
+ St_dev uint32 // 0x10
+ St_nlink uint32 // 0x14
+ St_uid uint32 // 0x18
+ St_gid uint32 // 0x1c
+ St_size uint64 // 0x20
+ St_atime uint32 // 0x28
+ St_mtime uint32 // 0x2c
+ St_ctime uint32 // 0x30
+ St_rdev uint32 // 0x34
+ St_auditoraudit uint32 // 0x38
+ St_useraudit uint32 // 0x3c
+ St_blksize uint32 // 0x40
+ St_createtime uint32 // 0x44
+ St_auditid [4]uint32 // 0x48
+ St_res01 uint32 // 0x58
+ Ft_ccsid uint16 // 0x5c
+ Ft_flags uint16 // 0x5e
+ St_res01a [2]uint32 // 0x60
+ St_res02 uint32 // 0x68
+ St_blocks uint32 // 0x6c
+ St_opaque [3]uint8 // 0x70
+ St_visible uint8 // 0x73
+ St_reftime uint32 // 0x74
+ St_fid uint64 // 0x78
+ St_filefmt uint8 // 0x80
+ St_fspflag2 uint8 // 0x81
+ St_res03 [2]uint8 // 0x82
+ St_ctimemsec uint32 // 0x84
+ St_seclabel [8]uint8 // 0x88
+ St_res04 [4]uint8 // 0x90
+ // end of version 1
+ _ uint32 // 0x94
+ St_atime64 uint64 // 0x98
+ St_mtime64 uint64 // 0xa0
+ St_ctime64 uint64 // 0xa8
+ St_createtime64 uint64 // 0xb0
+ St_reftime64 uint64 // 0xb8
+ _ uint64 // 0xc0
+ St_res05 [16]uint8 // 0xc8
+ // end of version 2
+}
+
+type BpxFilestatus struct {
+ Oflag1 byte
+ Oflag2 byte
+ Oflag3 byte
+ Oflag4 byte
+}
+
+type BpxMode struct {
+ Ftype byte
+ Mode1 byte
+ Mode2 byte
+ Mode3 byte
+}
+
+// Thr attribute structure for extended attributes
+type Bpxyatt_t struct { // DSECT BPXYATT
+ Att_id [4]uint8
+ Att_version uint16
+ Att_res01 [2]uint8
+ Att_setflags1 uint8
+ Att_setflags2 uint8
+ Att_setflags3 uint8
+ Att_setflags4 uint8
+ Att_mode uint32
+ Att_uid uint32
+ Att_gid uint32
+ Att_opaquemask [3]uint8
+ Att_visblmaskres uint8
+ Att_opaque [3]uint8
+ Att_visibleres uint8
+ Att_size_h uint32
+ Att_size_l uint32
+ Att_atime uint32
+ Att_mtime uint32
+ Att_auditoraudit uint32
+ Att_useraudit uint32
+ Att_ctime uint32
+ Att_reftime uint32
+ // end of version 1
+ Att_filefmt uint8
+ Att_res02 [3]uint8
+ Att_filetag uint32
+ Att_res03 [8]uint8
+ // end of version 2
+ Att_atime64 uint64
+ Att_mtime64 uint64
+ Att_ctime64 uint64
+ Att_reftime64 uint64
+ Att_seclabel [8]uint8
+ Att_ver3res02 [8]uint8
+ // end of version 3
+}
+
+func BpxOpen(name string, options *BpxFilestatus, mode *BpxMode) (rv int32, rc int32, rn int32) {
+ if len(name) < 1024 {
+ var namebuf [1024]byte
+ sz := int32(copy(namebuf[:], name))
+ A2e(namebuf[:sz])
+ var parms [7]unsafe.Pointer
+ parms[0] = unsafe.Pointer(&sz)
+ parms[1] = unsafe.Pointer(&namebuf[0])
+ parms[2] = unsafe.Pointer(options)
+ parms[3] = unsafe.Pointer(mode)
+ parms[4] = unsafe.Pointer(&rv)
+ parms[5] = unsafe.Pointer(&rc)
+ parms[6] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4OPN)
+ return rv, rc, rn
+ }
+ return -1, -1, -1
+}
+
+func BpxClose(fd int32) (rv int32, rc int32, rn int32) {
+ var parms [4]unsafe.Pointer
+ parms[0] = unsafe.Pointer(&fd)
+ parms[1] = unsafe.Pointer(&rv)
+ parms[2] = unsafe.Pointer(&rc)
+ parms[3] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4CLO)
+ return rv, rc, rn
+}
+
+func BpxFileFStat(fd int32, st *Bpxystat_t) (rv int32, rc int32, rn int32) {
+ st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3}
+ st.St_version = 2
+ stat_sz := uint32(unsafe.Sizeof(*st))
+ var parms [6]unsafe.Pointer
+ parms[0] = unsafe.Pointer(&fd)
+ parms[1] = unsafe.Pointer(&stat_sz)
+ parms[2] = unsafe.Pointer(st)
+ parms[3] = unsafe.Pointer(&rv)
+ parms[4] = unsafe.Pointer(&rc)
+ parms[5] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4FST)
+ return rv, rc, rn
+}
+
+func BpxFileStat(name string, st *Bpxystat_t) (rv int32, rc int32, rn int32) {
+ if len(name) < 1024 {
+ var namebuf [1024]byte
+ sz := int32(copy(namebuf[:], name))
+ A2e(namebuf[:sz])
+ st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3}
+ st.St_version = 2
+ stat_sz := uint32(unsafe.Sizeof(*st))
+ var parms [7]unsafe.Pointer
+ parms[0] = unsafe.Pointer(&sz)
+ parms[1] = unsafe.Pointer(&namebuf[0])
+ parms[2] = unsafe.Pointer(&stat_sz)
+ parms[3] = unsafe.Pointer(st)
+ parms[4] = unsafe.Pointer(&rv)
+ parms[5] = unsafe.Pointer(&rc)
+ parms[6] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4STA)
+ return rv, rc, rn
+ }
+ return -1, -1, -1
+}
+
+func BpxFileLStat(name string, st *Bpxystat_t) (rv int32, rc int32, rn int32) {
+ if len(name) < 1024 {
+ var namebuf [1024]byte
+ sz := int32(copy(namebuf[:], name))
+ A2e(namebuf[:sz])
+ st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3}
+ st.St_version = 2
+ stat_sz := uint32(unsafe.Sizeof(*st))
+ var parms [7]unsafe.Pointer
+ parms[0] = unsafe.Pointer(&sz)
+ parms[1] = unsafe.Pointer(&namebuf[0])
+ parms[2] = unsafe.Pointer(&stat_sz)
+ parms[3] = unsafe.Pointer(st)
+ parms[4] = unsafe.Pointer(&rv)
+ parms[5] = unsafe.Pointer(&rc)
+ parms[6] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4LST)
+ return rv, rc, rn
+ }
+ return -1, -1, -1
+}
+
+func BpxChattr(path string, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) {
+ if len(path) >= 1024 {
+ return -1, -1, -1
+ }
+ var namebuf [1024]byte
+ sz := int32(copy(namebuf[:], path))
+ A2e(namebuf[:sz])
+ attr_sz := uint32(unsafe.Sizeof(*attr))
+ var parms [7]unsafe.Pointer
+ parms[0] = unsafe.Pointer(&sz)
+ parms[1] = unsafe.Pointer(&namebuf[0])
+ parms[2] = unsafe.Pointer(&attr_sz)
+ parms[3] = unsafe.Pointer(attr)
+ parms[4] = unsafe.Pointer(&rv)
+ parms[5] = unsafe.Pointer(&rc)
+ parms[6] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4CHR)
+ return rv, rc, rn
+}
+
+func BpxLchattr(path string, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) {
+ if len(path) >= 1024 {
+ return -1, -1, -1
+ }
+ var namebuf [1024]byte
+ sz := int32(copy(namebuf[:], path))
+ A2e(namebuf[:sz])
+ attr_sz := uint32(unsafe.Sizeof(*attr))
+ var parms [7]unsafe.Pointer
+ parms[0] = unsafe.Pointer(&sz)
+ parms[1] = unsafe.Pointer(&namebuf[0])
+ parms[2] = unsafe.Pointer(&attr_sz)
+ parms[3] = unsafe.Pointer(attr)
+ parms[4] = unsafe.Pointer(&rv)
+ parms[5] = unsafe.Pointer(&rc)
+ parms[6] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4LCR)
+ return rv, rc, rn
+}
+
+func BpxFchattr(fd int32, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) {
+ attr_sz := uint32(unsafe.Sizeof(*attr))
+ var parms [6]unsafe.Pointer
+ parms[0] = unsafe.Pointer(&fd)
+ parms[1] = unsafe.Pointer(&attr_sz)
+ parms[2] = unsafe.Pointer(attr)
+ parms[3] = unsafe.Pointer(&rv)
+ parms[4] = unsafe.Pointer(&rc)
+ parms[5] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4FCR)
+ return rv, rc, rn
+}
+
+func BpxCondTimedWait(sec uint32, nsec uint32, events uint32, secrem *uint32, nsecrem *uint32) (rv int32, rc int32, rn int32) {
+ var parms [8]unsafe.Pointer
+ parms[0] = unsafe.Pointer(&sec)
+ parms[1] = unsafe.Pointer(&nsec)
+ parms[2] = unsafe.Pointer(&events)
+ parms[3] = unsafe.Pointer(secrem)
+ parms[4] = unsafe.Pointer(nsecrem)
+ parms[5] = unsafe.Pointer(&rv)
+ parms[6] = unsafe.Pointer(&rc)
+ parms[7] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4CTW)
+ return rv, rc, rn
+}
+func BpxGetthent(in *Pgtha, outlen *uint32, out unsafe.Pointer) (rv int32, rc int32, rn int32) {
+ var parms [7]unsafe.Pointer
+ inlen := uint32(26) // nothing else will work. Go says Pgtha is 28-byte because of alignment, but Pgtha is "packed" and must be 26-byte
+ parms[0] = unsafe.Pointer(&inlen)
+ parms[1] = unsafe.Pointer(&in)
+ parms[2] = unsafe.Pointer(outlen)
+ parms[3] = unsafe.Pointer(&out)
+ parms[4] = unsafe.Pointer(&rv)
+ parms[5] = unsafe.Pointer(&rc)
+ parms[6] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4GTH)
+ return rv, rc, rn
+}
+func ZosJobname() (jobname string, err error) {
+ var pgtha Pgtha
+ pgtha.Pid = uint32(Getpid())
+ pgtha.Accesspid = PGTHA_CURRENT
+ pgtha.Flag1 = PGTHA_PROCESS
+ var out [256]byte
+ var outlen uint32
+ outlen = 256
+ rv, rc, rn := BpxGetthent(&pgtha, &outlen, unsafe.Pointer(&out[0]))
+ if rv == 0 {
+ gthc := []byte{0x87, 0xa3, 0x88, 0x83} // 'gthc' in ebcdic
+ ix := bytes.Index(out[:], gthc)
+ if ix == -1 {
+ err = fmt.Errorf("BPX4GTH: gthc return data not found")
+ return
+ }
+ jn := out[ix+80 : ix+88] // we didn't declare Pgthc, but jobname is 8-byte at offset 80
+ E2a(jn)
+ jobname = string(bytes.TrimRight(jn, " "))
+
+ } else {
+ err = fmt.Errorf("BPX4GTH: rc=%d errno=%d reason=code=0x%x", rv, rc, rn)
+ }
+ return
+}
+func Bpx4ptq(code int32, data string) (rv int32, rc int32, rn int32) {
+ var userdata [8]byte
+ var parms [5]unsafe.Pointer
+ copy(userdata[:], data+" ")
+ A2e(userdata[:])
+ parms[0] = unsafe.Pointer(&code)
+ parms[1] = unsafe.Pointer(&userdata[0])
+ parms[2] = unsafe.Pointer(&rv)
+ parms[3] = unsafe.Pointer(&rc)
+ parms[4] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4PTQ)
+ return rv, rc, rn
+}
+
+const (
+ PT_TRACE_ME = 0 // Debug this process
+ PT_READ_I = 1 // Read a full word
+ PT_READ_D = 2 // Read a full word
+ PT_READ_U = 3 // Read control info
+ PT_WRITE_I = 4 //Write a full word
+ PT_WRITE_D = 5 //Write a full word
+ PT_CONTINUE = 7 //Continue the process
+ PT_KILL = 8 //Terminate the process
+ PT_READ_GPR = 11 // Read GPR, CR, PSW
+ PT_READ_FPR = 12 // Read FPR
+ PT_READ_VR = 13 // Read VR
+ PT_WRITE_GPR = 14 // Write GPR, CR, PSW
+ PT_WRITE_FPR = 15 // Write FPR
+ PT_WRITE_VR = 16 // Write VR
+ PT_READ_BLOCK = 17 // Read storage
+ PT_WRITE_BLOCK = 19 // Write storage
+ PT_READ_GPRH = 20 // Read GPRH
+ PT_WRITE_GPRH = 21 // Write GPRH
+ PT_REGHSET = 22 // Read all GPRHs
+ PT_ATTACH = 30 // Attach to a process
+ PT_DETACH = 31 // Detach from a process
+ PT_REGSET = 32 // Read all GPRs
+ PT_REATTACH = 33 // Reattach to a process
+ PT_LDINFO = 34 // Read loader info
+ PT_MULTI = 35 // Multi process mode
+ PT_LD64INFO = 36 // RMODE64 Info Area
+ PT_BLOCKREQ = 40 // Block request
+ PT_THREAD_INFO = 60 // Read thread info
+ PT_THREAD_MODIFY = 61
+ PT_THREAD_READ_FOCUS = 62
+ PT_THREAD_WRITE_FOCUS = 63
+ PT_THREAD_HOLD = 64
+ PT_THREAD_SIGNAL = 65
+ PT_EXPLAIN = 66
+ PT_EVENTS = 67
+ PT_THREAD_INFO_EXTENDED = 68
+ PT_REATTACH2 = 71
+ PT_CAPTURE = 72
+ PT_UNCAPTURE = 73
+ PT_GET_THREAD_TCB = 74
+ PT_GET_ALET = 75
+ PT_SWAPIN = 76
+ PT_EXTENDED_EVENT = 98
+ PT_RECOVER = 99 // Debug a program check
+ PT_GPR0 = 0 // General purpose register 0
+ PT_GPR1 = 1 // General purpose register 1
+ PT_GPR2 = 2 // General purpose register 2
+ PT_GPR3 = 3 // General purpose register 3
+ PT_GPR4 = 4 // General purpose register 4
+ PT_GPR5 = 5 // General purpose register 5
+ PT_GPR6 = 6 // General purpose register 6
+ PT_GPR7 = 7 // General purpose register 7
+ PT_GPR8 = 8 // General purpose register 8
+ PT_GPR9 = 9 // General purpose register 9
+ PT_GPR10 = 10 // General purpose register 10
+ PT_GPR11 = 11 // General purpose register 11
+ PT_GPR12 = 12 // General purpose register 12
+ PT_GPR13 = 13 // General purpose register 13
+ PT_GPR14 = 14 // General purpose register 14
+ PT_GPR15 = 15 // General purpose register 15
+ PT_FPR0 = 16 // Floating point register 0
+ PT_FPR1 = 17 // Floating point register 1
+ PT_FPR2 = 18 // Floating point register 2
+ PT_FPR3 = 19 // Floating point register 3
+ PT_FPR4 = 20 // Floating point register 4
+ PT_FPR5 = 21 // Floating point register 5
+ PT_FPR6 = 22 // Floating point register 6
+ PT_FPR7 = 23 // Floating point register 7
+ PT_FPR8 = 24 // Floating point register 8
+ PT_FPR9 = 25 // Floating point register 9
+ PT_FPR10 = 26 // Floating point register 10
+ PT_FPR11 = 27 // Floating point register 11
+ PT_FPR12 = 28 // Floating point register 12
+ PT_FPR13 = 29 // Floating point register 13
+ PT_FPR14 = 30 // Floating point register 14
+ PT_FPR15 = 31 // Floating point register 15
+ PT_FPC = 32 // Floating point control register
+ PT_PSW = 40 // PSW
+ PT_PSW0 = 40 // Left half of the PSW
+ PT_PSW1 = 41 // Right half of the PSW
+ PT_CR0 = 42 // Control register 0
+ PT_CR1 = 43 // Control register 1
+ PT_CR2 = 44 // Control register 2
+ PT_CR3 = 45 // Control register 3
+ PT_CR4 = 46 // Control register 4
+ PT_CR5 = 47 // Control register 5
+ PT_CR6 = 48 // Control register 6
+ PT_CR7 = 49 // Control register 7
+ PT_CR8 = 50 // Control register 8
+ PT_CR9 = 51 // Control register 9
+ PT_CR10 = 52 // Control register 10
+ PT_CR11 = 53 // Control register 11
+ PT_CR12 = 54 // Control register 12
+ PT_CR13 = 55 // Control register 13
+ PT_CR14 = 56 // Control register 14
+ PT_CR15 = 57 // Control register 15
+ PT_GPRH0 = 58 // GP High register 0
+ PT_GPRH1 = 59 // GP High register 1
+ PT_GPRH2 = 60 // GP High register 2
+ PT_GPRH3 = 61 // GP High register 3
+ PT_GPRH4 = 62 // GP High register 4
+ PT_GPRH5 = 63 // GP High register 5
+ PT_GPRH6 = 64 // GP High register 6
+ PT_GPRH7 = 65 // GP High register 7
+ PT_GPRH8 = 66 // GP High register 8
+ PT_GPRH9 = 67 // GP High register 9
+ PT_GPRH10 = 68 // GP High register 10
+ PT_GPRH11 = 69 // GP High register 11
+ PT_GPRH12 = 70 // GP High register 12
+ PT_GPRH13 = 71 // GP High register 13
+ PT_GPRH14 = 72 // GP High register 14
+ PT_GPRH15 = 73 // GP High register 15
+ PT_VR0 = 74 // Vector register 0
+ PT_VR1 = 75 // Vector register 1
+ PT_VR2 = 76 // Vector register 2
+ PT_VR3 = 77 // Vector register 3
+ PT_VR4 = 78 // Vector register 4
+ PT_VR5 = 79 // Vector register 5
+ PT_VR6 = 80 // Vector register 6
+ PT_VR7 = 81 // Vector register 7
+ PT_VR8 = 82 // Vector register 8
+ PT_VR9 = 83 // Vector register 9
+ PT_VR10 = 84 // Vector register 10
+ PT_VR11 = 85 // Vector register 11
+ PT_VR12 = 86 // Vector register 12
+ PT_VR13 = 87 // Vector register 13
+ PT_VR14 = 88 // Vector register 14
+ PT_VR15 = 89 // Vector register 15
+ PT_VR16 = 90 // Vector register 16
+ PT_VR17 = 91 // Vector register 17
+ PT_VR18 = 92 // Vector register 18
+ PT_VR19 = 93 // Vector register 19
+ PT_VR20 = 94 // Vector register 20
+ PT_VR21 = 95 // Vector register 21
+ PT_VR22 = 96 // Vector register 22
+ PT_VR23 = 97 // Vector register 23
+ PT_VR24 = 98 // Vector register 24
+ PT_VR25 = 99 // Vector register 25
+ PT_VR26 = 100 // Vector register 26
+ PT_VR27 = 101 // Vector register 27
+ PT_VR28 = 102 // Vector register 28
+ PT_VR29 = 103 // Vector register 29
+ PT_VR30 = 104 // Vector register 30
+ PT_VR31 = 105 // Vector register 31
+ PT_PSWG = 106 // PSWG
+ PT_PSWG0 = 106 // Bytes 0-3
+ PT_PSWG1 = 107 // Bytes 4-7
+ PT_PSWG2 = 108 // Bytes 8-11 (IA high word)
+ PT_PSWG3 = 109 // Bytes 12-15 (IA low word)
+)
+
+func Bpx4ptr(request int32, pid int32, addr unsafe.Pointer, data unsafe.Pointer, buffer unsafe.Pointer) (rv int32, rc int32, rn int32) {
+ var parms [8]unsafe.Pointer
+ parms[0] = unsafe.Pointer(&request)
+ parms[1] = unsafe.Pointer(&pid)
+ parms[2] = unsafe.Pointer(&addr)
+ parms[3] = unsafe.Pointer(&data)
+ parms[4] = unsafe.Pointer(&buffer)
+ parms[5] = unsafe.Pointer(&rv)
+ parms[6] = unsafe.Pointer(&rc)
+ parms[7] = unsafe.Pointer(&rn)
+ bpxcall(parms[:], BPX4PTR)
+ return rv, rc, rn
+}
+
+func copyU8(val uint8, dest []uint8) int {
+ if len(dest) < 1 {
+ return 0
+ }
+ dest[0] = val
+ return 1
+}
+
+func copyU8Arr(src, dest []uint8) int {
+ if len(dest) < len(src) {
+ return 0
+ }
+ for i, v := range src {
+ dest[i] = v
+ }
+ return len(src)
+}
+
+func copyU16(val uint16, dest []uint16) int {
+ if len(dest) < 1 {
+ return 0
+ }
+ dest[0] = val
+ return 1
+}
+
+func copyU32(val uint32, dest []uint32) int {
+ if len(dest) < 1 {
+ return 0
+ }
+ dest[0] = val
+ return 1
+}
+
+func copyU32Arr(src, dest []uint32) int {
+ if len(dest) < len(src) {
+ return 0
+ }
+ for i, v := range src {
+ dest[i] = v
+ }
+ return len(src)
+}
+
+func copyU64(val uint64, dest []uint64) int {
+ if len(dest) < 1 {
+ return 0
+ }
+ dest[0] = val
+ return 1
+}
diff --git a/vendor/golang.org/x/sys/unix/bpxsvc_zos.s b/vendor/golang.org/x/sys/unix/bpxsvc_zos.s
new file mode 100644
index 0000000000..4bd4a17982
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/bpxsvc_zos.s
@@ -0,0 +1,192 @@
+// Copyright 2024 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.
+
+#include "go_asm.h"
+#include "textflag.h"
+
+// function to call USS assembly language services
+//
+// doc: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_3.1.0/com.ibm.zos.v3r1.bpxb100/bit64env.htm
+//
+// arg1 unsafe.Pointer array that ressembles an OS PLIST
+//
+// arg2 function offset as in
+// doc: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_3.1.0/com.ibm.zos.v3r1.bpxb100/bpx2cr_List_of_offsets.htm
+//
+// func bpxcall(plist []unsafe.Pointer, bpx_offset int64)
+
+TEXT ·bpxcall(SB), NOSPLIT|NOFRAME, $0
+ MOVD plist_base+0(FP), R1 // r1 points to plist
+ MOVD bpx_offset+24(FP), R2 // r2 offset to BPX vector table
+ MOVD R14, R7 // save r14
+ MOVD R15, R8 // save r15
+ MOVWZ 16(R0), R9
+ MOVWZ 544(R9), R9
+ MOVWZ 24(R9), R9 // call vector in r9
+ ADD R2, R9 // add offset to vector table
+ MOVWZ (R9), R9 // r9 points to entry point
+ BYTE $0x0D // BL R14,R9 --> basr r14,r9
+ BYTE $0xE9 // clobbers 0,1,14,15
+ MOVD R8, R15 // restore 15
+ JMP R7 // return via saved return address
+
+// func A2e(arr [] byte)
+// code page conversion from 819 to 1047
+TEXT ·A2e(SB), NOSPLIT|NOFRAME, $0
+ MOVD arg_base+0(FP), R2 // pointer to arry of characters
+ MOVD arg_len+8(FP), R3 // count
+ XOR R0, R0
+ XOR R1, R1
+ BYTE $0xA7; BYTE $0x15; BYTE $0x00; BYTE $0x82 // BRAS 1,(2+(256/2))
+
+ // ASCII -> EBCDIC conversion table:
+ BYTE $0x00; BYTE $0x01; BYTE $0x02; BYTE $0x03
+ BYTE $0x37; BYTE $0x2d; BYTE $0x2e; BYTE $0x2f
+ BYTE $0x16; BYTE $0x05; BYTE $0x15; BYTE $0x0b
+ BYTE $0x0c; BYTE $0x0d; BYTE $0x0e; BYTE $0x0f
+ BYTE $0x10; BYTE $0x11; BYTE $0x12; BYTE $0x13
+ BYTE $0x3c; BYTE $0x3d; BYTE $0x32; BYTE $0x26
+ BYTE $0x18; BYTE $0x19; BYTE $0x3f; BYTE $0x27
+ BYTE $0x1c; BYTE $0x1d; BYTE $0x1e; BYTE $0x1f
+ BYTE $0x40; BYTE $0x5a; BYTE $0x7f; BYTE $0x7b
+ BYTE $0x5b; BYTE $0x6c; BYTE $0x50; BYTE $0x7d
+ BYTE $0x4d; BYTE $0x5d; BYTE $0x5c; BYTE $0x4e
+ BYTE $0x6b; BYTE $0x60; BYTE $0x4b; BYTE $0x61
+ BYTE $0xf0; BYTE $0xf1; BYTE $0xf2; BYTE $0xf3
+ BYTE $0xf4; BYTE $0xf5; BYTE $0xf6; BYTE $0xf7
+ BYTE $0xf8; BYTE $0xf9; BYTE $0x7a; BYTE $0x5e
+ BYTE $0x4c; BYTE $0x7e; BYTE $0x6e; BYTE $0x6f
+ BYTE $0x7c; BYTE $0xc1; BYTE $0xc2; BYTE $0xc3
+ BYTE $0xc4; BYTE $0xc5; BYTE $0xc6; BYTE $0xc7
+ BYTE $0xc8; BYTE $0xc9; BYTE $0xd1; BYTE $0xd2
+ BYTE $0xd3; BYTE $0xd4; BYTE $0xd5; BYTE $0xd6
+ BYTE $0xd7; BYTE $0xd8; BYTE $0xd9; BYTE $0xe2
+ BYTE $0xe3; BYTE $0xe4; BYTE $0xe5; BYTE $0xe6
+ BYTE $0xe7; BYTE $0xe8; BYTE $0xe9; BYTE $0xad
+ BYTE $0xe0; BYTE $0xbd; BYTE $0x5f; BYTE $0x6d
+ BYTE $0x79; BYTE $0x81; BYTE $0x82; BYTE $0x83
+ BYTE $0x84; BYTE $0x85; BYTE $0x86; BYTE $0x87
+ BYTE $0x88; BYTE $0x89; BYTE $0x91; BYTE $0x92
+ BYTE $0x93; BYTE $0x94; BYTE $0x95; BYTE $0x96
+ BYTE $0x97; BYTE $0x98; BYTE $0x99; BYTE $0xa2
+ BYTE $0xa3; BYTE $0xa4; BYTE $0xa5; BYTE $0xa6
+ BYTE $0xa7; BYTE $0xa8; BYTE $0xa9; BYTE $0xc0
+ BYTE $0x4f; BYTE $0xd0; BYTE $0xa1; BYTE $0x07
+ BYTE $0x20; BYTE $0x21; BYTE $0x22; BYTE $0x23
+ BYTE $0x24; BYTE $0x25; BYTE $0x06; BYTE $0x17
+ BYTE $0x28; BYTE $0x29; BYTE $0x2a; BYTE $0x2b
+ BYTE $0x2c; BYTE $0x09; BYTE $0x0a; BYTE $0x1b
+ BYTE $0x30; BYTE $0x31; BYTE $0x1a; BYTE $0x33
+ BYTE $0x34; BYTE $0x35; BYTE $0x36; BYTE $0x08
+ BYTE $0x38; BYTE $0x39; BYTE $0x3a; BYTE $0x3b
+ BYTE $0x04; BYTE $0x14; BYTE $0x3e; BYTE $0xff
+ BYTE $0x41; BYTE $0xaa; BYTE $0x4a; BYTE $0xb1
+ BYTE $0x9f; BYTE $0xb2; BYTE $0x6a; BYTE $0xb5
+ BYTE $0xbb; BYTE $0xb4; BYTE $0x9a; BYTE $0x8a
+ BYTE $0xb0; BYTE $0xca; BYTE $0xaf; BYTE $0xbc
+ BYTE $0x90; BYTE $0x8f; BYTE $0xea; BYTE $0xfa
+ BYTE $0xbe; BYTE $0xa0; BYTE $0xb6; BYTE $0xb3
+ BYTE $0x9d; BYTE $0xda; BYTE $0x9b; BYTE $0x8b
+ BYTE $0xb7; BYTE $0xb8; BYTE $0xb9; BYTE $0xab
+ BYTE $0x64; BYTE $0x65; BYTE $0x62; BYTE $0x66
+ BYTE $0x63; BYTE $0x67; BYTE $0x9e; BYTE $0x68
+ BYTE $0x74; BYTE $0x71; BYTE $0x72; BYTE $0x73
+ BYTE $0x78; BYTE $0x75; BYTE $0x76; BYTE $0x77
+ BYTE $0xac; BYTE $0x69; BYTE $0xed; BYTE $0xee
+ BYTE $0xeb; BYTE $0xef; BYTE $0xec; BYTE $0xbf
+ BYTE $0x80; BYTE $0xfd; BYTE $0xfe; BYTE $0xfb
+ BYTE $0xfc; BYTE $0xba; BYTE $0xae; BYTE $0x59
+ BYTE $0x44; BYTE $0x45; BYTE $0x42; BYTE $0x46
+ BYTE $0x43; BYTE $0x47; BYTE $0x9c; BYTE $0x48
+ BYTE $0x54; BYTE $0x51; BYTE $0x52; BYTE $0x53
+ BYTE $0x58; BYTE $0x55; BYTE $0x56; BYTE $0x57
+ BYTE $0x8c; BYTE $0x49; BYTE $0xcd; BYTE $0xce
+ BYTE $0xcb; BYTE $0xcf; BYTE $0xcc; BYTE $0xe1
+ BYTE $0x70; BYTE $0xdd; BYTE $0xde; BYTE $0xdb
+ BYTE $0xdc; BYTE $0x8d; BYTE $0x8e; BYTE $0xdf
+
+retry:
+ WORD $0xB9931022 // TROO 2,2,b'0001'
+ BVS retry
+ RET
+
+// func e2a(arr [] byte)
+// code page conversion from 1047 to 819
+TEXT ·E2a(SB), NOSPLIT|NOFRAME, $0
+ MOVD arg_base+0(FP), R2 // pointer to arry of characters
+ MOVD arg_len+8(FP), R3 // count
+ XOR R0, R0
+ XOR R1, R1
+ BYTE $0xA7; BYTE $0x15; BYTE $0x00; BYTE $0x82 // BRAS 1,(2+(256/2))
+
+ // EBCDIC -> ASCII conversion table:
+ BYTE $0x00; BYTE $0x01; BYTE $0x02; BYTE $0x03
+ BYTE $0x9c; BYTE $0x09; BYTE $0x86; BYTE $0x7f
+ BYTE $0x97; BYTE $0x8d; BYTE $0x8e; BYTE $0x0b
+ BYTE $0x0c; BYTE $0x0d; BYTE $0x0e; BYTE $0x0f
+ BYTE $0x10; BYTE $0x11; BYTE $0x12; BYTE $0x13
+ BYTE $0x9d; BYTE $0x0a; BYTE $0x08; BYTE $0x87
+ BYTE $0x18; BYTE $0x19; BYTE $0x92; BYTE $0x8f
+ BYTE $0x1c; BYTE $0x1d; BYTE $0x1e; BYTE $0x1f
+ BYTE $0x80; BYTE $0x81; BYTE $0x82; BYTE $0x83
+ BYTE $0x84; BYTE $0x85; BYTE $0x17; BYTE $0x1b
+ BYTE $0x88; BYTE $0x89; BYTE $0x8a; BYTE $0x8b
+ BYTE $0x8c; BYTE $0x05; BYTE $0x06; BYTE $0x07
+ BYTE $0x90; BYTE $0x91; BYTE $0x16; BYTE $0x93
+ BYTE $0x94; BYTE $0x95; BYTE $0x96; BYTE $0x04
+ BYTE $0x98; BYTE $0x99; BYTE $0x9a; BYTE $0x9b
+ BYTE $0x14; BYTE $0x15; BYTE $0x9e; BYTE $0x1a
+ BYTE $0x20; BYTE $0xa0; BYTE $0xe2; BYTE $0xe4
+ BYTE $0xe0; BYTE $0xe1; BYTE $0xe3; BYTE $0xe5
+ BYTE $0xe7; BYTE $0xf1; BYTE $0xa2; BYTE $0x2e
+ BYTE $0x3c; BYTE $0x28; BYTE $0x2b; BYTE $0x7c
+ BYTE $0x26; BYTE $0xe9; BYTE $0xea; BYTE $0xeb
+ BYTE $0xe8; BYTE $0xed; BYTE $0xee; BYTE $0xef
+ BYTE $0xec; BYTE $0xdf; BYTE $0x21; BYTE $0x24
+ BYTE $0x2a; BYTE $0x29; BYTE $0x3b; BYTE $0x5e
+ BYTE $0x2d; BYTE $0x2f; BYTE $0xc2; BYTE $0xc4
+ BYTE $0xc0; BYTE $0xc1; BYTE $0xc3; BYTE $0xc5
+ BYTE $0xc7; BYTE $0xd1; BYTE $0xa6; BYTE $0x2c
+ BYTE $0x25; BYTE $0x5f; BYTE $0x3e; BYTE $0x3f
+ BYTE $0xf8; BYTE $0xc9; BYTE $0xca; BYTE $0xcb
+ BYTE $0xc8; BYTE $0xcd; BYTE $0xce; BYTE $0xcf
+ BYTE $0xcc; BYTE $0x60; BYTE $0x3a; BYTE $0x23
+ BYTE $0x40; BYTE $0x27; BYTE $0x3d; BYTE $0x22
+ BYTE $0xd8; BYTE $0x61; BYTE $0x62; BYTE $0x63
+ BYTE $0x64; BYTE $0x65; BYTE $0x66; BYTE $0x67
+ BYTE $0x68; BYTE $0x69; BYTE $0xab; BYTE $0xbb
+ BYTE $0xf0; BYTE $0xfd; BYTE $0xfe; BYTE $0xb1
+ BYTE $0xb0; BYTE $0x6a; BYTE $0x6b; BYTE $0x6c
+ BYTE $0x6d; BYTE $0x6e; BYTE $0x6f; BYTE $0x70
+ BYTE $0x71; BYTE $0x72; BYTE $0xaa; BYTE $0xba
+ BYTE $0xe6; BYTE $0xb8; BYTE $0xc6; BYTE $0xa4
+ BYTE $0xb5; BYTE $0x7e; BYTE $0x73; BYTE $0x74
+ BYTE $0x75; BYTE $0x76; BYTE $0x77; BYTE $0x78
+ BYTE $0x79; BYTE $0x7a; BYTE $0xa1; BYTE $0xbf
+ BYTE $0xd0; BYTE $0x5b; BYTE $0xde; BYTE $0xae
+ BYTE $0xac; BYTE $0xa3; BYTE $0xa5; BYTE $0xb7
+ BYTE $0xa9; BYTE $0xa7; BYTE $0xb6; BYTE $0xbc
+ BYTE $0xbd; BYTE $0xbe; BYTE $0xdd; BYTE $0xa8
+ BYTE $0xaf; BYTE $0x5d; BYTE $0xb4; BYTE $0xd7
+ BYTE $0x7b; BYTE $0x41; BYTE $0x42; BYTE $0x43
+ BYTE $0x44; BYTE $0x45; BYTE $0x46; BYTE $0x47
+ BYTE $0x48; BYTE $0x49; BYTE $0xad; BYTE $0xf4
+ BYTE $0xf6; BYTE $0xf2; BYTE $0xf3; BYTE $0xf5
+ BYTE $0x7d; BYTE $0x4a; BYTE $0x4b; BYTE $0x4c
+ BYTE $0x4d; BYTE $0x4e; BYTE $0x4f; BYTE $0x50
+ BYTE $0x51; BYTE $0x52; BYTE $0xb9; BYTE $0xfb
+ BYTE $0xfc; BYTE $0xf9; BYTE $0xfa; BYTE $0xff
+ BYTE $0x5c; BYTE $0xf7; BYTE $0x53; BYTE $0x54
+ BYTE $0x55; BYTE $0x56; BYTE $0x57; BYTE $0x58
+ BYTE $0x59; BYTE $0x5a; BYTE $0xb2; BYTE $0xd4
+ BYTE $0xd6; BYTE $0xd2; BYTE $0xd3; BYTE $0xd5
+ BYTE $0x30; BYTE $0x31; BYTE $0x32; BYTE $0x33
+ BYTE $0x34; BYTE $0x35; BYTE $0x36; BYTE $0x37
+ BYTE $0x38; BYTE $0x39; BYTE $0xb3; BYTE $0xdb
+ BYTE $0xdc; BYTE $0xd9; BYTE $0xda; BYTE $0x9f
+
+retry:
+ WORD $0xB9931022 // TROO 2,2,b'0001'
+ BVS retry
+ RET
diff --git a/vendor/golang.org/x/sys/unix/epoll_zos.go b/vendor/golang.org/x/sys/unix/epoll_zos.go
deleted file mode 100644
index 7753fddea8..0000000000
--- a/vendor/golang.org/x/sys/unix/epoll_zos.go
+++ /dev/null
@@ -1,220 +0,0 @@
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build zos && s390x
-
-package unix
-
-import (
- "sync"
-)
-
-// This file simulates epoll on z/OS using poll.
-
-// Analogous to epoll_event on Linux.
-// TODO(neeilan): Pad is because the Linux kernel expects a 96-bit struct. We never pass this to the kernel; remove?
-type EpollEvent struct {
- Events uint32
- Fd int32
- Pad int32
-}
-
-const (
- EPOLLERR = 0x8
- EPOLLHUP = 0x10
- EPOLLIN = 0x1
- EPOLLMSG = 0x400
- EPOLLOUT = 0x4
- EPOLLPRI = 0x2
- EPOLLRDBAND = 0x80
- EPOLLRDNORM = 0x40
- EPOLLWRBAND = 0x200
- EPOLLWRNORM = 0x100
- EPOLL_CTL_ADD = 0x1
- EPOLL_CTL_DEL = 0x2
- EPOLL_CTL_MOD = 0x3
- // The following constants are part of the epoll API, but represent
- // currently unsupported functionality on z/OS.
- // EPOLL_CLOEXEC = 0x80000
- // EPOLLET = 0x80000000
- // EPOLLONESHOT = 0x40000000
- // EPOLLRDHUP = 0x2000 // Typically used with edge-triggered notis
- // EPOLLEXCLUSIVE = 0x10000000 // Exclusive wake-up mode
- // EPOLLWAKEUP = 0x20000000 // Relies on Linux's BLOCK_SUSPEND capability
-)
-
-// TODO(neeilan): We can eliminate these epToPoll / pToEpoll calls by using identical mask values for POLL/EPOLL
-// constants where possible The lower 16 bits of epoll events (uint32) can fit any system poll event (int16).
-
-// epToPollEvt converts epoll event field to poll equivalent.
-// In epoll, Events is a 32-bit field, while poll uses 16 bits.
-func epToPollEvt(events uint32) int16 {
- var ep2p = map[uint32]int16{
- EPOLLIN: POLLIN,
- EPOLLOUT: POLLOUT,
- EPOLLHUP: POLLHUP,
- EPOLLPRI: POLLPRI,
- EPOLLERR: POLLERR,
- }
-
- var pollEvts int16 = 0
- for epEvt, pEvt := range ep2p {
- if (events & epEvt) != 0 {
- pollEvts |= pEvt
- }
- }
-
- return pollEvts
-}
-
-// pToEpollEvt converts 16 bit poll event bitfields to 32-bit epoll event fields.
-func pToEpollEvt(revents int16) uint32 {
- var p2ep = map[int16]uint32{
- POLLIN: EPOLLIN,
- POLLOUT: EPOLLOUT,
- POLLHUP: EPOLLHUP,
- POLLPRI: EPOLLPRI,
- POLLERR: EPOLLERR,
- }
-
- var epollEvts uint32 = 0
- for pEvt, epEvt := range p2ep {
- if (revents & pEvt) != 0 {
- epollEvts |= epEvt
- }
- }
-
- return epollEvts
-}
-
-// Per-process epoll implementation.
-type epollImpl struct {
- mu sync.Mutex
- epfd2ep map[int]*eventPoll
- nextEpfd int
-}
-
-// eventPoll holds a set of file descriptors being watched by the process. A process can have multiple epoll instances.
-// On Linux, this is an in-kernel data structure accessed through a fd.
-type eventPoll struct {
- mu sync.Mutex
- fds map[int]*EpollEvent
-}
-
-// epoll impl for this process.
-var impl epollImpl = epollImpl{
- epfd2ep: make(map[int]*eventPoll),
- nextEpfd: 0,
-}
-
-func (e *epollImpl) epollcreate(size int) (epfd int, err error) {
- e.mu.Lock()
- defer e.mu.Unlock()
- epfd = e.nextEpfd
- e.nextEpfd++
-
- e.epfd2ep[epfd] = &eventPoll{
- fds: make(map[int]*EpollEvent),
- }
- return epfd, nil
-}
-
-func (e *epollImpl) epollcreate1(flag int) (fd int, err error) {
- return e.epollcreate(4)
-}
-
-func (e *epollImpl) epollctl(epfd int, op int, fd int, event *EpollEvent) (err error) {
- e.mu.Lock()
- defer e.mu.Unlock()
-
- ep, ok := e.epfd2ep[epfd]
- if !ok {
-
- return EBADF
- }
-
- switch op {
- case EPOLL_CTL_ADD:
- // TODO(neeilan): When we make epfds and fds disjoint, detect epoll
- // loops here (instances watching each other) and return ELOOP.
- if _, ok := ep.fds[fd]; ok {
- return EEXIST
- }
- ep.fds[fd] = event
- case EPOLL_CTL_MOD:
- if _, ok := ep.fds[fd]; !ok {
- return ENOENT
- }
- ep.fds[fd] = event
- case EPOLL_CTL_DEL:
- if _, ok := ep.fds[fd]; !ok {
- return ENOENT
- }
- delete(ep.fds, fd)
-
- }
- return nil
-}
-
-// Must be called while holding ep.mu
-func (ep *eventPoll) getFds() []int {
- fds := make([]int, len(ep.fds))
- for fd := range ep.fds {
- fds = append(fds, fd)
- }
- return fds
-}
-
-func (e *epollImpl) epollwait(epfd int, events []EpollEvent, msec int) (n int, err error) {
- e.mu.Lock() // in [rare] case of concurrent epollcreate + epollwait
- ep, ok := e.epfd2ep[epfd]
-
- if !ok {
- e.mu.Unlock()
- return 0, EBADF
- }
-
- pollfds := make([]PollFd, 4)
- for fd, epollevt := range ep.fds {
- pollfds = append(pollfds, PollFd{Fd: int32(fd), Events: epToPollEvt(epollevt.Events)})
- }
- e.mu.Unlock()
-
- n, err = Poll(pollfds, msec)
- if err != nil {
- return n, err
- }
-
- i := 0
- for _, pFd := range pollfds {
- if pFd.Revents != 0 {
- events[i] = EpollEvent{Fd: pFd.Fd, Events: pToEpollEvt(pFd.Revents)}
- i++
- }
-
- if i == n {
- break
- }
- }
-
- return n, nil
-}
-
-func EpollCreate(size int) (fd int, err error) {
- return impl.epollcreate(size)
-}
-
-func EpollCreate1(flag int) (fd int, err error) {
- return impl.epollcreate1(flag)
-}
-
-func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
- return impl.epollctl(epfd, op, fd, event)
-}
-
-// Because EpollWait mutates events, the caller is expected to coordinate
-// concurrent access if calling with the same epfd from multiple goroutines.
-func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
- return impl.epollwait(epfd, events, msec)
-}
diff --git a/vendor/golang.org/x/sys/unix/fstatfs_zos.go b/vendor/golang.org/x/sys/unix/fstatfs_zos.go
deleted file mode 100644
index c8bde601e7..0000000000
--- a/vendor/golang.org/x/sys/unix/fstatfs_zos.go
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build zos && s390x
-
-package unix
-
-import (
- "unsafe"
-)
-
-// This file simulates fstatfs on z/OS using fstatvfs and w_getmntent.
-
-func Fstatfs(fd int, stat *Statfs_t) (err error) {
- var stat_v Statvfs_t
- err = Fstatvfs(fd, &stat_v)
- if err == nil {
- // populate stat
- stat.Type = 0
- stat.Bsize = stat_v.Bsize
- stat.Blocks = stat_v.Blocks
- stat.Bfree = stat_v.Bfree
- stat.Bavail = stat_v.Bavail
- stat.Files = stat_v.Files
- stat.Ffree = stat_v.Ffree
- stat.Fsid = stat_v.Fsid
- stat.Namelen = stat_v.Namemax
- stat.Frsize = stat_v.Frsize
- stat.Flags = stat_v.Flag
- for passn := 0; passn < 5; passn++ {
- switch passn {
- case 0:
- err = tryGetmntent64(stat)
- break
- case 1:
- err = tryGetmntent128(stat)
- break
- case 2:
- err = tryGetmntent256(stat)
- break
- case 3:
- err = tryGetmntent512(stat)
- break
- case 4:
- err = tryGetmntent1024(stat)
- break
- default:
- break
- }
- //proceed to return if: err is nil (found), err is nonnil but not ERANGE (another error occurred)
- if err == nil || err != nil && err != ERANGE {
- break
- }
- }
- }
- return err
-}
-
-func tryGetmntent64(stat *Statfs_t) (err error) {
- var mnt_ent_buffer struct {
- header W_Mnth
- filesys_info [64]W_Mntent
- }
- var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
- fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
- if err != nil {
- return err
- }
- err = ERANGE //return ERANGE if no match is found in this batch
- for i := 0; i < fs_count; i++ {
- if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
- stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
- err = nil
- break
- }
- }
- return err
-}
-
-func tryGetmntent128(stat *Statfs_t) (err error) {
- var mnt_ent_buffer struct {
- header W_Mnth
- filesys_info [128]W_Mntent
- }
- var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
- fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
- if err != nil {
- return err
- }
- err = ERANGE //return ERANGE if no match is found in this batch
- for i := 0; i < fs_count; i++ {
- if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
- stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
- err = nil
- break
- }
- }
- return err
-}
-
-func tryGetmntent256(stat *Statfs_t) (err error) {
- var mnt_ent_buffer struct {
- header W_Mnth
- filesys_info [256]W_Mntent
- }
- var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
- fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
- if err != nil {
- return err
- }
- err = ERANGE //return ERANGE if no match is found in this batch
- for i := 0; i < fs_count; i++ {
- if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
- stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
- err = nil
- break
- }
- }
- return err
-}
-
-func tryGetmntent512(stat *Statfs_t) (err error) {
- var mnt_ent_buffer struct {
- header W_Mnth
- filesys_info [512]W_Mntent
- }
- var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
- fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
- if err != nil {
- return err
- }
- err = ERANGE //return ERANGE if no match is found in this batch
- for i := 0; i < fs_count; i++ {
- if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
- stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
- err = nil
- break
- }
- }
- return err
-}
-
-func tryGetmntent1024(stat *Statfs_t) (err error) {
- var mnt_ent_buffer struct {
- header W_Mnth
- filesys_info [1024]W_Mntent
- }
- var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
- fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
- if err != nil {
- return err
- }
- err = ERANGE //return ERANGE if no match is found in this batch
- for i := 0; i < fs_count; i++ {
- if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
- stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
- err = nil
- break
- }
- }
- return err
-}
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
index fdcaa974d2..e14b766a32 100644
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -58,6 +58,7 @@ includes_Darwin='
#define _DARWIN_USE_64_BIT_INODE
#define __APPLE_USE_RFC_3542
#include
+#include
#include
#include
#include
@@ -263,6 +264,7 @@ struct ltchars {
#include
#include
#include
+#include
#include
#include